list.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="bg-white margin-top">
  3. <view class="common-logistics">
  4. <view class="logistic-item" v-for="(item, index) in logisticsData" :key="index">
  5. <view class="total-wrap" :style="{ marginTop: item.isFirstNode ? '22rpx' : '6rpx' }">
  6. <view class="item-container">
  7. <view class="item-container-left" :class="[index == 0 ? 'text-1A1A1A' : 'text-808080']">
  8. <view class="text-df">{{ item.time.split(" ")[0] }}</view>
  9. <view class="text-sm">{{ item.time.split(" ")[1] }}</view>
  10. </view>
  11. <view class="item-container-center">
  12. <view class="tag-container">
  13. <image v-if="item.isFirstNode && String(item.status) != 'null'" :src="nodeIconUrl(item.status, index)" mode="scaleToFill"></image>
  14. <view v-else class="item-tag-container">
  15. <image
  16. class="item-tag"
  17. :src="[index == 0 ? '/pages-mall/static/express-dot-active.png' : '/pages-mall/static/express-dot.png']"
  18. mode="scaleToFill"
  19. ></image>
  20. </view>
  21. </view>
  22. <!-- :style="{ height: item.isFirstNode ? '145rpx' : '88rpx', paddingTop: item.isFirstNode ? '22rpx' : '8rpx' }" -->
  23. <view class="line-container" :style="{ height: '88rpx', paddingTop: '8rpx' }">
  24. <!-- :style="{ height: item.isFirstNode ? '120rpx' : '80rpx' }" -->
  25. <view v-if="index !== logisticsData.length - 1" class="line" :style="{ height:'120rpx' }"></view>
  26. </view>
  27. </view>
  28. <!-- :style="{ paddingTop: item.isFirstNode ? '0' : '8rpx' }" -->
  29. <view class="item-container-right">
  30. <!-- <view v-if="item.isFirstNode" class="item-title text-dm text-bold" :class="[index == 0 ? 'text-1A1A1A' : 'text-808080']">{{ item.status }}</view> -->
  31. <!-- :style="{ marginTop: item.isFirstNode ? '10rpx' : '0' }" -->
  32. <view class="item-desc text-dm" :class="[index == 0 ? 'text-1A1A1A' : 'text-999999']">
  33. {{ item.status }}
  34. </view>
  35. <view class="item-time">{{ item.createTime }}</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. props: {
  46. logisticsData: {
  47. type: [Object, Array]
  48. }
  49. },
  50. computed: {
  51. nodeIconUrl() {
  52. return function(data, isFirstIndex) {
  53. // 0在途,1揽收,2疑难,3签收,4退签,5派件,6退回,7转单,10待清关,11清关中,12已清关,13清关异常,14收件人拒签
  54. // 图标根据需要自行更改,这里只作演示
  55. if (data == '在途') {
  56. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  57. } else if (data == '揽收') {
  58. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  59. } else if (data == '在途') {
  60. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  61. } else if (data == '疑难') {
  62. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  63. } else if (data == '签收') {
  64. return isFirstIndex === 0 ? require('@/pages-mall/static/express-over.png') : require('@/pages-mall/static/express-over.png');
  65. } else if (data == '退签') {
  66. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  67. } else if (data == '派件') {
  68. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  69. } else if (data == '退回') {
  70. return isFirstIndex === 0 ? require('@/pages-mall/static/express-ing.png') : require('@/pages-mall/static/express-ing.png');
  71. }
  72. };
  73. }
  74. }
  75. };
  76. </script>
  77. <style lang="scss" scoped>
  78. .common-logistics {
  79. height: auto;
  80. box-sizing: border-box;
  81. padding: 20rpx 20rpx 50rpx;
  82. }
  83. .item-container {
  84. width: 100%;
  85. height: auto;
  86. display: flex;
  87. .item-container-left {
  88. width: 160rpx;
  89. // max-width: 120rpx;
  90. }
  91. .item-container-center {
  92. width: 44rpx;
  93. height: auto;
  94. .tag-container {
  95. width: 44rpx;
  96. height: 44rpx;
  97. image {
  98. width: 44rpx;
  99. height: 44rpx;
  100. border-radius: 50%;
  101. }
  102. .item-tag-container {
  103. width: 44rpx;
  104. height: 44rpx;
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. .item-tag {
  109. width: 48rpx;
  110. height: 48rpx;
  111. border-radius: 50%;
  112. }
  113. }
  114. }
  115. .line-container {
  116. box-sizing: border-box;
  117. width: 44rpx;
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. .line {
  122. width: 2rpx;
  123. background-color: #dcdcdc;
  124. }
  125. }
  126. }
  127. .item-container-right {
  128. width: 500rpx;
  129. // max-width: 510rpx;
  130. box-sizing: border-box;
  131. padding: 0 10rpx 0 24rpx;
  132. .item-title {
  133. width: 100%;
  134. height: 40rpx;
  135. line-height: 44rpx;
  136. color: #222;
  137. font-size: 28rpx;
  138. }
  139. .item-desc {
  140. margin-top: 16rpx;
  141. width: 100%;
  142. min-height: 30rpx;
  143. line-height: 30rpx;
  144. word-wrap: break-word;
  145. word-break: normal;
  146. }
  147. .item-time {
  148. margin-top: 12rpx;
  149. width: 100%;
  150. height: 34rpx;
  151. line-height: 34rpx;
  152. font-size: 24rpx;
  153. }
  154. }
  155. }
  156. .line-state {
  157. width: 20rpx;
  158. height: 20rpx;
  159. border-radius: 50%;
  160. }
  161. .take-space {
  162. width: 100%;
  163. height: 80rpx;
  164. }
  165. .text-1A1A1A {
  166. color: #1a1a1a;
  167. }
  168. .text-999999 {
  169. color: #999999;
  170. }
  171. .text-808080 {
  172. color: #808080;
  173. }
  174. .text-df{
  175. font-size: 28rpx;
  176. }
  177. .text-sm{
  178. font-size: 24rpx;
  179. }
  180. </style>