|
@@ -4,7 +4,7 @@ import { handleWeChatPayment } from "../../../../utils/util";
|
|
|
import {
|
|
import {
|
|
|
getTickleContext,
|
|
getTickleContext,
|
|
|
} from "../../../../core/behavior/tickle.behavior";
|
|
} from "../../../../core/behavior/tickle.behavior";
|
|
|
-import { getOrderDetailMethod, orderPayMethod } from "../../request";
|
|
|
|
|
|
|
+import { getOrderDetailMethod, orderPayMethod, applyAfterSaleMethod } from "../../request";
|
|
|
// module/order/pages/select-goods/other-detail.ts
|
|
// module/order/pages/select-goods/other-detail.ts
|
|
|
Page({
|
|
Page({
|
|
|
behaviors: [PageContainerBehavior, DictionariesBehavior],
|
|
behaviors: [PageContainerBehavior, DictionariesBehavior],
|
|
@@ -45,7 +45,7 @@ Page({
|
|
|
refundSubmitSuccessPopupVisible: false,
|
|
refundSubmitSuccessPopupVisible: false,
|
|
|
selectedAfterSaleType: "",
|
|
selectedAfterSaleType: "",
|
|
|
selectedRefundReason: "",
|
|
selectedRefundReason: "",
|
|
|
- refundStatus: "received", // received | not-received
|
|
|
|
|
|
|
+ refundStatus: "",
|
|
|
refundMaxAmount: 0,
|
|
refundMaxAmount: 0,
|
|
|
refundAmount: 0,
|
|
refundAmount: 0,
|
|
|
refundDesc: "",
|
|
refundDesc: "",
|
|
@@ -55,6 +55,10 @@ Page({
|
|
|
price: 0,
|
|
price: 0,
|
|
|
meta1: "",
|
|
meta1: "",
|
|
|
meta2: "",
|
|
meta2: "",
|
|
|
|
|
+ image: "",
|
|
|
|
|
+ patientConditioningProgramId: "",
|
|
|
|
|
+ patientConditioningRecordId: "",
|
|
|
|
|
+ sellType: "",
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
onLoad(options: any) {
|
|
onLoad(options: any) {
|
|
@@ -188,8 +192,9 @@ Page({
|
|
|
statusText: this.getGoodsStatusText(item?.sellType, item?.progress, item?.receiptStatus, item.expressStatus),
|
|
statusText: this.getGoodsStatusText(item?.sellType, item?.progress, item?.receiptStatus, item.expressStatus),
|
|
|
isCanEvaluate: item?.isCanEvaluate, //是否可以评价 false-否 true-是
|
|
isCanEvaluate: item?.isCanEvaluate, //是否可以评价 false-否 true-是
|
|
|
evaluateTime: item?.evaluateTime, //有评价时间就是已评价,是空就是未评价
|
|
evaluateTime: item?.evaluateTime, //有评价时间就是已评价,是空就是未评价
|
|
|
- // [测试数据] 实体商品模拟”退款申请中”,线下服务和线上权益模拟”申请售后”
|
|
|
|
|
- afterSaleStatus: item?.sellType === '1' ? 1 : 0,
|
|
|
|
|
|
|
+ isShowAftersaleButton: item?.isShowAftersaleButton || false,
|
|
|
|
|
+ aftersaleProgressStr: item?.aftersaleProgressStr || '',
|
|
|
|
|
+ aftersaleProgress: item?.aftersaleProgress,
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -295,13 +300,7 @@ Page({
|
|
|
// 仅用于 catchtap 阻止冒泡,避免触发父级 goAppointment
|
|
// 仅用于 catchtap 阻止冒泡,避免触发父级 goAppointment
|
|
|
},
|
|
},
|
|
|
onApplyAfterSale(e: any) {
|
|
onApplyAfterSale(e: any) {
|
|
|
- const { status, goods } = e.currentTarget.dataset;
|
|
|
|
|
- if (status === 1) {
|
|
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: "/module/order/pages/refund-processing/refund-processing"
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const { goods } = e.currentTarget.dataset;
|
|
|
this.setData({
|
|
this.setData({
|
|
|
afterSaleSiteOption: {
|
|
afterSaleSiteOption: {
|
|
|
image: goods.image || '',
|
|
image: goods.image || '',
|
|
@@ -309,12 +308,22 @@ Page({
|
|
|
price: goods.price,
|
|
price: goods.price,
|
|
|
meta1: goods.description || '',
|
|
meta1: goods.description || '',
|
|
|
meta2: `x${goods.quantity}`,
|
|
meta2: `x${goods.quantity}`,
|
|
|
|
|
+ patientConditioningProgramId: goods.id || '',
|
|
|
|
|
+ patientConditioningRecordId: goods.patientConditioningRecordId || '',
|
|
|
|
|
+ sellType: goods.sellType || '',
|
|
|
},
|
|
},
|
|
|
refundMaxAmount: goods.price || 0,
|
|
refundMaxAmount: goods.price || 0,
|
|
|
refundAmount: goods.price || 0,
|
|
refundAmount: goods.price || 0,
|
|
|
afterSalePopupVisible: true,
|
|
afterSalePopupVisible: true,
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
|
|
+ // 点击退款状态,跳转到售后详情页
|
|
|
|
|
+ onAftersaleProgress(e: any) {
|
|
|
|
|
+ const { goods } = e.currentTarget.dataset;
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: `/module/order/pages/refund-processing/refund-processing?id=${goods.id}`,
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
onAfterSalePopupClose() {
|
|
onAfterSalePopupClose() {
|
|
@@ -348,7 +357,6 @@ Page({
|
|
|
selectedRefundReason: reason,
|
|
selectedRefundReason: reason,
|
|
|
refundReasonPopupVisible: false,
|
|
refundReasonPopupVisible: false,
|
|
|
refundConfirmPopupVisible: true,
|
|
refundConfirmPopupVisible: true,
|
|
|
- refundStatus: "received",
|
|
|
|
|
refundAmount: this.data.refundMaxAmount,
|
|
refundAmount: this.data.refundMaxAmount,
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
@@ -357,8 +365,8 @@ Page({
|
|
|
this.setData({ refundConfirmPopupVisible: false });
|
|
this.setData({ refundConfirmPopupVisible: false });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- onChangeRefundStatus(e: WechatMiniprogram.CustomEvent<{ status: "received" | "not-received" }>) {
|
|
|
|
|
- this.setData({ refundStatus: e.detail?.status || "received" });
|
|
|
|
|
|
|
+ onChangeRefundStatus(e: WechatMiniprogram.CustomEvent<{ status: string }>) {
|
|
|
|
|
+ this.setData({ refundStatus: e.detail?.status || "" });
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
onOpenRefundReasonAgain() {
|
|
onOpenRefundReasonAgain() {
|
|
@@ -386,7 +394,7 @@ Page({
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- onSubmitRefundApply() {
|
|
|
|
|
|
|
+ async onSubmitRefundApply() {
|
|
|
if (!this.data.selectedRefundReason) {
|
|
if (!this.data.selectedRefundReason) {
|
|
|
wx.showToast({ title: "请选择退款原因", icon: "none" });
|
|
wx.showToast({ title: "请选择退款原因", icon: "none" });
|
|
|
return;
|
|
return;
|
|
@@ -395,12 +403,29 @@ Page({
|
|
|
wx.showToast({ title: "请上传凭证图片", icon: "none" });
|
|
wx.showToast({ title: "请上传凭证图片", icon: "none" });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- this.setData({
|
|
|
|
|
- refundConfirmPopupVisible: false,
|
|
|
|
|
- });
|
|
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: "/module/order/pages/refund-success/refund-success",
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ wx.showLoading({ title: "提交中" });
|
|
|
|
|
+ const { afterSaleSiteOption, selectedAfterSaleType, refundStatus, selectedRefundReason, refundAmount, refundProofImages, refundDesc } = this.data;
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ patientConditioningRecordId: (afterSaleSiteOption as any).patientConditioningRecordId,
|
|
|
|
|
+ patientConditioningProgramId: (afterSaleSiteOption as any).patientConditioningProgramId,
|
|
|
|
|
+ type: selectedAfterSaleType,
|
|
|
|
|
+ receiptStatus: (afterSaleSiteOption as any).sellType === '1' ? refundStatus : '',
|
|
|
|
|
+ reason: selectedRefundReason,
|
|
|
|
|
+ applyAmount: refundAmount,
|
|
|
|
|
+ voucherImgs: refundProofImages,
|
|
|
|
|
+ remark: refundDesc,
|
|
|
|
|
+ };
|
|
|
|
|
+ console.log(params, "参数111")
|
|
|
|
|
+ try {
|
|
|
|
|
+ await applyAfterSaleMethod(params);
|
|
|
|
|
+ this.setData({ refundConfirmPopupVisible: false });
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: "/module/order/pages/refund-success/refund-success",
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (error: any) {
|
|
|
|
|
+ wx.showToast({ title: error.errMsg || "提交失败", icon: "none" });
|
|
|
|
|
+ }
|
|
|
|
|
+ wx.hideLoading();
|
|
|
},
|
|
},
|
|
|
onReview(e: WechatMiniprogram.TouchEvent) {
|
|
onReview(e: WechatMiniprogram.TouchEvent) {
|
|
|
console.log(e.currentTarget.dataset);
|
|
console.log(e.currentTarget.dataset);
|