126 lines
4.9 KiB
Vue
126 lines
4.9 KiB
Vue
<template>
|
||
<view class="container">
|
||
<view v-for="(item, index) in currentAfterSale" :key="index">
|
||
<view class="after-sale-item">
|
||
<!-- 头部信息 -->
|
||
<view class="header">
|
||
<view class="company-info">
|
||
<text class="company-name">{{ item.commodity_order_item[0].goods_name || '衡水喜屏传媒有限公司'
|
||
}}</text>
|
||
<text class="after-sale-no">退货退款</text>
|
||
</view>
|
||
<text class="order-time">提交订单:{{ formatDate(item.create_time) }}</text>
|
||
</view>
|
||
|
||
<!-- 商品信息 -->
|
||
<view class="goods-info" v-for="(ite, index) in item.commodity_order_item" :key="index">
|
||
<view class="asGoodTag tag-img" v-if="ite.is_support_same_day === 1">当日达</view>
|
||
<image :src="ite.commodity_pic" class="goods-image"></image>
|
||
<view class="goods-details">
|
||
<text class="goods-name">
|
||
<text class="asGoodTag asGoodTag1" v-if="ite.is_support_same_day === 1">当日达</text>
|
||
{{ ite.goods_name }}
|
||
<text class="refund-amount">退款:¥{{ ite.sales_price }}</text>
|
||
</text>
|
||
<text class="goods-desc">{{ ite.after_sales_reason }}</text>
|
||
<view class="price-count">
|
||
<text class="goods-price">¥{{ ite.sales_price }}/个</text>
|
||
<text class="goods-count">x{{ ite.count }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 退款状态 -->
|
||
<view class="status-container">
|
||
<view class="status-item" @click="pendingPage(item)">
|
||
<text class="status-label">{{ getStatusText(item.after_sales_status) }}</text>
|
||
<text class="status-desc">商家将在<text style="color: #e73b05;">{{
|
||
calculateProcessingTime(item.create_time) }}</text>内处理</text>
|
||
<view class="arrow-right"></view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 操作按钮 -->
|
||
<view class="action-buttons">
|
||
<button class="modify-btn" @click="modifyApplication">修改申请</button>
|
||
<button class="cancel-btn" @click="cancelApplication">撤销申请</button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import afterSaleData from './afterSale.json';
|
||
import {
|
||
isPhone,
|
||
picUrl,
|
||
request,
|
||
upload,
|
||
NavgateTo
|
||
} from '../../../utils';
|
||
|
||
export default {
|
||
data() {
|
||
return {
|
||
currentAfterSale: afterSaleData
|
||
};
|
||
},
|
||
onLoad() {
|
||
|
||
},
|
||
methods: {
|
||
getStatusText(status) {
|
||
// 根据状态码返回对应的状态文本
|
||
const statusMap = {
|
||
1: '商家待处理',
|
||
2: '已撤销',
|
||
3: '已完成',
|
||
4: '已拒绝'
|
||
};
|
||
return statusMap[status] || '未知状态';
|
||
},
|
||
calculateProcessingTime(createTime) {
|
||
return '2天';
|
||
},
|
||
formatDate(dateString) {
|
||
if (!dateString) return '';
|
||
const date = new Date(dateString);
|
||
const year = date.getFullYear();
|
||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||
const day = String(date.getDate()).padStart(2, '0');
|
||
const hours = String(date.getHours()).padStart(2, '0');
|
||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||
},
|
||
modifyApplication() {
|
||
console.log('修改申请');
|
||
},
|
||
cancelApplication() {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '确定要撤销退款申请吗?',
|
||
success: (res) => {
|
||
if (res.confirm) {
|
||
console.log('撤销申请');
|
||
uni.navigateBack();
|
||
}
|
||
}
|
||
});
|
||
},
|
||
pendingPage(item) {
|
||
// NavgateTo(`/packages/myOrders/pending/index?item=${JSON.stringify(item)}`); //拒绝申请
|
||
// NavgateTo(`/packages/myOrders/sendBack/index?item=${JSON.stringify(item)}`); //自行寄回
|
||
// NavgateTo(`/packages/myOrders/refundOver/index?item=${JSON.stringify(item)}`); //退款成功
|
||
NavgateTo(`/packages/myOrders/changeInfo/index?item=${JSON.stringify(item)}`); //换货
|
||
}
|
||
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style scoped>
|
||
@import url(./index.css);
|
||
</style> |