|
@@ -187,14 +187,29 @@ export default {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
uni.showLoading({mask:true})
|
|
uni.showLoading({mask:true})
|
|
|
- let product = this.selectList.map(i=>({ productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice }))
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let productList = []
|
|
|
|
|
+
|
|
|
|
|
+ this.selectList.forEach((productItem,productIdx,productArr) => {
|
|
|
|
|
+ let unitType = productItem.unitType
|
|
|
|
|
+ let bigNum = 0
|
|
|
|
|
+ let num = productItem.currentNum
|
|
|
|
|
+ let smallNum = 0
|
|
|
|
|
+ if(unitType == 0){
|
|
|
|
|
+ bigNum = num
|
|
|
|
|
+ }else{
|
|
|
|
|
+ smallNum = num
|
|
|
|
|
+ }
|
|
|
|
|
+ productList.push({productId:productItem.id,bigNum:bigNum,smallNum:smallNum,classId:0,itemId:productItem.itemId,price:productItem.unitPrice})
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
//isCashier=1时收银台播放 总金额139元,请扫码付款
|
|
//isCashier=1时收银台播放 总金额139元,请扫码付款
|
|
|
- createOrder({...params,product:JSON.stringify(product),isCashier:1,customId:this.customId}).then(res=>{
|
|
|
|
|
|
|
+ createOrder({...params,product:JSON.stringify(productList),isCashier:1,customId:this.customId}).then(res=>{
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
if(res.data.status == 1){
|
|
if(res.data.status == 1){
|
|
|
this.orderId = res.data.id
|
|
this.orderId = res.data.id
|
|
|
- this.price = res.data.mainPay ? Number(res.data.mainPay) : 0
|
|
|
|
|
|
|
+ this.price = res.data.actPrice ? Number(res.data.actPrice) : 0
|
|
|
this.$refs.toPayRef.open('center')
|
|
this.$refs.toPayRef.open('center')
|
|
|
}else{
|
|
}else{
|
|
|
this.removeFromSaveDirect()
|
|
this.removeFromSaveDirect()
|