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