1
This commit is contained in:
@ -164,10 +164,11 @@ export const getDonationSummary = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 抖音审核
|
// 抖音审核
|
||||||
export const getdouyReview = () => {
|
export const getdouyReview = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: DOUY_REVIEW,
|
url: DOUY_REVIEW,
|
||||||
method: "GET"
|
method: "POST",
|
||||||
|
data,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="payBtn" @click.stop="writeOff">
|
<view class="payBtn" @click.stop="writeOff">
|
||||||
核销
|
预约
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -147,6 +147,12 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
InfoCell,
|
InfoCell,
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
orderId: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
imgPrefix,
|
imgPrefix,
|
||||||
@ -156,7 +162,7 @@ export default {
|
|||||||
ORDER_TYPE_RESERVATION,
|
ORDER_TYPE_RESERVATION,
|
||||||
ORDER_TYPE_SITE,
|
ORDER_TYPE_SITE,
|
||||||
orderType: ORDER_TYPE_RESERVATION,
|
orderType: ORDER_TYPE_RESERVATION,
|
||||||
selectedPetType: PET_TYPE_CAT, // 默认选中“猫”
|
selectedPetType: PET_TYPE_CAT, // 默认选中"猫"
|
||||||
petInfo: {}, // 兼容下游,取 selectedPets[0]
|
petInfo: {}, // 兼容下游,取 selectedPets[0]
|
||||||
selectedPets: [], // 多选宠物列表
|
selectedPets: [], // 多选宠物列表
|
||||||
parkState: "",
|
parkState: "",
|
||||||
@ -168,11 +174,24 @@ export default {
|
|||||||
address: null,
|
address: null,
|
||||||
catHtmlData: "",
|
catHtmlData: "",
|
||||||
dogHtmlData: "",
|
dogHtmlData: "",
|
||||||
tip: ''
|
tip: '',
|
||||||
|
localOrderId: null, // 本地存储的 orderId
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initData();
|
this.initData();
|
||||||
|
// 如果有传入的 orderId,保存到本地
|
||||||
|
if (this.orderId) {
|
||||||
|
this.localOrderId = this.orderId;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 监听 orderId 变化
|
||||||
|
orderId(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.localOrderId = newVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 展示价格:discount_price 数组相加的总和
|
// 展示价格:discount_price 数组相加的总和
|
||||||
@ -186,26 +205,87 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 用于接收从父页面传递的数据
|
||||||
|
onShowFun(orderId) {
|
||||||
|
if (orderId) {
|
||||||
|
this.localOrderId = orderId;
|
||||||
|
}
|
||||||
|
},
|
||||||
// 核销按钮点击处理
|
// 核销按钮点击处理
|
||||||
async writeOff () {
|
async writeOff () {
|
||||||
const data = {
|
// 校验必填项
|
||||||
goods_order_id:1, //抖音商品订单id(整数)
|
if (Object.keys(this.reservationTime).length === 0) {
|
||||||
order_date:'2026-03-01', //预约日期(‘2026-03-01’格式)
|
uni.showToast({
|
||||||
period_id:1, //预约时间段id(整数)
|
title: "请选择预约时间",
|
||||||
address_id:1, //地址id(整数)
|
icon: "none",
|
||||||
recipient_name:'用户姓名', //用户姓名
|
});
|
||||||
phone:123, //用户手机
|
return;
|
||||||
park_desc:123, //停车描述
|
}
|
||||||
note:'哈哈' // 备注
|
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) => {
|
getdouyReview(data).then((res) => {
|
||||||
|
uni.hideLoading();
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "预约成功",
|
title: "预约成功",
|
||||||
icon: "none",
|
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) {
|
getPetShortName(pet) {
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
<reservation
|
<reservation
|
||||||
v-show="activePageId === 'reservationPage'"
|
v-show="activePageId === 'reservationPage'"
|
||||||
ref="reservationPage"
|
ref="reservationPage"
|
||||||
|
:orderId="orderId"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<tab-bar
|
<tab-bar
|
||||||
@ -60,6 +61,7 @@ export default {
|
|||||||
path: "/pages/client/index/index",
|
path: "/pages/client/index/index",
|
||||||
},
|
},
|
||||||
getUserInfoPromise: null, // 用于防止重复调用 getUserInfo
|
getUserInfoPromise: null, // 用于防止重复调用 getUserInfo
|
||||||
|
orderId: null, // 存储从订单页面传递过来的 orderId
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -165,12 +167,17 @@ export default {
|
|||||||
this.$store.dispatch('user/setReferrerID', Number(option.referrerID) || 0);
|
this.$store.dispatch('user/setReferrerID', Number(option.referrerID) || 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理从订单页面传递的 orderId
|
||||||
|
if (option?.orderId) {
|
||||||
|
this.orderId = option.orderId;
|
||||||
|
}
|
||||||
|
|
||||||
// 处理页面跳转参数
|
// 处理页面跳转参数
|
||||||
if (option?.activePageId) {
|
if (option?.activePageId) {
|
||||||
const targetPageId = option.activePageId;
|
const targetPageId = option.activePageId;
|
||||||
// 如果目标页面与当前页面不同,触发切换
|
// 如果目标页面与当前页面不同,触发切换
|
||||||
if (this.activePageId !== targetPageId) {
|
if (this.activePageId !== targetPageId) {
|
||||||
this.handleTabChange([targetPageId]);
|
this.handleTabChange([targetPageId], option.orderId);
|
||||||
} else {
|
} else {
|
||||||
this.activePageId = targetPageId;
|
this.activePageId = targetPageId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,7 +104,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="flex-center fs-24 app-fc-white status-btn confirm"
|
class="flex-center fs-24 app-fc-white status-btn confirm"
|
||||||
@click.stop="jumpToReservation"
|
@click.stop="jumpToReservation(data.order_id)"
|
||||||
>
|
>
|
||||||
立即预约
|
立即预约
|
||||||
</view>
|
</view>
|
||||||
@ -335,16 +335,27 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
outOrderNo: "DYG177556196373493862814838179",
|
outOrderNo: "DYG177556196373493862814838179",
|
||||||
refundInfo: {
|
refundInfo: {
|
||||||
reason:["计划有变,暂时不需要了"],
|
reason: ["计划有变,暂时不需要了"]
|
||||||
reasonCode:[401],
|
},
|
||||||
},
|
// refundInfo: {
|
||||||
goodsList: [
|
// reason:["计划有变,暂时不需要了"],
|
||||||
{ goodsId: "7625832097692813354", goodsType: 1, quantity: 1 },
|
// 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({
|
plugin.applyRefund({
|
||||||
goodsList: res1.data.goodsList,
|
itemOrderList:res1.data.itemOrderList,
|
||||||
|
// goodsList: res1.data.goodsList,
|
||||||
outOrderNo: res1.data.outOrderNo,
|
outOrderNo: res1.data.outOrderNo,
|
||||||
refundInfo: res1.data.refundInfo,
|
refundInfo: res1.data.refundInfo,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
@ -453,9 +464,9 @@ export default {
|
|||||||
jumpToDetails() {
|
jumpToDetails() {
|
||||||
this.$emit("jumpToDetails", this.data);
|
this.$emit("jumpToDetails", this.data);
|
||||||
},
|
},
|
||||||
jumpToReservation() {
|
jumpToReservation(orderId) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/client/index/index?activePageId=reservationPage",
|
url: `/pages/client/index/index?activePageId=reservationPage&orderId=${orderId}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user