修复bug

This commit is contained in:
weipengfei 2023-12-11 18:19:04 +08:00
parent e59f83a0e9
commit e6bc9233f4
3 changed files with 9 additions and 2 deletions

View File

@ -51,7 +51,7 @@
</view> </view>
</view> </view>
<view> <view>
商品库存 <text style="margin-left: 20rpx;">{{(sku[changeSkuKey] && sku[changeSkuKey].stock)||change.stock}}</text> 商品库存 <text style="margin-left: 20rpx;">{{sku[changeSkuKey] ? sku[changeSkuKey].stock : change.stock}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -217,6 +217,7 @@ import { Toast } from '../libs/uniApi';
// //
addcart() { addcart() {
// return console.log(this.sku[this.changeSkuKey]); // return console.log(this.sku[this.changeSkuKey]);
if(!this.sku[this.changeSkuKey]) return Toast('该规格有错误, 请选择其他规格');
if(+this.sku[this.changeSkuKey].procure_price * +this.cart_num<=0) return Toast('无法购买价格小于等于0的商品'); if(+this.sku[this.changeSkuKey].procure_price * +this.cart_num<=0) return Toast('无法购买价格小于等于0的商品');
if (this.sku[this.changeSkuKey]) { if (this.sku[this.changeSkuKey]) {
if (this.cart_num > this.sku[this.changeSkuKey].stock) return uni.showToast({ if (this.cart_num > this.sku[this.changeSkuKey].stock) return uni.showToast({

View File

@ -380,6 +380,12 @@
type: 2 type: 2
}) })
this.cloudList = data; this.cloudList = data;
this.cloudList.forEach((item)=>{
item.children.unshift({
cate_name: '全部',
store_category_id: item.store_category_id,
});
})
this.merchant = this.cloudList[0]; this.merchant = this.cloudList[0];
this.merchantTow = this.merchant?.children[0]; this.merchantTow = this.merchant?.children[0];
this.storeParam.category_id = this.merchantTow.store_category_id; this.storeParam.category_id = this.merchantTow.store_category_id;

View File

@ -402,7 +402,7 @@
this.credit_buy = options.credit_buy this.credit_buy = options.credit_buy
this.sotreParam.type_id = options.type_id this.sotreParam.type_id = options.type_id
this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || '' this.sotreParam.type_id = options.type_id && options.type_id.split(',').toString() || ''
this.sotreParam.category_id = options.merchant_category_id || '' this.sotreParam.category_id = options.cate_id || ''
this.storeList = []; this.storeList = [];
if (this.mer_location == 1) { if (this.mer_location == 1) {