Commit bd7da9ca by 李嘉林

加购倍数

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