分享优惠券更新

This commit is contained in:
GaoHao
2024-11-08 17:32:35 +08:00
parent 7b81e2ffb0
commit 7167c2604f
7 changed files with 211 additions and 72 deletions

View File

@@ -22,7 +22,7 @@
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png" mode="aspectFill"/>
<text class="title">桌台</text>
</view>
<view class="value" v-if="tableCode"> {{ shopTableInfo.name }} </view>
<view class="value" v-if="tableCode"> {{ shopTableInfo.name || '' }} </view>
<u-icon v-else @click="scan" name="scan" size="60"></u-icon>
</view>
<!-- 打包外带 -->
@@ -85,7 +85,7 @@
</view>
<view class="favorable_right" ><text class="favorable_right_text"></text> <u-icon name="arrow-right" color="#575B66" size="28"></u-icon></view>
</view>
<view class="favorable" v-else-if="item.type=='points'">
<view class="favorable" v-else-if="item.type=='points'&&calcUsablePointsData.usable">
<view class="favorable_left">
<image class="icon" :src="item.url" mode="aspectFill"/>
<text class="name"> {{ item.name }} </text>
@@ -287,9 +287,9 @@
setPayAmount ( cartLists ) {
console.log(cartLists)
if ( this.amountVIP.isVip == 1 && cartLists.memberAmount > 0 ) {
this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo.seatNum*this.storeInfo.tableFee)).toFixed(2)
this.listinfo.payAmount = (cartLists.memberAmount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
} else {
this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo.seatNum*this.storeInfo.tableFee)).toFixed(2)
this.listinfo.payAmount = (cartLists.amount+(this.shopTableInfo?(this.shopTableInfo.seatNum*this.storeInfo.tableFee):0)).toFixed(2)
}
},
/**
@@ -382,6 +382,14 @@
if (this.tableCode) {params.code = this.tableCode}
if (this.shopId) {params.shopId = this.shopId}
let res = await this.api.productqueryShop(params)
if ( res.data.shopTableInfo && !res.data.shopTableInfo.choseCount&&this.orderAMeal) {
this.orderAMeal = false;
uni.pro.navigateTo('/pagesOrder/orderAMeal/index', {
tableCode: this.tableCode,
shopId: res.data.storeInfo.id,
})
return;
}
this.freeDingConfig = res.data.freeDingConfig;
this.shopTableInfo = res.data.shopTableInfo;
this.storeInfo = res.data.storeInfo;
@@ -438,22 +446,26 @@
return;
}
this.isSocket = true;
this.isPointsChecked = false;
this.listinfoid = msg.data.id
this.listinfo.details = msg.data.detailList;
this.setPayAmount(msg.data)
uni.$off('getMessage')
this.orderorderInfo(1)
this.getCalcUsablePoints()
}
break;
case 'addCart':
this.isSocket = true;
if ( this.eatModel == "dine-in" && this.tableCode ) {
this.isPointsChecked = false;
if (this.listinfoid) {
this.orderorderInfo()
} else {
this.listinfo.details = msg.data;
this.setPayAmount(msg)
}
this.getCalcUsablePoints()
}
break;
@@ -466,12 +478,14 @@
}, 1000)
break;
case 'addcart':
this.isPointsChecked = false;
if (this.listinfoid) {
this.orderorderInfo()
} else {
this.listinfo.details = msg.data;
this.setPayAmount(msg)
}
this.getCalcUsablePoints()
this.isSocket = true;
break;
}
@@ -618,7 +632,7 @@
"sendType": this.sendType,
"remark": this.remark,
}
if ( this.calcUsablePointsData.pointsNum && this.calcUsablePointsData.pointsNum > 0) {
if ( this.isPointsChecked && this.calcUsablePointsData.pointsNum && this.calcUsablePointsData.pointsNum > 0) {
params.pointsNum = this.calcUsablePointsData.pointsNum;
}
let res = await this.api.creatOrder(params)