商品列表监听事件
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
@@ -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')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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 = '积分代兑换'
|
||||||
|
|||||||
@@ -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')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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']),
|
||||||
|
|||||||
@@ -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')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user