Commit 3d0c0b97 by liimin

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

- 移除了 RefundStatus 导入和相关逻辑
- 添加了 RefundStatus 组件引用
- 删除了 status-box 相关样式和逻辑
- 简化了页面结构,提高了组件化程度
1 parent 178b0ff7
import {
RefundStatus,
} from "~/constants/mine.js";
Page({
/**
* 页面的初始数据
*/
data: {
order: {
express_no: ''
express_no: "",
},
// Mock数据用于页面展示
orderInfo: {
......@@ -53,13 +49,8 @@ Page({
*/
onLoad: function (options) {
// this.getOrderRefundDetail(options.orderCode)
this.setData({
refund: RefundStatus.find(
(item) => item.status == this.data.orderInfo.refundStatus
),
});
},
getOrderRefundDetail(orderCode) {
wx.p.wxApi.showLoading("加载中...");
wx.p.api.shopmallApi.getOrderRefundDetail(orderCode).then((data) => {
......@@ -77,7 +68,7 @@ Page({
});
});
},
confirm() {
let { orderInfo } = this.data;
console.log(orderInfo);
......@@ -86,21 +77,21 @@ Page({
orderInfo
);
},
previewImage(e) {
let params = e.detail; // 从组件传递的数据
wx.p.wxApi.previewImage(params);
},
onExpressNoInput(e) {
const { value } = e.detail;
this.setData({
'order.express_no': value
"order.express_no": value,
});
},
onSubmitLogistics() {
// 提交物流信息的处理逻辑
console.log('提交物流信息');
}
});
\ No newline at end of file
console.log("提交物流信息");
},
});
{
"navigationBarTitleText": "售后详情",
"usingComponents": {
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet",
"refund-status": "./components/RefundStatus/RefundStatus",
"return-address-box": "./components/ReturnAddressBox/ReturnAddressBox",
"after-sale-info-box": "./components/AfterSaleInfoBox/AfterSaleInfoBox",
"re-submit-button": "./components/ReSubmitButton/ReSubmitButton"
......
.layout {
padding: 32rpx;
}
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
.icon {
width: 80rpx;
height: 80rpx;
}
.box-info {
.title {
font-size: 40rpx;
font-weight: 500;
color: #282829;
}
.tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
}
margin-bottom: 32rpx;
}
.box {
border-radius: 16rpx;
background-color: #fff;
}
.mb {
margin-bottom: 24rpx;
}
// .section {
// font-size: 32rpx;
// font-weight: 400;
// color: #323233;
// height: 104rpx;
// line-height: 104rpx;
// text-align: center;
// &.active {
// color: var(--btnColor);
// background: #fff9f5;
// }
// }
.weui-actionsheet__title-text {
font-size: 32rpx;
color: #323233;
font-weight: 500;
}
.weui-actionsheet__cell {
&::before {
display: none;
}
}
.weui-actionsheet__cell:hover,
.weui-actionsheet__cell_warn {
color: var(--btnColor);
background: #fff9f5;
}
.text-box {
padding: 32rpx 24rpx;
border-bottom: 2rpx solid #eff0f2;
.title {
font-weight: 600;
font-size: 32rpx;
color: #282829;
}
.form {
margin-top: 24rpx;
background: #f7f8fa;
border-radius: 12rpx;
padding: 0 32rpx;
.item {
height: 104rpx;
line-height: 104rpx;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0;
.label {
margin-right: 12rpx;
font-size: 28rpx;
color: #282829;
}
&:first-child {
border-bottom: 2rpx solid #eff0f2;
}
}
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16rpx;
.copy {
background: #e8e8ea;
border-radius: 18rpx;
font-weight: 400;
font-size: 22rpx;
color: #707071;
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;
}
.submit-btn {
border-color: var(--btnColor);
color: var(--btnColor);
font-weight: 500;
}
}
}
.text-box .item {
margin-bottom: 12rpx;
display: flex;
align-items: flex-start;
}
.text-box .item .label {
width: 140rpx;
}
.text-box .item .value {
color: #656566;
width: calc(100% - 150rpx);
.arrow {
margin-left: 16rpx;
width: 20rpx;
height: 20rpx;
transform: translateY(1rpx);
}
&.icon {
display: flex;
align-items: center;
justify-content: space-between;
}
}
.photo-box {
padding: 40rpx 0 28rpx 20rpx;
display: flex;
flex-wrap: wrap;
}
.photo-box .item {
width: 200rpx;
height: 200rpx;
background: #d8d8d8;
margin: 0 20rpx 20rpx 0;
border-radius: 16rpx;
overflow: hidden;
}
<block wx:if="{{orderInfo}}">
<view class="layout isFullSucreen">
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<glsx-image webp src="{{refund.image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{refund.title}}</view>
<view class="tips">{{refund.tips}}</view>
</view>
</view>
<!-- 退款状态组件 -->
<refund-status refundStatus="{{orderInfo.refundStatus}}"></refund-status>
<!-- 退货地址和物流信息组件 -->
<return-address-box />
<return-address-box />
<!-- 售后信息组件 -->
<after-sale-info-box
order-info="{{orderInfo}}"
bindpreviewimage="previewImage">
</after-sale-info-box>
<after-sale-info-box order-info="{{orderInfo}}"></after-sale-info-box>
<!-- 重新提交按钮组件 -->
<re-submit-button wx:if="{{orderInfo.refundStatus >5}}" bindresubmit="confirm"></re-submit-button>
</view>
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司" >
</mp-actionSheet>
</view>
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司"></mp-actionSheet>
</block>
\ No newline at end of file
import { RefundStatus } from "~/constants/mine.js";
Component({
properties: {
refundStatus: {
type: String,
value: "",
observer: function (status) {
this.updateStatus(status);
},
},
},
data: {
refund: {},
},
methods: {
updateStatus(status) {
this.setData({
refund: RefundStatus[status],
});
},
},
});
{
"component": true,
"usingComponents": {
"glsx-image": "/components/image/index"
}
}
\ No newline at end of file
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<glsx-image webp src="{{refund.image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{refund.title}}</view>
<view class="tips">{{refund.tips}}</view>
</view>
</view>
\ No newline at end of file
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
margin-bottom: 32rpx;
}
.status-box .icon {
width: 80rpx;
height: 80rpx;
}
.status-box .box-info .title {
font-size: 40rpx;
font-weight: 500;
color: #282829;
}
.status-box .box-info .tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
\ 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!