diff --git a/src/pages/exchangepage/main/main.js b/src/pages/exchangepage/main/main.js index 588efef8..5e9c6fb7 100644 --- a/src/pages/exchangepage/main/main.js +++ b/src/pages/exchangepage/main/main.js @@ -227,6 +227,7 @@ export default class acclist extends React.Component { editFn(e,row) { sessionStorage.setItem("mouldType",2) + sessionStorage.setItem("pageChange",1) sessionStorage.setItem("pageInfo",JSON.stringify(row)) // let link = window.location.href.replace(window.location.hash, "#/edittemplate"); // window.open(link, "_blank") @@ -288,19 +289,19 @@ export default class acclist extends React.Component { } onPreview(e,row){ let rowdata={}; - let model={} - model.title=row.title; - model.top_image=row.top_image; - model.middle_image=row.middle_image; - model.describe=row.describe; - model.bg_color=row.bg_color; - model.thumb=row.thumb; - rowdata.model=model; - rowdata.product_list=row.product_list; - rowdata.product_detail=row.product_detail; - this.setState({preview_url:row.href}) + if(row.page==1){//白名单 + rowdata.model=row.access_conf.land; + rowdata.product_list=row.access_conf.product_list; + rowdata.product_detail=row.access_conf.product_detail; + }else if(row.page==3){ + rowdata.model=row.exchange.land; + rowdata.product_list=row.exchange.product_list; + rowdata.product_detail=row.exchange.product_detail; + } + this.setState({preview_visible:true}) this.setState({previewData:rowdata}) + this.setState({preview_url:row.href}) } closePhone(e){ diff --git a/src/pages/exchangepage/template/main.js b/src/pages/exchangepage/template/main.js index 1a845996..40e6638a 100644 --- a/src/pages/exchangepage/template/main.js +++ b/src/pages/exchangepage/template/main.js @@ -45,7 +45,11 @@ export default class mytemplate extends React.Component{ } componentDidMount(e){ + //监听滚动条滚动事件 + let component=document.querySelector('.mytemplate'); + let self=this; + getThemeType().then(res=>{ handelResponse(res,(req,msg)=>{ let typeListSource=res.data.map(it=>{ @@ -58,7 +62,8 @@ export default class mytemplate extends React.Component{ }) }).catch(err=>{ }); - getSystemTemplate().then(res=>{ + let data={page:1,limit:10000} + getSystemTemplate(data).then(res=>{ handelResponse(res,(req,msg)=>{ this.setState({system_template:req.data}) @@ -67,11 +72,16 @@ export default class mytemplate extends React.Component{ }) }).catch(err=>{ }); - + } - - + bindHandleScroll = (event) => { + console.log('滚动事件'); + console.log('滚动事件',event); + } + componentWillUnmount() { + window.removeEventListener('scroll', this.bindHandleScroll); + } createBox(){ // let link = window.location.href.replace(window.location.hash,"#/edittemplate"); sessionStorage.removeItem('pageInfo'); @@ -83,7 +93,8 @@ export default class mytemplate extends React.Component{ this.setState({typeIndex:e}) if(e == -1)//全部 { - getSystemTemplate().then(res=>{ + let data={page:1,limit:10000} + getSystemTemplate(data).then(res=>{ handelResponse(res,(req,msg)=>{ console.log(req) this.setState({system_template:req.data}) @@ -93,7 +104,7 @@ export default class mytemplate extends React.Component{ }).catch(err=>{ }); }else{ - let data={type_id:e} + let data={type_id:e,page:1,limit:10000} getSystemTemplate(data).then(res=>{ handelResponse(res,(req,msg)=>{ this.setState({system_template:req.data}) @@ -111,7 +122,8 @@ export default class mytemplate extends React.Component{ if(e == 0) { - getSystemTemplate().then(res=>{ + let data={page:1,limit:10000} + getSystemTemplate(data).then(res=>{ handelResponse(res,(req,msg)=>{ console.log(req) this.setState({system_template:req.data}) @@ -123,8 +135,8 @@ export default class mytemplate extends React.Component{ }); } else{ - - getTheme().then(res=>{ + let data={page:1,limit:10000} + getTheme(data).then(res=>{ handelResponse(res,(req,msg)=>{ this.setState({system_template:req.data}) @@ -201,6 +213,7 @@ export default class mytemplate extends React.Component{ onClose(){ this.setState({preview_visible:false}) } + render(){ return( diff --git a/src/pages/exchangepage/template/main.less b/src/pages/exchangepage/template/main.less index 83dedbb3..261d9990 100644 --- a/src/pages/exchangepage/template/main.less +++ b/src/pages/exchangepage/template/main.less @@ -1,10 +1,4 @@ - - - - - - .xj-root { min-width: 1280px }