Commit c945cf21 by 杨明

fixed

1 parent 520162be
......@@ -2,14 +2,14 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-19 13:46:20
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 20:14:15
* @LastEditTime: 2023-07-14 21:38:37
* @FilePath: \scrm-micro-home\src\mixins\gpt.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapState, mapActions } from 'vuex'
import apis from '@/api'
import Drawing from '@/utils/drawing'
const WIDTH = 375
const WIDTH = 244
const RATIO = WIDTH / 375
export default {
data() {
return {}
......@@ -59,6 +59,13 @@ export default {
},
{ ...this.logoInfo }
].filter(item => item.url)
const styles = [titleStyle, subTitleStyle]
for (const style of styles) {
style.x = parseInt(style.x * RATIO)
style.y = parseInt(style.y * RATIO)
style.size = parseInt(style.size * RATIO)
style.width = parseInt(style.width * RATIO)
}
let textList = [],
title = {
titleStyle,
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-05-16 17:13:33
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 19:33:38
* @LastEditTime: 2023-07-14 20:59:39
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -51,9 +51,9 @@ export default {
SET_ACTIVITY_INFO(state, data) {
if (data.activityBigImg) {
data.codeId = null
data.backgroundImage = data.activityBigImg
data.merchantAddress = data.activityAddressDetailName
}
data.backgroundImage = data.activityBigImg
data.merchantAddress = data.activityAddressDetailName
state.activityInfo = Object.assign({}, data)
},
SET_KET_WORDs(state, data) {
......
......@@ -7,7 +7,7 @@
<div @click="showCase" class="show-case-btn" v-if="addOrEdit == 'add'">历史营销方案</div>
</div>
<div class="acitity-content">
<marketing-task v-show="step == 1"></marketing-task>
<marketing-task v-show="step == 1" v-if="addOrEdit == 'add'"></marketing-task>
<marketing-gift v-show="step == 2"></marketing-gift>
<marketing-content v-show="step == 3"></marketing-content>
</div>
......@@ -48,6 +48,7 @@ export default {
},
data() {
return {
addOrEdit: this.$route.query.addOrEdit,
dialogVisible: false,
activityInfo: {},
routeInfo: {},
......@@ -125,13 +126,13 @@ export default {
}
},
mounted() {
if (this.$route.query.addOrEdit == 'edit') {
if (this.addOrEdit == 'edit') {
this.SET_STEP(2)
this.setProcess({ 0: true })
}
},
computed: {
...mapState('marketing', ['step', 'addOrEdit', 'subscribe'])
...mapState('marketing', ['step', 'subscribe'])
},
watch: {
subscribe(val) {
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-06-29 21:24:27
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 20:49:42
* @LastEditTime: 2023-07-14 21:14:33
* @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
-->
......@@ -24,7 +24,7 @@
</div>
<template slot="activityTimeHtml">
<div class="activity-time-container">
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy/MM/dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']"></el-date-picker>
</div>
</template>
</glsx-combi-form>
......@@ -201,6 +201,9 @@ export default {
}
}
},
mounted() {
this.setProcess({ 2: false })
},
watch: {
GPTList: {
handler() {
......@@ -215,6 +218,11 @@ export default {
} else {
this.editFormData[0].isHide = true
}
if (val == 6 && this.$route.query.addOrEdit == 'add') {
this.editRule.detailImage[0].required = true
} else {
this.editRule.detailImage[0].required = false
}
},
merchantInfo: {
handler(val) {
......@@ -248,47 +256,10 @@ export default {
activityInfo: {
handler(val) {
const info = this.$common.utils.deepClone(val)
if (Object.keys(info).length == 0) {
return (this.editForm = {
marketingTitle: '',
marketingSubtitle: '',
activityTime: [],
backgroundImage: '',
detailImage: '',
merchantLog: '',
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress
})
}
if ([9, 10].includes(info.codeId)) {
this.editRule.detailImage[0].required = true
} else {
this.editRule.detailImage[0].required = false
}
if (info.codeId) {
this.setDetail(info)
return
}
this.editForm = Object.assign({ merchantLog: '' }, info)
if (info.activityName) {
this.$set(this.editForm, 'marketingTitle', info.activityName)
}
if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')])
}
if (info.startTime) {
this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')])
}
if (info.merchantName) {
this.$set(this.editForm, 'merchantname', info.merchantName)
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
this.getInfo(info)
},
deep: true
deep: true,
immediate: true
}
},
computed: {
......@@ -296,22 +267,62 @@ export default {
},
methods: {
...mapActions('marketing', ['setProcess', 'getTemplateInfo']),
getInfo(info) {
if (Object.keys(info || {}).length == 0) {
this.editForm = {
marketingTitle: '',
marketingSubtitle: '',
activityTime: [],
backgroundImage: '',
detailImage: '',
merchantLog: '',
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress
}
if ([2, 5].includes(+this.subscribe) && this.$route.query.addOrEdit == 'add') {
const obj = {
2: 2,
5: 3
}
this.editForm.backgroundImage = this.editForm.backgroundImage ? this.editForm.backgroundImage : `${this.staticImgUrl}model-main-${obj[this.subscribe]}.png`
const html = `<p><img src="${this.staticImgUrl}model-detail-${obj[this.subscribe]}.png" style="max-width:100%;" contenteditable="false"/></p>`
this.editForm.activityDetail = html
console.log(this.editForm, 777)
}
return
}
if (info.codeId) {
this.setDetail(info)
return
}
console.log(888)
this.editForm = Object.assign({ merchantLog: '' }, info)
if (info.activityName) {
this.$set(this.editForm, 'marketingTitle', info.activityName)
}
if (info.starttime) {
this.$set(this.editForm, 'activityTime', [info.starttime.replace(/-/g, '/'), info.endtime.replace(/-/g, '/')])
}
if (info.startTime) {
this.$set(this.editForm, 'activityTime', [info.startTime.replace(/-/g, '/'), info.endTime.replace(/-/g, '/')])
}
if (info.merchantName) {
this.$set(this.editForm, 'merchantname', info.merchantName)
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.editFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
},
setDetail(info) {
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, titleStyle, subTitleStyle, codeId } = info
this.editForm = {
codeId,
marketingTitle: title,
marketingSubtitle: subTitle,
backgroundImage: backgroundImg,
detailImage: captionImg,
titleStyle: titleStyle,
subTitleStyle: subTitleStyle,
activityTime: [startTime + ' 00:00:00', endTime + ' 00:00:00'],
...info,
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress,
merchantLog: '',
mainColor: ''
}
console.log(this.editForm, 9)
},
handleSure(val) {
this.modelVisible = false
......
......@@ -145,7 +145,8 @@ export default {
this.getList()
},
activityInfo: {
handler(info) {
handler(val) {
const info = this.$common.utils.deepClone(val)
this.init()
this.$nextTick(() => {
if (info.serviceMerchantPackageConfigDTOS) this.selectedCarList = info.serviceMerchantPackageConfigDTOS
......@@ -528,6 +529,11 @@ export default {
tabClick(index) {
this.currentIndex = index
}
},
mounted() {
this.setProcess({
1: false
})
}
}
</script>
......
......@@ -110,7 +110,7 @@
</el-select>
</el-form-item>
<el-form-item label="营销短信:" :size="size">
<el-input v-model="configForm.messageContent" type="textarea"></el-input>
<el-input v-model="configForm.messageContent" type="textarea" :disabled="true"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -201,6 +201,19 @@ export default {
})
}
},
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
findMerchantStaffList() {
let param = {
merchantNo: this.$globalState.session.merchantId,
......
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2023-05-15 15:08:32
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 20:11:55
* @LastEditTime: 2023-07-14 21:46:29
* @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
-->
......@@ -188,7 +188,7 @@
</div>
</template>
<template v-else>
<phone-view-a :editForm="activityInfo"></phone-view-a>
<phone-view-a :editForm="activityInfo" v-if="activityInfo"></phone-view-a>
</template>
</div>
</template>
......@@ -297,7 +297,7 @@ export default {
},
mounted() {
this.$nextTick(() => {
if (!this.activityInfo.id) return
if (!this.activityInfo?.id) return
this.detail = this.activityInfo
this.detailCoupon = this.detail
this.isFestival = false
......@@ -334,28 +334,49 @@ export default {
this.modelNum = this.detail.codeId
this.isRenewal = true
this.backgroundHeight = await this.getImgH(this.detail.backgroundImage)
try {
const style1 = JSON.parse(this.detail.titleStyle)
const style2 = JSON.parse(this.detail.subTitleStyle)
Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, color: style1.style.color, font: style1.font })
Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, color: style2.style.color, font: style2.font })
} catch (e) {
console.log(e)
const style1 = JSON.parse(this.detail.titleStyle)
const style2 = JSON.parse(this.detail.subTitleStyle)
const styles = [style1, style2]
for (const style of styles) {
style.x = parseInt(style.x * RATIO)
style.y = parseInt(style.y * RATIO)
style.size = parseInt(style.size * RATIO)
style.width = parseInt(style.width * RATIO)
}
Object.assign(this.draggableList[0], { content: this.detail.marketingTitle, ...style1, color: style1.style.color, font: style1.font })
Object.assign(this.draggableList[1], { content: this.detail.marketingSubtitle, ...style2, color: style2.style.color, font: style2.font })
}
if (FESTIVAL.includes(this.detail.codeId)) {
const style1 = JSON.parse(this.detail.titleStyle)
const style2 = JSON.parse(this.detail.subTitleStyle)
const styles = [style1, style2]
for (const style of styles) {
style.x = parseInt(style.x * RATIO)
style.y = parseInt(style.y * RATIO)
style.size = parseInt(style.size * RATIO)
style.width = parseInt(style.width * RATIO)
}
this.textList = []
const title = {
titleStyle: style1,
subTitleStyle: style2
}
this.detail.marketingTitle.split(' ').forEach((item, index) => {
this.textList.push({
...style1,
text: item
x: title.titleStyle.x,
y: title.titleStyle.y + index * title.titleStyle.fontSize * 1.14,
fontSize: title.titleStyle.fontSize,
color: title.titleStyle.color,
text: item,
bold: title.titleStyle.bold
})
})
new Array(this.detail.marketingSubtitle).forEach((item, index) => {
this.textList.push({
...style2,
x: title.subTitleStyle.x,
y: title.subTitleStyle.y + title.titleStyle.fontSize * 1.14 * (this.textList.length - 1),
fontSize: title.subTitleStyle.fontSize,
color: title.subTitleStyle.color,
text: item
})
})
......
......@@ -84,7 +84,7 @@ export default {
origin = 'updateApi'
params.activityName = params.marketingTitle
params = { ...params, ...this.addProperties(params) }
params = this.deleteKeys(params, ['serviceMerchantPackageConfigDTOS', 'activityActionReport', 'couponList', 'superMarketingCouponRelRequestList'])
params = this.deleteKeys(params, ['activityActionReport', 'couponList', 'superMarketingCouponRelRequestList'])
}
params.subscribe = this.subscribe
params.bigImage = url
......
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-06 11:45:15
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-14 15:12:20
* @FilePath: \scrm-micro-link\src\views\activityLink\components\SelectInsure.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<GLDialog class="model-panel" width="720px" title="选择模板" :before-close="handleModelClose" @onCancel="handleModelClose" @onOk="handleConfirm" :visible.sync="modelVisible">
<div class="model-body">
......@@ -40,8 +48,7 @@ export default {
})
},
handleConfirm() {
this.getCalendarDetail(this.selectObj.id)
this.$emit('handleClose')
this.$emit('handleSure', this.selectObj)
},
handleModelClose() {
this.$emit('handleClose')
......
......@@ -43,7 +43,7 @@ export default {
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList
const serviceList = n.selectedServiceList || []
this.serviceList = serviceList
},
deep: true,
......
......@@ -29,7 +29,7 @@ export default {
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList
const serviceList = n.selectedCarList || []
console.log(serviceList)
this.serviceList = serviceList
},
......
......@@ -34,7 +34,7 @@ export default {
watch: {
detail: {
handler(n) {
const serviceList = n.selectedServiceList
const serviceList = n.selectedServiceList || []
this.serviceList = serviceList
},
deep: true,
......
......@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-08 09:40:43
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-13 09:30:21
* @LastEditTime: 2023-07-14 16:06:09
* @FilePath: \scrm-micro-link\src\views\activityLink\components\model\model_2\equity\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -36,7 +36,7 @@ export default {
watch: {
detail: {
handler(n) {
const serviceList = n.selectedCarList
const serviceList = n.selectedCarList || []
this.serviceList = serviceList
},
deep: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!