Commit 5f1a6333 by 高淑倩

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

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