|
@ -71,17 +71,15 @@ |
|
|
<view class="account-label">我的余额</view> |
|
|
<view class="account-label">我的余额</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex flex-column"> |
|
|
<view class="flex flex-column"> |
|
|
<!-- todo: 字段对接 --> |
|
|
|
|
|
<view class="account-value">{{ userCenterData.score || 0 }}</view> |
|
|
<view class="account-value">{{ userCenterData.score || 0 }}</view> |
|
|
<view class="account-label">我的积分</view> |
|
|
<view class="account-label">我的积分</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex flex-column"> |
|
|
<view class="flex flex-column"> |
|
|
<view class="account-value">{{ riceInfo.canWithdraw || 0 }}<text class="account-unit">元</text></view> |
|
|
|
|
|
|
|
|
<view class="account-value">{{ userInfo.recommendAmount || 0 }}<text class="account-unit">元</text></view> |
|
|
<view class="account-label">推广佣金</view> |
|
|
<view class="account-label">推广佣金</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex flex-column"> |
|
|
<view class="flex flex-column"> |
|
|
<!-- todo: 字段对接 --> |
|
|
|
|
|
<view class="account-value">{{ riceInfo.balance || 0 }}<text class="account-unit">张</text></view> |
|
|
|
|
|
|
|
|
<view class="account-value">{{ couponCount || 0 }}<text class="account-unit">张</text></view> |
|
|
<view class="account-label">优惠券</view> |
|
|
<view class="account-label">优惠券</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -178,6 +176,7 @@ |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
couponCount: 0, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
onShow() { |
|
@ -185,6 +184,7 @@ |
|
|
this.$store.commit('getUserInfo') |
|
|
this.$store.commit('getUserInfo') |
|
|
this.$store.commit('getUserCenterInfo') |
|
|
this.$store.commit('getUserCenterInfo') |
|
|
this.$store.commit('getRiceInfo') |
|
|
this.$store.commit('getRiceInfo') |
|
|
|
|
|
this.fetchCouponData() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
@ -214,10 +214,16 @@ |
|
|
console.log(res); |
|
|
console.log(res); |
|
|
if (res.result) { |
|
|
if (res.result) { |
|
|
// 处理扫码结果 |
|
|
// 处理扫码结果 |
|
|
|
|
|
const [id, type] = res.result.split(',') |
|
|
console.log('扫码结果:', res.result); |
|
|
console.log('扫码结果:', res.result); |
|
|
|
|
|
|
|
|
|
|
|
console.log('--overOrder', { |
|
|
|
|
|
orderId : id, |
|
|
|
|
|
type, // type区分,0-订单核销 1-代金券核销 |
|
|
|
|
|
}) |
|
|
this.$fetch('overOrder', { |
|
|
this.$fetch('overOrder', { |
|
|
orderId : res.result |
|
|
|
|
|
|
|
|
orderId : id, |
|
|
|
|
|
type, // type区分,0-订单核销 1-代金券核销 |
|
|
}).then(() => { |
|
|
}).then(() => { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '核销成功', |
|
|
title: '核销成功', |
|
@ -236,6 +242,15 @@ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
async fetchCouponData() { |
|
|
|
|
|
try { |
|
|
|
|
|
const { total } = await this.$fetch('queryVouchersList', { type: 0 }) |
|
|
|
|
|
|
|
|
|
|
|
this.couponCount = total |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|