From ffe2bee7e0eb35540a07549d364e336dfaface3a Mon Sep 17 00:00:00 2001 From: Apple <> Date: Wed, 12 Oct 2022 15:51:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E6=A8=A1=E6=9D=BF)?= =?UTF-8?q?=EF=BC=9A=E4=BF=AE=E5=A4=8D=E3=80=90=E7=B3=BB=E7=BB=9F=E8=90=A5?= =?UTF-8?q?=E9=94=80=E6=A8=A1=E6=9D=BF=E3=80=91=E5=85=91=E6=8D=A2=E7=A0=81?= =?UTF-8?q?=E3=80=81=E7=99=BD=E5=90=8D=E5=8D=95=E3=80=81=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E3=80=81=E4=BC=98=E6=83=A0=E5=88=B8=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E4=BF=9D=E5=AD=98=EF=BC=8C=E5=89=8D=E7=AB=AF=E4=BC=A0?= =?UTF-8?q?=E5=80=BC=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangepage/edittemplate/main.js | 48 ++++++++------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index d41b02cc..d2bdbb12 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -24,6 +24,12 @@ import CouponGoodsDetailForm from './couponCard/couponDetailconfig'; //优惠券 import CouponReduceDetailForm from './couponCard/couponReduceDetail'; //优惠券立减金详情页 import CouponComLib from './couponCard/goodsPage/componentLib/main'; //优惠券组件库 import CouponGoodsListForm from './couponCard/goodsPage/config/main'; //优惠券商品列表页 +let typeList={//1 白名单 3 兑换码 4优惠券 8 优惠券白名单 + '1':'whiteList', + '3':'exchange', + '4':'coupon', + '8':'coupon', +} //落地页 let model = { title: '落地页标题', @@ -274,25 +280,11 @@ export default class edittemplate extends React.Component { newEditor.exchangeList = exchangeList newEditor.whiteList = whiteList newEditor.coupon = coupon; - if (template == 1) { //1-白名单 3-兑换码 - this.setState({ - model: newEditor.whiteList.land, - product_list: newEditor.whiteList.product_list, - 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 - }) - } + this.setState({//编辑回显 + model: newEditor[typeList[template]].land, + product_list: newEditor[typeList[template]].product_list, + product_detail: newEditor[typeList[template]].product_detail + }) sessionStorage.setItem('editorConfig', JSON.stringify(newEditor)) if (mouldType != 0 && pageChange == 1) { this.setState({ pagedisable: true }) @@ -323,10 +315,9 @@ export default class edittemplate extends React.Component { let self = this let mouldType = sessionStorage.getItem('mouldType') let myInfoData = JSON.parse(sessionStorage.getItem('pageInfo'))//判断是否有数据 - let editorList = JSON.parse(sessionStorage.getItem('editorConfig')) - let addSystemData = _.cloneDeep(editorList) - let infoWhite = addSystemData.whiteList - let infoCoupon = addSystemData.coupon//优惠券 + let addSystemData = _.cloneDeep(JSON.parse(sessionStorage.getItem('editorConfig'))) + let infoWhite = _.omit(addSystemData.whiteList,['land[sort]','land[title]','land[type_id]','land[thumb]']) + let infoCoupon = _.omit(addSystemData.coupon,['land[sort]','land[title]',,'land[thumb]'])//优惠券 if (!this.state.model.top_image) { Notify.clear() Notify.error('请上传落地页顶部banner') @@ -355,16 +346,15 @@ export default class edittemplate extends React.Component { return } this.setState({ loading_visible: true, activeNavStatus: 1 }) - let thumbresult = null if (mouldType == 0) { //系统模板 this.setState({ activeNavStatus: 1 }) if (this.state.showType != 3) { - let exchangeFlag = await this.onmodelChange({ target: { value: 3 } }) + this.onmodelChange({ target: { value: 3 } }) } } this.canvasImg.style.display = 'block' - thumbresult = await this.canvasImgFn() + let thumbresult = await this.canvasImgFn() let formdata = { title: exchangeStateData.model.title, page: exchangeStateData.showType, @@ -373,16 +363,16 @@ export default class edittemplate extends React.Component { } if (mouldType == 0) { //系统模板新增 - formdata.sort = exchangeStateData.model.sort; + formdata.sort = exchangeStateData.model.sort;//权重 formdata.type_id = exchangeStateData.model.type_id.key; let infoExchange = {} infoExchange.land = exchangeStateData.model infoExchange.product_list = exchangeStateData.product_list infoExchange.product_detail = exchangeStateData.product_detail - formdata.exchange = infoExchange + formdata.exchange = _.omit(infoExchange,['land[sort]','land[title]','thumb'])//优惠券 formdata.access_conf = infoWhite formdata.coupon = infoCoupon - console.log(387,exchangeStateData); + console.log(387,formdata); if (myInfoData) { //编辑 putSystemTemplate(myInfoData.id, formdata).then((res) => { From 473d7150978d61d89119d9a6e6abb9a2f5ce7692 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 12 Oct 2022 15:59:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=A6=82=E6=9E=9C=E6=98=AF=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E6=98=A0=E5=B0=84=E5=95=86=E5=93=81=E5=8F=AF?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 5 ++++ src/pages/plan/list/list.js | 32 +++-------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index b2fe1c80..90893ffb 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -947,6 +947,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => { table_index: index, }); } else { + // 如果是复制删除 code_batch_id + if (state.isState === "1") { + delete rowData.code_batch_id; + } + console.log("rowData =>", rowData); setState({ product_title: "编辑商品", productData: rowData, diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 4b2fedb7..6d34754d 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -540,21 +540,8 @@ export default class acclist extends React.Component { window.location.hash, "#/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"); + window.open(link, "_blank"); } // 一键复制 onCopy(e, row) { @@ -578,21 +565,8 @@ export default class acclist extends React.Component { window.location.hash, "#/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"); + window.open(link, "_blank"); } onFilterClose(prop) { let data = {}; @@ -956,7 +930,7 @@ export default class acclist extends React.Component { this.onCopy(e, rowData); }} > - 复制 + 复制1111 )} From 1b04a801a45235ad49efd893b9e85263ae95883f Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 12 Oct 2022 16:03:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=88=97=E8=A1=A8=20table=E5=B1=95=E7=A4=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/coupon/list/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index dcf42ae2..f1f44c5e 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -55,11 +55,11 @@ const tableColumn = [ name: "plan_title", }, { - title: "归属key批次名称", + title: "归属key批次id", width: "auto", type: "normal", - prop: "keyBatch.batch_name", - name: "keyBatch.batch_name", + prop: "key_batch_id", + name: "key_batch_id", }, { title: "启用/暂停",