2025-09-09 16:23:08 +08:00

216 lines
8.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<!-- 进度条 -->
<view class="progress-container" v-if="false">
<view class="progress-item active">
<text class="progress-text">商家处理</text>
</view>
<view class="progress-line"></view>
<view class="progress-item">
<text class="progress-text">寄回商品</text>
</view>
<view class="progress-line"></view>
<view class="progress-item">
<text class="progress-text">退款结束</text>
</view>
</view>
<view class="progress-container">
<view class="progress-item active">
<text class="progress-text">商家处理</text>
</view>
<view class="progress-line"></view>
<view class="progress-item">
<text class="progress-text">退款结束</text>
</view>
</view>
<!-- 状态提示 -->
<view class="status-tip" v-if="false">
<text class="status-title">请等待商家处理</text>
<text class="status-desc"><text style="font-weight: bold;">2</text>后商家未处理将自动同意</text>
<text class="status-desc">您已成功发起退款申请请耐心等待商家处理</text>
</view>
<view class="status-tip">
<text class="status-title">商家拒绝申请,请您处理</text>
<text class="status-desc"><text style="color: #f63b08;">2</text>后未处理将自动关闭</text>
</view>
<view class="hr"></view>
<!-- 商品信息 -->
<view class="goods-info">
<view class="goods-item">
<view class="asGoodTag tag-img"
v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</view>
<image class="goods-image" :src="currentAfterSale.commodity_order_item[0].commodity_pic"></image>
<view class="goods-details">
<text class="goods-name">
<text class="asGoodTag asGoodTag1"
v-if="currentAfterSale.commodity_order_item[0].is_support_same_day === 1">当日达</text>
{{ currentAfterSale.commodity_order_item[0].goods_name }}
<text class="refund-amount">退款¥{{ currentAfterSale.refund_amount.toFixed(2) }}</text>
</text>
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
<text class="goods-price">
{{ '¥' + currentAfterSale.commodity_order_item[0].sales_price.toFixed(2) + '/个' }}
<text class="goods-count">X{{ currentAfterSale.commodity_order_item[0].count }}</text>
</text>
</view>
</view>
</view>
<!-- 退款信息 -->
<view class="refund-info">
<view class="info-item">
<text class="info-label">服务类型<text style="color: #fc3811;">*</text></text>
<text class="info-value">{{ getServiceTypeText(currentAfterSale.after_sales_type) }}</text>
<text class="info-arrow"></text>
</view>
<view class="info-item">
<text class="info-label">退款原因<text style="color: #fc3811;">*</text></text>
<text class="info-value">{{ currentAfterSale.after_sales_reason }}</text>
<text class="info-arrow"></text>
</view>
<view class="info-item">
<text class="info-label">退款金额<text style="color: #fc3811;">*</text></text>
<text class="info-value amount">{{ '¥' + currentAfterSale.refund_amount.toFixed(2) }}</text>
</view>
<view class="info-item">
<text class="info-label">申请时间<text style="color: #fc3811;">*</text></text>
<text class="info-value">{{ formatDate(currentAfterSale.create_time) }}</text>
</view>
<view class="info-item">
<text class="info-label">退款编号<text style="color: #fc3811;">*</text></text>
<text class="info-value">{{ currentAfterSale.after_sales_no }}</text>
<text class="copy-icon" @click="copyRefundNo"></text>
</view>
</view>
<!-- 操作按钮 -->
<view class="action-buttons">
<button class="cancel-btn" @click="cancelRefund">撤销申请</button>
<button class="modify-btn" @click="modifyRefund">修改申请</button>
<button class="urge-btn" @click="urgeProcess">催处理</button>
</view>
<u-popup ref="popup" :show="showPopup" @close="closePopup" :mask-close-able="false"
:close-on-click-overlay="false">
<view class="popup-content">
<view class="success-icon">
<view class="check-circle">
<text class="check-mark"></text>
</view>
</view>
<view class="popup-title">已为您催处理</view>
<view class="popup-desc">平台客服已帮您催促卖家07月26日20:49前卖家未处理系统将自动退款</view>
<view class="popup-buttons">
<button class="continue-btn" @click="closePopup">继续联系卖家</button>
<button class="know-btn" @click="closePopup">我知道了</button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
isPhone,
picUrl,
request,
upload,
NavgateTo
} from '../../../utils';
export default {
data() {
return {
currentAfterSale: {},
pickerDefaultDate: new Date(),
showPopup: false
};
},
created() {
// 初始化日期选择器默认值为当前申请时间
this.pickerDefaultDate = new Date(this.currentAfterSale.create_time);
},
onLoad(options) {
const item = JSON.parse(options?.item);
console.log("🚀 ~ onLoad ~ item:", item)
this.currentAfterSale = item;
},
methods: {
getServiceTypeText(type) {
return type === 1 ? '退货退款' : '仅退款';
},
// 格式化日期
formatDate(dateString) {
if (!dateString) return '';
const date = new Date(dateString);
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}:${String(date.getSeconds()).padStart(2, '0')}`;
},
// 复制退款编号
copyRefundNo() {
// 使用uni-app的复制API
uni.setClipboardData({
data: this.currentAfterSale.after_sales_no,
success: () => {
uni.showToast({
title: '复制成功',
icon: 'success'
});
},
fail: () => {
uni.showToast({
title: '复制失败',
icon: 'none'
});
}
});
},
// 撤销申请
cancelRefund() {
uni.showModal({
title: "确定要撤销本次售后申请吗?",
showCancel: true,
cancelText: "暂不撤销",
confirmText: "确认撤销",
confirmColor: "#ff4d4f",
success: (res) => {
if (res.confirm) {
// 撤销售后接口
uni.showToast({
title: '订单撤销成功',
icon: 'success'
});
}
},
});
},
// 修改申请
modifyRefund() {
NavgateTo(`../apply/index?item=${JSON.stringify(this.currentAfterSale)}`);
},
// 催处理
urgeProcess() {
this.showPopup = true;
},
// 关闭弹窗
closePopup() {
this.showPopup = false;
}
}
};
</script>
<style scoped>
@import url('./index.css')
</style>