6
0
Fork 0

confirm_order loading

develop
panliang 2023-02-26 11:23:36 +08:00
parent b9437e26e0
commit 3cb4dc104c
1 changed files with 26 additions and 20 deletions

View File

@ -179,7 +179,13 @@
addressId: '',
couponId: '',
goodsList: [],
orderInfo: {},
orderInfo: {
products_total_amount: '',
shipping_fee: '',
coupon_discount_amount: '',
vip_discount_amount: '',
total_amount: '',
},
addressList: [],
remarks: '',
tempCouponId: '',
@ -194,7 +200,7 @@
mid: '',
};
},
onLoad(options) {
async onLoad(options) {
let data = {}
if (options.data) {
data = JSON.parse(decodeURIComponent(options.data));
@ -206,7 +212,8 @@
else if (options.store_cart) {
// id
let desk = uni.getStorageSync('desk')
this.$api.get(`/v1/store/desk/${desk}`).then(res => {
uni.showLoading()
let res = await this.$api.get(`/v1/store/desk/${desk}`)
this.desk = res
this.type = 'desk'
this.remarks = '桌号:' + this.desk.name
@ -214,7 +221,7 @@
this.mid = options.mid
// id
let ids = options.store_cart.split(',').map(value => parseInt(value))
this.$store.dispatch('storeCart/getCart').then(res => {
res = await this.$store.dispatch('storeCart/getCart')
const goods = res.filter(item => ids.indexOf(item.id) >= 0)
this.goods = goods.map(item => {
return {
@ -223,8 +230,7 @@
}
})
this.getDetail()
})
})
uni.hideLoading()
} else {
this.type = data.type;
this.goods = data?.goods ?? [];