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,25 +212,25 @@
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()
this.desk = res let res = await this.$api.get(`/v1/store/desk/${desk}`)
this.type = 'desk' this.desk = res
this.remarks = '桌号:' + this.desk.name this.type = 'desk'
// id this.remarks = '桌号:' + this.desk.name
this.mid = options.mid // id
// id this.mid = options.mid
let ids = options.store_cart.split(',').map(value => parseInt(value)) // id
this.$store.dispatch('storeCart/getCart').then(res => { let ids = options.store_cart.split(',').map(value => parseInt(value))
const goods = res.filter(item => ids.indexOf(item.id) >= 0) res = await this.$store.dispatch('storeCart/getCart')
this.goods = goods.map(item => { const goods = res.filter(item => ids.indexOf(item.id) >= 0)
return { this.goods = goods.map(item => {
sku_id: item.id, return {
num: item.number sku_id: item.id,
} num: item.number
}) }
this.getDetail()
})
}) })
this.getDetail()
uni.hideLoading()
} else { } else {
this.type = data.type; this.type = data.type;
this.goods = data?.goods ?? []; this.goods = data?.goods ?? [];