From 744a092ca2ddea791b62899a9ffd1fe0dc8aeb9b Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Tue, 25 Jan 2022 20:41:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangepage/edittemplate/main.js | 1 + src/pages/exchangepage/template/main.js | 2 -- src/pages/exchangepage/template/preview.js | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index ba010e34..197bd39c 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -188,6 +188,7 @@ getLandingdata(val){ this.canvasImg.style.display='block'; thumbresult =await this.canvasImgFn(); }else{ + this.setState({activeNavStatus:1}); this.canvasImg.style.display='block'; thumbresult =await this.canvasImgFn(); } diff --git a/src/pages/exchangepage/template/main.js b/src/pages/exchangepage/template/main.js index 800b25c3..9108d473 100644 --- a/src/pages/exchangepage/template/main.js +++ b/src/pages/exchangepage/template/main.js @@ -266,8 +266,6 @@ export default class mytemplate extends React.Component{ return } - - if(this.state.sourceIndex == 0) { copyThemecustom(row.id).then(res=>{ diff --git a/src/pages/exchangepage/template/preview.js b/src/pages/exchangepage/template/preview.js index 83d31b80..052fb221 100644 --- a/src/pages/exchangepage/template/preview.js +++ b/src/pages/exchangepage/template/preview.js @@ -24,10 +24,10 @@ export default class acclist extends React.Component{ let img = document.getElementById("preview-center-img") // center.style.height = img.scrollHeight + "px"; let imgHeight=this.refs; - // img.onload = function (e) { - // center.style.height = img.clientHeight + "px"; - // }offsetHeight - console.log(29,imgHeight); + img.onload = function (e) { + center.style.height = imgHeight.middleCenter.clientHeight + "px"; + } + } exchangeBtn(){ @@ -67,7 +67,7 @@ export default class acclist extends React.Component{ { propsData.model.middle_image?: } - + {/* */}
From 4c2fd829728348bdc9ccbbbcd67d2f6896dfbe7a Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Tue, 25 Jan 2022 20:55:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E8=90=BD?= =?UTF-8?q?=E5=9C=B0=E9=A1=B5=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangepage/edittemplate/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index 197bd39c..7c54f066 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -181,6 +181,7 @@ getLandingdata(val){ 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}}); exchangeStateData=_.clone(this.state); @@ -188,7 +189,7 @@ getLandingdata(val){ this.canvasImg.style.display='block'; thumbresult =await this.canvasImgFn(); }else{ - this.setState({activeNavStatus:1}); + this.canvasImg.style.display='block'; thumbresult =await this.canvasImgFn(); } @@ -200,6 +201,8 @@ getLandingdata(val){ "thumb":thumbresult } if(mouldType==0){//系统模板新增 + infoWhite=JSON.parse(sessionStorage.getItem('editorConfig')).whiteList; + formdata.sort=exchangeStateData.model.sort; formdata.type_id=exchangeStateData.model.type_id.key; let exchangeState=_.clone(exchangeStateData); 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 3/4] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BB=91=E5=AE=9A=E8=90=BD=E5=9C=B0=E9=A1=B5?= =?UTF-8?q?=E7=B1=BB=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{
+ onClick={(e)=>{ this.onUse(this.state.moudleData,this.state.showType) }}> 使用
diff --git a/src/pages/exchangepage/template/preview.js b/src/pages/exchangepage/template/preview.js index 052fb221..2601bdb1 100644 --- a/src/pages/exchangepage/template/preview.js +++ b/src/pages/exchangepage/template/preview.js @@ -20,13 +20,13 @@ export default class acclist extends React.Component{ } } componentDidMount(e){ - let center = document.getElementById("preview-center") - let img = document.getElementById("preview-center-img") - // center.style.height = img.scrollHeight + "px"; - let imgHeight=this.refs; - img.onload = function (e) { - center.style.height = imgHeight.middleCenter.clientHeight + "px"; - } + // let center = document.getElementById("preview-center") + // let img = document.getElementById("preview-center-img") + // // center.style.height = img.scrollHeight + "px"; + // let imgHeight=this.refs; + // img.onload = function (e) { + // center.style.height = imgHeight.middleCenter.clientHeight + "px"; + // } } exchangeBtn(){ From 932d8171879b1024548ddd186279fa1c8b6ad6c4 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Wed, 26 Jan 2022 10:28:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangepage/edittemplate/main.js | 16 ++++++++++++---- src/pages/exchangepage/template/main.js | 11 ++++++++--- src/pages/exchangepage/template/main.less | 4 ++-- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/pages/exchangepage/edittemplate/main.js b/src/pages/exchangepage/edittemplate/main.js index bdb4301a..af5fee54 100644 --- a/src/pages/exchangepage/edittemplate/main.js +++ b/src/pages/exchangepage/edittemplate/main.js @@ -86,8 +86,11 @@ getLandingdata(val){ componentWillMount(e){ let href=window.location.href; - let strindex = href.lastIndexOf("\="); - let typePage = href.substr(strindex + 1, href.length); + let strindex = href.lastIndexOf("\="); + let typePage =null; + if(strindex>-1){ + typePage = href.substr(strindex + 1, href.length); + } sessionStorage.removeItem('editorConfig'); let myInfoData = JSON.parse(sessionStorage.getItem("pageInfo")) let mouldType=sessionStorage.getItem('mouldType'); @@ -95,10 +98,11 @@ getLandingdata(val){ let pageChange=sessionStorage.getItem('pageChange'); if(myInfoData) { - this.setState({showType:myInfoData.page}); let newEditor=_.clone(myInfoData); if(typePage){ this.setState({showType:Number(typePage)}); + }else{ + this.setState({showType:Number(myInfoData.page)}); } let exchangeList=newEditor.exchange; exchangeList['land'].title=newEditor.title; @@ -109,7 +113,11 @@ getLandingdata(val){ newEditor.exchangeList=exchangeList; newEditor.whiteList=whiteList; if(mouldType==0){ - this.setState({model:newEditor.exchangeList.land,product_list:newEditor.exchangeList.product_list,product_detail:newEditor.exchangeList.product_detail}); + 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}); + } }else{ if(this.state.showType==1){ this.setState({model:newEditor.whiteList.land,product_list:newEditor.whiteList.product_list,product_detail:newEditor.whiteList.product_detail}); diff --git a/src/pages/exchangepage/template/main.js b/src/pages/exchangepage/template/main.js index b194b373..118104b0 100644 --- a/src/pages/exchangepage/template/main.js +++ b/src/pages/exchangepage/template/main.js @@ -292,7 +292,12 @@ export default class mytemplate extends React.Component{ // let link = window.location.href.replace(window.location.hash,"#/home/edittemplate"); // window.open(link, "_blank") sessionStorage.setItem('mouldType',1); - window.location.href='/#/edittemplate'; + // window.location.href='/#/edittemplate'; + if(type){ + window.location.href= "/#/edittemplate?type="+type; + }else{ + window.location.href= "/#/edittemplate?type="+row.page; + } sessionStorage.setItem('pageChange',1); } @@ -479,8 +484,8 @@ export default class mytemplate extends React.Component{
this.handleSize(375,667)}>主流机型375x667
this.handleSize(375,750)}>全面屏375x750
this.handleSize(375,812)}>刘海屏375x812
this.handleSize(375,500)}>小屏手机375x500

落地页类型:

{this.onTypeChange(e)} } value={this.state.showType} > - 兑换码 - 白名单 + 兑换码 + 白名单 立减金 diff --git a/src/pages/exchangepage/template/main.less b/src/pages/exchangepage/template/main.less index 8a6e1d2d..3f0d1d6e 100644 --- a/src/pages/exchangepage/template/main.less +++ b/src/pages/exchangepage/template/main.less @@ -2672,6 +2672,6 @@ div.previewclose { .left-choice .zent-radio-button--checked[data-zv="9.11.0"]{ background: rgba(41, 107, 239, 0.08)!important; -border: 1px solid #2096f5; -color: #296bef; +border: 1px solid #2096f5!important; +color: #296bef!important; }