Commit cd72f831 by 穆启卓

解决banner广告和视频冲突

视频有后端控制显不显示
parent c82fc79e
...@@ -535,30 +535,38 @@ Page({ ...@@ -535,30 +535,38 @@ Page({
if (app.globalData.referrerAppid && app.globalData.scene === 1038) { if (app.globalData.referrerAppid && app.globalData.scene === 1038) {
const bubbleLeaveTime = wx.getStorageSync('bubbleLeaveTime') || 0; const bubbleLeaveTime = wx.getStorageSync('bubbleLeaveTime') || 0;
const bubbleId = wx.getStorageSync('bubbleId'); const bubbleId = wx.getStorageSync('bubbleId');
if (Date.now() - bubbleLeaveTime > 10000 && bubbleId) { // 体验成功,可以加步数 console.log('earnStep', bubbleLeaveTime)
requestData.data = { console.log('earnStep', bubbleId)
task_id: bubbleId wx.removeStorageSync('bubbleLeaveTime');
}; wx.removeStorageSync('bubbleId');
requestData.method = 'POST'; console.log('earnStep', bubbleLeaveTime)
requestData.success = res => { console.log('earnStep', bubbleId)
console.log('earnStep', res) if (bubbleId) {
if (res.data.code === 0) { if (Date.now() - bubbleLeaveTime > 10000) { // 体验成功,可以加步数
wx.showToast({ requestData.data = {
title: '恭喜赚取步数成功', task_id: bubbleId
icon: 'none', };
duration: 2000 requestData.method = 'POST';
}); requestData.success = res => {
this.setData({ console.log('earnStep', res)
bubbleList: res.data.data if (res.data.code === 0) {
}); wx.showToast({
} title: '恭喜赚取步数成功',
}; icon: 'none',
} else { duration: 2000
return wx.showToast({ });
title: '体验不达标,获赠步数失败', this.setData({
icon: 'none', bubbleList: res.data.data
duration: 2000 });
}) }
};
} else {
return wx.showToast({
title: '体验不达标,获赠步数失败',
icon: 'none',
duration: 2000
})
}
} }
} }
wx.request(requestData); wx.request(requestData);
...@@ -654,6 +662,7 @@ Page({ ...@@ -654,6 +662,7 @@ Page({
this.data.bubbleList.forEach(item => { this.data.bubbleList.forEach(item => {
if (item.task_type === 2) { if (item.task_type === 2) {
earnStep = item.bonus_step; earnStep = item.bonus_step;
item.can_watch = res2.data.data.can_watch;
} }
}); });
this.setData({ this.setData({
...@@ -667,7 +676,7 @@ Page({ ...@@ -667,7 +676,7 @@ Page({
}); });
} }
wx.showModal({ wx.showModal({
content: `恭喜增加${earnStep}步数成功`, content: `恭喜成功增加${earnStep}步数`,
showCancel: false showCancel: false
}); });
} }
......
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