Commit d38099de by liimin

feat(order): 添加订单详情页面的物流信息展示功能

- 新增 Express 组件用于显示物流信息
- 在 detail 页面中引入并使用 Express 组件
- 重构 Express 组件的数据结构和 UI,使用时间轴组件展示物流状态
1 parent 6da581ce
/*可视化地呈现时间流信息*/
Component({
properties: {
list: {
// 时间轴列表
type: Array,
value: [],
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
.box {
padding: 10rpx;
}
.one {
position: relative;
padding-bottom: 40rpx;
}
.onedot {
left: -2rpx;
width: 20rpx;
height: 20rpx;
position: absolute;
background-color: #e8e8ea;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
&.highlight {
background-color: var(--btnColor);
}
&.tiny {
width: 12rpx;
height: 12rpx;
left: 2rpx;
}
}
.oneline {
position: absolute;
left: 8rpx;
height: 100%;
border-left: 1rpx solid #f0f0f0;
}
.onemain {
position: relative;
padding-left: 56rpx;
top: -6rpx;
.main {
display: flex;
align-items: center;
gap: 12rpx;
.title {
font-weight: 500;
font-size: 32rpx;
color: #282829;
}
.time {
font-weight: 400;
font-size: 24rpx;
color: #282829;
}
}
}
.onemaintitle {
margin-bottom: 16rpx;
padding-top: 8rpx;
color: #909399;
line-height: 1;
font-size: 26rpx;
}
.tip {
font-weight: 400;
font-size: 24rpx;
color: #656566;
}
<view class="box">
<view wx:for="{{list}}" wx:key="index" class="one">
<view class="onedot {{index==list.length-1?'highlight':''}} {{!item.status?'tiny':''}}"></view>
<view wx:if="{{index!=list.length-1}}" class="oneline"></view>
<view class="onemain ">
<view class="main">
<view class="title">{{item.status}}</view>
<view class="time">{{item.time}}</view>
</view>
<view class="tip" wx:for="{{item.tips}}" wx:for-item="tip">{{tip}}</view>
</view>
</view>
</view>
\ No newline at end of file
const { mockDeliveryInfoData } = require('./mock.js');
const { mockDeliveryInfoData } = require("./mock.js");
Component({
properties: {
orderInfo: {
type: Object,
value: {}
value: {},
},
deliveryStatus: {
type: Object,
value: {}
}
value: {},
},
},
data: {
// Mock数据用于开发和测试
...mockDeliveryInfoData
list: [
{
time: "",
tips: ["深圳市南山区南山智园崇文园区1号楼14层","何万瑞 15077226060"],
status:'address'
},
{
time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"],
status:''
},
{
time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"],
status:'已离开'
},
{
time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分这是主要内容部分这是主要内容部分这是主要内容部分"],
status:'已离开'
},
],
},
methods: {
}
})
\ No newline at end of file
});
{
"component": true,
"usingComponents": {}
"usingComponents": {
"TimeLine": "/components/TimeLine/TimeLine"
}
}
\ No newline at end of file
<view class="item">
<view class="label">收货地址:</view>
<view class="value">{{orderInfo.deliveryCompany || ''}}{{orderInfo.deliveryNumber || ''}}</view>
<TimeLine list="{{list}}"/>
</view>
\ No newline at end of file
......@@ -8,6 +8,7 @@
"OrderInfo": "./components/OrderInfo/OrderInfo",
"OrderGoods": "./components/OrderGoods/OrderGoods",
"OrderAmount": "./components/OrderAmount/OrderAmount",
"content": "/packageMine/pages/order/index/components/Content/Content"
"content": "/packageMine/pages/order/index/components/Content/Content",
"Express": "./components/Express/Express"
}
}
\ No newline at end of file
......@@ -7,6 +7,9 @@
<DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo>
</BlockBox>
<BlockBox>
<Express />
</BlockBox>
<BlockBox>
<OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
</BlockBox>
<!-- <BlockBox>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!