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