|
|
@ -220,8 +220,12 @@ export default { |
|
|
|
|
|
|
|
// 触发搜索 |
|
|
|
searchTrigger() { |
|
|
|
let data = { |
|
|
|
curStore: this.curStore, |
|
|
|
}; |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
url: '/subpackage/retail/pages/search/search' |
|
|
|
url: `/subpackage/retail/pages/search/search?data=${encodeURIComponent(JSON.stringify(data))}` |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
@ -260,6 +264,12 @@ export default { |
|
|
|
|
|
|
|
switch (type) { |
|
|
|
case "add": { |
|
|
|
// 判断库存 |
|
|
|
if (this.cartList[i].erp_goods_sale_total + 1 > this.cartList[i].stock_num) { |
|
|
|
util.showNone("库存就这么多了!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.cartList[i].erp_goods_sale_total += 1; |
|
|
|
for (let i = 0; i < mainItems.length; ++i) { |
|
|
|
mainItems[i].erp_goods_sale_total += 1; |
|
|
@ -490,6 +500,11 @@ export default { |
|
|
|
if (goodsItem) { |
|
|
|
switch (type) { |
|
|
|
case "add": { |
|
|
|
// 判断库存 |
|
|
|
if (goodsItem.erp_goods_sale_total + 1 > goodsItem.stock_num) { |
|
|
|
util.showNone("库存就这么多了!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
goodsItem.erp_goods_sale_total += 1; |
|
|
|
} break; |
|
|
|
case "sub": { |
|
|
@ -537,14 +552,13 @@ export default { |
|
|
|
// 获取商品信息 |
|
|
|
getGoodsInfo() { |
|
|
|
let _this = this; |
|
|
|
|
|
|
|
_this.goodsInfo = []; |
|
|
|
// let categoryName = ""; |
|
|
|
|
|
|
|
retailServer.get({ |
|
|
|
url: retailApi.assistantListErpGoodsCateAndGoods, |
|
|
|
data: { |
|
|
|
// brand_id: _this.indexData.brand.id, |
|
|
|
stadium_id: _this.curStore.id, |
|
|
|
}, |
|
|
|
isDefaultGet: false, |
|
|
|
failMsg: '加载物品数据失败!' |
|
|
@ -579,6 +593,7 @@ export default { |
|
|
|
_this.goodsInfo.push(res.data.data.list[i]); |
|
|
|
} |
|
|
|
|
|
|
|
_this.cartList = []; // 购物车的数据清空,每次切换门店都执行 |
|
|
|
_this.totalCount = 0; |
|
|
|
_this.totalPrice = 0; |
|
|
|
_this.goodsInfo[1].style = _this.categoryBtnStyle.click; |
|
|
@ -626,9 +641,10 @@ export default { |
|
|
|
let _this = this; |
|
|
|
let curStoreList = _this.curStoreList; |
|
|
|
_this.curStore = curStoreList[e.detail.value] || {}; |
|
|
|
// _this.$nextTick(function() { |
|
|
|
// _this.getGoodsInfo(); // 获取商品信息 |
|
|
|
// }); |
|
|
|
_this.$nextTick(function() { |
|
|
|
util.showLoad(); |
|
|
|
_this.getGoodsInfo(); // 获取商品信息 |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|