Commit 603b000e by 高淑倩

modify: 集点活动详情-领取成功,关闭弹窗后,未进行刷新获取最新数据

parent 5efd2dee
// component/dialog/dialog.js
const wxService = require('../../utils/wxService')
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
......@@ -80,6 +82,10 @@ Component({
this._updateData({
show: false
})
// 触发父级事件
wxService.nextTick(() => {
this.triggerEvent('_closeDialog')
})
}
}
})
......@@ -8,6 +8,7 @@ wxService.page({
* 页面的初始数据
*/
data: {
id: 0,
imgHeight: 450,
dialog: {
show: false,
......@@ -41,7 +42,7 @@ wxService.page({
wx.showLoading({
title: '加载中'
})
wxService.get(`/sale/touchpoints/pointConsumptionActivity/findById/${id} `).then(res => {
wxService.get(`/sale/touchpoints/pointConsumptionActivity/findById/${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
......@@ -121,9 +122,13 @@ wxService.page({
const { activityId } = this.data
wxService.router(`/subPackage/page/pages/pointGoodsList/pointGoodsList`).search({ activityId })
},
_closeDialog() {
const { id } = this.data
if(id) this.getPointDetail(id)
},
handleGo() {
// 跳转 popupType: 0 默认不跳转 1 优惠券 2 积分
const { popupType } = this.data
const { popupType, id } = this.data
if (popupType == 1) {
wxService.router(`/pages/coupons/coupons`)
} else if (popupType == 2) {
......@@ -132,7 +137,7 @@ wxService.page({
// 隐藏 dialog
this.isShowDialog(false)
// 获取最新数据
this.getPointExchange()
this.getPointDetail(id)
}
},
// 触点有礼-消费集点兑换
......@@ -188,7 +193,11 @@ wxService.page({
onShow: function () {
const { id } = this.options
if (id) {
this.setData({
id
},()=> {
this.getPointDetail(id)
})
}
// 隐藏 dialog
this.isShowDialog(false)
......
......@@ -52,5 +52,5 @@
</view>
</view>
<x-dialog dialog="{{dialog}}" bind:handleGo="handleGo" show="{{dialog.show}}" />
<x-dialog dialog="{{dialog}}" bind:handleGo="handleGo" bind:_closeDialog="_closeDialog" show="{{dialog.show}}" />
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