霸王餐更改

This commit is contained in:
wwz
2025-03-25 21:58:59 +08:00
parent 1169e300df
commit 3a6fa55234
14 changed files with 130 additions and 100 deletions

View File

@@ -70,7 +70,7 @@
<view class="price">
<view class="priceAmount">
{{orderVIP.isVip ==1 && ordershopUserInfo.isMemberPrice==1?item.memberPrice:item.price}}
{{orderVIP.isVip ==1 && ordershopUserInfo.isMemberPrice==1?(item.memberPrice|| item.price):item.price}}
</view>
<view class="num">x{{item.num}}</view>
</view>
@@ -122,8 +122,7 @@
<!-- 支付之前 -->
<block v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
<view v-for="(item,indexe) in favorablelist" :key="indexe">
<view class="favorable" :class="{column:item.value.length>0&&item.type=='product'}"
@click="goUrl(item)">
<view class="favorable" :class="{column:item.type=='product'}" @click="goUrl(item)">
<view class="favorable_left">
<text class="name"> {{ item.name }} </text>
</view>
@@ -161,7 +160,7 @@
</view>
</block>
<block v-else>
<view class="cell-item column" v-if="listinfo.discountInfo.length > 0">
<view class="cell-item column" v-if="listinfo.discountInfo">
<view class="label">优惠折扣</view>
<view class="val column">
<view class="productCoupon" v-for="(item,index) in listinfo.discountInfo" :key="index">
@@ -343,6 +342,7 @@
// 跳转
const goUrl = (item) => {
console.log(props.listinfo.totalPrices, props.listinfo.Productroll)
if (props.changeFreeenable) {
uni.showToast({
title: '不可与其他优惠共享!',
@@ -360,7 +360,8 @@
type: "confirm_order_coupon",
shopId: uni.cache.get('orderVIP').shopId,
shopUserId: props.orderVIP.id,
payAmount: props.listinfo.totalCost,
payAmount: (parseFloat(props.listinfo.totalPrices) - parseFloat(props.listinfo
.Productroll)).toFixed(2),
shoppingCart: JSON.stringify(props.listinfo.combinedArray)
})
break;

View File

@@ -336,6 +336,7 @@
Orderinfo.shopUserId = options.shopUserId
Orderinfo.payAmount = options.payAmount
console.log(Orderinfo.payAmount)
Orderinfo.shoppingCart = JSON.parse(decodeURIComponent(options.shoppingCart))
}
getCouponList()

View File

@@ -173,13 +173,6 @@
})
if (res) {
Object.assign(listinfo, res);
// if (listinfo.status == 'unpaid') {
// try {
// let res = await APIhistoryOrder({
// orderId: orderId.value
// })
// } catch (error) {}
// }
// 历史订单
if (listinfo.detailMap) {
let combinedArray = [];
@@ -190,12 +183,12 @@
}
}
listinfo.combinedArray = combinedArray
listinfo.packFeess = await cartStore.getTotalPackFee(listinfo.combinedArray)
listinfo.packFeess = cartStore.getTotalPackFee(listinfo.combinedArray)
// 计算购物车商品费用
listinfo.totalPrices = await cartStore.getTotalTotalPrices(listinfo
.combinedArray)
listinfo.totalPrices = cartStore.getTotalTotalPrices(listinfo
.combinedArray, changeFreeenable)
// 餐位费listinfo.seatNum
listinfo.Seatcharge = await cartStore.getTotalSeatcharge(listinfo.seatNum)
listinfo.Seatcharge = cartStore.getTotalSeatcharge(listinfo.seatNum)
}
if (listinfo.discountInfo) {
const discountObj = JSON.parse(listinfo.discountInfo);
@@ -207,8 +200,10 @@
});
}
listinfo.discountInfo = tempArray;
console.log(tempArray)
}
// 回填先质控
listinfo.pointsDiscountAmount = 0
// console.log(listinfo)
}
}
@@ -231,6 +226,7 @@
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
.coupondiscountAmount || 0) - (listinfo.pointsDiscountAmount || 0);
listinfo.totalCost = Math.round(sums * 100) / 100;
// 霸王餐
try {
console.log(orderVIP.value.freeDineConfig.enable, changeFreeenable.value)
@@ -257,12 +253,13 @@
const changeFreeenable = ref(false)
const changeFree = (e) => {
console.log(e)
if (e) {
orderInfoAfterRef.value.bwcclear()
uniqueIds.value = [] // 筛选出商品卷的id
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
listinfo.pointsNum = 0 // 商品卷总价价格
let res = cartStore.getTotalTotalPrices(listinfo.combinedArray, 1)
console.log(res)
// 支付方式切换
// #ifdef MP-WEIXIN
paymentMethodref.value.groupChanges(2)
@@ -453,7 +450,7 @@
amount: listinfo.totalCost, // 最终订单金额
returnUrl: '', //跳转地址
buyerRemark: '',
seatNum: listinfo.seatNum
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //用餐人数
})
return false;
} else {
@@ -549,9 +546,13 @@
onShow(() => {
console.log(uni.cache.get('orderVIP'))
try {
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
// 更新数据
if (orderVIP.value) {
orderVIP.value = uni.cache.get('orderVIP')
ordershopUserInfo.value = orderVIP.value.shopInfo
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
}
} catch (error) {
//TODO handle the exception
}