index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <page title="物流信息" ref="pageRef" nav-color="#fff">
  3. <view class="wrapper">
  4. <view v-if="data" class="dataWrapper" style="background: #fff">
  5. <view class="marginX10 marginT14 padding14 flex-align-between radius6" style="background: #fff">
  6. <view>{{data.expName}}</view>
  7. <view>{{data.number}}</view>
  8. </view>
  9. <view class="paddingB20 font2" v-if="data.list && data.list.length > 0">
  10. <view class="cell" v-for="(item, index) in data.list" :key="item.version">
  11. <view class="line" :style="{top: index === 0 ? '50%' : '0', bottom: index === list.length - 1 ? '50%' : '0'}">
  12. </view>
  13. <view class="translateY" :class="[index === 0 ? 'dot' : 'dot2']"></view>
  14. <view class="content">
  15. <view class=" font4">{{item.status}}</view>
  16. <view class=" font2 paddingT10 flex-align-between">
  17. <view style="opacity: 0.5">{{item.time}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <empty v-if="isEmpty" :top="200" />
  23. </view>
  24. </view>
  25. </page>
  26. </template>
  27. <script>
  28. import empty from '@/components/empty'
  29. export default {
  30. components: { empty },
  31. data() {
  32. return {
  33. data: null,
  34. isEmpty: false
  35. }
  36. },
  37. onLoad(options) {
  38. this.type = options.type
  39. this.tradeNo = options.tradeNo
  40. this.packageId = options.packageId
  41. },
  42. mounted() {
  43. this.getData(true)
  44. },
  45. onPullDownRefresh() {
  46. this.getData()
  47. },
  48. methods: {
  49. async getData(loading = false) {
  50. let res = null
  51. if (this.type == 1) {
  52. res = await this.$service.mall.express(this.tradeNo, this.packageId, loading)
  53. } else {
  54. res = await this.$service.award.express(this.tradeNo, this.packageId, loading)
  55. }
  56. this.isEmpty = res && (!res.list || res.list.length === 0)
  57. this.data = res
  58. uni.stopPullDownRefresh()
  59. }
  60. }
  61. }
  62. </script>
  63. <style>
  64. </style>
  65. <style lang="scss" scoped>
  66. .cell {
  67. margin: 0 30rpx;
  68. padding: 15rpx 0;
  69. position: relative;
  70. .line {
  71. position: absolute;
  72. left: 7rpx;
  73. width: 2rpx;
  74. background: #D8D8D8;
  75. }
  76. .dot {
  77. width: 16rpx;
  78. height: 16rpx;
  79. border-radius: 8rpx;
  80. background: #D8D8D8;
  81. position: absolute;
  82. left: 0;
  83. }
  84. .dot2 {
  85. width: 14rpx;
  86. height: 14rpx;
  87. border-radius: 8rpx;
  88. border: 2rpx dashed #D8D8D8;
  89. background: #D8D8D8;
  90. position: absolute;
  91. left: 0;
  92. }
  93. .content {
  94. background: #fff;
  95. padding: 24rpx 0 0 20px;
  96. border-radius: 8rpx;
  97. }
  98. }
  99. .wrapper{
  100. padding: 0 20rpx;
  101. .dataWrapper{
  102. background-color: #fff;
  103. border-radius: 20rpx;
  104. }
  105. }
  106. </style>