Commit 5f1a6333 by 高淑倩

add: 可领取次数>0_请求

parent 8705194c
......@@ -25,7 +25,8 @@ wxService.page({
countObj: {
surplusPoints: 0,
exchangeCount: 0,
totalPoints: 0
totalPoints: 0,
surplusExchangeCount: 0
},
currentPercent: 0, // 当前进度
isDisabled: false
......@@ -85,7 +86,8 @@ wxService.page({
if (result == 0) {
this.setData({
countObj: data,
currentPercent: (100 / this.data.goal) * data.surplusPoints
currentPercent: (100 / this.data.goal) * data.surplusPoints,
surplusExchangeCount: data.surplusExchangeCount
}, () => {
wx.hideLoading()
})
......@@ -100,20 +102,15 @@ wxService.page({
handleGo() {
// 跳转 popupType: 0 默认不跳转 1 优惠券 2 积分
const { popupType } = this.data
let dialog = this.data.dialog
if (popupType == 1) {
wxService.router(`/pages/coupons/coupons`)
} else if (popupType == 2) {
wxService.router(`/pages/integralWater/integralWater`)
} else {
// 隐藏 dialog
dialog.show = false
this.setData({
dialog
},()=>{
this.isShowDialog(false)
// 获取最新数据
this.getPointExchange()
})
}
},
// 触点有礼-消费集点兑换
......@@ -129,21 +126,25 @@ wxService.page({
if (result == 0) {
wx.hideLoading()
// 显示 dialog
this.showDialog()
this.isShowDialog(true)
}
}
})
},
showDialog() {
isShowDialog(flag) {
let dialog = this.data.dialog
dialog.show = true
dialog.show = flag
this.setData({
dialog
})
},
handleToGet() {
// 按钮防止短时间多次点击
const { countObj } = this.data
if(countObj.surplusExchangeCount) {
this.getPointExchange()
}
this.setData({
isDisabled: true
})
......@@ -168,6 +169,8 @@ wxService.page({
if (id) {
this.getPointDetail(id)
}
// 隐藏 dialog
this.isShowDialog(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