Merge branch 'couponV2.0' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend into couponV2.0

This commit is contained in:
wangsongsole 2022-10-12 17:25:44 +08:00
commit 89c599a3fa
4 changed files with 30 additions and 61 deletions

View File

@ -947,6 +947,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
table_index: index, table_index: index,
}); });
} else { } else {
// code_batch_id
if (state.isState === "1") {
delete rowData.code_batch_id;
}
console.log("rowData =>", rowData);
setState({ setState({
product_title: "编辑商品", product_title: "编辑商品",
productData: rowData, productData: rowData,

View File

@ -55,11 +55,11 @@ const tableColumn = [
name: "plan_title", name: "plan_title",
}, },
{ {
title: "归属key批次名称", title: "归属key批次id",
width: "auto", width: "auto",
type: "normal", type: "normal",
prop: "keyBatch.batch_name", prop: "key_batch_id",
name: "keyBatch.batch_name", name: "key_batch_id",
}, },
{ {
title: "启用/暂停", title: "启用/暂停",

View File

@ -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) => {

View File

@ -540,21 +540,8 @@ export default class acclist extends React.Component {
window.location.hash, window.location.hash,
"#/home/plan-edit" "#/home/plan-edit"
); );
window.open(link, "_blank");
sessionStorage.setItem("showflag", true);
let arr = [
{
pagetitle: "编辑",
items: [
{ path: "/home/key-list", name: "营销计划管理" },
{ path: "/home/key-list", name: "编辑:" + row.title },
],
},
];
sessionStorage.setItem("breaknav", JSON.stringify(arr));
sessionStorage.setItem("linkshowname", "营销计划管理");
sessionStorage.setItem("isState", "2"); sessionStorage.setItem("isState", "2");
window.open(link, "_blank");
} }
// 一键复制 // 一键复制
onCopy(e, row) { onCopy(e, row) {
@ -578,21 +565,8 @@ export default class acclist extends React.Component {
window.location.hash, window.location.hash,
"#/home/plan-edit-copy" "#/home/plan-edit-copy"
); );
window.open(link, "_blank");
sessionStorage.setItem("showflag", true);
let arr = [
{
pagetitle: "复制",
items: [
{ path: "/home/plan-edit-copy", name: "营销计划管理" },
{ path: "/home/plan-edit-copy", name: "复制:" + row.title },
],
},
];
sessionStorage.setItem("breaknav", JSON.stringify(arr));
sessionStorage.setItem("linkshowname", "营销计划管理");
sessionStorage.setItem("isState", "1"); sessionStorage.setItem("isState", "1");
window.open(link, "_blank");
} }
onFilterClose(prop) { onFilterClose(prop) {
let data = {}; let data = {};
@ -956,7 +930,7 @@ export default class acclist extends React.Component {
this.onCopy(e, rowData); this.onCopy(e, rowData);
}} }}
> >
复制 复制1111
</span> </span>
)} )}