|
@@ -22,6 +22,9 @@
|
|
|
<u-number-box :max="goodContent.inventoryQty" v-model="nums"></u-number-box>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="goods-goldLimit">
|
|
|
+ 此商品需要满<text>{{goldLimit}}</text>乐豆才可购买
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<!-- 商品属性 -->
|
|
|
<view class="goods-attr">
|
|
@@ -74,12 +77,14 @@
|
|
|
imageList:[], // 商品图片
|
|
|
nums:1, // 商品数量
|
|
|
id: '',
|
|
|
- goodContent: null
|
|
|
+ goodContent: null,
|
|
|
+ goldLimit: 0
|
|
|
};
|
|
|
},
|
|
|
onLoad(opts) {
|
|
|
console.log(opts)
|
|
|
this.id = opts.id
|
|
|
+ this.goldLimit = opts.goldLimit
|
|
|
this.getDetail()
|
|
|
},
|
|
|
methods: {
|
|
@@ -104,10 +109,17 @@
|
|
|
// 立即下单
|
|
|
toOrder(){
|
|
|
// console.log(this.goodContent,this.id,'pppppppp')
|
|
|
- this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
|
|
|
- uni.redirectTo({
|
|
|
- url:"/pages/toOrder/index"
|
|
|
- })
|
|
|
+ if(this.goodContent.sellGold * this.nums >= this.goldLimit){
|
|
|
+ this.$u.vuex("vuex_toOrderList",[{id:this.id,buyQty:this.nums,goodsNo:this.goodContent.goodsNo,goods:this.goodContent}])
|
|
|
+ uni.redirectTo({
|
|
|
+ url:"/pages/toOrder/index"
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"此商品需要满" +this.goldLimit+ "乐豆才可购买"
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@@ -174,7 +186,7 @@ page{
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
- padding:0 40upx 20upx;
|
|
|
+ padding:0 40upx;
|
|
|
>view{
|
|
|
&:first-child{
|
|
|
font-size: 22upx;
|
|
@@ -186,6 +198,15 @@ page{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .goods-goldLimit{
|
|
|
+ padding: 10upx 40upx;
|
|
|
+ color: #F0AD4E;
|
|
|
+ font-size: 24rpx;
|
|
|
+ text-align: right;
|
|
|
+ text{
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
.goods-attr{
|
|
|
margin: 20upx 0;
|