Commit 669a0184 by 杨明

fixed

1 parent c945cf21
......@@ -13,8 +13,8 @@ export default {
],
serviceTabList: [
{ label: '门店服务', type: 7 },
{ label: '代金券', type: 2 },
{ label: '折扣券', type: 3 },
{ label: '代金券', type: 3 },
{ label: '折扣券', type: 2 },
{ label: '兑换券', type: 4 }
],
carTableParams: {
......
......@@ -2,19 +2,14 @@
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-07-10 10:53:53
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-10 11:10:17
* @LastEditTime: 2023-07-16 10:12:40
* @FilePath: \scrm-micro-link\src\mixins\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
data() {
return {
process: { 0: false, 1: false, 2: false }
}
},
methods: {
setProcess(data) {
this.process = { ...this.process, ...data }
routerInfo: this.$route.query
}
}
}
......@@ -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-14 20:59:39
* @LastEditTime: 2023-07-16 10:17:32
* @FilePath: \scrm-micro-home\src\store\modules\marketing.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -18,8 +18,7 @@ export default {
GPTList: null,
packageList: {},
process: { 0: false, 1: false, 2: false },
activityInfo: null,
addOrEdit: null,
activityInfo: {},
merchantInfo: {},
step: 1
},
......@@ -33,9 +32,6 @@ export default {
state.activityInfo = Object.assign({})
}
},
SET_STATUS(state, data) {
state.addOrEdit = data
},
SET_STEP(state, data) {
state.step = data
},
......
......@@ -4,10 +4,10 @@
<div class="choseRow-item">
<div class="choseItem" :class="{ active: step == index + 1 }" v-for="(item, index) in tabList" :key="index" @click="tabClick(index + 1)">{{ item.label }}</div>
</div>
<div @click="showCase" class="show-case-btn" v-if="addOrEdit == 'add'">历史营销方案</div>
<div @click="showCase" class="show-case-btn" v-if="routerInfo.addOrEdit == 'add'">历史营销方案</div>
</div>
<div class="acitity-content">
<marketing-task v-show="step == 1" v-if="addOrEdit == 'add'"></marketing-task>
<marketing-task v-show="step == 1" v-if="routerInfo.addOrEdit == 'add'"></marketing-task>
<marketing-gift v-show="step == 2"></marketing-gift>
<marketing-content v-show="step == 3"></marketing-content>
</div>
......@@ -38,8 +38,10 @@ import marketingTask from './MarketingTask'
import marketingGift from './MarketingGift'
import marketingContent from './MarketingContent'
import { mapActions, mapState, mapMutations } from 'vuex'
import marketing from '@/mixins/marketing'
import PhoneView from './PhoneView.vue'
export default {
mixins: [marketing],
components: {
marketingTask,
marketingGift,
......@@ -48,7 +50,6 @@ export default {
},
data() {
return {
addOrEdit: this.$route.query.addOrEdit,
dialogVisible: false,
activityInfo: {},
routeInfo: {},
......@@ -126,7 +127,7 @@ export default {
}
},
mounted() {
if (this.addOrEdit == 'edit') {
if (this.routerInfo.addOrEdit == 'edit') {
this.SET_STEP(2)
this.setProcess({ 0: true })
}
......@@ -178,7 +179,7 @@ export default {
})
},
tabClick(index) {
if (index == 1 && (this.addOrEdit == 'edit' || this.subscribe == 9)) {
if (index == 1 && (this.routerInfo.addOrEdit == 'edit' || this.subscribe == 9)) {
return
}
this.SET_STEP(index)
......
......@@ -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-14 21:14:33
* @LastEditTime: 2023-07-16 10:22:37
* @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
-->
......@@ -40,7 +40,9 @@ import selectInsure from './SelectInsure.vue'
import getUploadImgColor from '@/utils/color'
import { mapState, mapActions } from 'vuex'
import { RENEWAL, FESTIVAL } from '@/common/constant'
import marketing from '@/mixins/marketing'
export default {
mixins: [marketing],
components: {
selectInsure
},
......@@ -213,12 +215,12 @@ export default {
deep: true
},
subscribe(val) {
if (val == 5 && this.$route.query.addOrEdit == 'add') {
if (val == 5 && this.routerInfo.addOrEdit == 'add') {
this.editFormData[0].isHide = false
} else {
this.editFormData[0].isHide = true
}
if (val == 6 && this.$route.query.addOrEdit == 'add') {
if (val == 6 && this.routerInfo.addOrEdit == 'add') {
this.editRule.detailImage[0].required = true
} else {
this.editRule.detailImage[0].required = false
......@@ -226,7 +228,7 @@ export default {
},
merchantInfo: {
handler(val) {
if (this.$route.query.addOrEdit == 'edit') return
if (this.routerInfo.addOrEdit == 'edit') return
if (!this.editForm.merchantname) {
this.editForm.merchantname = val.merchantName
}
......@@ -268,6 +270,7 @@ export default {
methods: {
...mapActions('marketing', ['setProcess', 'getTemplateInfo']),
getInfo(info) {
console.log(info, this.subscribe, 999999999)
if (Object.keys(info || {}).length == 0) {
this.editForm = {
marketingTitle: '',
......@@ -279,13 +282,14 @@ export default {
merchantname: this.merchantInfo.merchantName,
merchantAddress: this.merchantInfo.merchantAddress
}
if ([2, 5].includes(+this.subscribe) && this.$route.query.addOrEdit == 'add') {
const subscribe = +(this.subscribe || this.routerInfo.subscribe)
if ([2, 5].includes(subscribe) && this.routerInfo.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.backgroundImage = this.editForm.backgroundImage ? this.editForm.backgroundImage : `${this.staticImgUrl}model-main-${obj[subscribe]}.png`
const html = `<p><img src="${this.staticImgUrl}model-detail-${obj[subscribe]}.png" style="max-width:100%;" contenteditable="false"/></p>`
this.editForm.activityDetail = html
console.log(this.editForm, 777)
}
......
......@@ -518,8 +518,7 @@ export default {
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
}
console.log(this.selectedCarList)
// this.getList()
this.getList()
})
})
},
......
......@@ -225,6 +225,7 @@ export default {
})
},
handleChange(item) {
this.$refs['form' + item.batchNo][0].clearSelection()
if (item.assignType == 1) {
const staffPhone = item.lastFollowStaffList.map(item => item.staffPhone)
item.tableData.forEach(i => {
......
......@@ -57,6 +57,7 @@ export default {
init() {
this.SET_INIT(true)
},
//执行营销方案
async handleSave() {
let params = { merchantId: this.$globalState.session.merchantId }
for (let k in this.process) {
......@@ -74,10 +75,10 @@ export default {
} = this.$refs.viewForm
let url = backgroundImage
if (RENEWAL.includes(params.codeId)) {
url = await this.createMain(backgroundHeight, backgroundImage, draggableList)
url = await this.createMain(backgroundHeight, backgroundImage, draggableList) //合并主图、文字
}
if (FESTIVAL.includes(params.codeId)) {
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle))
url = await this.createBig(this.$refs.viewForm.detail, this.logoInfo, JSON.parse(titleStyle), JSON.parse(subTitleStyle)) //合并主图、背景图、logo、文字
}
let origin = 'createSuperMarketing'
if (params.id) {
......@@ -86,6 +87,7 @@ export default {
params = { ...params, ...this.addProperties(params) }
params = this.deleteKeys(params, ['activityActionReport', 'couponList', 'superMarketingCouponRelRequestList'])
}
if (params.codeId) delete params.activityDetail
params.subscribe = this.subscribe
params.bigImage = url
this.$apis.marketing[origin](params)
......@@ -101,14 +103,16 @@ export default {
this.loading = false
})
},
//删除对象中的属性
deleteKeys(obj, keys) {
const filteredEntries = Object.entries(obj).filter(([key]) => !keys.includes(key))
return Object.fromEntries(filteredEntries)
},
//添加的属性
addProperties(obj) {
return {
...obj,
marketingType: 5,
marketingType: 5, // 膨胀金
couponCreateRequests: obj.superMarketingCouponRelRequestList
}
}
......
<template>
<div class="scene-container">
<el-button :size="size" type="success" plain @click="handleAdd" class="el-icon-plus" v-if="addOrEdit == 'add'">新建营销方案</el-button>
<el-button :size="size" type="success" plain @click="handleAdd" class="el-icon-plus" v-if="routerInfo.addOrEdit == 'add'">新建营销方案</el-button>
<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>
......@@ -50,10 +50,11 @@
<script>
import { mapActions, mapMutations, mapState } from 'vuex'
import marketing from '@/mixins/marketing'
export default {
mixins: [marketing],
data() {
return {
addOrEdit: this.$route.query.addOrEdit,
qrCode: '',
tabList: [
{ label: '保险', type: 5 },
......@@ -95,14 +96,13 @@ export default {
}
},
mounted() {
const routeInfo = this.$route.query
this.calendarPage()
this.EntWechatQrCode()
if (routeInfo.addOrEdit == 'edit') {
this.getActivityInfo(routeInfo.id)
if (this.routerInfo.addOrEdit == 'edit') {
this.getActivityInfo(this.routerInfo.id)
this.sceneList[1].content = '编辑无法再次导入客群'
} else {
this.setSubscribe(routeInfo.subscribe)
this.setSubscribe(this.routerInfo.subscribe)
this.tabList.splice(3, 1)
}
},
......@@ -131,15 +131,15 @@ export default {
this.setSubscribe({ subscribe: 6, keywords: this.selectItem.keywords })
},
handleStep(index) {
if (this.addOrEdit == 'edit' && index == 1) return
if (this.routerInfo.addOrEdit == 'edit' && index == 1) return
if ([1, 2, 3].includes(index)) this.SET_STEP(index)
},
handleAdd() {
this.SET_INIT(true)
},
tabClick(index) {
console.log(this.addOrEdit, 'addOrEdit')
if (this.addOrEdit == 'edit') return
console.log(this.routerInfo.addOrEdit, 'routerInfo.addOrEdit')
if (this.routerInfo.addOrEdit == 'edit') return
this.currentIndex = index
if (index != 6) {
this.setSubscribe(index)
......
......@@ -47,7 +47,7 @@ export default {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
......
......@@ -43,7 +43,7 @@ export default {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
......
......@@ -49,8 +49,9 @@ export default {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
console.log(item.price, price, item)
})
this.serviceList = serviceList
},
......@@ -62,7 +63,7 @@ export default {
</script>
<style scoped lang="scss">
.wrap {
margin-bottom: 70px;
margin-bottom: 35px;
.container-panel {
padding: 4px;
......@@ -132,10 +133,10 @@ export default {
}
.service-desc {
flex: 1;
.service-title {
font-size: 12px;
color: #111111;
white-space: nowrap;
}
.service-content {
......@@ -147,7 +148,7 @@ export default {
.service-price {
margin-left: auto;
width: 80px;
width: 50px;
text-align: center;
font-size: 15px;
color: #ff5c67;
......
......@@ -43,7 +43,7 @@ export default {
const serviceList = n.selectedGoodsList || []
serviceList.length > 0 &&
serviceList.forEach(item => {
const price = item.couponAnticipatedCost || item.denomination
const price = item.couponAnticipatedCost || item.denomination || item.anticipatedCost
item.price = (price / 100).toFixed(2).replace(/\.[0]+$/, '')
})
this.serviceList = serviceList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!