config
parent
2c3d45f7cc
commit
0a7e7ef725
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
ENV = 'production'
|
||||
|
||||
VUE_APP_BASE_API = 'https://jiqu-library.peidikeji.cn/api'
|
||||
#VUE_APP_BASE_API = 'https://jiqu-library.abcdefg.fun/api'
|
||||
#VUE_APP_BASE_API = 'https://jiqu-library.peidikeji.cn/api'
|
||||
VUE_APP_BASE_API = 'https://jiqu-library.abcdefg.fun/api'
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ export default {
|
|||
},
|
||||
},
|
||||
selectedLength() {
|
||||
return this.cartList.length;
|
||||
return this.selectedCart.length;
|
||||
},
|
||||
|
||||
height() {
|
||||
|
|
|
|||
|
|
@ -121,7 +121,9 @@ export default {
|
|||
},
|
||||
onLoad(e) {
|
||||
this.searchText = e.keywords;
|
||||
this.category = e.cid;
|
||||
if (e.cid && e.cid != 0) {
|
||||
this.category = e.cid
|
||||
}
|
||||
this.mid = e.mid;
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -129,7 +131,6 @@ export default {
|
|||
if (e == '') uni.navigateBack();
|
||||
},
|
||||
Search() {
|
||||
this.category = '';
|
||||
this.downCallback();
|
||||
},
|
||||
onChangeNumber(e) {
|
||||
|
|
|
|||
|
|
@ -198,6 +198,10 @@
|
|||
let data = {}
|
||||
if (options.data) {
|
||||
data = JSON.parse(decodeURIComponent(options.data));
|
||||
this.type = data.type;
|
||||
this.goods = data?.goods ?? [];
|
||||
this.cards = data?.cards ?? [];
|
||||
this.cuId = data?.cuId
|
||||
}
|
||||
else if (options.store_cart) {
|
||||
// 桌号 id
|
||||
|
|
@ -205,7 +209,6 @@
|
|||
this.$api.get(`/v1/store/desk/${desk}`).then(res => {
|
||||
this.desk = res
|
||||
this.type = 'desk'
|
||||
})
|
||||
// 商户 id
|
||||
this.mid = options.mid
|
||||
// 购物车商品 id
|
||||
|
|
@ -220,14 +223,14 @@
|
|||
})
|
||||
this.getDetail()
|
||||
})
|
||||
}
|
||||
|
||||
uni.$on('address:select', this.addressUpdate);
|
||||
|
||||
})
|
||||
} else {
|
||||
this.type = data.type;
|
||||
this.goods = data?.goods ?? [];
|
||||
this.cards = data?.cards ?? [];
|
||||
this.cuId = data?.cuId
|
||||
}
|
||||
uni.$on('address:select', this.addressUpdate);
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
|
@ -299,7 +302,7 @@
|
|||
params.cuId = this.cuId
|
||||
} else if (this.type == 'cart') {
|
||||
params.shopping_cart = this.cards;
|
||||
} else {
|
||||
} else if (this.type == 'desk') {
|
||||
params.products = this.goods.map(item => {
|
||||
return {
|
||||
sku_id: item.sku_id,
|
||||
|
|
@ -307,6 +310,10 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
const {num, sku_id } = this.goods[0];
|
||||
params.product = { sku_id: sku_id, quantity: num }
|
||||
}
|
||||
|
||||
if (btnLoading) return;
|
||||
btnLoading = true;
|
||||
|
|
@ -323,6 +330,8 @@
|
|||
params.desk = this.desk.id
|
||||
params.store_id = this.mid
|
||||
order = await this.$api.post(`/v1/order/orders`, params)
|
||||
// 清空桌号
|
||||
uni.clearStorageSync('desk')
|
||||
}
|
||||
else {
|
||||
order = await this.$api.post('/v1/order/orders', params);
|
||||
|
|
@ -369,9 +378,7 @@
|
|||
this.couponShow = true
|
||||
},
|
||||
//地址更换
|
||||
addressUpdate({
|
||||
id
|
||||
}) {
|
||||
addressUpdate({id}) {
|
||||
this.addressId = id;
|
||||
},
|
||||
//确认订单详情
|
||||
|
|
@ -386,22 +393,21 @@
|
|||
params.quantity= num
|
||||
} else if(this.type == 'bargains'){
|
||||
params.bargain_order_id = this.cuId
|
||||
const {
|
||||
num,
|
||||
sku_id
|
||||
} = this.goods[0];
|
||||
params.product = {
|
||||
sku_id: sku_id,
|
||||
quantity: num,
|
||||
};
|
||||
const { num, sku_id } = this.goods[0];
|
||||
params.product = { sku_id: sku_id, quantity: num };
|
||||
}else if (this.type == 'cart') {
|
||||
params.shopping_cart = this.cards;
|
||||
} else if (this.type == 'desk') {
|
||||
params.store_id = this.mid
|
||||
params.products = this.goods.map(item => {
|
||||
return {
|
||||
sku_id: item.sku_id,
|
||||
quantity: item.num,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const { num, sku_id } = this.goods[0];
|
||||
params.product = {
|
||||
sku_id: sku_id,
|
||||
quantity: num,
|
||||
};
|
||||
params.product = {sku_id: sku_id,quantity: num};
|
||||
}
|
||||
try {
|
||||
let orderInfo
|
||||
|
|
|
|||
Loading…
Reference in New Issue