调整优惠券部分

This commit is contained in:
2024-12-09 10:36:16 +08:00
parent 9bc3cb5584
commit fd7777e4f4
6 changed files with 48 additions and 10 deletions

View File

@@ -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() => {