Commit 1e3f22ca by liimin

refactor(mine): 重构售后详情页面

- 将 RefundStatus、ExpressList、AfterSaleObj 和 AddressInfo 移至 constants/mine.js 文件
- 优化页面数据结构,使用引入的常量替代原有的本地定义
- 修改快递选择弹窗的显示逻辑和样式
- 添加提交物流按钮
1 parent e5e53600
......@@ -88,17 +88,124 @@ export const RefundReason = [
},
];
export const RefundStatus= [
{ status: 1, title: "待处理", tips: "等待平台处理",image:'mine/order/wait.png' },
{ status: 2, title: "待发货", tips: "等待平台处理" ,image:'mine/order/wait.png' },
{ status: 3, title: "待确认收到退货", tips: "等待平台处理",image:'mine/order/wait.png' },
{ status: 4, title: "退款中", tips: "等待平台处理",image:'mine/order/wait.png' },
{ status: 5, title: "已退款", tips: "钱款已退回至原账户" ,image:'mine/order/success.png' },
{ status: 6, title: "退款失败", tips: "您可以尝试再次提交退款申请" ,image:'mine/order/error.png' },
{
status: 7,
title: "审核不通过",
tips: "您可以尝试再次提交退款申请",
image:'mine/order/error.png'
},
];
export const RefundStatus = [
{
status: 1,
title: "待处理",
tips: "等待平台处理",
image: "mine/order/wait.png",
},
{
status: 2,
title: "待发货",
tips: "等待平台处理",
image: "mine/order/wait.png",
},
{
status: 3,
title: "待确认收到退货",
tips: "等待平台处理",
image: "mine/order/wait.png",
},
{
status: 4,
title: "退款中",
tips: "等待平台处理",
image: "mine/order/wait.png",
},
{
status: 5,
title: "已退款",
tips: "钱款已退回至原账户",
image: "mine/order/success.png",
},
{
status: 6,
title: "退款失败",
tips: "您可以尝试再次提交退款申请",
image: "mine/order/error.png",
},
{
status: 7,
title: "审核不通过",
tips: "您可以尝试再次提交退款申请",
image: "mine/order/error.png",
},
];
export const ExpressList = [
{
value: 0,
text: "圆通快递",
},
{
value: 1,
text: "顺丰快递",
},
{
value: 2,
text: "中通快递",
},
{
value: 3,
text: "韵达快递",
},
{
value: 4,
text: "京东快递",
},
{
value: 5,
text: "百世快递",
},
{
value: 6,
text: "德邦快递",
},
{
value: 7,
text: "其他",
},
];
export const AfterSaleObj = [
{
title: "退款原因",
key: "refundPrice",
},
{
title: "退款金额",
key: "refundPrice",
},
{
title: "退款数量",
key: "goodsNumber",
},
{
title: "售后编号",
key: "orderCode",
},
{
title: "申请时间",
key: "time",
},
{
title: "申请描述",
key: "remark",
},
];
export const AddressInfo = [
{
title: "地址",
key: "address",
},
{
title: "收货人",
key: "name",
},
{
title: "联系电话",
key: "phone",
},
];
import { RefundStatus } from "~/constants/mine.js";
import {
RefundStatus,
ExpressList,
AfterSaleObj,
AddressInfo,
} from "~/constants/mine.js";
Page({
/**
......@@ -6,82 +11,14 @@ Page({
*/
data: {
// 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过
afterSaleObj: Object.freeze([
{
title: "退款金额",
key: "refundPrice",
},
{
title: "退款数量",
key: "goodsNumber",
},
{
title: "售后编号",
key: "orderCode",
},
{
title: "申请时间",
key: "time",
},
{
title: "申请描述",
key: "remark",
},
]),
address: [
{
title: "地址",
key: "address",
},
{
title: "收货人",
key: "name",
},
{
title: "联系电话",
key: "phone",
},
],
afterSaleObj: Object.freeze(AfterSaleObj),
address: Object.freeze(AddressInfo),
addressObject: {
name: "张三",
phone: "12345678901",
address: "广东省深圳市南山区",
},
expressList: [
{
value: 0,
text: "圆通",
},
{
value: 1,
text: "顺丰",
},
{
value: 2,
text: "中通",
},
{
value: 3,
text: "韵达",
},
{
value: 4,
text: "京东",
type: "warn",
},
{
value: 5,
text: "百世",
},
{
value: 6,
text: "德邦",
},
{
value: 7,
text: "其他",
},
],
expressList: Object.freeze(ExpressList),
// Mock数据用于页面展示
orderInfo: {
refundStatus: 1, // 1:待处理
......@@ -131,14 +68,14 @@ Page({
),
});
},
showPopup() {
showExpressSelector() {
this.setData({
showPopup: true,
isShowExpressSelector: true,
});
},
selectExpress(e) {
this.setData({
showPopup: false,
isShowExpressSelector: false,
});
const expressList = this.data.expressList.map((item) => {
if (item.value == e.detail.value) {
......
......@@ -46,6 +46,12 @@
// background: #fff9f5;
// }
// }
.weui-actionsheet__title-text {
font-size: 32rpx;
color: #323233;
font-weight: 500;
}
.weui-actionsheet__cell {
&::before {
display: none;
......@@ -101,6 +107,29 @@
padding: 4rpx 18rpx;
}
}
.btn-box{
display: flex;
justify-content: center;
align-items: center;
margin-top: 24rpx;
.btn {
display: flex;
align-items: center;
justify-content: center;
width: 336rpx;
height: 80rpx;
border-radius: 20rpx;
border: 2rpx solid #dcdfe6;
font-size: 24rpx;
margin-left: 12rpx;
color: #1b233d;
}
.submit-btn {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
}
}
.text-box .item {
margin-bottom: 12rpx;
......
......@@ -28,8 +28,8 @@
<view class="form">
<view class="item">
<view class="label">物流公司:</view>
<view class="value icon" bindtap="showPopup">
<view>{{express.name||'请选择'}}</view>
<view class="value icon" bindtap="showExpressSelector">
<view>{{express.text||'请选择'}}</view>
<mp-icon icon="arrow" color="#B1B1B3" size="12"></mp-icon>
</view>
</view>
......@@ -40,6 +40,9 @@
</view>
</view>
</view>
<view class="btn-box">
<view class="btn submit-btn" data-order-code="{{item.orderCode}}">提交物流</view>
</view>
</view>
</view>
<view class="box">
......@@ -80,6 +83,6 @@
{{item.name}}
</view>
</popup> -->
<mp-actionSheet bindactiontap="selectExpress" show="{{showPopup}}" actions="{{expressList}}" title="选择快递公司" >
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司" >
</mp-actionSheet>
</block>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!