Commit bd7da9ca by 李嘉林

加购倍数

parent a117c8b4
......@@ -67,6 +67,7 @@
<div class="buyQty flex">
<div class="ti">购买数量</div>
<van-stepper :value="buyQty"
:step="product_goods_info.plusPurchaseMultiple"
:min="product_goods_info.productMinCount > 0 ? product_goods_info.productMinCount : 1" :max="MaxQtyNum"
:disable-input="true" @change="changeQty" input-class="ipt" />
</div>
......@@ -113,7 +114,8 @@ export default {
sellMaxQty: "",
limitQty: "",
specifications: [], //原规格
discountPrice: ""
discountPrice: "",
plusPurchaseMultiple: 1,
},
buyQty: 1,
goodsGuige: [],
......@@ -215,7 +217,7 @@ export default {
this.productNature = res.data.productNature - 0;
// 商品开售状态 1:立刻开售,2:定时开售)
this.saleWay = res.data.saleWay ? res.data.saleWay - 0 : 1;
this.init();
this.init(val);
}
})
},
......@@ -223,7 +225,7 @@ export default {
this.show = false;
},
// 初始化
async init() {
async init(val) {
let query = {
productInfoId: val.productId,
terminalProductId: val.terminalProductId,
......@@ -239,6 +241,7 @@ export default {
res.data.data[0].productGoodsMixId;
this.product_goods_info.specifications = res.data.data[0].specifications;
this.product_goods_info.oversoldFlag = res.data.data[0].oversoldFlag;
this.product_goods_info.plusPurchaseMultiple = res.data.data[0].plusPurchaseMultiple - 0;
}
});
// 获取商品规格
......@@ -423,6 +426,7 @@ export default {
query.goodsString = JSON.stringify(this.goodsString);
query.maxQty = this.product_goods_info.maxQty;
query.productMinCount = this.product_goods_info.productMinCount;
query.plusPurchaseMultiple = this.product_goods_info.plusPurchaseMultiple;
query.fromLived = 1;
query.liveId = this.liveId;
this.show = false;
......@@ -482,6 +486,8 @@ export default {
Number(res.data.data.goodsSuggestedRetailPrice);
this.product_goods_info.singleItemActivityId =
res.data.data.singleItemActivityId || '';
this.product_goods_info.plusPurchaseMultiple =
res.data.data.plusPurchaseMultiple - 0 || 1;
if (!getNewPrice) {
this.buyQty =
this.product_goods_info.productMinCount > 0 ? this.product_goods_info.productMinCount : 1;
......
......@@ -31,6 +31,7 @@
库存:<span v-if="item.oversoldFlag == 1">充足</span><span v-else>{{ item.saleQty | keepIntNum }}</span>
</p>
<van-stepper button-size="24px" integer :min="0"
:step="item.plusPurchaseMultiple"
:max="item.oversoldFlag == 1 ? 999999 : item.maxLimitPurchaseNum > 0 ? item.maxLimitPurchaseNum : 999999"
@minus="(e) => changeQty(item, e, 'minus')" @plus="(e) => changeQty(item, e, 'plus')"
@blur="(e) => changeQty(item, e, 'blur')" v-model="item.qty" :disabled="item.disabled" />
......@@ -154,6 +155,7 @@ export default {
item.disabled = false;
item.minLimitPurchaseNum = item.minLimitPurchaseNum - 0;
item.maxLimitPurchaseNum = item.maxLimitPurchaseNum - 0;
item.plusPurchaseMultiple = item.plusPurchaseMultiple - 0;
item.discountPrice = item.discountPrice - 0;
item.goodsImgUrl = DFSImg(item.goodsImgUrl);
item.purchased = 0;
......@@ -193,13 +195,13 @@ export default {
) {
qty = 0;
} else {
qty = Number(qty) - 1;
qty -= (data.plusPurchaseMultiple - 0 || 1)
}
} else if (type == "plus") {
if (data.minLimitPurchaseNum > 0 && qty == 0) {
qty = data.minLimitPurchaseNum;
qty = data.minLimitPurchaseNum<data.plusPurchaseMultiple?data.plusPurchaseMultiple:data.minLimitPurchaseNum;
} else {
qty = Number(qty) + 1;
qty += (data.plusPurchaseMultiple - 0 || 1)
}
} else if (type == "blur") {
if (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment