|
@@ -78,7 +78,7 @@
|
|
|
<view class="stats-section flex"
|
|
<view class="stats-section flex"
|
|
|
:class="currentTab == 0 ? 'backg-color1' : currentTab == 1 ? 'backg-color2' : 'backg-color3'">
|
|
:class="currentTab == 0 ? 'backg-color1' : currentTab == 1 ? 'backg-color2' : 'backg-color3'">
|
|
|
<text class="stat-item" v-if="currentTab == 0">已购买:{{ couponList.payNumber }}</text>
|
|
<text class="stat-item" v-if="currentTab == 0">已购买:{{ couponList.payNumber }}</text>
|
|
|
- <text class="stat-item" v-else>已领取:{{ couponList.payNumber }}</text>
|
|
|
|
|
|
|
+ <text class="stat-item" v-else>已领取:{{ couponList.receivedCount }}</text>
|
|
|
<text class="stat-item">已使用:{{ couponList.useNumber }}</text>
|
|
<text class="stat-item">已使用:{{ couponList.useNumber }}</text>
|
|
|
<text class="stat-item">总库存:{{ couponList.number }}</text>
|
|
<text class="stat-item">总库存:{{ couponList.number }}</text>
|
|
|
</view>
|
|
</view>
|
|
@@ -185,6 +185,19 @@ export default {
|
|
|
delta: 1
|
|
delta: 1
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ goCouponList() {
|
|
|
|
|
+ const listTab = Number(this.currentTab) > 0 ? Number(this.currentTab) - 1 : 0
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ const pages = getCurrentPages()
|
|
|
|
|
+ if (pages.length > 1) {
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.redirectTo({
|
|
|
|
|
+ url: `/pages/coupon/coupon?tab=${listTab}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 500)
|
|
|
|
|
+ },
|
|
|
deleteFun() {
|
|
deleteFun() {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: '删除优惠券',
|
|
title: '删除优惠券',
|
|
@@ -194,10 +207,11 @@ export default {
|
|
|
if (this.currentTab == 0) {
|
|
if (this.currentTab == 0) {
|
|
|
this.$http.get('/merchant/localVoucherInfo/delete?id=' + this.productId).then(res => {
|
|
this.$http.get('/merchant/localVoucherInfo/delete?id=' + this.productId).then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
- this.$tip.error(res.data.message || '删除成功');
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: `/pages/coupon/coupon`
|
|
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.data.message || '删除成功',
|
|
|
|
|
+ icon: 'none'
|
|
|
})
|
|
})
|
|
|
|
|
+ this.goCouponList()
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
this.$tip.error(res.data.message);
|
|
this.$tip.error(res.data.message);
|
|
@@ -205,12 +219,13 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- this.$http.delete('/merchant/localCouponInfo/delete?id=' + this.productId).then(res => {
|
|
|
|
|
|
|
+ this.$http.delete(`/merchant/localCouponInfo/delete?id=${this.productId}&type=${this.currentTab}`).then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
- this.$tip.error(res.data.message || '删除成功');
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: `/pages/coupon/coupon?tab=${this.currentTab}`
|
|
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: res.data.message || '删除成功',
|
|
|
|
|
+ icon: 'none'
|
|
|
})
|
|
})
|
|
|
|
|
+ this.goCouponList()
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
this.$tip.error(res.data.message);
|
|
this.$tip.error(res.data.message);
|
|
@@ -233,7 +248,7 @@ export default {
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
if (options) {
|
|
if (options) {
|
|
|
this.productId = options.id
|
|
this.productId = options.id
|
|
|
- this.currentTab = options.tab
|
|
|
|
|
|
|
+ this.currentTab = Number(options.tab) || 0
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|