Commit 125eb59d by 穆启卓

1

parent 74b0b106
...@@ -617,19 +617,27 @@ Page({ ...@@ -617,19 +617,27 @@ Page({
method: 'POST', method: 'POST',
success: res2 => { success: res2 => {
if (res2.data.code === 0) { if (res2.data.code === 0) {
wx.showToast({ if (this.data.targetSteps) {
title: '视频错误,请尝试其他方式赚取步数', wx.showToast({
icon: 'none', title: '视频错误,请尝试其他方式赚取步数',
duration: 2000 icon: 'none',
}); duration: 2000
this.data.bubbleList.forEach(item => { });
if (item.task_type === 2) { this.data.bubbleList.forEach(item => {
item.can_watch = false; if (item.task_type === 2) {
} item.can_watch = false;
}); }
this.setData({ });
bubbleList: this.data.bubbleList this.setData({
}); bubbleList: this.data.bubbleList
});
} else {
wx.showToast({
title: '报名后将获取步数',
icon: 'none',
duration: 2000
});
}
} }
} }
}); });
...@@ -648,22 +656,30 @@ Page({ ...@@ -648,22 +656,30 @@ Page({
method: 'POST', method: 'POST',
success: res2 => { success: res2 => {
if (res2.data.code === 0) { if (res2.data.code === 0) {
wx.showToast({ if (this.data.targetSteps) {
title: '获取步数成功', wx.showToast({
icon: 'none', title: '获取步数成功',
duration: 2000 icon: 'none',
}); duration: 2000
let earnStep = 0; });
this.data.bubbleList.forEach(item => { let earnStep = 0;
if (item.task_type === 2) { this.data.bubbleList.forEach(item => {
item.can_watch = false; if (item.task_type === 2) {
earnStep = item.bonus_step; item.can_watch = false;
} earnStep = item.bonus_step;
}); }
this.setData({ });
bubbleList: this.data.bubbleList, this.setData({
currentSteps: this.data.currentSteps + earnStep bubbleList: this.data.bubbleList,
}); currentSteps: this.data.currentSteps + earnStep
});
} else {
wx.showToast({
title: '报名后将获取步数',
icon: 'none',
duration: 2000
});
}
} }
} }
}); });
......
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