|
@@ -86,10 +86,10 @@
|
|
|
hanldOperationConfim(data){//显示选择数量确认弹窗
|
|
|
console.log(this.handleData)
|
|
|
this.handleData = data
|
|
|
- this.number = 1
|
|
|
- this.buyRetailPrice = Number(data.price1);
|
|
|
- this.secondProductType = data.secondProductType
|
|
|
- this.specClass = 'show';
|
|
|
+ this.number = 1
|
|
|
+ this.buyRetailPrice = Number(data.price1);
|
|
|
+ this.secondProductType = data.secondProductType
|
|
|
+ this.specClass = 'show';
|
|
|
},
|
|
|
hideSpec() {//关闭选择数量确认弹窗
|
|
|
this.specClass = 'hide';
|
|
@@ -98,7 +98,7 @@
|
|
|
}, 200);
|
|
|
},
|
|
|
changeCountAdd(){//popup弹窗数量增加按钮
|
|
|
- if(this.handleData.secondProductType == 2){
|
|
|
+ if(this.handleData.secondHandType == 2||this.handleData.secondHandType == 3){
|
|
|
if(this.number >= this.handleData.stock){
|
|
|
this.number= this.handleData.stock
|
|
|
this.isStock =true
|
|
@@ -108,14 +108,15 @@
|
|
|
this.number++
|
|
|
this.isQuantity =false
|
|
|
}
|
|
|
+ this.buyRetailPrice = this.number*this.handleData.price1
|
|
|
}else{
|
|
|
this.isStock =true
|
|
|
this.$util.msg(`该商品购买数量只能为1`,2000);
|
|
|
}
|
|
|
},
|
|
|
changeCountSub(){//popup弹窗数量减按钮
|
|
|
- if(this.handleData.secondProductType == 2){
|
|
|
- if(this.number < 1){
|
|
|
+ if(this.handleData.secondHandType == 2||this.handleData.secondHandType == 3){
|
|
|
+ if(this.number <= 1){
|
|
|
this.number= 1
|
|
|
this.isQuantity =true
|
|
|
this.$util.msg(`购买数量最低为1`,2000);
|
|
@@ -124,24 +125,37 @@
|
|
|
this.number--
|
|
|
this.isQuantity =false
|
|
|
}
|
|
|
+ this.buyRetailPrice = this.number*this.handleData.price1
|
|
|
}else{
|
|
|
this.isQuantity =true
|
|
|
this.$util.msg(`该商品购买数量只能为1`,2000);
|
|
|
}
|
|
|
},
|
|
|
+ // changeNumber(e){
|
|
|
+ // let _value = e.detail.value;
|
|
|
+ // if(!this.$api.isNumber(_value)){
|
|
|
+ // this.number = this.minBuyNumber
|
|
|
+ // }else if(_value < this.minBuyNumber){
|
|
|
+ // this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
|
|
|
+ // this.number = this.minBuyNumber
|
|
|
+ // }else if( _value % this.minBuyNumber !=0 ){
|
|
|
+ // this.$util.msg(`购买量必须为起订量的整数倍`,2000);
|
|
|
+ // this.number = this.minBuyNumber
|
|
|
+ // }else{
|
|
|
+ // this.number = e.detail.value
|
|
|
+ // }
|
|
|
+ // },
|
|
|
changeNumber(e){
|
|
|
let _value = e.detail.value;
|
|
|
if(!this.$api.isNumber(_value)){
|
|
|
- this.number = this.minBuyNumber
|
|
|
- }else if(_value < this.minBuyNumber){
|
|
|
- this.$util.msg(`该商品最小起订量为${this.minBuyNumber}`,2000);
|
|
|
- this.number = this.minBuyNumber
|
|
|
- }else if( _value % this.minBuyNumber !=0 ){
|
|
|
- this.$util.msg(`购买量必须为起订量的整数倍`,2000);
|
|
|
- this.number = this.minBuyNumber
|
|
|
+ this.number = 1
|
|
|
+ }else if(_value <= 1){
|
|
|
+ this.$util.msg(`该商品最小起订量为1`,2000);
|
|
|
+ this.number = 1
|
|
|
}else{
|
|
|
this.number = e.detail.value
|
|
|
}
|
|
|
+ this.buyRetailPrice = this.number*this.handleData.price1
|
|
|
},
|
|
|
clearProduct(){//成功加入购物车后清空所选值
|
|
|
this.handleData.productKind= 0;
|
|
@@ -155,7 +169,7 @@
|
|
|
this.specClass = 'hide';
|
|
|
let cartPramsData={
|
|
|
clubId:this.clubID,
|
|
|
- allPrice:this.number*this.buyRetailPrice,
|
|
|
+ allPrice:this.buyRetailPrice,
|
|
|
allCount:this.number,
|
|
|
productID:this.handleData.productID,
|
|
|
productCount:this.number
|