|
|
@ -34,13 +34,23 @@ |
|
|
|
<view class="desc"> |
|
|
|
{{ item.sku }} |
|
|
|
</view> |
|
|
|
<view class="price"> |
|
|
|
<view class="price-box"> |
|
|
|
<view class=""> |
|
|
|
<uv-number-box |
|
|
|
v-model="item.num" |
|
|
|
v-if="[1, 2].includes(item.type)" |
|
|
|
></uv-number-box> |
|
|
|
</view> |
|
|
|
<view class=""> |
|
|
|
|
|
|
|
<!-- 会员价:普通商品并且是会员的时候显示 --> |
|
|
|
<view class="price" |
|
|
|
v-if="[2].includes(item.type) && [1].includes(userInfo.isPay)"> |
|
|
|
会员价¥{{ item.vipPrice }} |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 零售价、价格 --> |
|
|
|
<view class="price" |
|
|
|
v-else> |
|
|
|
¥{{ item.price }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -114,15 +124,24 @@ |
|
|
|
let price = 0 |
|
|
|
|
|
|
|
this.productList.forEach(n => { |
|
|
|
price += n.price * n.num |
|
|
|
|
|
|
|
if([2].includes(n.type) && |
|
|
|
[1].includes(this.userInfo.isPay)){ |
|
|
|
// 普通商品的同时用户是会员就计算会员价 |
|
|
|
price += n.vipPrice * n.num |
|
|
|
}else{ |
|
|
|
// 普通价格 |
|
|
|
price += n.price * n.num |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
return Number(price).toFixed(2) |
|
|
|
}, |
|
|
|
...mapState(['payOrderProduct']), |
|
|
|
...mapState(['payOrderProduct', 'userInfo']), |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
this.getRiceProductDetail() |
|
|
|
this.$store.commit('getUserInfo') |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getAddressList() |
|
|
@ -220,12 +239,12 @@ |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
|
|
|
|
setTimeout(uni.navigateTo, 700, { |
|
|
|
url: '/pages_order/order/order' |
|
|
|
setTimeout(uni.redirectTo, 700, { |
|
|
|
url: '/pages/index/order' |
|
|
|
}) |
|
|
|
}).catch(n => { |
|
|
|
setTimeout(uni.navigateTo, 500, { |
|
|
|
url: '/pages_order/order/order' |
|
|
|
setTimeout(uni.redirectTo, 700, { |
|
|
|
url: '/pages/index/order' |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
@ -249,7 +268,7 @@ |
|
|
|
border-radius: 20rpx; |
|
|
|
|
|
|
|
image { |
|
|
|
width: 40rpx; |
|
|
|
width: 60rpx; |
|
|
|
height: 40rpx; |
|
|
|
margin: 20rpx; |
|
|
|
} |
|
|
@ -305,12 +324,22 @@ |
|
|
|
margin-top: 10rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.price { |
|
|
|
.price-box { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
color: #f40; |
|
|
|
font-size: 30rpx; |
|
|
|
font-weight: 900; |
|
|
|
.price{ |
|
|
|
&>view:nth-child(2){ |
|
|
|
font-size: 22rpx; |
|
|
|
color: #777; |
|
|
|
text{ |
|
|
|
font-size: 26rpx; |
|
|
|
font-weight: 900; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|