商品列表监听事件

This commit is contained in:
liuye
2023-05-23 09:15:42 +08:00
parent cb1db05f00
commit 4f40ebce05
9 changed files with 21 additions and 3 deletions

View File

@@ -41,9 +41,14 @@ export default {
computed: {
...mapState(['user']),
},
onLoad() {
this.getListInit()
},
onShow() {
document.title = "积分代兑换"
this.getListInit()
uni.$on('updateGoodsList', () => {
this.getListInit()
})
},
methods: {

View File

@@ -123,6 +123,7 @@ export default {
this.$http.post(`/app/appintegralsupermarketorder/cancelForXCX?id=${item.id}`).then(res => {
if (res.code === 0) {
this.getListInit()
uni.$emit('updateGoodsList')
}
})
},

View File

@@ -105,6 +105,7 @@ export default {
createUserId: this.userId
}).then(res => {
if (res.code === 0) {
uni.$emit('updateGoodsList')
this.toSuccess()
}
})

View File

@@ -116,6 +116,9 @@ export default {
this.$dict.load(['integralSGTypeText']).then(() => {
this.getList()
})
uni.$on('updateGoodsList', () => {
this.getListInit()
})
},
onShow() {
document.title = '积分代兑换'

View File

@@ -123,6 +123,7 @@ export default {
this.$http.post(`/app/appintegralsupermarketorder/cancelForXCX?id=${item.id}`).then(res => {
if (res.code === 0) {
this.getListInit()
uni.$emit('updateGoodsList')
}
})
},

View File

@@ -105,6 +105,7 @@ export default {
createUserId: this.userId
}).then(res => {
if (res.code === 0) {
uni.$emit('updateGoodsList')
this.toSuccess()
}
})

View File

@@ -110,16 +110,20 @@ export default {
...mapState(['user']),
},
onLoad() {
this.$dict.load(['integralSGTypeText'])
this.$dict.load(['integralSGTypeText']).then(() => {
this.getListInit()
})
},
onShow() {
document.title = '积分商城'
this.$nextTick(() => {
this.getAccount().then(() => {
this.total = this.user.girdIntegral || 0
this.getListInit()
})
})
uni.$on('updateGoodsList', () => {
this.getListInit()
})
},
methods: {
...mapActions(['getAccount']),

View File

@@ -114,6 +114,7 @@ export default {
this.$http.post(`/app/appintegralsupermarketorder/cancelForGird?id=${item.id}`).then(res => {
if (res.code === 0) {
this.getListInit()
uni.$emit('updateGoodsList')
}
})
},

View File

@@ -104,6 +104,7 @@ export default {
quantity: this.goodsNum
}).then(res => {
if (res.code === 0) {
uni.$emit('updateGoodsList')
this.toSuccess()
}
})