|
|
@@ -303,12 +303,28 @@
|
|
|
this.takeTime = this.$dateTime.format(new Date(data.date))
|
|
|
}
|
|
|
},
|
|
|
+ getGoodsPreview(){
|
|
|
+ let goodsPreview=[]
|
|
|
+ this.cart.forEach(item=>{
|
|
|
+ let obj={
|
|
|
+ image:item.image,
|
|
|
+ name:item.name,
|
|
|
+ propertyStr:item.propertyStr,
|
|
|
+ number:item.number,
|
|
|
+ realPrice:item.realPrice,
|
|
|
+ defaultPrice:item.defaultPrice
|
|
|
+ }
|
|
|
+ goodsPreview.push(obj)
|
|
|
+ })
|
|
|
+ return JSON.stringify(goodsPreview)
|
|
|
+ },
|
|
|
async order() {
|
|
|
+ let goodsPreview=this.getGoodsPreview()
|
|
|
let params = {
|
|
|
receiveId: this.shopId,
|
|
|
payId: this.vuex_userId,
|
|
|
takeType: this.takeType,
|
|
|
- goodsPreview: JSON.stringify(this.cart),
|
|
|
+ goodsPreview,
|
|
|
goodsTotalNum: this.totalNum,
|
|
|
totalPrice: this.total,
|
|
|
extraInfo: this.remark,
|
|
|
@@ -383,6 +399,10 @@
|
|
|
payStatus: this.$global.payStatus.IS_WAIT
|
|
|
}
|
|
|
let res = await this.$api.pay.payOrder(obj)
|
|
|
+ if (this.$isEmpty(res.data.prePayTn)) {
|
|
|
+ this.$refs.toast.error(res.data.message)
|
|
|
+ return
|
|
|
+ }
|
|
|
let prePayTn = JSON.parse(res.data.prePayTn)
|
|
|
this.$mpi.requestPayment(prePayTn).then(() => {
|
|
|
this.handelResult(true)
|