fix(系统模板):修复【系统营销模板】兑换码、白名单、优惠券、优惠券白名单保存,前端传值有误
This commit is contained in:
parent
e3c81251f9
commit
ffe2bee7e0
|
@ -24,6 +24,12 @@ import CouponGoodsDetailForm from './couponCard/couponDetailconfig'; //优惠券
|
||||||
import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页
|
import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页
|
||||||
import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库
|
import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库
|
||||||
import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页
|
import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页
|
||||||
|
let typeList={//1 白名单 3 兑换码 4优惠券 8 优惠券白名单
|
||||||
|
'1':'whiteList',
|
||||||
|
'3':'exchange',
|
||||||
|
'4':'coupon',
|
||||||
|
'8':'coupon',
|
||||||
|
}
|
||||||
//落地页
|
//落地页
|
||||||
let model = {
|
let model = {
|
||||||
title: '落地页标题',
|
title: '落地页标题',
|
||||||
|
@ -274,25 +280,11 @@ export default class edittemplate extends React.Component {
|
||||||
newEditor.exchangeList = exchangeList
|
newEditor.exchangeList = exchangeList
|
||||||
newEditor.whiteList = whiteList
|
newEditor.whiteList = whiteList
|
||||||
newEditor.coupon = coupon;
|
newEditor.coupon = coupon;
|
||||||
if (template == 1) { //1-白名单 3-兑换码
|
this.setState({//编辑回显
|
||||||
this.setState({
|
model: newEditor[typeList[template]].land,
|
||||||
model: newEditor.whiteList.land,
|
product_list: newEditor[typeList[template]].product_list,
|
||||||
product_list: newEditor.whiteList.product_list,
|
product_detail: newEditor[typeList[template]].product_detail
|
||||||
product_detail: newEditor.whiteList.product_detail
|
|
||||||
})
|
})
|
||||||
} else if (template == 3) {
|
|
||||||
this.setState({
|
|
||||||
model: newEditor.exchangeList.land,
|
|
||||||
product_list: newEditor.exchangeList.product_list,
|
|
||||||
product_detail: newEditor.exchangeList.product_detail
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.setState({
|
|
||||||
model: newEditor.coupon.land,
|
|
||||||
product_list: newEditor.coupon.product_list,
|
|
||||||
product_detail: newEditor.coupon.product_detail
|
|
||||||
})
|
|
||||||
}
|
|
||||||
sessionStorage.setItem('editorConfig', JSON.stringify(newEditor))
|
sessionStorage.setItem('editorConfig', JSON.stringify(newEditor))
|
||||||
if (mouldType != 0 && pageChange == 1) {
|
if (mouldType != 0 && pageChange == 1) {
|
||||||
this.setState({ pagedisable: true })
|
this.setState({ pagedisable: true })
|
||||||
|
@ -323,10 +315,9 @@ export default class edittemplate extends React.Component {
|
||||||
let self = this
|
let self = this
|
||||||
let mouldType = sessionStorage.getItem('mouldType')
|
let mouldType = sessionStorage.getItem('mouldType')
|
||||||
let myInfoData = JSON.parse(sessionStorage.getItem('pageInfo'))//判断是否有数据
|
let myInfoData = JSON.parse(sessionStorage.getItem('pageInfo'))//判断是否有数据
|
||||||
let editorList = JSON.parse(sessionStorage.getItem('editorConfig'))
|
let addSystemData = _.cloneDeep(JSON.parse(sessionStorage.getItem('editorConfig')))
|
||||||
let addSystemData = _.cloneDeep(editorList)
|
let infoWhite = _.omit(addSystemData.whiteList,['land[sort]','land[title]','land[type_id]','land[thumb]'])
|
||||||
let infoWhite = addSystemData.whiteList
|
let infoCoupon = _.omit(addSystemData.coupon,['land[sort]','land[title]',,'land[thumb]'])//优惠券
|
||||||
let infoCoupon = addSystemData.coupon//优惠券
|
|
||||||
if (!this.state.model.top_image) {
|
if (!this.state.model.top_image) {
|
||||||
Notify.clear()
|
Notify.clear()
|
||||||
Notify.error('请上传落地页顶部banner')
|
Notify.error('请上传落地页顶部banner')
|
||||||
|
@ -355,16 +346,15 @@ export default class edittemplate extends React.Component {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.setState({ loading_visible: true, activeNavStatus: 1 })
|
this.setState({ loading_visible: true, activeNavStatus: 1 })
|
||||||
let thumbresult = null
|
|
||||||
if (mouldType == 0) {
|
if (mouldType == 0) {
|
||||||
//系统模板
|
//系统模板
|
||||||
this.setState({ activeNavStatus: 1 })
|
this.setState({ activeNavStatus: 1 })
|
||||||
if (this.state.showType != 3) {
|
if (this.state.showType != 3) {
|
||||||
let exchangeFlag = await this.onmodelChange({ target: { value: 3 } })
|
this.onmodelChange({ target: { value: 3 } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.canvasImg.style.display = 'block'
|
this.canvasImg.style.display = 'block'
|
||||||
thumbresult = await this.canvasImgFn()
|
let thumbresult = await this.canvasImgFn()
|
||||||
let formdata = {
|
let formdata = {
|
||||||
title: exchangeStateData.model.title,
|
title: exchangeStateData.model.title,
|
||||||
page: exchangeStateData.showType,
|
page: exchangeStateData.showType,
|
||||||
|
@ -373,16 +363,16 @@ export default class edittemplate extends React.Component {
|
||||||
}
|
}
|
||||||
if (mouldType == 0) {
|
if (mouldType == 0) {
|
||||||
//系统模板新增
|
//系统模板新增
|
||||||
formdata.sort = exchangeStateData.model.sort;
|
formdata.sort = exchangeStateData.model.sort;//权重
|
||||||
formdata.type_id = exchangeStateData.model.type_id.key;
|
formdata.type_id = exchangeStateData.model.type_id.key;
|
||||||
let infoExchange = {}
|
let infoExchange = {}
|
||||||
infoExchange.land = exchangeStateData.model
|
infoExchange.land = exchangeStateData.model
|
||||||
infoExchange.product_list = exchangeStateData.product_list
|
infoExchange.product_list = exchangeStateData.product_list
|
||||||
infoExchange.product_detail = exchangeStateData.product_detail
|
infoExchange.product_detail = exchangeStateData.product_detail
|
||||||
formdata.exchange = infoExchange
|
formdata.exchange = _.omit(infoExchange,['land[sort]','land[title]','thumb'])//优惠券
|
||||||
formdata.access_conf = infoWhite
|
formdata.access_conf = infoWhite
|
||||||
formdata.coupon = infoCoupon
|
formdata.coupon = infoCoupon
|
||||||
console.log(387,exchangeStateData);
|
console.log(387,formdata);
|
||||||
if (myInfoData) {
|
if (myInfoData) {
|
||||||
//编辑
|
//编辑
|
||||||
putSystemTemplate(myInfoData.id, formdata).then((res) => {
|
putSystemTemplate(myInfoData.id, formdata).then((res) => {
|
||||||
|
|
Loading…
Reference in New Issue