绿满眶商城微信小程序-uniapp
xiangpei
2025-05-26 86cbf346204232ba9a4ffea6fbcb4d9d2b521916
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
  <view class="logistics-detail">
    <view class="card">
      <view class="card-title">
        <span>{{ logiList.shipper }}</span>快递 <span>{{ logiList.logisticCode }}</span>
      </view>
      <view class="time-line">
        <u-time-line v-if="logiList.traces && logiList.traces.length != 0">
          <u-time-line-item nodeTop="2" v-for="(item, index) in logiList.traces" :key="index">
            <!-- 此处自定义了左边内容,用一个图标替代 -->
            <template v-slot:node >
              <view v-if="index == logiList.traces.length - 1" class="u-node" :style="{ background: $lightColor }" style="padding: 0 4px">
                <!-- 此处为uView的icon组件 -->
                <u-icon name="pushpin-fill" color="#fff" :size="24"></u-icon>
              </view>
            </template>
            <template v-slot:content>
              <view>
                <!-- <view class="u-order-title">待取件</view> -->
                <view class="u-order-desc">{{ item.AcceptStation }}</view>
                <view class="u-order-time">{{ item.AcceptTime }}</view>
              </view>
            </template>
          </u-time-line-item>
        </u-time-line>
        <u-empty class="empty" v-else text="目前没有物流订单" mode="list"></u-empty>
      </view>
    </view>
  </view>
</template>
 
<script>
import '@/uview-components/uview-ui'
import { getExpress } from "@/api/trade.js";
export default {
  data() {
    return {
      express: "",
      resData: {
        title: "物流详情",
      },
 
      logiList: "",
      activeStep: 0,
    };
  },
  methods: {
    init(sn) {
      getExpress(sn).then((res) => {
        this.logiList = res.data.result;
      });
    },
  },
  onLoad(option) {
    let sn = option.order_sn;
    this.init(sn);
  },
};
</script>
 
<style lang="scss">
.card-title {
  background: #f2f2f2;
}
.logistics-detail {
  margin-top: 20rpx;
  padding: 0 16rpx;
}
.card {
  background: #fff;
  border-radius: 20rpx;
  width: 100%;
  > .card-title {
    font-size: 24rpx;
    border-top-left-radius: 20rpx;
    border-top-right-radius: 20rpx;
    padding: 16rpx;
  }
  > .time-line {
    padding: 16rpx 32rpx;
  }
}
.u-order-title {
  font-weight: bold;
}
.u-order-desc {
  font-size: 26rpx;
  color: #666;
  margin: 10rpx 0;
}
.u-order-time {
  font-size: 24rpx;
  color: #999;
}
.empty {
  padding: 40rpx 0;
}
</style>