feat: 商品详情支付交互调试
This commit is contained in:
@@ -66,7 +66,7 @@ import Calender from "@/components/Calender/index.vue";
|
||||
const calendarVisible = ref(false);
|
||||
const goodsData = ref({});
|
||||
const goodConfirmRef = ref(null);
|
||||
const selectedDate = ref("");
|
||||
const selectedDate = ref();
|
||||
const priceData = ref([]);
|
||||
|
||||
// 获取商品详情数据
|
||||
@@ -117,25 +117,40 @@ const showConfirmPopup = () => {
|
||||
|
||||
// 处理确认订单
|
||||
const handleConfirmOrder = async (orderData) => {
|
||||
console.log("确认订单:", orderData);
|
||||
// const commodityId = orderData.commodityId;
|
||||
// const purchaseAmount = orderData.purchaseAmount;
|
||||
// const checkInData = orderData.checkInData;
|
||||
// const checkOutData = orderData.checkOutData;
|
||||
// const consumerInfoEntityList = orderData.consumerInfoEntityList;
|
||||
// const payWay = "0";
|
||||
// const paySource = "1";
|
||||
console.log("确认订单---1:", orderData);
|
||||
const { goodsData } = orderData;
|
||||
// 购买的商品id
|
||||
const commodityId = goodsData.commodityId;
|
||||
// 消费者信息
|
||||
const consumerInfoEntityList = orderData.userFormList;
|
||||
// 购买数量
|
||||
const purchaseAmount = orderData.userFormList.length;
|
||||
// 支付方式 0-微信 1-支付宝 2-云闪付
|
||||
const payWay = "0";
|
||||
// 支付渠道 0-app 1-小程序 2-h5
|
||||
const paySource = "1";
|
||||
|
||||
// const params = {
|
||||
// commodityId,
|
||||
// purchaseAmount,
|
||||
// payWay,
|
||||
// paySource,
|
||||
// consumerInfoEntityList,
|
||||
// checkInData,
|
||||
// checkOutData,
|
||||
// };
|
||||
// const res = await orderPay(params);
|
||||
const params = {
|
||||
commodityId,
|
||||
purchaseAmount,
|
||||
payWay,
|
||||
paySource,
|
||||
consumerInfoEntityList,
|
||||
};
|
||||
|
||||
//酒店类型添加入住时间、离店时间
|
||||
if (goodsData.commodityTypeCode === "0" && selectedDate.value) {
|
||||
const { startDate, endDate } = selectedDate.value;
|
||||
// 入住时间
|
||||
params.checkInData = startDate;
|
||||
// 离店时间
|
||||
params.checkOutData = endDate;
|
||||
}
|
||||
|
||||
// 购买数量
|
||||
|
||||
const res = await orderPay(params);
|
||||
console.log("确认订单---2:", res);
|
||||
|
||||
// 仅作为示例,非真实参数信息。
|
||||
// uni.requestPayment({
|
||||
|
||||
Reference in New Issue
Block a user