优化积分兑换详情页控制台报错问题
This commit is contained in:
parent
7b46c3637a
commit
ec7f284035
@ -43,7 +43,7 @@
|
||||
<text class="points-label">当前积分{{ userPoints }}</text>
|
||||
</view>
|
||||
<view v-if="userPoints < selectedGoodsInfo.points" class="insufficient-points">
|
||||
<text v-if="!uni.getStorageSync('ctoken')" >暂未登录,请先登录</text>
|
||||
<text v-if="!isLoggedIn" >暂未登录,请先登录</text>
|
||||
<text v-else>积分不足,还差{{ selectedGoodsInfo.points - userPoints }}积分哦</text>
|
||||
</view>
|
||||
<button v-else class="exchange-btn" @click="showSpecPopup = true">立即兑换</button>
|
||||
@ -112,7 +112,8 @@ export default {
|
||||
selectedSpecId: 1,
|
||||
selectedSpec: '',
|
||||
quantity: 1,
|
||||
selectedGoodsInfo: {}
|
||||
selectedGoodsInfo: {},
|
||||
isLoggedIn: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -182,9 +183,13 @@ export default {
|
||||
},
|
||||
onshow() {
|
||||
this.getPointNum();
|
||||
// 更新登录状态
|
||||
this.isLoggedIn = !!uni.getStorageSync("ctoken");
|
||||
},
|
||||
onLoad(options) {
|
||||
this.getPointNum();
|
||||
// 初始化登录状态
|
||||
this.isLoggedIn = !!uni.getStorageSync("ctoken");
|
||||
const orderInfo = JSON.parse(options.product);
|
||||
const params = {
|
||||
id: orderInfo.id
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user