积分兑换
This commit is contained in:
@@ -3,18 +3,16 @@
|
||||
<div class="goods-img">
|
||||
<u-swiper :list="list" mode="none" img-mode="aspectFit" height="750" bg-color="#fff"></u-swiper>
|
||||
</div>
|
||||
<div class="goods-title">
|
||||
天薇抽纸天然无香纸巾天薇抽纸天然无香纸巾天薇抽纸天然无香纸巾可湿水…
|
||||
</div>
|
||||
<div class="goods-title">{{goodsInfo.merchandiseName}}</div>
|
||||
<div class="goods-point">
|
||||
<h3>10<span>积分</span></h3>
|
||||
<div>库存100</div>
|
||||
<h3>{{goodsInfo.merchandiseIntegral}}<span>积分</span></h3>
|
||||
<div>库存{{goodsInfo.merchandiseNumber}}</div>
|
||||
</div>
|
||||
<div class="goods-btn status-lack">
|
||||
<div class="text">积分余额:438</div>
|
||||
<div class="btn" @click="toOrder()">立即兑换</div>
|
||||
<!-- <div class="btn lack-btn">积分不足</div> -->
|
||||
<!-- <div class="btn lack-btn">缺货</div> -->
|
||||
<div class="text">积分余额:{{userIntegral}}</div>
|
||||
<div class="btn" @click="toOrder()" v-if="goodsInfo.status == 0 && userIntegral >= goodsInfo.merchandiseIntegral">立即兑换</div>
|
||||
<div class="btn lack-btn" v-if="goodsInfo.status == 0 && userIntegral < goodsInfo.merchandiseIntegral">积分不足</div>
|
||||
<div class="btn lack-btn" v-if="goodsInfo.status != 0">缺货</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,23 +24,35 @@ export default {
|
||||
name: 'detail',
|
||||
data() {
|
||||
return {
|
||||
list: [
|
||||
{ image: 'https://cdn.uviewui.com/uview/swiper/1.jpg'},
|
||||
{ image: 'https://cdn.uviewui.com/uview/swiper/2.jpg'},
|
||||
{ image: 'https://cdn.uviewui.com/uview/swiper/3.jpg'}
|
||||
],
|
||||
list: [],
|
||||
userIntegral: '',
|
||||
id: '',
|
||||
goodsInfo: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userIntegral = option.userIntegral
|
||||
this.id = option.id
|
||||
this.getDetail()
|
||||
},
|
||||
onShow() {
|
||||
document.title = '商品详情'
|
||||
},
|
||||
methods: {
|
||||
toOrder() {
|
||||
uni.navigateTo({url:'./order'})
|
||||
}
|
||||
uni.navigateTo({url:`./order?userIntegral=${this.userIntegral}&id=${this.id}`})
|
||||
},
|
||||
getDetail() {
|
||||
this.$http.post(`/app/appintegralmerchandise/queryDetailById?id=${this.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.goodsInfo = res.data
|
||||
this.list = [{image: res.data.imageUrl}]
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user