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