Commit 9836b0c5 by 程智春

弹窗广告只显示一次

parent cc98ee00
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
process.env.NODE_ENV == "production" || process.env.NODE_ENV == "production" ||
JSON.stringify(extConfig) == "{}" JSON.stringify(extConfig) == "{}"
) { ) {
// extConfig = { mixid: "antgood", shopid: 67 }; extConfig = { mixid: "antgood", shopid: 67 };
// extConfig = { "mixid":"xyyx", // extConfig = { "mixid":"xyyx",
// "shopid":133 }; // "shopid":133 };
} }
......
...@@ -134,18 +134,18 @@ function getThemePage({mixid,shopid}) { ...@@ -134,18 +134,18 @@ function getThemePage({mixid,shopid}) {
if (!mpApp.globalData.setPopupStorage){ // if (!mpApp.globalData.setPopupStorage){
let popUpList = wx.getStorageSync('popUpList') || [] // let popUpList = wx.getStorageSync('popUpList') || []
let arr = [] // let arr = []
popUpList.forEach(item=> { // popUpList.forEach(item=> {
arr.push(item) // arr.push(item)
wx.removeStorageSync(item) // wx.removeStorageSync(item)
}) // })
arr.forEach(item => { // arr.forEach(item => {
popUpList.splice(popUpList.indexOf(item),1) // popUpList.splice(popUpList.indexOf(item),1)
}) // })
wx.setStorageSync('popUpList', popUpList) // wx.setStorageSync('popUpList', popUpList)
} // }
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,14 @@ Component({ ...@@ -29,7 +29,14 @@ Component({
this.setData({ this.setData({
img: app.DFSImg(this.data.datas.componentData.imageUrl,700,null,1) img: app.DFSImg(this.data.datas.componentData.imageUrl,700,null,1)
}) })
console.log(this.data.datas.componentData,'this.data.datas.componentData.once')
if(!this.data.datas.componentData.once){
console.log('laizhelile')
let routes = getCurrentPages()
let page = routes[routes.length - 1].route
wx.removeStorageSync(`${app.globalData.shopInfo.shopCode}_popFlag_${page}_${this.data.datas.id}`)
}
if (this.getPopFlag() == 'true'){ if (this.getPopFlag() == 'true'){
this.setData({ this.setData({
domainShow : false domainShow : false
...@@ -45,7 +52,9 @@ Component({ ...@@ -45,7 +52,9 @@ Component({
this.setData({ this.setData({
domainShow: false domainShow: false
}) })
this.setPopFlag('true') if(this.data.datas.componentData.once){
this.setPopFlag('true')
}
}, this.data.datas.componentData.columnNum * 1000) }, this.data.datas.componentData.columnNum * 1000)
} }
} }
...@@ -75,7 +84,10 @@ Component({ ...@@ -75,7 +84,10 @@ Component({
this.setData({ this.setData({
domainShow : false domainShow : false
}) })
this.setPopFlag("true"); if(this.data.datas.componentData.once){
this.setPopFlag("true");
}
clearTimeout(this.data.timeout); clearTimeout(this.data.timeout);
}, },
onclickHandle() { onclickHandle() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment