Commit ae5a7d0f by 杨北旺

sop-新增素材

1 parent 66ffd01a
<!-- 素材弹窗 --> <!-- 素材弹窗 -->
<template> <template>
<glsx-dialog title="选择素材" :isVisible.sync="isMaterialVisible" width="70%" @confirmDialog="handleMaterialConfirm" @closeDialog="handleMaterialClose" class="relateStore"> <glsx-dialog title="选择素材" :isVisible.sync="isMaterialVisible" width="1088px" @confirmDialog="handleMaterialConfirm" @closeDialog="handleMaterialClose" class="relateStore">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer"> <span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button> <el-button :size="size" type="default" @click="handleReset">重置</el-button>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-tabs> </el-tabs>
</div> --> </div> -->
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading"> <div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)"> <div class="model-item" :class="{ checked: selectItem.id == item.id }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" :title="item.materialContentRpcResponse.materialName">{{ item.materialContentRpcResponse ? item.materialContentRpcResponse.materialName : '-' }}</div> <div class="model-item-title" :title="item.materialContentRpcResponse.materialName">{{ item.materialContentRpcResponse ? item.materialContentRpcResponse.materialName : '-' }}</div>
<img :src="item.groupName"/> <img :src="item.groupName"/>
</div> </div>
...@@ -98,6 +98,10 @@ export default { ...@@ -98,6 +98,10 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
} }
// selectedId: {
// type: String,
// default: ''
// }
// storeApi: { // storeApi: {
// type: Function, // type: Function,
// default: () => {} // default: () => {}
...@@ -131,13 +135,13 @@ export default { ...@@ -131,13 +135,13 @@ export default {
// item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo // item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo
// }) // })
// this.getSelectingList() // this.getSelectingList()
// this.selectItem.id = this.selectedId
this.getModelList() this.getModelList()
}, },
methods: { methods: {
getBaseData() { getBaseData() {
this.$apis.sop.getGroupListApi({}).then(res => { this.$apis.sop.getGroupListApi({}).then(res => {
console.log(res)
this.baseData.groupList = res this.baseData.groupList = res
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}) })
...@@ -157,6 +161,17 @@ export default { ...@@ -157,6 +161,17 @@ export default {
this.tableTotal = res.count this.tableTotal = res.count
}) })
}, },
handleReset() {
this.searchForm = {
groupId: '',
businessType: ''
}
this.handleSearch()
},
handleSearch() {
this.pageNum = 1
this.getModelList()
},
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
this.getModelList() this.getModelList()
...@@ -238,7 +253,12 @@ export default { ...@@ -238,7 +253,12 @@ export default {
// this.recoverySelection() // this.recoverySelection()
// }, // },
handleMaterialConfirm() { handleMaterialConfirm() {
this.$emit('handleMaterialConfirm', this.selectedData) this.$emit('handleMaterialConfirm', {
objectId: this.selectItem.id,
objectType: 10,
objectName: this.selectItem.materialContentRpcResponse.materialName,
additionalType: 1
})
}, },
handleMaterialClose() { handleMaterialClose() {
this.$emit('handleMaterialClose') this.$emit('handleMaterialClose')
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
<glsx-combi-form ref="editFormRefTime" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataTime" :formRules="editRule"> <glsx-combi-form ref="editFormRefTime" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataTime" :formRules="editRule">
<div class="flex-default m-r-20" slot="repeatTime" slot-scope="scope"> <div class="flex-default m-r-20" slot="repeatTime" slot-scope="scope">
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 2"> <div class="flex-default m-r-20" v-if="editForm.repeatMode == 2">
<p style="width: 50px;">每周</p> <p style="width: 50px">每周</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期"> <el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期">
<el-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option> <el-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select> </el-select>
</div> </div>
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 3"> <div class="flex-default m-r-20" v-if="editForm.repeatMode == 3">
<p style="width: 50px;">每月</p> <p style="width: 50px">每月</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期"> <el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期">
<el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option> <el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select> </el-select>
...@@ -42,25 +42,14 @@ ...@@ -42,25 +42,14 @@
<div slot="eventContent" class="content"> <div slot="eventContent" class="content">
<div class="content-bg"> <div class="content-bg">
<!-- <wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea> --> <!-- <wTextarea ref="textContent" v-model="textValue" @updateText="updateText"></wTextarea> -->
<el-input type="textarea" :rows="9" maxlength="280" show-word-limit v-model="editForm.eventContent" @input="textInput" style="-webkit-user-modify: read-write-plaintext-only !important; width: 656px;" placeholder="请输入营销文案"></el-input> <el-input type="textarea" :rows="9" maxlength="280" show-word-limit v-model="editForm.eventContent" @input="textInput" style="-webkit-user-modify: read-write-plaintext-only !important; width: 656px" placeholder="请输入营销文案"></el-input>
<div v-for="(itm, index) in previewList" :key="itm.id"> <div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1"> <!-- additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) -->
<!-- <template v-if="itm.attType == 2"> <div class="welcome-file">
<i v-show="index == previewList.length - 1 && loading" class="el-icon-loading"></i> <template>
<span :title="itm.attContent">{{ itm.attContent }}</span> <img :src="require(`@/assets/sop/icon-${btnList.find(k => k.id == itm.additionalType).type}.png`)" alt />
</template> -->
<!-- <template v-else-if="itm.attType == 3">
<img src="@/assets/sop/icon-img.png" alt />
<span :title="itm.attContent">{{ itm.attContent }}</span>
</template> -->
<template v-if="itm.attType == 7">
<img src="@/assets/sop/icon-applet.png" alt />
<span :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span> <span :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
</template> </template>
<!-- <template v-else-if="itm.attType == 5">
<img src="@/assets/sop/icon-applet.png" alt />
<span :title="itm.attContent.title">{{ itm.attContent.title }}</span>
</template> -->
<i class="el-icon-circle-close" @click="close(index)"></i> <i class="el-icon-circle-close" @click="close(index)"></i>
</div> </div>
</div> </div>
...@@ -96,15 +85,15 @@ ...@@ -96,15 +85,15 @@
</template> </template>
<script> <script>
const ATT_TYPE = { // const ATT_TYPE = {
TEXT: 1, // TEXT: 1,
IMAGE: 2, // IMAGE: 2,
VEDIO: 3, // VEDIO: 3,
URL: 4, // URL: 4,
MINIPROGRAM: 5, // MINIPROGRAM: 5,
FILE: 6, // FILE: 6,
ACTIVITY: 7 // ACTIVITY: 7
} // }
import ActivityModel from './components/activityModel' import ActivityModel from './components/activityModel'
import materialModel from './components/materialModel' import materialModel from './components/materialModel'
import nicknameModel from './components/nicknameModel' import nicknameModel from './components/nicknameModel'
...@@ -164,19 +153,19 @@ export default { ...@@ -164,19 +153,19 @@ export default {
funName: 'material' funName: 'material'
}, },
{ {
id: 3, id: 2,
name: '活动', name: '活动',
type: 'activity', type: 'activity',
funName: 'activity' funName: 'activity'
}, },
{ {
id: 4, id: 3,
name: '优惠券', name: '优惠券',
type: 'coupon', type: 'coupon',
funName: 'coupon' funName: 'coupon'
}, },
{ {
id: 5, id: 4,
name: '朋友圈模板', name: '朋友圈模板',
type: 'nickname', type: 'nickname',
funName: 'nickname' funName: 'nickname'
...@@ -464,7 +453,16 @@ export default { ...@@ -464,7 +453,16 @@ export default {
}, },
// 素材 // 素材
handleMaterialConfirm() { handleMaterialConfirm(val) {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
this.previewList = [
{
attContent: val,
additionalType: val.additionalType
}
]
this.handleMaterialClose() this.handleMaterialClose()
}, },
...@@ -507,26 +505,12 @@ export default { ...@@ -507,26 +505,12 @@ export default {
selectActivity(val) { selectActivity(val) {
this.editForm.object = JSON.parse(JSON.stringify(val)) this.editForm.object = JSON.parse(JSON.stringify(val))
let idx this.previewList = [
const hasActivity = this.previewList.some((item, index) => { {
if (item.attType == 7) {
idx = index
return item
}
})
if (val) {
if (hasActivity) {
this.$set(this.previewList, idx, {
attContent: val,
attType: ATT_TYPE.ACTIVITY
})
} else {
this.previewList.push({
attContent: val, attContent: val,
attType: ATT_TYPE.ACTIVITY additionalType: val.additionalType
})
}
} }
]
}, },
// 营销内容 // 营销内容
...@@ -610,7 +594,7 @@ export default { ...@@ -610,7 +594,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!