Commit 90b8efd9 by 杨明

fixed

1 parent cabcf0f1
...@@ -268,6 +268,10 @@ const subscribe = [ ...@@ -268,6 +268,10 @@ const subscribe = [
{ {
optionId: 8, optionId: 8,
optionLabel: '超级营销' optionLabel: '超级营销'
},
{
optionId: 9,
optionLabel: '售后众筹'
} }
] ]
const giftPackage = [ const giftPackage = [
......
.vdr {
touch-action: none;
position: absolute;
box-sizing: border-box;
border: 1px dashed black;
}
.handle {
box-sizing: border-box;
position: absolute;
width: 10px;
height: 10px;
background: #EEE;
border: 1px solid #333;
}
.handle-tl {
top: -10px;
left: -10px;
cursor: nw-resize;
}
.handle-tm {
top: -10px;
left: 50%;
margin-left: -5px;
cursor: n-resize;
}
.handle-tr {
top: -10px;
right: -10px;
cursor: ne-resize;
}
.handle-ml {
top: 50%;
margin-top: -5px;
left: -10px;
cursor: w-resize;
}
.handle-mr {
top: 50%;
margin-top: -5px;
right: -10px;
cursor: e-resize;
}
.handle-bl {
bottom: -10px;
left: -10px;
cursor: sw-resize;
}
.handle-bm {
bottom: -10px;
left: 50%;
margin-left: -5px;
cursor: s-resize;
}
.handle-br {
bottom: -10px;
right: -10px;
cursor: se-resize;
}
@media only screen and (max-width: 768px) {
[class*="handle-"]:before {
content: '';
left: -10px;
right: -10px;
bottom: -10px;
top: -10px;
position: absolute;
}
}
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
* @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-05-31 18:11:57 * @LastEditTime: 2023-07-09 12:59:17
* @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
*/ */
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import apis from '@/api'
import Drawing from '@/utils/drawing' import Drawing from '@/utils/drawing'
const WIDTH = 375
export default { export default {
data() { data() {
return {} return {}
...@@ -77,6 +78,43 @@ export default { ...@@ -77,6 +78,43 @@ export default {
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
},
async createMain(h, url, draggableList) {
const style1 = draggableList[0]
const style2 = draggableList[1]
const drawfun = new Drawing(document.getElementById('canvasId'), {
width: WIDTH,
height: h
})
const imageList = [
{
url,
x: 0,
y: 0,
width: WIDTH,
height: h
}
]
const textList = [
{ x: style1.x, y: style1.y, fontSize: style1.size, width: style1.width, text: style1.content },
{ x: style2.x, y: style2.y, fontSize: style2.size, width: style2.width, text: style2.content }
]
console.log(imageList, textList)
const canvasBase64 = await drawfun.begin({
imageList,
textList
})
return new Promise(async resolve => {
resolve(await this.uploadImg(canvasBase64))
})
},
uploadImg(imgFile) {
return new Promise((resolve, reject) => {
const base64 = 'png' + '@' + imgFile.split(',')[1]
apis.common.pictureUpload({ file: base64, fileType: 'image' }).then(res => {
resolve(res)
})
})
} }
}, },
mounted() {} mounted() {}
......
...@@ -2,25 +2,34 @@ ...@@ -2,25 +2,34 @@
* @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-07 18:23:30 * @LastEditTime: 2023-07-09 11:19:44
* @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
*/ */
import apis from '@/api' import apis from '@/api'
const subscribeData = { 5: '保险', 2: '定保', 8: '售后众筹' } const subscribeData = { 5: '保险', 2: '定保', 9: '售后众筹' }
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
subscribe: null, subscribe: 5,
keywords: null, keywords: null,
GPTList: null, GPTList: null,
packageList: {}, packageList: {},
process: { 0: false, 1: false, 2: false }, process: { 0: false, 1: false, 2: false },
activityInfo: {} activityInfo: null
}, },
mutations: { mutations: {
SET_INIT(state, data) {
if (data) {
state.keywords = null
state.GPTList = null
state.packageList = {}
state.process = Object.assign({}, { 0: false, 1: false, 2: false })
state.activityInfo = Object.assign({})
}
},
// 设置场景值 // 设置场景值
SET_SUBSCRIBE(state, data) { SET_SUBSCRIBE(state, data) {
state.subscribe = data state.subscribe = data
...@@ -55,19 +64,15 @@ export default { ...@@ -55,19 +64,15 @@ export default {
}) })
}, },
//活动活动详情 //活动活动详情
getActivityInfo({ commit }, data) { getActivityInfo({ commit, state }, data) {
let { id, subscribe } = data, apis.marketing.activityDetail({ id: data }).then(res => {
param = { state.subscribe = res.subscribe
activityId: id commit('SET_ACTIVITY_INFO', res)
}, })
activityAPi = 'findActivityInfo' },
if (subscribe != 8) { //活动模板详情
param = { getCalendarDetail({ commit }, data) {
id apis.marketing.calendarDetail({ id: data }).then(res => {
}
activityAPi = 'activityDetail'
}
apis.marketing[activityAPi](param).then(res => {
commit('SET_ACTIVITY_INFO', res) commit('SET_ACTIVITY_INFO', res)
}) })
}, },
......
import { isFunction } from './fns'
export function matchesSelectorToParentElements(el, selector, baseNode) {
let node = el
const matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(func => isFunction(node[func]))
if (!isFunction(node[matchesSelectorFunc])) return false
do {
if (node[matchesSelectorFunc](selector)) return true
if (node === baseNode) return false
node = node.parentNode
} while (node)
return false
}
export function getComputedSize($el) {
const style = window.getComputedStyle($el)
return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]
}
export function addEvent(el, event, handler) {
if (!el) {
return
}
if (el.attachEvent) {
el.attachEvent('on' + event, handler)
} else if (el.addEventListener) {
el.addEventListener(event, handler, true)
} else {
el['on' + event] = handler
}
}
export function removeEvent(el, event, handler) {
if (!el) {
return
}
if (el.detachEvent) {
el.detachEvent('on' + event, handler)
} else if (el.removeEventListener) {
el.removeEventListener(event, handler, true)
} else {
el['on' + event] = null
}
}
export function isFunction(func) {
return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'
}
export function snapToGrid(grid, pendingX, pendingY, scale = 1) {
const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale
const x = Math.round(pendingX / scaleX / grid[0]) * grid[0]
const y = Math.round(pendingY / scaleY / grid[1]) * grid[1]
return [x, y]
}
export function getSize(el) {
const rect = el.getBoundingClientRect()
return [parseInt(rect.width), parseInt(rect.height)]
}
export function computeWidth(parentWidth, left, right) {
return parentWidth - left - right
}
export function computeHeight(parentHeight, top, bottom) {
return parentHeight - top - bottom
}
export function restrictToBounds(value, min, max) {
if (min !== null && value < min) {
return min
}
if (max !== null && max < value) {
return max
}
return value
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-tab-pane label="保 险" name="5"></el-tab-pane> <el-tab-pane label="保 险" name="5"></el-tab-pane>
<el-tab-pane label="定 保" name="2"></el-tab-pane> <el-tab-pane label="定 保" name="2"></el-tab-pane>
<el-tab-pane label="节日关怀" name="6"></el-tab-pane> <el-tab-pane label="节日关怀" name="6"></el-tab-pane>
<el-tab-pane label="售后众筹" name="4"></el-tab-pane> <el-tab-pane label="售后众筹" name="9"></el-tab-pane>
</el-tabs> </el-tabs>
<div></div> <div></div>
</div> </div>
...@@ -130,7 +130,7 @@ export default { ...@@ -130,7 +130,7 @@ export default {
//引用 //引用
handleUse(row) { handleUse(row) {
this.caseVisible = false this.caseVisible = false
this.getActivityInfo(row) this.getActivityInfo(row.id)
}, },
//预览 //预览
handleView(row) {}, handleView(row) {},
......
...@@ -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-07 18:29:33 * @LastEditTime: 2023-07-09 12:29:03
* @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
--> -->
...@@ -60,7 +60,8 @@ export default { ...@@ -60,7 +60,8 @@ export default {
editFormData: [ editFormData: [
{ {
label: '预设模板', label: '预设模板',
addHtml: 'model' addHtml: 'model',
isHide: false
}, },
{ {
label: '营销标题', label: '营销标题',
...@@ -207,6 +208,7 @@ export default { ...@@ -207,6 +208,7 @@ export default {
deep: true deep: true
}, },
subscribe(val) { subscribe(val) {
console.log(val, 999)
if (val == 5) { if (val == 5) {
this.editRule.detailImage[0].required = false this.editRule.detailImage[0].required = false
this.editFormData[0].isHide = false this.editFormData[0].isHide = false
...@@ -217,6 +219,13 @@ export default { ...@@ -217,6 +219,13 @@ export default {
}, },
activityInfo: { activityInfo: {
handler(info) { handler(info) {
if (Object.keys(info).length == 0) {
return (this.editForm = {})
}
if (info.subTitle) {
this.setDetail(info)
return
}
this.editForm = this.$common.utils.deepClone(info) this.editForm = 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)
...@@ -242,10 +251,21 @@ export default { ...@@ -242,10 +251,21 @@ export default {
} }
}, },
computed: { computed: {
...mapState('marketing', ['GPTList', 'subscribe', 'activityInfo']) ...mapState('marketing', ['GPTList', 'subscribe', 'activityInfo', 'isInit'])
}, },
methods: { methods: {
...mapActions('marketing', ['setProcess']), ...mapActions('marketing', ['setProcess']),
setDetail(info) {
const { title, subTitle, startTime, endTime, backgroundImg, captionImg, titleStyle, subTitleStyle, codeId } = this.$common.utils.deepClone(info || {})
this.editForm.codeId = codeId
this.editForm.marketingTitle = title
this.editForm.marketingSubtitle = subTitle
this.editForm.backgroundImage = backgroundImg
this.editForm.detailImage = captionImg
this.editForm.titleStyle = titleStyle
this.editForm.subTitleStyle = subTitleStyle
this.editForm.activityTime = [startTime + ' 00:00:00', endTime + ' 00:00:00']
},
handleSure(val) { handleSure(val) {
this.modelVisible = false this.modelVisible = false
this.getTemplateInfo(val.id) this.getTemplateInfo(val.id)
...@@ -253,8 +273,9 @@ export default { ...@@ -253,8 +273,9 @@ export default {
getTemplateInfo(id) { getTemplateInfo(id) {
this.$apis.marketing.calendarDetail({ id }).then(res => { this.$apis.marketing.calendarDetail({ id }).then(res => {
console.log(res) console.log(res)
const { title, subTitle, startTime, endTime, backgroundImg, captionImg } = this.$common.utils.deepClone(res || {}) const { title, subTitle, startTime, endTime, backgroundImg, captionImg, codeId } = this.$common.utils.deepClone(res || {})
this.editForm.templateId = id this.editForm.templateId = id
this.editForm.codeId = id
this.editForm.marketingTitle = title this.editForm.marketingTitle = title
this.editForm.marketingSubtitle = subTitle this.editForm.marketingSubtitle = subTitle
this.editForm.backgroundImage = backgroundImg this.editForm.backgroundImage = backgroundImg
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div v-show="currentIndex == 1" class="car-table"> <div v-show="currentIndex == 1" class="car-table">
<GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @select="handleSelectionCarTable"> <GLTable :hasPage="false" v-loading="loading" ref="carRef" :tableData="carList" :tableParams="carTableParams" @refreshTable="getCarList" @select="handleSelectionCarTable">
<template slot="price" slot-scope="scope"> <template slot="price" slot-scope="scope">
<el-input v-model="scope.scope.price" placeholder="请输入"></el-input> <el-input v-model="scope.scope.packageAmount" placeholder="请输入"></el-input>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="tab-border" :style="{ left: (serviceIndex == 7 ? 0 : serviceIndex - 1) * 88 + 2 + 'px' }"></div> <div class="tab-border" :style="{ left: (serviceIndex == 7 ? 0 : serviceIndex - 1) * 88 + 2 + 'px' }"></div>
</div> </div>
<div v-for="(item, index) in serviceTabList" :key="index"> <div v-for="(item, index) in serviceTabList" :key="index">
<GLTable :hasPage="false" v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @select="handleSelectionServiceTable"> <GLTable v-loading="loading" v-show="serviceIndex == item.type" :ref="'serviceRef' + item.type" :tableData="serviceList" :tableParams="serviceTableParams" @refreshTable="getServiceList" @select="handleSelectionServiceTable">
<span slot="effectiveType" slot-scope="scope"> <span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span> <span>{{ toLabelText(scope.scope) }}</span>
</span> </span>
...@@ -98,7 +98,7 @@ export default { ...@@ -98,7 +98,7 @@ export default {
type: 'input' type: 'input'
} }
], ],
giftList: [{ name: 'A礼包' }, { name: 'B礼包' }] giftList: []
} }
}, },
watch: { watch: {
...@@ -120,9 +120,20 @@ export default { ...@@ -120,9 +120,20 @@ export default {
}, },
activityInfo: { activityInfo: {
handler(info) { handler(info) {
if (info.serviceMerchantPackageConfigDTOList && info.serviceMerchantPackageConfigDTOList.length) { this.init()
this.selectedCarList = info.serviceMerchantPackageConfigDTOList this.$nextTick(() => {
let activityCoupon = info.activityCouponBaseInfoDTOS || info.couponList if (info.serviceMerchantPackageConfigDTOList && info.serviceMerchantPackageConfigDTOList.length) {
this.selectedCarList = info.serviceMerchantPackageConfigDTOList.map(item => {
return {
packageCode: item.packageCode,
packageAmount: item.packageAmount
}
})
this.selectedCarList = info.serviceMerchantPackageConfigDTOList
}
let activityCoupon = info.activityCouponBaseInfoDTOS || info.couponList || info.couponItemList
if (activityCoupon && activityCoupon.length) { if (activityCoupon && activityCoupon.length) {
activityCoupon.forEach(item => { activityCoupon.forEach(item => {
item.id = item.couponId item.id = item.couponId
...@@ -131,7 +142,9 @@ export default { ...@@ -131,7 +142,9 @@ export default {
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8) this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8) this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
} }
} console.log(this.selectedCarList, this.selectedGoodsList, this.selectedServiceList, 11111111)
this.getList()
})
}, },
deep: true deep: true
} }
...@@ -141,6 +154,20 @@ export default { ...@@ -141,6 +154,20 @@ export default {
}, },
methods: { methods: {
...mapActions('marketing', ['setPackage', 'setProcess']), ...mapActions('marketing', ['setPackage', 'setProcess']),
init() {
this.currentIndex = '1'
this.goodsIndex = 1
this.serviceIndex = 7
this.carList = []
this.selectedCarList = []
this.serviceList = []
this.selectedServiceList = []
this.goodsList = []
this.selectedGoodsList = []
this.$refs['carRef'].$refs['listMutiTable'].clearSelection()
this.$refs['goodsRef' + this.goodsIndex][0].$refs['listMutiTable'].clearSelection()
this.$refs['serviceRef' + this.serviceIndex][0].$refs['listMutiTable'].clearSelection()
},
getGiftList(val) { getGiftList(val) {
const { merchantId } = this const { merchantId } = this
let params = { let params = {
...@@ -152,6 +179,9 @@ export default { ...@@ -152,6 +179,9 @@ export default {
}) })
}, },
handleSaveGift() { handleSaveGift() {
if (!this.editForm.activityPrice) {
this.$message.error('输入活动价格')
}
if (this.selectedGoodsList.length + this.selectedServiceList.length + this.selectedCarList.length == 0) { if (this.selectedGoodsList.length + this.selectedServiceList.length + this.selectedCarList.length == 0) {
this.$message.error('权益服务、平台优惠、门店优惠券至少选一项') this.$message.error('权益服务、平台优惠、门店优惠券至少选一项')
return return
...@@ -186,8 +216,9 @@ export default { ...@@ -186,8 +216,9 @@ export default {
}) })
const equities = {} const equities = {}
selectedCarList.forEach(item => { selectedCarList.forEach(item => {
equities[item.packageCode] = item.price equities[item.packageCode] = item.packageAmount
}) })
console.log(equities, selectedCarList)
let params = { let params = {
merchantId, merchantId,
activitySubscribe: subscribe, activitySubscribe: subscribe,
...@@ -225,10 +256,11 @@ export default { ...@@ -225,10 +256,11 @@ export default {
}, },
// 选择/取消 门店服务 // 选择/取消 门店服务
handleSelectionServiceTable(selection, row) { handleSelectionServiceTable(selection, row) {
console.log(selection, row)
if (selection && selection.find(item => item && item.id == row.id)) { if (selection && selection.find(item => item && item.id == row.id)) {
this.addRows(this.selectedServiceList, [row]) this.addRows(this.selectedServiceList, [row], 'id')
} else { } else {
this.deleteRows(this.selectedServiceList, [val]) this.deleteRows(this.selectedServiceList, [row], 'id')
} }
console.log(this.selectedServiceList) console.log(this.selectedServiceList)
// this.selectedServiceList = val // this.selectedServiceList = val
...@@ -301,6 +333,7 @@ export default { ...@@ -301,6 +333,7 @@ export default {
.then(res => { .then(res => {
this.loading = false this.loading = false
this.carList = res.packageConfigs this.carList = res.packageConfigs
this.selectedPreExisting(this.selectedCarList, this.carList, 'packageCode', this.$refs['carRef'])
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
...@@ -369,7 +402,7 @@ export default { ...@@ -369,7 +402,7 @@ export default {
this.serviceList = res.list this.serviceList = res.list
// this.fnCallBack = true // this.fnCallBack = true
this.$refs['serviceRef' + this.serviceIndex][0].tableTotal = res.total this.$refs['serviceRef' + this.serviceIndex][0].tableTotal = res.total
this.selectedPreExisting(this.selectedServiceList, this.serviceList, 'id', this.$refs['goodsRef' + this.serviceIndex][0]) this.selectedPreExisting(this.selectedServiceList, this.serviceList, 'id', this.$refs['serviceRef' + this.serviceIndex][0])
}) })
.finally(() => { .finally(() => {
this.loading = false this.loading = false
...@@ -377,8 +410,34 @@ export default { ...@@ -377,8 +410,34 @@ export default {
}, },
//获取礼包详情 //获取礼包详情
getModel() { getModel() {
if (!this.giftValue) {
return
}
this.$apis.giftBag.packageDetail({ id: this.giftValue }).then(res => { this.$apis.giftBag.packageDetail({ id: this.giftValue }).then(res => {
console.log(res) this.init()
this.$nextTick(() => {
if (res.serviceMerchantPackageConfigDTOS && res.serviceMerchantPackageConfigDTOS.length) {
this.selectedCarList = res.serviceMerchantPackageConfigDTOS.map(item => {
return {
packageCode: item.packageCode,
packageAmount: item.packageAmount
}
})
}
let activityCoupon = res.couponList || []
if (activityCoupon && activityCoupon.length) {
activityCoupon.forEach(item => {
item.id = item.couponId
item.denomination = item.couponAnticipatedCost
})
this.selectedGoodsList = activityCoupon.filter(i => i.discountType == 8)
this.selectedServiceList = activityCoupon.filter(i => i.discountType != 8)
}
console.log(this.selectedCarList)
this.getList()
})
}) })
}, },
handleClose() { handleClose() {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
<div class="case-container"> <div class="case-container">
<div class="case-container-title">预览营销方案</div> <div class="case-container-title">预览营销方案</div>
<phoneView></phoneView> <phoneView ref="viewForm"></phoneView>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import phoneView from './PhoneView' import phoneView from './PhoneView'
import draw from '@/mixins/draw'
export default { export default {
mixins: [draw],
components: { components: {
phoneView phoneView
}, },
...@@ -44,7 +46,13 @@ export default { ...@@ -44,7 +46,13 @@ export default {
} }
}, },
methods: { methods: {
handleSave() { async handleSave() {
const {
backgroundHeight,
detail: { backgroundImage },
draggableList
} = this.$refs.viewForm
const url = await this.createMain(backgroundHeight, backgroundImage, draggableList)
let params = { merchantId: this.$globalState.session.merchantId } let params = { merchantId: this.$globalState.session.merchantId }
for (let k in this.process) { for (let k in this.process) {
if (!this.process[k]) { if (!this.process[k]) {
...@@ -53,6 +61,8 @@ export default { ...@@ -53,6 +61,8 @@ export default {
} }
params = { ...params, ...this.process[k] } params = { ...params, ...this.process[k] }
} }
params.subscribe = this.subscribe
params.backgroundImage = url
this.loading = true this.loading = true
this.$apis.marketing this.$apis.marketing
.createSuperMarketing(params) .createSuperMarketing(params)
...@@ -68,7 +78,7 @@ export default { ...@@ -68,7 +78,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState('marketing', ['process']) ...mapState('marketing', ['process', 'subscribe'])
} }
} }
</script> </script>
......
...@@ -4,7 +4,19 @@ ...@@ -4,7 +4,19 @@
<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">
<div class="fes-item" v-for="item in festivalList" :key="item.id">{{ item.title }}</div>
<div class="fes-waiting">不断更新中……</div>
</div>
<div class="scene-content"> <div class="scene-content">
<!-- <div class="scene-card">
<div class="scene-card-img">
<img src="" />
</div>
<div class="scene-card-content">
请扫码添加【XXXX】小管家,并组群获得支持
</div>
</div> -->
<div class="scene-item" v-for="(item, index) in sceneList" :key="index"> <div class="scene-item" v-for="(item, index) in sceneList" :key="index">
<div class="scene-item-box"> <div class="scene-item-box">
<div class="scene-item-title"> <div class="scene-item-title">
...@@ -22,11 +34,18 @@ ...@@ -22,11 +34,18 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions, mapMutations, mapState } from 'vuex'
export default { export default {
data() { data() {
return { return {
tabList: [{ label: '保险', type: 5 }, { label: '定保', type: 2 }, { label: '节日关怀', type: 6 }, { label: '售后众筹' }], routeInfo: {},
tabList: [
{ label: '保险', type: 5 },
{ label: '定保', type: 2 },
{ label: '节日关怀', type: 6 },
{ label: '售后众筹', type: 9 }
],
festivalList: [],
currentIndex: 5, currentIndex: 5,
sceneList: [ sceneList: [
{ {
...@@ -56,13 +75,41 @@ export default { ...@@ -56,13 +75,41 @@ export default {
] ]
} }
}, },
mounted() {
this.calendarPage()
this.routeInfo = this.$route.query
if (this.routeInfo.addOrEdit == 'edit') {
this.getInfo()
} else {
this.setSubscribe(this.routeInfo.subscribe)
}
},
computed: {
...mapState('marketing', ['subscribe'])
},
watch: {
subscribe(val) {
this.currentIndex = val
}
},
methods: { methods: {
...mapActions('marketing', ['setSubscribe']), ...mapActions('marketing', ['setSubscribe', 'getActivityInfo']),
handleAdd() {}, ...mapMutations('marketing', ['SET_INIT']),
handleAdd() {
this.SET_INIT(true)
},
getInfo() {
this.getActivityInfo(this.routeInfo.id)
},
tabClick(index) { tabClick(index) {
this.currentIndex = index this.currentIndex = index
console.log(index) console.log(index)
this.setSubscribe(index) this.setSubscribe(index)
},
calendarPage() {
this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1 }).then(res => {
this.festivalList = (res.data || []).filter(item => item.marketingType == 6)
})
} }
} }
} }
...@@ -75,6 +122,29 @@ export default { ...@@ -75,6 +122,29 @@ export default {
background: #fff; background: #fff;
padding: 16px; padding: 16px;
display: flex; display: flex;
position: relative;
.scene-card {
position: absolute;
width: 178px;
height: 169px;
background: #ffffff;
border: 1px solid #e5e5e5;
box-shadow: 0 4px 12px 0 #00000014;
top: -160px;
left: 16px;
padding: 10px;
&-img {
width: 82px;
height: 82px;
margin: 10px auto;
}
&-content {
font-size: 12px;
color: #666666;
text-align: center;
line-height: 18px;
}
}
.scene-item { .scene-item {
width: 16.7%; width: 16.7%;
display: flex; display: flex;
...@@ -117,6 +187,28 @@ export default { ...@@ -117,6 +187,28 @@ export default {
} }
} }
} }
.fes-box {
display: flex;
height: 70px;
background: #ffffff;
border-radius: 0 4px 4px 4px;
padding: 20px;
box-sizing: border-box;
.fes-item {
padding: 0px 16px;
background: #f9f9f9;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #666666;
margin-right: 10px;
}
.fes-waiting {
font-size: 12px;
color: #666666;
line-height: 30px;
}
}
.choseRow { .choseRow {
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</GLDialog> </GLDialog>
</template> </template>
<script> <script>
import { mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
...@@ -31,6 +32,7 @@ export default { ...@@ -31,6 +32,7 @@ export default {
} }
}, },
methods: { methods: {
...mapActions('marketing', ['getCalendarDetail']),
calendarPage() { calendarPage() {
this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1 }).then(res => { this.$apis.marketing.calendarPage({ pageSize: 100, pageNum: 1 }).then(res => {
this.modelList = (res.data || []).filter(item => item.marketingType == 5) this.modelList = (res.data || []).filter(item => item.marketingType == 5)
...@@ -38,7 +40,8 @@ export default { ...@@ -38,7 +40,8 @@ export default {
}) })
}, },
handleConfirm() { handleConfirm() {
this.$emit('handleSure', this.selectObj) this.getCalendarDetail(this.selectObj.id)
this.$emit('handleClose')
}, },
handleModelClose() { handleModelClose() {
this.$emit('handleClose') this.$emit('handleClose')
......
<template> <template>
<div class="wrap" v-if="serviceList.length>0"> <div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel"> <div class="container-panel">
<img class="angle" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/deliver.png?v=1.0.2" /> <img class="angle" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/deliver.png?v=1.0.2" />
<div class="title"> <div class="title">
...@@ -30,23 +30,24 @@ export default { ...@@ -30,23 +30,24 @@ export default {
4: '兑换券', 4: '兑换券',
7: '服务券' 7: '服务券'
}, },
serviceList:[] serviceList: []
} }
}, },
props: { props: {
detail: { detail: {
type: Object, type: Object,
default:()=> {} default: () => {}
} }
}, },
watch: { watch: {
detail: { detail: {
handler(n) { handler(n) {
const serviceList = n.selectedGoodsList const serviceList = n.selectedGoodsList || []
serviceList.length>0&&serviceList.forEach(item=>{ serviceList.length > 0 &&
item.couponAnticipatedCost = (item.denomination/100).toFixed(2).replace(/\.[0]+$/,'') serviceList.forEach(item => {
}) item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '')
this.serviceList =serviceList })
this.serviceList = serviceList
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -99,7 +100,7 @@ export default { ...@@ -99,7 +100,7 @@ export default {
background-image: linear-gradient(-83deg, #fe6a7545 0%, #fcf0ee00 96%); background-image: linear-gradient(-83deg, #fe6a7545 0%, #fcf0ee00 96%);
border-radius: 10px; border-radius: 10px;
margin-top: 10px; margin-top: 10px;
padding:8px; padding: 8px;
box-sizing: border-box; box-sizing: border-box;
&:last-child { &:last-child {
......
<template> <template>
<div class="wrap" v-if="serviceList.length>0"> <div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel"> <div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/delivery.png" /> <img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_4/delivery.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index"> <div class="service-item" v-for="(item, index) in serviceList" :key="index">
<div class="service-logo"> </div> <div class="service-logo"></div>
<div class="service-desc"> <div class="service-desc">
<div class="service-title">{{item.brandName}}{{item.goodsName}}</div> <div class="service-title">{{ item.brandName }}{{ item.goodsName }}</div>
<div class="service-content">x{{item.couponAmount}} 抵扣券</div> <div class="service-content">x{{ item.couponAmount }} 抵扣券</div>
</div>
<div class="service-price">{{item.couponAnticipatedCost}}<span>元</span> </div>
</div> </div>
<div class="service-price">
{{ item.couponAnticipatedCost }}
<span>元</span>
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
...@@ -23,23 +26,24 @@ export default { ...@@ -23,23 +26,24 @@ export default {
4: '兑换券', 4: '兑换券',
7: '服务券' 7: '服务券'
}, },
serviceList:[] serviceList: []
} }
}, },
props: { props: {
detail: { detail: {
type: Object, type: Object,
default:()=> {} default: () => {}
} }
}, },
watch: { watch: {
detail: { detail: {
handler(n) { handler(n) {
const serviceList = n.selectedGoodsList const serviceList = n.selectedGoodsList || []
serviceList.length>0&&serviceList.forEach(item=>{ serviceList.length > 0 &&
item.couponAnticipatedCost = (item.denomination/100).toFixed(2).replace(/\.[0]+$/,'') serviceList.forEach(item => {
}) item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '')
this.serviceList =serviceList })
this.serviceList = serviceList
}, },
deep: true, deep: true,
immediate: true immediate: true
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
watch: { watch: {
detail: { detail: {
handler(n) { handler(n) {
const serviceList = n.selectedGoodsList const serviceList = n.selectedGoodsList || []
serviceList.length > 0 && serviceList.length > 0 &&
serviceList.forEach(item => { serviceList.forEach(item => {
item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '') item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '')
......
<template> <template>
<div class="wrap" v-if="serviceList.length>0"> <div class="wrap" v-if="serviceList && serviceList.length > 0">
<div class="container-panel"> <div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/rob.png" /> <img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/rob.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index"> <div class="service-item" v-for="(item, index) in serviceList" :key="index">
...@@ -16,20 +16,20 @@ ...@@ -16,20 +16,20 @@
export default { export default {
data() { data() {
return { return {
serviceList:[] serviceList: []
} }
}, },
props: { props: {
detail: { detail: {
type: Object, type: Object,
default:()=> {} default: () => {}
} }
}, },
watch: { watch: {
detail: { detail: {
handler(n) { handler(n) {
const serviceList = n.selectedCarList const serviceList = n.selectedCarList
this.serviceList =serviceList this.serviceList = serviceList
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
color: #fe455d; color: #fe455d;
width:63px; width: 63px;
span { span {
font-size: 12px; font-size: 12px;
......
<template> <template>
<div class="wrap" v-if="serviceList.length>0"> <div class="wrap" v-if="serviceList.length > 0">
<div class="container-panel"> <div class="container-panel">
<img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/deliver.png" /> <img class="header-panel" src="https://img02.glsx.com.cn/weapp/resource/miniprogram/expandedGold/model_8/deliver.png" />
<div class="service-item" v-for="(item, index) in serviceList" :key="index"> <div class="service-item" v-for="(item, index) in serviceList" :key="index">
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
watch: { watch: {
detail: { detail: {
handler(n) { handler(n) {
const serviceList = n.selectedGoodsList const serviceList = n.selectedGoodsList || []
serviceList.length > 0 && serviceList.length > 0 &&
serviceList.forEach(item => { serviceList.forEach(item => {
item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '') item.couponAnticipatedCost = (item.denomination / 100).toFixed(2).replace(/\.[0]+$/, '')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!