Merge branch 'product_v1.1.0' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend into product_v1.1.0

This commit is contained in:
姜棚 2022-01-26 10:28:51 +08:00
commit 1b8ff043a2
4 changed files with 48 additions and 25 deletions

View File

@ -83,8 +83,14 @@ getLandingdata(val){
}
},500)
}
componentWillMount(e){
let href=window.location.href;
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');
@ -92,8 +98,12 @@ 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;
exchangeList['land'].sort=newEditor.sort;
@ -103,9 +113,13 @@ 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(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});
@ -181,6 +195,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,6 +203,7 @@ getLandingdata(val){
this.canvasImg.style.display='block';
thumbresult =await this.canvasImgFn();
}else{
this.canvasImg.style.display='block';
thumbresult =await this.canvasImgFn();
}
@ -199,6 +215,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);

View File

@ -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,9 +265,6 @@ export default class mytemplate extends React.Component{
Notify.error("该模板是定制模板无法编辑");
return
}
if(this.state.sourceIndex == 0)
{
copyThemecustom(row.id).then(res=>{
@ -279,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=>{
});
@ -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{
<section class="screen-size-selector"><div className={this.state.activeHeight==667?'size active':'size'} onClick={()=>this.handleSize(375,667)}>主流机型<span>375x667</span></div><div className={this.state.activeHeight==750?'size active':'size'} onClick={()=>this.handleSize(375,750)}><span>375x750</span></div><div className={this.state.activeHeight==812?'size active':'size'} onClick={()=>this.handleSize(375,812)}><span>375x812</span></div><div className={this.state.activeHeight==500?'size active':'size'} onClick={()=>this.handleSize(375,500)}><span>375x500</span></div></section>
<p>落地页类型:</p>
<RadioGroup onChange={(e)=>{this.onTypeChange(e)} } value={this.state.showType} >
<RadioButton value={3} >兑换码</RadioButton>
<RadioButton value={1} >白名单</RadioButton>
<RadioButton value={3} disabled={this.state.sourceIndex==1}>兑换码</RadioButton>
<RadioButton value={1} disabled={this.state.sourceIndex==1}>白名单</RadioButton>
<RadioButton disabled={true} value={2}>立减金</RadioButton>
</RadioGroup>
@ -497,7 +502,7 @@ export default class mytemplate extends React.Component{
</div>
<div className="touse">
<Button type = "primary"
onClick={(e)=>{ this.onUse(this.state.moudleData) }}> 使用 </Button>
onClick={(e)=>{ this.onUse(this.state.moudleData,this.state.showType) }}> 使用 </Button>
</div>
</div>
</div>

View File

@ -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;
}

View File

@ -20,14 +20,14 @@ 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;
// 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 = img.clientHeight + "px";
// }offsetHeight
console.log(29,imgHeight);
// center.style.height = imgHeight.middleCenter.clientHeight + "px";
// }
}
exchangeBtn(){
@ -67,7 +67,7 @@ export default class acclist extends React.Component{
{
propsData.model.middle_image?<img id="preview-center-img" src={propsData.model.middle_image} />:<img id="preview-center-img" src={this.state.middle_image}/>
}
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/verify.png" className="verifycode"/>
{/* <img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/verify.png" className="verifycode"/> */}
<div className="submit"></div>
</div>
<div className="bottom">