This commit is contained in:
2026-04-08 10:47:25 +08:00
parent 1739401cb8
commit 078e0bc8ab
2 changed files with 552 additions and 428 deletions

View File

@ -1,21 +1,30 @@
<template> <template>
<view class="order-item"> <view class="order-item">
<view class="flex-row-between order-title" @click="jumpToDetails"> <view class="flex-row-between order-title" @click="jumpToDetails">
<text class="fs-24 app-fc-normal"> <text class="fs-24 app-fc-normal">
订单编号{{ data.order_no || "-" }} 订单编号{{ data.order_no || "-" }}
</text> </text>
<!-- 待支付状态显示倒计时横幅 --> <!-- 待支付状态显示倒计时横幅 -->
<view v-if="data.status === SHOP_ORDER_UNPAY && !data.tui_status && countDownTime > 0" <view
class="order-status-banner"> v-if="
<view class="status-banner-left"> data.status === SHOP_ORDER_UNPAY &&
<text class="status-text">等待付款</text> !data.tui_status &&
</view> countDownTime > 0
<view class="status-banner-right"> "
<text class="countdown-text">{{ formatCountdown(countDownTime) }}</text> class="order-status-banner"
</view> >
</view> <view class="status-banner-left">
<!-- 其他状态显示原有样式 --> <text class="status-text">等待付款</text>
<view v-else-if=" </view>
<view class="status-banner-right">
<text class="countdown-text">{{
formatCountdown(countDownTime)
}}</text>
</view>
</view>
<!-- 其他状态:显示原有样式 -->
<view
v-else-if="
([ ([
SHOP_ORDER_CANCEL, SHOP_ORDER_CANCEL,
SHOP_ORDER_UNPAY, SHOP_ORDER_UNPAY,
@ -26,457 +35,537 @@
].includes(data.status) && ].includes(data.status) &&
!data.tui_status) || !data.tui_status) ||
[SHOP_ORDER_AFTERSALE_REJECT].includes(data.tui_status) [SHOP_ORDER_AFTERSALE_REJECT].includes(data.tui_status)
" class="flex-center fs-24 order-btn" :class="[ "
class="flex-center fs-24 order-btn"
:class="[
![SHOP_ORDER_DONE, SHOP_ORDER_CANCEL, SHOP_ORDER_UNREMARK].includes( ![SHOP_ORDER_DONE, SHOP_ORDER_CANCEL, SHOP_ORDER_UNREMARK].includes(
data.status data.status
) )
? 'app-fc-mark confirm' ? 'app-fc-mark confirm'
: 'cancel', : 'cancel',
]"> ]"
{{ orderStatus }} >
</view> {{ orderStatus }}
<view v-if=" </view>
<view
v-if="
[SHOP_ORDER_AFTERSALE, SHOP_ORDER_AFTERSALE_DONE].includes( [SHOP_ORDER_AFTERSALE, SHOP_ORDER_AFTERSALE_DONE].includes(
data.tui_status data.tui_status
) )
" class="flex-center fs-24 order-btn cancel"> "
{{ refundOrderStatus }} class="flex-center fs-24 order-btn cancel"
</view> >
</view> {{ refundOrderStatus }}
<view class="order-content" :class="{ 'split-border': showStatusBtn }" @click="jumpToDetails"> </view>
<good-info :data="data.items" :actual_price="data.actual_price" /> </view>
<view v-if="data.type && data.type !== 1" class="fs-24 app-fc-mark order-type"> <view
随车订单 class="order-content"
</view> :class="{ 'split-border': showStatusBtn }"
</view> @click="jumpToDetails"
<view v-if="showStatusBtn" class="order-btns"> >
<!-- 待支付 --> <good-info :data="data.items" :actual_price="data.actual_price" />
<template v-if="[SHOP_ORDER_UNPAY].includes(data.status)"> <view
<view class="flex-center fs-24 app-fc-main cancel-order-btn" @click.stop="$emit('cancelOrder', data)"> v-if="data.type && data.type !== 1"
取消订单 class="fs-24 app-fc-mark order-type"
</view> >
<view class="order-btns-right"> 随车订单
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> </view>
</view>
<view v-if="showStatusBtn" class="order-btns">
<!-- 待支付 -->
<template v-if="[SHOP_ORDER_UNPAY].includes(data.status)">
<view
class="flex-center fs-24 app-fc-main cancel-order-btn"
@click.stop="$emit('cancelOrder', data)"
>
取消订单
</view>
<view class="order-btns-right">
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm" @click.stop="$emit('pay', data)"> <view
立即支付 class="flex-center fs-24 app-fc-white status-btn confirm"
</view> @click.stop="$emit('pay', data)"
</view> >
</template> 立即支付
</view>
</view>
</template>
<!-- 待预约 --> <!-- 待预约 -->
<template v-if="[SHOP_ORDER_UNSLIVER].includes(data.status)"> <template v-if="[SHOP_ORDER_UNSLIVER].includes(data.status)">
<view class="order-btns-right"> <view class="order-btns-right">
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="remindRefund(data.order_id)"> <view
申请退款 class="flex-center fs-24 app-fc-main status-btn"
</view> @click.stop="remindRefund(data.order_id)"
<view class="flex-center fs-24 app-fc-white status-btn confirm" >
@click.stop="jumpToReservation"> 申请退款
立即预约 </view>
</view> <view
</view> class="flex-center fs-24 app-fc-white status-btn confirm"
</template> @click.stop="jumpToReservation"
>
立即预约
</view>
</view>
</template>
<!-- 待收货 --> <!-- 待收货 -->
<template v-if="[SHOP_ORDER_UNRECEIVE].includes(data.status)"> <template v-if="[SHOP_ORDER_UNRECEIVE].includes(data.status)">
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('afterSale', data)"> <view
申请售后 class="flex-center fs-24 app-fc-main status-btn"
</view> @click.stop="$emit('afterSale', data)"
<!-- 随车订单不显示物流 --> >
<!-- <view v-if="data.pay_type !== pay_type_BYCAR" class="flex-center fs-24 app-fc-main status-btn" 申请售后
</view>
<!-- 随车订单不显示物流 -->
<!-- <view v-if="data.pay_type !== pay_type_BYCAR" class="flex-center fs-24 app-fc-main status-btn"
@click.stop="$emit('checkSliver', data)"> @click.stop="$emit('checkSliver', data)">
查看物流 查看物流
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm" <view
@click.stop="$emit('confirmSliver', data)"> class="flex-center fs-24 app-fc-white status-btn confirm"
确认收货 @click.stop="$emit('confirmSliver', data)"
</view> >
</template> 确认收货
</view>
</template>
<!-- 已签收未评价 --> <!-- 已签收未评价 -->
<template v-if="[SHOP_ORDER_UNREMARK].includes(data.status)"> <template v-if="[SHOP_ORDER_UNREMARK].includes(data.status)">
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm" @click.stop="$emit('remark', data)"> <view
立即评价 class="flex-center fs-24 app-fc-white status-btn confirm"
</view> @click.stop="$emit('remark', data)"
</template> >
立即评价
</view>
</template>
<!-- 已完成 --> <!-- 已完成 -->
<template v-if="[SHOP_ORDER_DONE].includes(data.status)"> <template v-if="[SHOP_ORDER_DONE].includes(data.status)">
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm " <view
style="visibility: hidden;" class="flex-center fs-24 app-fc-white status-btn confirm"
> style="visibility: hidden"
>
</view> </view>
</template> </template>
<template v-if="[SHOP_ORDER_DONE].includes(data.status)"> <template v-if="[SHOP_ORDER_DONE].includes(data.status)">
<!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)"> <!-- <view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('concactService', data)">
联系客服 联系客服
</view> --> </view> -->
<view class="flex-center fs-24 app-fc-white status-btn confirm" <view
@click.stop="$emit('remarkDetails', data)"> class="flex-center fs-24 app-fc-white status-btn confirm"
查看评价 @click.stop="$emit('remarkDetails', data)"
</view> >
</template> 查看评价
</view> </view>
</view> </template>
</view>
</view>
</template> </template>
<script> <script>
import PopUpModal from "@/components/PopUpModal.vue"; import PopUpModal from "@/components/PopUpModal.vue";
import GoodInfo from "./GoodInfo.vue"; import GoodInfo from "./GoodInfo.vue";
import { import { walletTransaction, cancelPetOrderMall } from "../../../../api/login";
walletTransaction,
cancelPetOrderMall,
} from "../../../../api/login";
import {
SHOP_ORDER_STATUS,
SHOP_ORDER_UNPAY,
SHOP_ORDER_UNSLIVER,
SHOP_ORDER_UNRECEIVE,
SHOP_ORDER_DONE,
SHOP_ORDER_CANCEL,
SHOP_ORDER_AFTERSALE,
SHOP_ORDER_AFTERSALE_DONE,
SHOP_ORDER_AFTERSALE_REJECT,
SHOP_ORDER_AFTERSALE_STATUS,
SHOP_ORDER_UNREMARK,
pay_type_ADDRESS,
pay_type_BYCAR,
pay_type_BYPET
} from "@/constants/app.business";
export default { import {
props: { SHOP_ORDER_STATUS,
data: { SHOP_ORDER_UNPAY,
type: Object, SHOP_ORDER_UNSLIVER,
default: () => {}, SHOP_ORDER_UNRECEIVE,
}, SHOP_ORDER_DONE,
}, SHOP_ORDER_CANCEL,
data() { SHOP_ORDER_AFTERSALE,
return { SHOP_ORDER_AFTERSALE_DONE,
pay_type_ADDRESS, SHOP_ORDER_AFTERSALE_REJECT,
pay_type_BYCAR, SHOP_ORDER_AFTERSALE_STATUS,
pay_type_BYPET, SHOP_ORDER_UNREMARK,
SHOP_ORDER_STATUS, pay_type_ADDRESS,
SHOP_ORDER_UNPAY, pay_type_BYCAR,
SHOP_ORDER_UNSLIVER, pay_type_BYPET,
SHOP_ORDER_UNRECEIVE, } from "@/constants/app.business";
SHOP_ORDER_DONE,
SHOP_ORDER_CANCEL, export default {
SHOP_ORDER_AFTERSALE, props: {
SHOP_ORDER_AFTERSALE_DONE, data: {
SHOP_ORDER_AFTERSALE_REJECT, type: Object,
SHOP_ORDER_UNREMARK, default: () => {},
showCancelModal: false, },
countDownTime: 0, },
countDownTimer: null, data() {
}; return {
}, pay_type_ADDRESS,
components: { pay_type_BYCAR,
GoodInfo, pay_type_BYPET,
PopUpModal SHOP_ORDER_STATUS,
}, SHOP_ORDER_UNPAY,
options: { SHOP_ORDER_UNSLIVER,
styleIsolation: "shared", SHOP_ORDER_UNRECEIVE,
}, SHOP_ORDER_DONE,
computed: { SHOP_ORDER_CANCEL,
// 抖音退款组件需要的订单ID SHOP_ORDER_AFTERSALE,
orderId() { SHOP_ORDER_AFTERSALE_DONE,
return this.data.order_id || this.data.order_no || ""; SHOP_ORDER_AFTERSALE_REJECT,
}, SHOP_ORDER_UNREMARK,
// 抖音退款组件需要的订单状态1=待核销/待发货2=已核销/已发货) showCancelModal: false,
orderStatusForSDK() { countDownTime: 0,
// 根据你的业务状态映射到抖音SDK需要的状态 countDownTimer: null,
// SHOP_ORDER_UNSLIVER = 待发货 -> 映射为 1 };
if (this.data.status === SHOP_ORDER_UNSLIVER) { },
return 1; components: {
} GoodInfo,
// SHOP_ORDER_UNRECEIVE = 待收货 -> 映射为 2 PopUpModal,
if (this.data.status === SHOP_ORDER_UNRECEIVE) { },
return 2; options: {
} styleIsolation: "shared",
return 1; },
}, computed: {
// 订单总金额(单位:分) // 抖音退款组件需要的订单ID
orderTotalAmount() { orderId() {
const price = this.data.actual_price || 0; return this.data.order_id || this.data.order_no || "";
// 转换为分 },
return Math.round(parseFloat(price) * 100); // 抖音退款组件需要的订单状态1=待核销/待发货2=已核销/已发货)
}, orderStatusForSDK() {
// UniApp 需要传入的退款参数对象 // 根据你的业务状态映射到抖音SDK需要的状态
refundParams() { // SHOP_ORDER_UNSLIVER = 待发货 -> 映射为 1
return { if (this.data.status === SHOP_ORDER_UNSLIVER) {
reasonCode: [410], return 1;
note: '用户申请退款', }
applySource: 101, // SHOP_ORDER_UNRECEIVE = 待收货 -> 映射为 2
afterSaleType: 3, if (this.data.status === SHOP_ORDER_UNRECEIVE) {
needRefundPackFee: true return 2;
} }
}, return 1;
orderStatus() { },
return SHOP_ORDER_STATUS[this.data.status] || ""; // 订单总金额(单位:分)
}, orderTotalAmount() {
refundOrderStatus() { const price = this.data.actual_price || 0;
return SHOP_ORDER_AFTERSALE_STATUS[this.data.tui_status] || ""; // 转换为分
}, return Math.round(parseFloat(price) * 100);
showStatusBtn() { },
return ( // UniApp 需要传入的退款参数对象
([ refundParams() {
SHOP_ORDER_UNPAY, return {
SHOP_ORDER_UNSLIVER, reasonCode: [410],
SHOP_ORDER_UNRECEIVE, note: "用户申请退款",
SHOP_ORDER_DONE, applySource: 101,
SHOP_ORDER_UNREMARK, afterSaleType: 3,
].includes(this.data.status) && needRefundPackFee: true,
!this.data.tui_status) || [SHOP_ORDER_AFTERSALE_REJECT].includes(this.data.tui_status) };
); },
}, orderStatus() {
}, return SHOP_ORDER_STATUS[this.data.status] || "";
watch: { },
showCancelModal(val) { refundOrderStatus() {
this.$emit("disableScroll", val); return SHOP_ORDER_AFTERSALE_STATUS[this.data.tui_status] || "";
}, },
'data.daojishi'(newVal) { showStatusBtn() {
if (this.data.status === this.SHOP_ORDER_UNPAY && newVal) { return (
this.countDownTime = newVal; ([
this.startCountDown(); SHOP_ORDER_UNPAY,
} SHOP_ORDER_UNSLIVER,
}, SHOP_ORDER_UNRECEIVE,
'data.status'(newVal) { SHOP_ORDER_DONE,
if (newVal === this.SHOP_ORDER_UNPAY && this.data.daojishi) { SHOP_ORDER_UNREMARK,
this.countDownTime = this.data.daojishi; ].includes(this.data.status) &&
this.startCountDown(); !this.data.tui_status) ||
} else { [SHOP_ORDER_AFTERSALE_REJECT].includes(this.data.tui_status)
this.stopCountDown(); );
} },
}, },
}, watch: {
mounted() { showCancelModal(val) {
// console.log(this.data,'--=') this.$emit("disableScroll", val);
if (this.data.status === SHOP_ORDER_UNPAY && this.data.daojishi) { },
this.countDownTime = this.data.daojishi; "data.daojishi"(newVal) {
this.startCountDown(); if (this.data.status === this.SHOP_ORDER_UNPAY && newVal) {
} this.countDownTime = newVal;
}, this.startCountDown();
beforeDestroy() { }
this.stopCountDown(); },
}, "data.status"(newVal) {
methods: { if (newVal === this.SHOP_ORDER_UNPAY && this.data.daojishi) {
remindRefund(id) { this.countDownTime = this.data.daojishi;
this.startCountDown();
} else {
this.stopCountDown();
}
},
},
mounted() {
// console.log(this.data,'--=')
if (this.data.status === SHOP_ORDER_UNPAY && this.data.daojishi) {
this.countDownTime = this.data.daojishi;
this.startCountDown();
}
},
beforeDestroy() {
this.stopCountDown();
},
methods: {
remindRefund(id) {
const data = { const data = {
id: Number(id), id: Number(id),
}; };
cancelPetOrderMall(data).then((res) => { uni.showLoading({
const plugin = tt.requirePlugin("lifeServicePlugin"); icon: "none",
plugin.applyRefund({ title: "处理中",
goodsList:res.data.goodsList, mask: true,
outOrderNo:res.data.outOrderNo, });
refundInfo:res.data.refundInfo, cancelPetOrderMall(data)
success(res) { .then((res) => {
uni.showToast({ uni.hideLoading();
title: '退款成功', const plugin = tt.requirePlugin("lifeServicePlugin");
icon: 'success' let res1 = {
}) code: 0,
const { outRefundNo } = res; result: "success",
tt.showToast({ title: outRefundNo }); msg: "success",
}, data: {
fail(res) { outOrderNo: "DYG177556196373493862814838179",
console.log("fail", res); refundInfo: {
}, reason:["计划有变,暂时不需要了"],
reasonCode:[401],
},
goodsList: [
{ goodsId: "7625832097692813354", goodsType: 1, quantity: 1 },
],
},
};
plugin.applyRefund({
goodsList: res1.data.goodsList,
outOrderNo: res1.data.outOrderNo,
refundInfo: res1.data.refundInfo,
success: (res) => {
uni.showToast({
title: "退款申请已提交",
icon: "success",
});
this.$emit("refund", this.data);
},
fail: (err) => {
console.log("退款失败:", err);
// 处理session过期错误
if (err && err.errMsg && err.errMsg.includes("session已过期")) {
uni.showModal({
title: "提示",
content: "会话已过期,请重新登录后再试",
showCancel: false,
confirmText: "确定",
success: () => {
// 清除当前用户信息并跳转到登录页
this.$store.dispatch("user/deleteToken");
this.$store.dispatch("user/clearUserInfo");
uni.clearStorageSync();
uni.reLaunch({
url: "/pages/client/auth/index",
});
},
});
} else {
uni.showToast({
title: err?.errMsg || err?.msg || "退款失败,请重试",
icon: "none",
});
}
},
});
})
.catch((err) => {
uni.hideLoading();
console.error("获取退款信息失败:", err);
uni.showToast({
title: err?.msg || "获取退款信息失败",
icon: "none",
});
}); });
},
// 退款回调(组件触发)
handleRefund(event) {
const { status, result, outOrderNo } = event.detail;
console.log("退款回调:", { status, result, outOrderNo });
if (status === "success") {
uni.showToast({
title: "退款申请已提交",
icon: "success",
});
this.$emit("refund", this.data);
} else {
uni.showToast({
title: result?.errMsg || "退款失败,请稍后重试",
icon: "none",
});
}
},
// 错误处理
handleError(event) {
console.error("退款组件报错:", event.detail);
uni.showToast({
title: "组件加载失败,请稍后重试",
icon: "none",
}); });
}, },
// 退款回调(组件触发)
handleRefund(event) { startCountDown() {
const { status, result, outOrderNo } = event.detail this.stopCountDown();
console.log('退款回调:', { status, result, outOrderNo }) if (this.countDownTime > 0) {
this.countDownTimer = setInterval(() => {
if (status === 'success') { if (this.countDownTime > 0) {
uni.showToast({ this.countDownTime--;
title: '退款申请已提交', } else {
icon: 'success' this.stopCountDown();
}) // 倒计时结束,可以触发刷新
this.$emit('refund', this.data) this.$emit("countdownEnd", this.data);
} else { }
uni.showToast({ }, 1000);
title: result?.errMsg || '退款失败,请稍后重试', }
icon: 'none' },
}) stopCountDown() {
} if (this.countDownTimer) {
}, clearInterval(this.countDownTimer);
this.countDownTimer = null;
// 错误处理 }
handleError(event) { },
console.error('退款组件报错:', event.detail) formatCountdown(seconds) {
uni.showToast({ const hour = Math.floor(seconds / 3600);
title: '组件加载失败,请稍后重试', const minutes = Math.floor((seconds - hour * 3600) / 60);
icon: 'none' return `${hour}小时${minutes}分钟`;
}) },
}, orderCancel() {
this.showCancelModal = false;
startCountDown() { },
this.stopCountDown(); cancel() {
if (this.countDownTime > 0) { this.showCancelModal = false;
this.countDownTimer = setInterval(() => { },
if (this.countDownTime > 0) { jumpToDetails() {
this.countDownTime--; this.$emit("jumpToDetails", this.data);
} else { },
this.stopCountDown(); jumpToReservation() {
// 倒计时结束,可以触发刷新 uni.reLaunch({
this.$emit('countdownEnd', this.data); url: "/pages/client/index/index?activePageId=reservationPage",
} });
}, 1000); },
} },
}, };
stopCountDown() {
if (this.countDownTimer) {
clearInterval(this.countDownTimer);
this.countDownTimer = null;
}
},
formatCountdown(seconds) {
const hour = Math.floor(seconds / 3600);
const minutes = Math.floor((seconds - hour * 3600) / 60);
return `${hour}小时${minutes}分钟`;
},
orderCancel() {
this.showCancelModal = false;
},
cancel() {
this.showCancelModal = false;
},
jumpToDetails() {
this.$emit('jumpToDetails', this.data)
},
jumpToReservation() {
uni.reLaunch({
url: '/pages/client/index/index?activePageId=reservationPage'
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.order-item { .order-item {
width: calc(100vw - 40rpx); width: calc(100vw - 40rpx);
background: #fff; background: #fff;
margin: 20rpx; margin: 20rpx;
border-radius: 30rpx; border-radius: 30rpx;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx; padding: 20rpx;
margin-bottom: 0; margin-bottom: 0;
.order-title { .order-title {
padding-bottom: 20rpx; padding-bottom: 20rpx;
border-bottom: 1rpx solid #ececec; border-bottom: 1rpx solid #ececec;
.order-btn { .order-btn {
width: 104rpx; width: 104rpx;
height: 48rpx; height: 48rpx;
border-radius: 48rpx; border-radius: 48rpx;
&.confirm { &.confirm {
background: #fef6ff; background: #fef6ff;
} }
&.cancel { &.cancel {
background: #f7f7f7; background: #f7f7f7;
color: #afa5ae; color: #afa5ae;
} }
} }
.order-status-banner { .order-status-banner {
display: flex; display: flex;
align-items: center; align-items: center;
border-radius: 48rpx; border-radius: 48rpx;
overflow: hidden; overflow: hidden;
.status-banner-left { .status-banner-left {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
background: #FF19A0; background: #ff19a0;
padding: 8rpx; padding: 8rpx;
flex-shrink: 0; flex-shrink: 0;
border-radius: 10px 0px 10px 10px; border-radius: 10px 0px 10px 10px;
.status-text { .status-text {
font-size: 20rpx; font-size: 20rpx;
color: #FFFFFF; color: #ffffff;
} }
} }
.status-banner-right { .status-banner-right {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
background: #FFF0F8; background: #fff0f8;
padding: 8rpx; padding: 8rpx;
flex-shrink: 0; flex-shrink: 0;
.countdown-text {
font-size: 20rpx;
color: #ff19a0;
}
}
}
}
.countdown-text { .order-btns {
font-size: 20rpx; padding-top: 20rpx;
color: #FF19A0; display: flex;
} justify-content: flex-end;
} align-items: center;
}
}
.cancel-order-btn {
font-size: 24rpx;
color: #9b939a;
padding: 16rpx 0;
}
.order-btns { .order-btns-right {
padding-top: 20rpx; display: flex;
display: flex; align-items: center;
justify-content: flex-end; }
align-items: center;
.cancel-order-btn { .status-btn {
font-size: 24rpx; width: 70px;
color: #9B939A; height: 34px;
padding: 16rpx 0; // padding: 16rpx 20rpx;
} border-radius: 64rpx;
border: 1px solid #ff19a0;
margin-left: 20rpx;
.order-btns-right { &.confirm {
display: flex; color: $app_color_main;
align-items: center; border: 1px solid $app_color_main;
} }
}
}
.status-btn { ::v-deep {
width: 70px; .good-info-multi {
height: 34px; padding-top: 20rpx;
// padding: 16rpx 20rpx; }
border-radius: 64rpx; }
border: 1px solid #FF19A0;; }
margin-left: 20rpx;
&.confirm {
color: $app_color_main;
border: 1px solid $app_color_main;
}
}
}
::v-deep {
.good-info-multi {
padding-top: 20rpx;
}
}
}
</style> </style>

View File

@ -679,24 +679,59 @@ export default {
const data = { const data = {
id: Number(id), id: Number(id),
}; };
uni.showLoading({
icon: "none",
title: "处理中",
mask: true,
});
cancelPetOrderMall(data).then((res) => { cancelPetOrderMall(data).then((res) => {
uni.hideLoading();
const plugin = tt.requirePlugin("lifeServicePlugin"); const plugin = tt.requirePlugin("lifeServicePlugin");
plugin.applyRefund({ plugin.applyRefund({
goodsList:res.data.goodsList, goodsList: res.data.goodsList,
outOrderNo:res.data.outOrderNo, outOrderNo: res.data.outOrderNo,
refundInfo:res.data.refundInfo, refundInfo: res.data.refundInfo,
success(res) { success: (res) => {
uni.showToast({ uni.showToast({
title: '退款成功', title: '退款申请已提交',
icon: 'success' icon: 'success'
}) });
const { outRefundNo } = res; this.getOrderDetail();
tt.showToast({ title: outRefundNo });
}, },
fail(res) { fail: (err) => {
console.log("fail", res); console.log("退款失败:", err);
// 处理session过期错误
if (err && err.errMsg && err.errMsg.includes('session已过期')) {
uni.showModal({
title: '提示',
content: '会话已过期,请重新登录后再试',
showCancel: false,
confirmText: '确定',
success: () => {
// 清除当前用户信息并跳转到登录页
this.$store.dispatch("user/deleteToken");
this.$store.dispatch("user/clearUserInfo");
uni.clearStorageSync();
uni.reLaunch({
url: "/pages/client/auth/index"
});
}
});
} else {
uni.showToast({
title: err?.errMsg || err?.msg || '退款失败,请重试',
icon: 'none'
});
}
}, },
}); });
}).catch((err) => {
uni.hideLoading();
console.error("获取退款信息失败:", err);
uni.showToast({
title: err?.msg || '获取退款信息失败',
icon: 'none'
});
}); });
}, },