This commit is contained in:
2026-04-08 16:11:18 +08:00
parent 078e0bc8ab
commit 124beb0666
4 changed files with 126 additions and 27 deletions

View File

@ -164,10 +164,11 @@ export const getDonationSummary = () => {
};
// 抖音审核
export const getdouyReview = () => {
export const getdouyReview = (data) => {
return request({
url: DOUY_REVIEW,
method: "GET"
method: "POST",
data,
});
};

View File

@ -96,7 +96,7 @@
</view> -->
</view>
<view class="payBtn" @click.stop="writeOff">
核销
预约
</view>
</view>
</view>
@ -147,6 +147,12 @@ export default {
components: {
InfoCell,
},
props: {
orderId: {
type: [String, Number],
default: null
}
},
data() {
return {
imgPrefix,
@ -156,7 +162,7 @@ export default {
ORDER_TYPE_RESERVATION,
ORDER_TYPE_SITE,
orderType: ORDER_TYPE_RESERVATION,
selectedPetType: PET_TYPE_CAT, // 默认选中“猫”
selectedPetType: PET_TYPE_CAT, // 默认选中"猫"
petInfo: {}, // 兼容下游,取 selectedPets[0]
selectedPets: [], // 多选宠物列表
parkState: "",
@ -168,11 +174,24 @@ export default {
address: null,
catHtmlData: "",
dogHtmlData: "",
tip: ''
tip: '',
localOrderId: null, // 本地存储的 orderId
};
},
mounted() {
this.initData();
// 如果有传入的 orderId保存到本地
if (this.orderId) {
this.localOrderId = this.orderId;
}
},
watch: {
// 监听 orderId 变化
orderId(newVal) {
if (newVal) {
this.localOrderId = newVal;
}
}
},
computed: {
// 展示价格discount_price 数组相加的总和
@ -186,26 +205,87 @@ export default {
}
},
methods: {
// 用于接收从父页面传递的数据
onShowFun(orderId) {
if (orderId) {
this.localOrderId = orderId;
}
},
// 核销按钮点击处理
async writeOff () {
const data = {
goods_order_id:1, //抖音商品订单id整数
order_date:'2026-03-01', //预约日期2026-03-01格式
period_id:1, //预约时间段id整数
address_id:1, //地址id整数
recipient_name:'用户姓名', //用户姓名
phone:123, //用户手机
park_desc:123, //停车描述
note:'哈哈' // 备注
// 校验必填项
if (Object.keys(this.reservationTime).length === 0) {
uni.showToast({
title: "请选择预约时间",
icon: "none",
});
return;
}
if (!this.address) {
uni.showToast({
title: "请选择服务地址",
icon: "none",
});
return;
}
if (!this.parkState) {
uni.showToast({
title: "请选择停车状况",
icon: "none",
});
return;
}
if (!this.localOrderId) {
uni.showToast({
title: "订单ID缺失",
icon: "none",
});
return;
}
const data = {
goods_order_id: Number(this.localOrderId), //抖音商品订单id整数
order_date: this.reservationTime.date, //预约日期('2026-03-01'格式)
period_id: Number(this.reservationTime.id), //预约时间段id整数
address_id: Number(this.address.id), //地址id整数
recipient_name: this.address.name || '用户姓名', //用户姓名
phone: this.address.phone || '', //用户手机
park_desc: this.otherParkState || this.parkState || '', //停车描述
note: '' // 备注
};
uni.showLoading({
title: "处理中",
mask: true,
});
getdouyReview(data).then((res) => {
uni.hideLoading();
if (res.code == 0) {
uni.showToast({
title: "预约成功",
icon: "none",
});
}
});
// 预约成功后清空数据并跳转
setTimeout(() => {
uni.reLaunch({
url: "/pages/client/index/index?activePageId=homePage",
});
}, 1500);
} else {
uni.showToast({
title: res.msg || "预约失败",
icon: "none",
});
}
}).catch((err) => {
uni.hideLoading();
console.error("预约失败:", err);
uni.showToast({
title: "预约失败,请重试",
icon: "none",
});
});
},
getPetShortName(pet) {

View File

@ -21,6 +21,7 @@
<reservation
v-show="activePageId === 'reservationPage'"
ref="reservationPage"
:orderId="orderId"
/>
</view>
<tab-bar
@ -60,6 +61,7 @@ export default {
path: "/pages/client/index/index",
},
getUserInfoPromise: null, // 用于防止重复调用 getUserInfo
orderId: null, // 存储从订单页面传递过来的 orderId
};
},
methods: {
@ -165,12 +167,17 @@ export default {
this.$store.dispatch('user/setReferrerID', Number(option.referrerID) || 0);
}
// 处理从订单页面传递的 orderId
if (option?.orderId) {
this.orderId = option.orderId;
}
// 处理页面跳转参数
if (option?.activePageId) {
const targetPageId = option.activePageId;
// 如果目标页面与当前页面不同,触发切换
if (this.activePageId !== targetPageId) {
this.handleTabChange([targetPageId]);
this.handleTabChange([targetPageId], option.orderId);
} else {
this.activePageId = targetPageId;
}

View File

@ -104,7 +104,7 @@
</view>
<view
class="flex-center fs-24 app-fc-white status-btn confirm"
@click.stop="jumpToReservation"
@click.stop="jumpToReservation(data.order_id)"
>
立即预约
</view>
@ -335,16 +335,27 @@ export default {
data: {
outOrderNo: "DYG177556196373493862814838179",
refundInfo: {
reason:["计划有变,暂时不需要了"],
reasonCode:[401],
},
goodsList: [
{ goodsId: "7625832097692813354", goodsType: 1, quantity: 1 },
],
reason: ["计划有变,暂时不需要了"]
},
// refundInfo: {
// reason:["计划有变,暂时不需要了"],
// reasonCode:[401],
// },
itemOrderList:[
{
"itemOrderId": "1093391915337944382",
"refundAmount": 9000
}],
// goodsList: [
// { goodsId: "7625832097692813354", goodsType: 1, quantity: 1 },
// ],
},
};
// console.log('applyRefund options', JSON.stringify(options))
console.log(res1.data,'??')
plugin.applyRefund({
goodsList: res1.data.goodsList,
itemOrderList:res1.data.itemOrderList,
// goodsList: res1.data.goodsList,
outOrderNo: res1.data.outOrderNo,
refundInfo: res1.data.refundInfo,
success: (res) => {
@ -453,9 +464,9 @@ export default {
jumpToDetails() {
this.$emit("jumpToDetails", this.data);
},
jumpToReservation() {
jumpToReservation(orderId) {
uni.reLaunch({
url: "/pages/client/index/index?activePageId=reservationPage",
url: `/pages/client/index/index?activePageId=reservationPage&orderId=${orderId}`,
});
},
},