Commit cb444a1e by 李嘉林

快速加购

parent bd7da9ca
......@@ -11,7 +11,7 @@ export default {
let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
console.log(extConfig, "-----------extConfig");
if (JSON.stringify(extConfig) == "{}") {
extConfig = process.env.NODE_ENV == "development" ? { mixid: "antgood", shopid: 67}:{ "mixid":"fruit", "shopid": 1213 };
extConfig = process.env.NODE_ENV == "development" ? { mixid: "antgood", shopid: 67}:{ "mixid":"qiyeCT", "shopid": 1045 };
}
......
......@@ -32,7 +32,7 @@
</p>
<van-stepper button-size="24px" integer :min="0"
:step="item.plusPurchaseMultiple"
:max="item.oversoldFlag == 1 ? 999999 : item.maxLimitPurchaseNum > 0 ? item.maxLimitPurchaseNum : 999999"
:max="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" />
</div>
......@@ -195,8 +195,12 @@ export default {
) {
qty = 0;
} else {
if (qty - data.plusPurchaseMultiple < data.minLimitPurchaseNum && data.minLimitPurchaseNum > 0) {
qty = data.minLimitPurchaseNum;
} else {
qty -= (data.plusPurchaseMultiple - 0 || 1)
}
}
} else if (type == "plus") {
if (data.minLimitPurchaseNum > 0 && qty == 0) {
qty = data.minLimitPurchaseNum<data.plusPurchaseMultiple?data.plusPurchaseMultiple:data.minLimitPurchaseNum;
......
......@@ -132,7 +132,7 @@ export function $themeToLink(data, option) {
}
}
}
export function $themeAddToCard(item, callback) {
export function $themeAddToCard(item, callback = () => { }) {
let errorMsg = "";
if (item.productNature == 5) {
errorMsg = "电子卡券不可加入购物车";
......@@ -151,7 +151,7 @@ export function $themeAddToCard(item, callback) {
}
cart
.addCart([
{ productGoodsId: item.minProductGoodsId, qty: item.saleQty }
{ productGoodsId: item.minProductGoodsId, qty: item.plusPurchaseMultiple }
])
.then(res => {
if (res.data.code == 200) {
......
......@@ -117,13 +117,19 @@ const componentOptions = {
console.log("加入购物车");
// $themeAddToCard(this.data.items);
console.log(app.globalData.shopInfo.whetherOpenEnterprisesWantGoods - 0,'app.globalData.shopInfo=')
let { whetherToEnableQuickPurchase } = app.shop_configuration;
if (whetherToEnableQuickPurchase == 1) {
// 快速加购
$themeAddToCard(this.data.items);
} else {
// 选规格加购
if (app.globalData.shopInfo.whetherOpenEnterprisesWantGoods - 0 == 1) {
// 开启企业要货加购
app.openTwoBAddCart(_this.data.items);
} else {
app.openSelectGoods(_this.data.items);
}
}
} else {
// 进入确认订单
linkVal = `/order/orderConfirm?productGoodsMixId=${minProductGoodsMixid}&productGoodsId=${minProductGoodsId}&goodsId=${minGoodsId}&qty=1&goodsString=null&source=3`;
......
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