From e15133de9aa1a88bcc3d223df0b5b349fe0b8717 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Wed, 26 Jan 2022 10:02:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=BB=91=E5=AE=9A=E8=90=BD=E5=9C=B0=E9=A1=B5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangepage/edittemplate/main.js | 10 ++++++++-- src/pages/exchangepage/template/main.js | 14 ++++++++------ src/pages/exchangepage/template/preview.js | 14 +++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index 7c54f066..bdb4301a 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -83,8 +83,11 @@ getLandingdata(val){ } },500) } - + componentWillMount(e){ + let href=window.location.href; + let strindex = href.lastIndexOf("\="); + let typePage = href.substr(strindex + 1, href.length); sessionStorage.removeItem('editorConfig'); let myInfoData = JSON.parse(sessionStorage.getItem("pageInfo")) let mouldType=sessionStorage.getItem('mouldType'); @@ -94,6 +97,9 @@ getLandingdata(val){ { this.setState({showType:myInfoData.page}); let newEditor=_.clone(myInfoData); + if(typePage){ + this.setState({showType:Number(typePage)}); + } let exchangeList=newEditor.exchange; exchangeList['land'].title=newEditor.title; exchangeList['land'].sort=newEditor.sort; @@ -105,7 +111,7 @@ getLandingdata(val){ if(mouldType==0){ this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail}); }else{ - if(myInfoData.page==1){ + if(this.state.showType==1){ this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail}); }else{ this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail}); diff --git a/src/pages/exchangepage/template/main.js b/src/pages/exchangepage/template/main.js index 9108d473..b194b373 100644 --- a/src/pages/exchangepage/template/main.js +++ b/src/pages/exchangepage/template/main.js @@ -257,7 +257,7 @@ export default class mytemplate extends React.Component{ this.setState({previewData:exchangedata}); } } - onUse(row){ + onUse(row,type){ console.log(258,row); let self=this; if(row.edit == 0) @@ -265,7 +265,6 @@ export default class mytemplate extends React.Component{ Notify.error("该模板是定制模板无法编辑"); return } - if(this.state.sourceIndex == 0) { copyThemecustom(row.id).then(res=>{ @@ -277,9 +276,12 @@ export default class mytemplate extends React.Component{ sessionStorage.setItem('pageChange',0); // let link = window.location.href.replace(window.location.hash,"#/edittemplate"); // window.open(link, "_blank") - window.location.href= "/#/edittemplate" - },(err)=>{ - + if(type){ + window.location.href= "/#/edittemplate?type="+type; + }else{ + window.location.href= "/#/edittemplate?type="+row.page; + } + },(err)=>{ }) }).catch(err=>{ }); @@ -495,7 +497,7 @@ export default class mytemplate extends React.Component{