Commit 7bcfa5ba by 杨北旺

sop-新增素材

1 parent 91e81703
<!-- 素材弹窗 -->
<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">
<span slot="footer">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
......@@ -18,7 +18,7 @@
</el-tabs>
</div> -->
<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>
<img :src="item.groupName"/>
</div>
......@@ -98,6 +98,10 @@ export default {
type: Boolean,
default: false
}
// selectedId: {
// type: String,
// default: ''
// }
// storeApi: {
// type: Function,
// default: () => {}
......@@ -131,13 +135,13 @@ export default {
// item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo
// })
// this.getSelectingList()
// this.selectItem.id = this.selectedId
this.getModelList()
},
methods: {
getBaseData() {
this.$apis.sop.getGroupListApi({}).then(res => {
console.log(res)
this.baseData.groupList = res
this.getOptionsList('searchFormData')
})
......@@ -157,6 +161,17 @@ export default {
this.tableTotal = res.count
})
},
handleReset() {
this.searchForm = {
groupId: '',
businessType: ''
}
this.handleSearch()
},
handleSearch() {
this.pageNum = 1
this.getModelList()
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
......@@ -238,7 +253,12 @@ export default {
// this.recoverySelection()
// },
handleMaterialConfirm() {
this.$emit('handleMaterialConfirm', this.selectedData)
this.$emit('handleMaterialConfirm', {
objectId: this.selectItem.id,
objectType: 10,
objectName: this.selectItem.materialContentRpcResponse.materialName,
additionalType: 1
})
},
handleMaterialClose() {
this.$emit('handleMaterialClose')
......
......@@ -17,13 +17,13 @@
<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" 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-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select>
</div>
<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-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select>
......@@ -42,25 +42,14 @@
<div slot="eventContent" class="content">
<div class="content-bg">
<!-- <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 class="welcome-file" v-if="itm.attType != 1">
<!-- <template v-if="itm.attType == 2">
<i v-show="index == previewList.length - 1 && loading" class="el-icon-loading"></i>
<span :title="itm.attContent">{{ itm.attContent }}</span>
</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 />
<!-- additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) -->
<div class="welcome-file">
<template>
<img :src="require(`@/assets/sop/icon-${btnList.find(k => k.id == itm.additionalType).type}.png`)" alt />
<span :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
</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>
</div>
</div>
......@@ -96,15 +85,15 @@
</template>
<script>
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7
}
// const ATT_TYPE = {
// TEXT: 1,
// IMAGE: 2,
// VEDIO: 3,
// URL: 4,
// MINIPROGRAM: 5,
// FILE: 6,
// ACTIVITY: 7
// }
import ActivityModel from './components/activityModel'
import materialModel from './components/materialModel'
import nicknameModel from './components/nicknameModel'
......@@ -164,19 +153,19 @@ export default {
funName: 'material'
},
{
id: 3,
id: 2,
name: '活动',
type: 'activity',
funName: 'activity'
},
{
id: 4,
id: 3,
name: '优惠券',
type: 'coupon',
funName: 'coupon'
},
{
id: 5,
id: 4,
name: '朋友圈模板',
type: 'nickname',
funName: 'nickname'
......@@ -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()
},
......@@ -507,26 +505,12 @@ export default {
selectActivity(val) {
this.editForm.object = JSON.parse(JSON.stringify(val))
let idx
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,
attType: ATT_TYPE.ACTIVITY
})
this.previewList = [
{
attContent: val,
additionalType: val.additionalType
}
}
]
},
// 营销内容
......@@ -610,7 +594,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!