调整优惠券部分
This commit is contained in:
@@ -13,6 +13,7 @@ Page({
|
||||
data: {
|
||||
currentList: [],
|
||||
canGetList: [],
|
||||
active: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -21,7 +22,17 @@ Page({
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
onChange(e) {
|
||||
console.log('e', e)
|
||||
this.setData({
|
||||
active: e.detail.index,
|
||||
}, () => {
|
||||
const { active } = this.data;
|
||||
this.init(active);
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@@ -33,8 +44,20 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
const { active } = this.data;
|
||||
this.init(active);
|
||||
},
|
||||
init(active) {
|
||||
switch(active) {
|
||||
case 0:
|
||||
this.getCurrent()
|
||||
break;
|
||||
case 1:
|
||||
this.getCanGet();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
async getCurrent() {
|
||||
const that = this;
|
||||
loadingFunc(async() => {
|
||||
|
Reference in New Issue
Block a user