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] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C=E7=99=BD?=
=?UTF-8?q?=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{
落地页类型: