商品列表监听事件

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: { computed: {
...mapState(['user']), ...mapState(['user']),
}, },
onLoad() {
this.getListInit()
},
onShow() { onShow() {
document.title = "积分代兑换" document.title = "积分代兑换"
this.getListInit() uni.$on('updateGoodsList', () => {
this.getListInit()
})
}, },
methods: { methods: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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