Commit 20c1aaf4 by 杨明

fixed

1 parent 18be4023
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20 * @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-10 10:17:54 * @LastEditTime: 2023-07-10 20:44:37
* @FilePath: \scrm-micro-home\src\mixins\gpt.js * @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -15,17 +15,31 @@ export default { ...@@ -15,17 +15,31 @@ export default {
return {} return {}
}, },
methods: { methods: {
//获取图片宽度高度
getImgInfo(src) {
return new Promise(resolve => {
if (!src) {
resolve({ dw: 0, dh: 0, src })
}
const img = new Image()
img.src = src
img.onload = () => {
resolve({ dw: img.width, dh: img.height, src })
}
})
},
//主图、内容图、logo合并图片 //主图、内容图、logo合并图片
async createCanvas() { async createBig(info, logoInfo) {
console.log(info)
this.loading = true this.loading = true
const { backgroundImage, detailImage, merchantLog, marketingTitle, marketingSubtitle } = this.editForm const { backgroundImage, detailImage, merchantLog, marketingTitle, marketingSubtitle } = info
if (!backgroundImage) return if (!backgroundImage) return
try { try {
const res = await Promise.all([this.getImgWH(backgroundImage), this.getImgWH(detailImage), this.getImgWH(merchantLog)]) const res = await Promise.all([this.getImgInfo(backgroundImage), this.getImgInfo(detailImage), this.getImgInfo(merchantLog)])
const h = (res[0].dh / res[0].dw) * 375 + (res[1].dh / res[1].dw) * 375 const h = (res[0].dh / res[0].dw) * WIDTH + (res[1].dh / res[1].dw) * WIDTH
this.logoInfo = { url: merchantLog, x: 375 - res[2].dw / 2 - 20, y: 20, width: res[2].dw / 2, height: res[2].dh / 2 } this.logoInfo = { url: merchantLog, ...logoInfo }
const drawfun = new Drawing(document.getElementById('canvasId'), { const drawfun = new Drawing(document.getElementById('canvasId'), {
width: 375, width: WIDTH,
height: h height: h
}), }),
imageList = [ imageList = [
...@@ -33,20 +47,33 @@ export default { ...@@ -33,20 +47,33 @@ export default {
url: backgroundImage, url: backgroundImage,
x: 0, x: 0,
y: 0, y: 0,
width: 375, width: WIDTH,
height: (res[0].dh / res[0].dw) * 375 height: (res[0].dh / res[0].dw) * WIDTH
}, },
{ {
url: detailImage, url: detailImage,
x: 0, x: 0,
y: (res[0].dh / res[0].dw) * 375, y: (res[0].dh / res[0].dw) * WIDTH,
width: 375, width: WIDTH,
height: (res[1].dh / res[1].dw) * 375 height: (res[1].dh / res[1].dw) * WIDTH
}, },
{ ...this.logoInfo } { ...this.logoInfo }
].filter(item => item.url) ].filter(item => item.url)
let textList = [], let textList = [],
title = this.cavansObj[this.editForm.templateId] title = {
titleStyle: {
x: 82,
y: 224,
fontSize: 52,
color: '#AD604C'
},
subTitleStyle: {
x: 66,
y: 300,
fontSize: 24,
color: '#AD604C'
}
}
if (title) { if (title) {
marketingTitle.split(' ').forEach((item, index) => { marketingTitle.split(' ').forEach((item, index) => {
textList.push({ textList.push({
...@@ -73,8 +100,9 @@ export default { ...@@ -73,8 +100,9 @@ export default {
imageList, imageList,
textList textList
}) })
await this.uploadImg(canvasBase64) return new Promise(async resolve => {
this.addOrUpdate() resolve(await this.uploadImg(canvasBase64))
})
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33 * @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-10 15:53:51 * @LastEditTime: 2023-07-10 19:18:22
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js * @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
setKeyWords({ commit, state }, data) { setKeyWords({ commit, state }, data) {
if (state.keywords == data) return if (state.keywords == data) return
commit('SET_KET_WORDs', data) commit('SET_KET_WORDs', data)
if (!data) return
apis.marketing.getChatGPTList({ 'req.userPrompt': data }).then(res => { apis.marketing.getChatGPTList({ 'req.userPrompt': data }).then(res => {
const gptList = JSON.parse(res.message) const gptList = JSON.parse(res.message)
commit('SET_KET_WORDs', '') commit('SET_KET_WORDs', '')
...@@ -74,6 +75,28 @@ export default { ...@@ -74,6 +75,28 @@ export default {
commit('SET_ACTIVITY_INFO', res) commit('SET_ACTIVITY_INFO', res)
}) })
}, },
getTemplateInfo({ state }, data) {
apis.marketing.calendarDetail({ id: data }).then(res => {
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, codeId, couponItemList = [], id } = res || {}
if (couponItemList && couponItemList.length)
couponItemList.forEach(item => {
item.id = item.couponId
})
state.activityInfo = Object.assign(
{},
{
templateId: id,
codeId,
marketingTitle: title,
marketingSubtitle: subTitle,
backgroundImage: backgroundImg,
detailImage: captionImg,
couponItemList,
activityTime: [startTime + ' 00:00:00', endTime + ' 00:00:00']
}
)
})
},
//活动模板详情 //活动模板详情
getCalendarDetail({ commit }, data) { getCalendarDetail({ commit }, data) {
apis.marketing.calendarDetail({ id: data }).then(res => { apis.marketing.calendarDetail({ id: data }).then(res => {
...@@ -87,8 +110,8 @@ export default { ...@@ -87,8 +110,8 @@ export default {
commit('SET_PROCESS', data) commit('SET_PROCESS', data)
}, },
setSubscribe({ commit, dispatch }, data) { setSubscribe({ commit, dispatch }, data) {
commit('SET_SUBSCRIBE', data) commit('SET_SUBSCRIBE', data.subscribe ? data.subscribe : data)
dispatch('setKeyWords', subscribeData[data]) dispatch('setKeyWords', data.subscribe ? data.keywords : subscribeData[data])
} }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 21:24:27 * @Date: 2023-06-29 21:24:27
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-10 14:51:57 * @LastEditTime: 2023-07-10 20:49:06
* @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue * @FilePath: \scrm-micro-link\src\views\activityLink\components\MarketingContent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -219,13 +219,20 @@ export default { ...@@ -219,13 +219,20 @@ export default {
activityInfo: { activityInfo: {
handler(info) { handler(info) {
if (Object.keys(info).length == 0) { if (Object.keys(info).length == 0) {
return (this.editForm = {}) return (this.editForm = {
marketingTitle: '',
marketingSubtitle: '',
activityTime: [],
backgroundImage: '',
detailImage: '',
merchantLog: ''
})
} }
if (info.subTitle) { if (info.subTitle) {
this.setDetail(info) this.setDetail(info)
return return
} }
this.editForm = this.$common.utils.deepClone(info) this.editForm = Object.assign({ merchantLog: '' }, this.$common.utils.deepClone(info))
if (info.activityName) { if (info.activityName) {
this.$set(this.editForm, 'marketingTitle', info.activityName) this.$set(this.editForm, 'marketingTitle', info.activityName)
} }
...@@ -253,7 +260,7 @@ export default { ...@@ -253,7 +260,7 @@ export default {
...mapState('marketing', ['GPTList', 'subscribe', 'activityInfo', 'isInit']) ...mapState('marketing', ['GPTList', 'subscribe', 'activityInfo', 'isInit'])
}, },
methods: { methods: {
...mapActions('marketing', ['setProcess']), ...mapActions('marketing', ['setProcess', 'getTemplateInfo']),
setDetail(info) { setDetail(info) {
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, titleStyle, subTitleStyle, codeId } = this.$common.utils.deepClone(info || {}) const { title, subTitle, startTime, endTime, backgroundImg, captionImg, titleStyle, subTitleStyle, codeId } = this.$common.utils.deepClone(info || {})
this.editForm.codeId = codeId this.editForm.codeId = codeId
...@@ -269,19 +276,6 @@ export default { ...@@ -269,19 +276,6 @@ export default {
this.modelVisible = false this.modelVisible = false
this.getTemplateInfo(val.id) this.getTemplateInfo(val.id)
}, },
getTemplateInfo(id) {
this.$apis.marketing.calendarDetail({ id }).then(res => {
console.log(res)
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, codeId } = this.$common.utils.deepClone(res || {})
this.editForm.templateId = id
this.editForm.codeId = id
this.editForm.marketingTitle = title
this.editForm.marketingSubtitle = subTitle
this.editForm.backgroundImage = backgroundImg
this.editForm.detailImage = captionImg
this.editForm.activityTime = [startTime + ' 00:00:00', endTime + ' 00:00:00']
})
},
getCouponInfoParams() { getCouponInfoParams() {
var param = this.$common.utils.deepClone(this.editForm) var param = this.$common.utils.deepClone(this.editForm)
const d = param.activityTime const d = param.activityTime
......
...@@ -227,8 +227,15 @@ export default { ...@@ -227,8 +227,15 @@ export default {
couponAnticipatedCost: item.denomination couponAnticipatedCost: item.denomination
} }
}) })
const equityServices = this.selectedCarList.map(i => i.packageCode) if (this.selectedCarList.length) {
params.equityServices = equityServices.join(',') const serviceMerchantPackageConfigDTOS = this.selectedCarList.map(i => {
return {
packageCode: i.packageCode,
packageAmount: i.packageAmount
}
})
params.serviceMerchantPackageConfigDTOS = serviceMerchantPackageConfigDTOS
}
params.activityPrice = (this.editForm.activityPrice * 100).toFixed(0) params.activityPrice = (this.editForm.activityPrice * 100).toFixed(0)
params.superMarketingCouponRelRequestList = selectedGoodsList || [] params.superMarketingCouponRelRequestList = selectedGoodsList || []
console.log(params) console.log(params)
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="260"> <el-table-column label="操作" width="260">
<div class="config-panel flex" slot-scope="scope"> <div class="config-panel flex" slot-scope="scope">
<div class="config-msg" v-if="item.assignType == 1 && item.registerStatus === 0" @click="showRegister">邀请人员注册</div> <div class="config-msg" v-if="item.assignType == 1 && scope.row.registerStatus === 0" @click="showRegister">邀请人员注册</div>
<div class="config-msg" @click="handleConfig(item.batchNo, scope)">配置话术 / 短信</div> <div class="config-msg" @click="handleConfig(item.batchNo, scope)">配置话术 / 短信</div>
</div> </div>
</el-table-column> </el-table-column>
...@@ -445,6 +445,7 @@ export default { ...@@ -445,6 +445,7 @@ export default {
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
flex-wrap: wrap;
.flow-emp { .flow-emp {
background: #f4f6fc; background: #f4f6fc;
border: 1px solid #e8e8ea; border: 1px solid #e8e8ea;
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32 * @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-10 10:16:44 * @LastEditTime: 2023-07-10 21:11:31
* @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue * @FilePath: \scrm-micro-home\src\views\home\components\Marketing\MarketingRight.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<div class="review-body"> <div class="review-body">
<canvas id="canvasId"></canvas> <canvas id="canvasId"></canvas>
<template v-if="isModel"> <template v-if="isRenewal">
<img src="@/assets/seckillActivity/phone.png" class="review-phone" /> <img src="@/assets/seckillActivity/phone.png" class="review-phone" />
<div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div> <div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div>
<div class="review-content"> <div class="review-content">
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</div> </div>
</div> </div>
</template> </template>
<template v-else-if="isSuper"> <template v-else-if="isFestival">
<img src="@/assets/seckillActivity/phone.png" class="review-phone" /> <img src="@/assets/seckillActivity/phone.png" class="review-phone" />
<div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div> <div class="review-title_top">{{ detail.marketingTitle || detail.activityName }}</div>
<div class="review-content"> <div class="review-content">
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
</template> </template>
<script> <script>
const WIDTH = 244 const WIDTH = 244
const RATIO = RATIO / 375 const RATIO = WIDTH / 375
import PhoneViewA from './PhoneViewA' import PhoneViewA from './PhoneViewA'
import draw from '@/mixins/draw' import draw from '@/mixins/draw'
import equityOne from './model/model_1/equity' import equityOne from './model/model_1/equity'
...@@ -214,7 +214,9 @@ export default { ...@@ -214,7 +214,9 @@ export default {
data() { data() {
return { return {
backgroundHeight: 0, backgroundHeight: 0,
logoHeight: 0,
currentIndex: 0, currentIndex: 0,
isFestival: false,
draggableList: [ draggableList: [
{ {
type: 'text', type: 'text',
...@@ -243,7 +245,7 @@ export default { ...@@ -243,7 +245,7 @@ export default {
font: '' font: ''
} }
], ],
isModel: true, isRenewal: true,
modelNum: 4, modelNum: 4,
activityInfo: {}, activityInfo: {},
detail: { detail: {
...@@ -279,57 +281,12 @@ export default { ...@@ -279,57 +281,12 @@ export default {
...mapState('marketing', ['packageList', 'process']) ...mapState('marketing', ['packageList', 'process'])
}, },
props: { props: {
// activityInfo: {
// type: Object,
// default: () => {}
// },
isSuper: { isSuper: {
type: Boolean, type: Boolean,
default: true default: true
} }
}, },
watch: { watch: {
// activityInfo: {
// handler(val) {
// this.detail = val
// const title = this.cavansObj[this.detail.templateId],
// { marketingTitle, marketingSubtitle } = this.detail,
// textList = []
// console.log(this.detail)
// if (title) {
// marketingTitle.split(' ').forEach((item, index) => {
// textList.push({
// x: title.titleStyle.x * 0.7,
// y: (title.titleStyle.y + index * title.titleStyle.fontSize * 1.1) * 0.7,
// fontSize: title.titleStyle.fontSize * 0.7,
// color: title.titleStyle.color,
// text: item,
// bold: title.titleStyle.bold
// })
// })
// new Array(marketingSubtitle).forEach((item, index) => {
// textList.push({
// x: title.subTitleStyle.x * 0.7,
// y: (title.subTitleStyle.y + title.titleStyle.fontSize * 1.1 * (textList.length - 1)) * 0.7,
// fontSize: title.subTitleStyle.fontSize * 0.7,
// color: title.subTitleStyle.color,
// text: item
// })
// })
// }
// this.textList = textList
// if (!this.detail.logoInfo) return
// const { x, y, height, width } = this.detail.logoInfo
// this.logoInfo = {
// x: (x * 262) / 375,
// y: (y * 262) / 375,
// height: (height * 262) / 375,
// width: (width * 262) / 375
// }
// },
// deep: true,
// immediate: true
// },
packageList: { packageList: {
handler(val) { handler(val) {
console.log(val, 8888) console.log(val, 8888)
...@@ -341,8 +298,12 @@ export default { ...@@ -341,8 +298,12 @@ export default {
process: { process: {
async handler(val) { async handler(val) {
this.detail = { ...this.detail, ...val[2] } this.detail = { ...this.detail, ...val[2] }
console.log(this.detail) this.isFestival = false
this.backgroundHeight = await this.getImgWH(this.detail.backgroundImage) this.isRenewal = false
console.log(this.detail.codeId, 88)
if (this.detail.codeId) {
this.isRenewal = true
this.backgroundHeight = await this.getImgH(this.detail.backgroundImage)
try { try {
const style1 = JSON.parse(this.detail.titleStyle) const style1 = JSON.parse(this.detail.titleStyle)
const style2 = JSON.parse(this.detail.subTitleStyle) const style2 = JSON.parse(this.detail.subTitleStyle)
...@@ -351,13 +312,20 @@ export default { ...@@ -351,13 +312,20 @@ export default {
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
}
if (this.detail.templateId && !this.detail.codeId) {
this.isFestival = true
this.logoInfo = await this.getImgWH(this.detail.merchantLog)
}
console.log(this.detail, this.isRenewal)
}, },
deep: true deep: true,
immediate: true
} }
}, },
methods: { methods: {
//获取图片宽度高度 //获取图片宽度高度
getImgWH(src) { getImgH(src) {
return new Promise(resolve => { return new Promise(resolve => {
const img = new Image() const img = new Image()
img.src = src img.src = src
...@@ -367,6 +335,16 @@ export default { ...@@ -367,6 +335,16 @@ export default {
} }
}) })
}, },
//获取图片宽度高度
getImgWH(src) {
return new Promise(resolve => {
const img = new Image()
img.src = src
img.onload = () => {
resolve({ width: Math.floor(RATIO * img.width), height: Math.floor(RATIO * img.height), x: WIDTH - Math.floor(RATIO * img.width) - 20, y: 20 })
}
})
},
onDrag(x, y) { onDrag(x, y) {
this.draggableList[this.currentIndex].x = x this.draggableList[this.currentIndex].x = x
this.draggableList[this.currentIndex].y = y this.draggableList[this.currentIndex].y = y
...@@ -444,6 +422,12 @@ export default { ...@@ -444,6 +422,12 @@ export default {
width: 100%; width: 100%;
} }
} }
.review-main-img {
width: 100%;
img {
width: 100%;
}
}
.main-title { .main-title {
position: absolute; position: absolute;
width: 100%; width: 100%;
......
...@@ -66,7 +66,13 @@ export default { ...@@ -66,7 +66,13 @@ export default {
detail: { backgroundImage }, detail: { backgroundImage },
draggableList draggableList
} = this.$refs.viewForm } = this.$refs.viewForm
const url = await this.createMain(backgroundHeight, backgroundImage, draggableList) let url
if (params.codeId) {
url = await this.createMain(backgroundHeight, backgroundImage, draggableList)
}
if (params.templateId && !params.codeId) {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, draggableList)
}
params.subscribe = this.subscribe params.subscribe = this.subscribe
params.backgroundImage = url params.backgroundImage = url
this.$apis.marketing this.$apis.marketing
......
...@@ -4,21 +4,32 @@ ...@@ -4,21 +4,32 @@
<div class="choseRow"> <div class="choseRow">
<div class="choseItem" :class="{ active: currentIndex == item.type }" v-for="(item, index) in tabList" :key="index" @click="tabClick(item.type)">{{ item.label }}</div> <div class="choseItem" :class="{ active: currentIndex == item.type }" v-for="(item, index) in tabList" :key="index" @click="tabClick(item.type)">{{ item.label }}</div>
</div> </div>
<div class="fes-box" v-if="currentIndex == 6 && isShow"> <div class="fes-box" v-if="currentIndex == 6">
<div :class="{ 'fes-item': true, checked: selectItem.id == item.id }" v-for="item in festivalList" :key="item.id" @click="selectFes(item)">{{ item.title }}</div> <div :class="{ 'fes-item': true, checked: selectItem.id == item.id }" v-for="item in festivalList" :key="item.id" @click="selectFes(item)">{{ item.title }}</div>
<div class="fes-waiting">不断更新中……</div> <div class="fes-waiting">不断更新中……</div>
</div> </div>
<div class="scene-content"> <div class="scene-content">
<div class="scene-card" v-if="isShowCard"> <div class="scene-item" v-for="(item, index) in sceneList" :key="index">
<div class="scene-item-box" v-if="index == 0">
<el-popover placement="top-start" width="200" trigger="hover">
<div class="scene-card">
<div class="scene-card-img"> <div class="scene-card-img">
<img src="" /> <img :src="qrCode" />
</div> </div>
<div class="scene-card-content"> <div class="scene-card-content">
请扫码添加【XXXX】小管家,并组群获得支持 请扫码添加小管家,并组群获得支持
</div> </div>
</div> </div>
<div class="scene-item" v-for="(item, index) in sceneList" :key="index"> <div class="scene-item-box" slot="reference">
<div class="scene-item-box" @click="handleStep(index)" @mouseenter="isShowCard = true" @mouseleave="isShowCard = false"> <div class="scene-item-title">
<img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" />
{{ item.title }}
</div>
<div class="scene-item-content">{{ item.content }}</div>
</div>
</el-popover>
</div>
<div class="scene-item-box" v-else @click="handleStep(index)">
<div class="scene-item-title"> <div class="scene-item-title">
<img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" /> <img :src="require(`@/assets/marketing/s${index + 1}.png`)" alt="" />
{{ item.title }} {{ item.title }}
...@@ -39,13 +50,13 @@ export default { ...@@ -39,13 +50,13 @@ export default {
data() { data() {
return { return {
routeInfo: {}, routeInfo: {},
qrCode: '',
tabList: [ tabList: [
{ label: '保险', type: 5 }, { label: '保险', type: 5 },
{ label: '定保', type: 2 }, { label: '定保', type: 2 },
{ label: '节日关怀', type: 6 }, { label: '节日关怀', type: 6 },
{ label: '售后众筹', type: 9 } { label: '售后众筹', type: 9 }
], ],
isShow: false,
isShowCard: false, isShowCard: false,
selectItem: {}, selectItem: {},
festivalList: [], festivalList: [],
...@@ -97,11 +108,12 @@ export default { ...@@ -97,11 +108,12 @@ export default {
} }
}, },
methods: { methods: {
...mapActions('marketing', ['setSubscribe', 'getActivityInfo']), ...mapActions('marketing', ['setSubscribe', 'getActivityInfo', 'getTemplateInfo']),
...mapMutations('marketing', ['SET_INIT', 'SET_STEP']), ...mapMutations('marketing', ['SET_INIT', 'SET_STEP']),
selectFes(item) { selectFes(item) {
this.selectItem = item this.selectItem = item
this.isShow = false this.getTemplateInfo(item.id)
this.setSubscribe({ subscribe: 6, keywords: item.keywords })
}, },
handleStep(index) { handleStep(index) {
if ([1, 2, 3].includes(index)) this.SET_STEP(index) if ([1, 2, 3].includes(index)) this.SET_STEP(index)
...@@ -114,14 +126,13 @@ export default { ...@@ -114,14 +126,13 @@ export default {
}, },
tabClick(index) { tabClick(index) {
this.currentIndex = index this.currentIndex = index
if (index == 6) { if (index != 6) {
this.isShow = true
}
this.setSubscribe(index) this.setSubscribe(index)
}
}, },
EntWechatQrCode() { EntWechatQrCode() {
this.$apis.marketing.EntWechatQrCode({}).then(res => { this.$apis.marketing.EntWechatQrCode({}).then(res => {
console.log(res) this.qrCode = res.qrCode
}) })
}, },
calendarPage() { calendarPage() {
...@@ -134,27 +145,17 @@ export default { ...@@ -134,27 +145,17 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.scene-container { .scene-card {
margin-top: 16px; width: 158px;
.scene-content {
background: #fff;
padding: 16px;
display: flex;
position: relative;
.scene-card {
position: absolute;
width: 178px;
height: 169px; height: 169px;
background: #ffffff;
border: 1px solid #e5e5e5;
box-shadow: 0 4px 12px 0 #00000014;
top: -160px;
left: 16px;
padding: 10px;
&-img { &-img {
width: 82px; width: 82px;
height: 82px; height: 82px;
margin: 10px auto; margin: 10px auto;
img {
width: 82px;
height: 82px;
}
} }
&-content { &-content {
font-size: 12px; font-size: 12px;
...@@ -162,7 +163,15 @@ export default { ...@@ -162,7 +163,15 @@ export default {
text-align: center; text-align: center;
line-height: 18px; line-height: 18px;
} }
} }
.scene-container {
margin-top: 16px;
.scene-content {
background: #fff;
padding: 16px;
display: flex;
position: relative;
.scene-item { .scene-item {
width: 16.7%; width: 16.7%;
display: flex; display: flex;
......
...@@ -41,22 +41,22 @@ ...@@ -41,22 +41,22 @@
<div class="link-title">{{ item.title }}</div> <div class="link-title">{{ item.title }}</div>
<div class="link-save"><el-button :size="size" type="primary" @click="downloadIamge">保存图片</el-button></div> <div class="link-save"><el-button :size="size" type="primary" @click="downloadIamge">保存图片</el-button></div>
</div> </div>
<div class="link-item-r"><el-image :src="qrCodeUrl" alt=""></el-image></div> <div class="link-item-r"><el-image :src="linkInfo[item.name]" alt=""></el-image></div>
</div> </div>
</div> </div>
<div class="link-address-box" v-for="(item, index) in linkValue" :key="index"> <div class="link-address-box" v-for="(item, index) in linkValue" :key="index">
<div class="link-address-title">{{ item.title }}</div> <div class="link-address-title">{{ item.title }}</div>
<div class="link-address">{{ item.url }}</div> <div class="link-address">{{ linkInfo[item.name] }}</div>
<div class="link-clone"><el-button :size="size" type="primary" @click="cloneText(item, url)">复制链接</el-button></div> <div class="link-clone"><el-button :size="size" type="primary" @click="cloneText(item, url)">复制链接</el-button></div>
</div> </div>
</div> </div>
<div class="qrcode-body" v-else> <div class="qrcode-body" v-else>
<div class="img" v-loading="imgLoading"> <div class="img" v-loading="imgLoading">
<el-image :src="qrCodeUrl" alt=""></el-image> <el-image :src="linkInfo.qrCodeUrl" alt=""></el-image>
</div> </div>
<div class="qrcode-link m-t-10"> <div class="qrcode-link m-t-10">
活动链接:{{ linkUrl }} 活动链接:{{ linkInfo.linkUrl }}
<span @click="handleSaveTxt(linkUrl)">复制</span> <span @click="handleSaveTxt(linkInfo.linkUrl)">复制</span>
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
...@@ -73,17 +73,20 @@ export default { ...@@ -73,17 +73,20 @@ export default {
data() { data() {
return { return {
orderStatus, orderStatus,
isLink: true, linkInfo: {},
attrToIcon: { attrToIcon: {
2: 'discount', 2: 'discount',
3: 'cash', 3: 'cash',
4: 'exchange', 4: 'exchange',
7: 'service' 7: 'service'
}, },
linkCode: [{ title: '活动二维码' }, { title: '注册二维码' }], linkCode: [
{ title: '活动二维码', name: 'qrCodeUrl' },
{ title: '注册二维码', name: 'staffLoginQrCodeUrl' }
],
linkValue: [ linkValue: [
{ title: '注册链接', url: 'thttp://scrm.test.glsx.com.cn/link/activityLink/index' }, { title: '注册链接', name: 'staffLoginLinkUrl' },
{ title: '活动链接', url: 'thttp://scrm.test.glsx.com.cn/link/activityLink/index' } { title: '活动链接', name: 'linkUrl' }
], ],
qrCodeUrl: '', qrCodeUrl: '',
linkUrl: '', linkUrl: '',
...@@ -258,7 +261,7 @@ export default { ...@@ -258,7 +261,7 @@ export default {
// return row.status == 2 || row.status == 0 // return row.status == 2 || row.status == 0
// }, // },
listeners: { listeners: {
click: row => this.shareQrcode(row) click: row => this.shareQrcode(row, false)
} }
}, },
{ {
...@@ -293,7 +296,7 @@ export default { ...@@ -293,7 +296,7 @@ export default {
}, },
listeners: { listeners: {
click: row => { click: row => {
this.shareQrcode(row) this.shareQrcode(row, true)
} }
} }
} }
...@@ -368,13 +371,12 @@ export default { ...@@ -368,13 +371,12 @@ export default {
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
shareQrcode(row) { shareQrcode(row, status) {
this.isQrcodeVisible = true this.isQrcodeVisible = true
this.isLink = status
this.$apis.activity.getShared({ id: row.id }).then(res => { this.$apis.activity.getShared({ id: row.id }).then(res => {
if (res) { if (res) {
this.isLink = false this.linkInfo = res
this.linkUrl = res.linkUrl
this.qrCodeUrl = res.qrCodeUrl
} }
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!