Commit 603b000e by 高淑倩

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

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