完成订单详情

This commit is contained in:
wwz
2025-03-13 09:15:51 +08:00
parent 7dde4ed754
commit e6ca187e5a
14 changed files with 219 additions and 176 deletions

View File

@@ -33,10 +33,10 @@
<!-- #endif -->
</view>
<!-- 先下单后支付 -->
<!-- x详情 -->
<orderInfoAfter ref="orderInfoAfterRef" :rechargeFreeChecked="rechargeFreeChecked" :freeCheck="freeCheck"
:listinfo="listinfo" :orderVIP="orderVIP" :ordershopUserInfo='ordershopUserInfo' @istype="istype"
@clickPointsamount='clickPointsamount'>
@clickPointsamount='clickPointsamount' @learcoupons="learcoupons">
</orderInfoAfter>
<!-- 先支付后下单 -->
@@ -85,8 +85,7 @@
</view>
</view>
<view style="width: 100%;height: 200rpx;"> </view>
<payPassword ref="payPasswordref" :isShow="ispws" @inputComplete="accountPayevent"
:password='payPasswordPassword' @close="ispws = false" />
<payPassword ref="payPasswordref" :isShow="ispws" @inputComplete="accountPayevent" @close="ispws = false" />
</view>
</template>
@@ -159,7 +158,10 @@
Productroll: 0,
coupondiscountAmount: 0,
couponInfoList: '',
pointsDiscountAmount: 0
pointsDiscountAmount: 0,
packFee: 0,
totalPrices: 0,
Seatcharge: 0
})
// 会员信息
@@ -195,24 +197,40 @@
// }
}
// 历史订单
if (listinfo.detailMap) {
let combinedArray = [];
for (const key in listinfo.detailMap) {
if (listinfo.detailMap.hasOwnProperty(key)) {
let subArray = listinfo.detailMap[key];
combinedArray = [...combinedArray, ...subArray]
try {
// 历史订单
if (listinfo.detailMap) {
let combinedArray = [];
for (const key in listinfo.detailMap) {
if (listinfo.detailMap.hasOwnProperty(key)) {
let subArray = listinfo.detailMap[key];
combinedArray = [...combinedArray, ...subArray]
}
}
}
listinfo.combinedArray = combinedArray
setTimeout(async () => {
listinfo.combinedArray = combinedArray
listinfo.packFee = await cartStore.getTotalPackFee(listinfo.combinedArray)
// 计算购物车商品费用
listinfo.totalPrices = await cartStore.getTotalTotalPrices(listinfo.combinedArray)
listinfo.totalPrices = await cartStore.getTotalTotalPrices(listinfo
.combinedArray)
// 餐位费listinfo.seatNum
listinfo.Seatcharge = await cartStore.getTotalSeatcharge(listinfo.seatNum)
})
}
if (listinfo.discountInfo) {
const discountObj = JSON.parse(listinfo.discountInfo);
const tempArray = [];
for (const [key, value] of Object.entries(discountObj)) {
tempArray.push({
name: key,
amount: value
});
}
listinfo.discountInfo = tempArray;
console.log(tempArray)
}
} catch (e) {
}
}
}
@@ -220,8 +238,8 @@
watchEffect(async () => {
if (listinfo.combinedArray.length > 0) {
//总价格
console.log(listinfo.combinedArray, listinfo.packFee, listinfo.totalPrices, listinfo.Seatcharge,
listinfo.Productroll, listinfo.coupondiscountAmount)
// console.log(listinfo.combinedArray, listinfo.packFee, listinfo.totalPrices, listinfo.Seatcharge,
// listinfo.Productroll, listinfo.coupondiscountAmount)
// 打包费packFee 计算购物车商品费用totalPrices 餐位费Seatcharge
let sum = (is_type.value != 0 ? listinfo.packFee : 0) + listinfo.totalPrices + (is_type.value ==
0 ? listinfo.Seatcharge : 0);
@@ -234,7 +252,8 @@
listinfo.totalCost = Math.round(sums * 100) / 100;
// 积分
if (listinfo.totalCost && listinfo.status == 'unpaid') {
await memberPointscalcUsablePoints()
uni.$u.debounce(await memberPointscalcUsablePoints(), 500)
}
}
});
@@ -286,15 +305,6 @@
listinfo.coupondiscountAmount = data.item.discountAmount
uniqueIds.value.push(data.item.id)
orderInfoAfterRef.value.dataprocessing(data)
} else {
if (listinfo.coupondiscountAmount > 0) {
listinfo.coupondiscountAmount = 0
uniqueIds.value.pop()
orderInfoAfterRef.value.dataprocessing({
typeOrder: 1,
item: ''
})
}
}
} else {
// 筛选出商品卷的id
@@ -310,7 +320,17 @@
};
const payPasswordPassword = ref('')
const learcoupons = (data) => {
console.log('qing')
if (data == 'product') {
uniqueIds.value = [] // 筛选出商品卷的id
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
listinfo.Productroll = 0 // 商品卷总价价格
} else {
uniqueIds.value = [] // 筛选出商品卷的id
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
}
}
// * 去支付
const goToPay = async () => {
@@ -333,7 +353,6 @@
})
} else {
payPasswordPassword.value = ''
ispws.value = true
}
return false
@@ -362,9 +381,7 @@
buyerRemark: '',
returnUrl: ''
})
if (res) {
await orderorderInfo()
}
await orderorderInfo()
}
//002-获取订单可用积分及抵扣金额(支付页面使用)
@@ -414,11 +431,10 @@
buyerRemark: '',
returnUrl: ''
})
await orderorderInfo()
} catch (error) {
//TODO handle the exception
}
payPasswordPassword.value = ''
orderorderInfo()
}
onUnmounted(() => {
@@ -447,7 +463,7 @@
orderVIP.value = res
ordershopUserInfo.value = res.shopInfo
}
await orderorderInfo()
orderorderInfo()
})
</script>
@@ -549,7 +565,7 @@
.head {
display: flex;
justify-content: space-between;
padding: 50rpx 34rpx 32rpx 34rpx;
padding: 50rpx 0 32rpx 0;
border-bottom: 2rpx dashed #E3E3E3;
.head_left {
@@ -653,7 +669,7 @@
}
.item {
margin-bottom: 32rpx;
padding: 32rpx 0 !important;
display: flex;
.cover {}