This commit is contained in:
2026-04-07 19:48:56 +08:00
parent 3afa2e8c10
commit 1739401cb8
4 changed files with 1325 additions and 1116 deletions

View File

@ -68,7 +68,7 @@
<!-- 待预约 -->
<template v-if="[SHOP_ORDER_UNSLIVER].includes(data.status)">
<view class="order-btns-right">
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="$emit('refund', data)">
<view class="flex-center fs-24 app-fc-main status-btn" @click.stop="remindRefund(data.order_id)">
申请退款
</view>
<view class="flex-center fs-24 app-fc-white status-btn confirm"
@ -135,6 +135,11 @@
<script>
import PopUpModal from "@/components/PopUpModal.vue";
import GoodInfo from "./GoodInfo.vue";
import {
walletTransaction,
cancelPetOrderMall,
} from "../../../../api/login";
import {
SHOP_ORDER_STATUS,
SHOP_ORDER_UNPAY,
@ -269,6 +274,30 @@
this.stopCountDown();
},
methods: {
remindRefund(id) {
const data = {
id: Number(id),
};
cancelPetOrderMall(data).then((res) => {
const plugin = tt.requirePlugin("lifeServicePlugin");
plugin.applyRefund({
goodsList:res.data.goodsList,
outOrderNo:res.data.outOrderNo,
refundInfo:res.data.refundInfo,
success(res) {
uni.showToast({
title: '退款成功',
icon: 'success'
})
const { outRefundNo } = res;
tt.showToast({ title: outRefundNo });
},
fail(res) {
console.log("fail", res);
},
});
});
},
// 退款回调(组件触发)
handleRefund(event) {
const { status, result, outOrderNo } = event.detail