|
|
@ -15,7 +15,7 @@ |
|
|
<text class="block margin-top-sm text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量</text> |
|
|
<text class="block margin-top-sm text-gray lf-font-28" style="margin-top: 20rpx;line-height: 40rpx;">数量</text> |
|
|
<view class="flex align-center margin-top-sm"> |
|
|
<view class="flex align-center margin-top-sm"> |
|
|
<text class="lf-iconfont lf-icon-jianhao lf-font-40" style="color: #999;" @tap="reduce"></text> |
|
|
<text class="lf-iconfont lf-icon-jianhao lf-font-40" style="color: #999;" @tap="reduce"></text> |
|
|
<input type="number" v-model="num" class="text-center margin-lr-sm radius text-black lf-font-32" style="width: 60rpx; height: 50rpx;background-color: #f1f1f1;color: #222;" /> |
|
|
|
|
|
|
|
|
<input @blur="changeNum(num)" type="number" v-model="num" class="text-center margin-lr-sm radius text-black lf-font-32" style="width: 60rpx; height: 50rpx;background-color: #f1f1f1;color: #222;" /> |
|
|
<text class="lf-iconfont lf-icon-jiahao lf-font-40" style="color: #999;" @tap="add"></text> |
|
|
<text class="lf-iconfont lf-icon-jiahao lf-font-40" style="color: #999;" @tap="add"></text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -98,15 +98,16 @@ |
|
|
type: 0, |
|
|
type: 0, |
|
|
order_id: 0, |
|
|
order_id: 0, |
|
|
ifDo: 1, |
|
|
ifDo: 1, |
|
|
ifPay: true |
|
|
|
|
|
|
|
|
ifPay: true, |
|
|
|
|
|
limit: 1 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
total(){ |
|
|
total(){ |
|
|
return function(num, price){ |
|
|
return function(num, price){ |
|
|
let big_num = new bigc(Number(num)); |
|
|
|
|
|
big_num = big_num.times(Number(price)); |
|
|
|
|
|
return big_num.round(2, 0).toString(); |
|
|
|
|
|
|
|
|
let big_price = new bigc(Number(price)); |
|
|
|
|
|
big_price = big_price.times(Number(num)); |
|
|
|
|
|
return big_price.round(2, 0).toString(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
isRight(){ |
|
|
isRight(){ |
|
|
@ -125,9 +126,20 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
changeNum(num) { |
|
|
|
|
|
if(num > this.limit) { |
|
|
|
|
|
this.$msg('该商品限购数量'+this.limit) |
|
|
|
|
|
this.num = this.limit |
|
|
|
|
|
return |
|
|
|
|
|
}else if(num < 1) { |
|
|
|
|
|
this.num = 1 |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
getConfirmOrder() { |
|
|
getConfirmOrder() { |
|
|
this.$http(this.API.API_COFIRMORDER_DETAILS, {goods_id: this.goods_id,goods_specs_id: this.goods_specs_id}).then(res => { |
|
|
this.$http(this.API.API_COFIRMORDER_DETAILS, {goods_id: this.goods_id,goods_specs_id: this.goods_specs_id}).then(res => { |
|
|
this.orderDetails = res.data |
|
|
this.orderDetails = res.data |
|
|
|
|
|
this.limit = res.data.goods.specs[0].limit |
|
|
|
|
|
// this.limit = 10 |
|
|
this.skeletonLoading = false |
|
|
this.skeletonLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
@ -136,7 +148,14 @@ |
|
|
this.num-- |
|
|
this.num-- |
|
|
}, |
|
|
}, |
|
|
add() { |
|
|
add() { |
|
|
this.num++ |
|
|
|
|
|
|
|
|
if(this.num < this.limit) { |
|
|
|
|
|
this.num++ |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$msg('该商品限购数量'+this.limit) |
|
|
|
|
|
this.num = this.limit |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
CheckboxChange(e) { |
|
|
CheckboxChange(e) { |
|
|
if(e.detail.value != '') { |
|
|
if(e.detail.value != '') { |
|
|
|