|
@@ -68,8 +68,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="sku-unit-nunbox">
|
|
|
- <view class="sku-unit-nunbox" v-if="skuProduct.step === 2">
|
|
|
- <view class="text">*该商品只能以起订量的整数倍购买</view>
|
|
|
+ <view class="sku-unit-nunbox-t" v-if="skuProduct.step === 2">
|
|
|
+ <view class="text">该商品只能以起订量的整数倍购买</view>
|
|
|
</view>
|
|
|
<view class="sku-unit-nunbox-t">
|
|
|
<view class="sku-unit-nunbox-text">购买数量:</view>
|
|
@@ -231,13 +231,23 @@ export default {
|
|
|
} else if (_value < this.handleMinNumber) {
|
|
|
this.$util.msg(`该商品最小起订量为${this.handleMinNumber}`, 2000)
|
|
|
this.productCount = this.handleMinNumber
|
|
|
- } else if (_value % this.handleMinNumber != 0) {
|
|
|
- this.$util.msg('购买量必须为起订量的整数倍', 2000)
|
|
|
- this.productCount = this.handleMinNumber
|
|
|
- } else if (_value > this.handleStock) {
|
|
|
- this.productCount = this.handleStock
|
|
|
- } else {
|
|
|
- this.productCount = e.detail.value
|
|
|
+ } else{
|
|
|
+ if (this.skuProduct.step == 2) {
|
|
|
+ if (_value % this.handleMinNumber != 0) {
|
|
|
+ this.$util.msg('购买量必须为起订量的整数倍', 2000)
|
|
|
+ this.productCount = this.handleMinNumber
|
|
|
+ } else if (_value > this.handleStock) {
|
|
|
+ this.productCount = this.handleStock
|
|
|
+ } else {
|
|
|
+ this.productCount = _value
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if (_value > this.handleStock) {
|
|
|
+ this.productCount = this.handleStock
|
|
|
+ } else {
|
|
|
+ this.productCount = _value
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
this.totalLadderPrice()
|
|
|
},
|
|
@@ -250,11 +260,18 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log('22222222',this.skuProduct.price)
|
|
|
},
|
|
|
handleBuyConfirm() {
|
|
|
- this.addParams.productCount = this.productCount
|
|
|
- this.handleAddClubCart(this.addParams)
|
|
|
+ if (this.skuProduct.step == 2) {
|
|
|
+ if (this.productCount % this.handleMinNumber != 0) {
|
|
|
+ this.$util.msg('购买量必须为起订量的整数倍', 2000)
|
|
|
+ this.productCount = this.handleMinNumber
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.addParams.productCount = this.productCount
|
|
|
+ this.handleAddClubCart(this.addParams)
|
|
|
+ }
|
|
|
},
|
|
|
handleAddClubCart(params) {
|
|
|
//增加购物车成功和toast弹窗提示成功
|
|
@@ -411,7 +428,7 @@ export default {
|
|
|
.text {
|
|
|
font-size: $font-size-24;
|
|
|
line-height: 48rpx;
|
|
|
- color: #999999;
|
|
|
+ color: #FF5B00;
|
|
|
}
|
|
|
.sku-unit-nunbox-text {
|
|
|
line-height: 44rpx;
|