完善功能
This commit is contained in:
@ -34,6 +34,10 @@
|
||||
<view>优惠券</view>
|
||||
<view>-¥{{ bill.coupon }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view>团购券</view>
|
||||
<view>-¥{{ bill.groupCoupon || 0 }}</view>
|
||||
</view>
|
||||
<view class="flex justify-between items-center text-24rpx text-[#909399] leading-34rpx mt-16rpx">
|
||||
<view>会员八折</view>
|
||||
<view>-¥{{ bill.discount }}</view>
|
||||
@ -149,7 +153,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="mr-30rpx">
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click="ChooseRoomReserve.handleReserve">立即预定</wd-button>
|
||||
<wd-button custom-class='!bg-[#4C9F44] !rounded-8rpx !h-70rpx' @click="ChooseRoomReserve.handleSubmitOrder">立即预定</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -200,6 +204,7 @@
|
||||
|
||||
// 团购优惠券ID
|
||||
const groupCouponId = ref<number>(0)
|
||||
const groupCouponOrderId = ref<number>(0)
|
||||
const groupCoupon = ref<any>({})
|
||||
const groupCouponHour = ref<number>(0) // 团购券可以抵消几个小时的时间
|
||||
|
||||
@ -215,7 +220,7 @@
|
||||
const selectedCoupon = ref<{id: number, name: string}>({id: 0, name: ''})
|
||||
|
||||
// 计算费用明细 service(服务费) groupCoupon(团购优惠券)
|
||||
const bill = ref<{service: any, groupCoupon: any, discount: number, totalDiscount: number, coupon: number, total: number}>({
|
||||
const bill = ref<{service: any, groupCoupon: number, discount: number, totalDiscount: number, coupon: number, total: number}>({
|
||||
service: {
|
||||
total: 0,
|
||||
unitPrice: 0,
|
||||
@ -226,10 +231,7 @@
|
||||
startHour: '',
|
||||
endHour: ''
|
||||
},
|
||||
groupCoupon: {
|
||||
hour: 0,
|
||||
total: 0
|
||||
},
|
||||
groupCoupon: 0,
|
||||
discount: 0,
|
||||
totalDiscount: 0,
|
||||
coupon: 0,
|
||||
@ -247,6 +249,7 @@
|
||||
id.value = Number(args.id)
|
||||
teaRoomPrice.value = Number(args.price) || 0
|
||||
groupCouponId.value = Number(args.groupCouponId) || 0
|
||||
groupCouponOrderId.value = Number(args.groupCouponOrderId) || 0
|
||||
ChooseRoomReserve.handleInitReserveRoom()
|
||||
|
||||
// 获取用户需求详
|
||||
@ -355,7 +358,7 @@
|
||||
end_time: bill.value.service.endHour,
|
||||
user_coupon_id: selectedCoupon.value.id || 0,
|
||||
hours: bill.value.service.num,
|
||||
group_coupon_id: groupCouponId.value
|
||||
group_coupon_id: groupCouponOrderId.value
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
@ -391,13 +394,14 @@
|
||||
const res = await calculateTeaRoomPrice({
|
||||
room_id: id.value,
|
||||
coupon_id: selectedCoupon.value.id || 0,
|
||||
group_id: bill.value.service.num > 0 ? groupCouponId.value : 0,
|
||||
group_coupon_id: bill.value.service.num > 0 ? groupCouponOrderId.value : 0,
|
||||
nums: bill.value.service.num,
|
||||
})
|
||||
|
||||
bill.value.service.total = res.details.room_price // 茶室价格
|
||||
bill.value.discount = res.details.discount_room_price // 茶室总价
|
||||
bill.value.totalDiscount = res.details.discount_all_price // 总优惠
|
||||
bill.value.groupCoupon = res.details.group_price // 团购优惠
|
||||
bill.value.total = res.details.order_amount // 订单金额
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,6 +89,7 @@
|
||||
// 订单
|
||||
const teaRoomId = ref<number>(0)
|
||||
const groupCouponId = ref<number>(0)
|
||||
const groupCouponOrderId = ref<number>(0)
|
||||
const orderStatus = ref<number>(0) // 订单状态:待使用、退款等
|
||||
const order = ref<ITeaRoomPackageOrderDetailsResult>({
|
||||
pay: 0,
|
||||
@ -124,6 +125,7 @@
|
||||
|
||||
onLoad((args) => {
|
||||
groupCouponId.value = args.groupCouponId
|
||||
groupCouponOrderId.value = args.groupCouponOrderId
|
||||
teaRoomId.value = Number(args.teaRoomId)
|
||||
|
||||
// 获取订单详情
|
||||
@ -256,8 +258,7 @@
|
||||
toast.info('请选择包间')
|
||||
return
|
||||
}
|
||||
|
||||
router.navigateTo(`/bundle/tea-room/choose-room-reserve?groupCouponId=${groupCouponId.value}&storeId=${teaRoomId.value}&id=${couponRoomId.value}&type=${ReserveServiceCategory.ReserveRoom}&price=${couponRoomPrice.value}`)
|
||||
router.navigateTo(`/bundle/tea-room/choose-room-reserve?groupCouponId=${groupCouponId.value}&groupCouponOrderId=${groupCouponOrderId.value}&storeId=${teaRoomId.value}&id=${couponRoomId.value}&type=${ReserveServiceCategory.ReserveRoom}&price=${couponRoomPrice.value}`)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -440,8 +440,7 @@
|
||||
selectedCoupon.value = {id: params.coupon.user_coupon_id, name: `${params.coupon.name}减${params.coupon.coupon_price}` }
|
||||
bill.value.coupon = params.coupon.coupon_price
|
||||
} else {
|
||||
selectedGroupCoupon.value = {id: params.coupon.group_id, name: `团购券-${params.coupon.tea_store_group.title}` }
|
||||
console.log("🚀 ~ selectedGroupCoupon.value:", selectedGroupCoupon.value.name)
|
||||
selectedGroupCoupon.value = {id: params.coupon.id, name: `团购券-${params.coupon.tea_store_group.title}` }
|
||||
bill.value.groupCoupon = params.coupon.coupon_price
|
||||
}
|
||||
|
||||
@ -532,14 +531,14 @@
|
||||
const res = await calculateTeaRoomPrice({
|
||||
room_id: id.value,
|
||||
coupon_id: selectedCoupon.value.id || 0,
|
||||
group_id: selectedGroupCoupon.value.id,
|
||||
group_coupon_id: selectedGroupCoupon.value.id,
|
||||
nums: bill.value.service.num,
|
||||
})
|
||||
|
||||
bill.value.service.total = res.details.room_price // 茶室价格
|
||||
bill.value.discount = res.details.discount_room_price // 茶室总价
|
||||
bill.value.totalDiscount = res.details.discount_all_price // 总优惠
|
||||
bill.value.groupCoupon = res.details.group_price // 总优惠
|
||||
bill.value.groupCoupon = res.details.group_price // 团购优惠
|
||||
bill.value.total = res.details.order_amount // 订单金额
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user