CfLogistics.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="cf-logistics">
  3. <pub-loading-view :loaded="loaded" height="100%">
  4. <view class="cf-logistics-top">
  5. <view class="icon"><text class="iconfont">&#xe674;</text></view>
  6. {{info.no}}
  7. <view class="copy-icon"> <text class="iconfont">&#xe620;</text></view>
  8. </view>
  9. <view class="logistics-list">
  10. <view class="logistics-item" :class="item.className" v-for="item in info.statusList" :key="item.id">
  11. <view class="logistics-item-left">
  12. <view class="icon" v-if='item.icon'>
  13. <text class="iconfont">&#xe602;</text>
  14. </view>
  15. <view class="icon" :class="item.className" v-else-if="item.className=='is-finish'">
  16. </view>
  17. <view class="dot" v-else></view>
  18. <view class="line"></view>
  19. </view>
  20. <view class="logistics-item-right">
  21. <view class="logistics-item-title" v-if="item.title">{{item.title}}</view>
  22. <view class="logistics-item-time">{{item.time}}</view>
  23. <view>{{item.text}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. </pub-loading-view>
  28. </view>
  29. </template>
  30. <script lang="ts" setup>
  31. import { ref, PropType, onMounted } from 'vue'
  32. import rest from '@/stores/rest'
  33. import { filterLogisticsTitle } from '@/lib/util'
  34. import { CfLogisticsVO } from '../../lib/type';
  35. defineProps({
  36. info: {
  37. type: Object as PropType<any>,
  38. default: () => ({}),
  39. },
  40. })
  41. const loaded = ref(false)
  42. const no = ref('SF145587878799')
  43. const info = ref({
  44. no: '',
  45. statusList: [],
  46. })
  47. // const statusList = ref([{
  48. // title: '已签收',
  49. // time: '2024/04/22 12:24',
  50. // text: '您的快件已由本人签收,如有疑问请电联快递员【方金花,电话:13391055998】,感谢您使用顺丰,期待再次为您服务。(主单总件数:1件) ',
  51. // className: 'is-finish',
  52. // }, {
  53. // icon: '&#xe602;',
  54. // title: '派送中',
  55. // time: '2024/04/22 12:24',
  56. // }, {
  57. // icon: '&#xe602;',
  58. // title: '运送中',
  59. // time: '2024/04/22 12:24',
  60. // text: '快件交给方金花,正在派送途中(联系电话:13391055998,顺丰已开启“安全呼叫”保护您的电话隐私,请放心接听!)(主单总件数:1件)',
  61. // }, {
  62. // text: '快件离开 【重庆中转场】,已发往【重庆慈竹店】的路上',
  63. // time: '2024/04/22 12:24',
  64. // }, {
  65. // text: '快件离开 【重庆中转场】,已发往【重庆慈竹店】的路上',
  66. // time: '2024/04/22 12:24',
  67. // }, {
  68. // text: '快件离开 【重庆中转场】,已发往【重庆慈竹店】的路上',
  69. // time: '2024/04/22 12:24',
  70. // }])
  71. const getInfo = async () => {
  72. loaded.value = true;
  73. try {
  74. let res = await rest.get('/app-api/bmfw/findCfWl',{ptwybh:'2024_1857595040975118338'}) as CfLogisticsVO
  75. for (let i = 0; i < res.cfList.length; i++) {
  76. let msgList = JSON.parse(res.cfList[i].msg)
  77. for (let j = 0; j< msgList.length;j++){
  78. let listWl = { time: '',title:'',icon:'',message:'' }
  79. listWl.time = msgList[j].time2
  80. listWl.title = filterLogisticsTitle(msgList[j].wlzt)
  81. listWl.icon = '\ue674'
  82. listWl.message = msgList[j].context
  83. info.value.statusList.push(listWl)
  84. }
  85. info.value.no = res.cfList[i].ydh
  86. }
  87. } catch (e) {
  88. console.log(e);
  89. }
  90. loaded.value = false;
  91. }
  92. onMounted(() => {
  93. getInfo()
  94. })
  95. </script>
  96. <style lang="scss" scoped>
  97. .cf-logistics {
  98. background: #fff;
  99. padding: $uni-spacing-col-s3 $page-row-spacing;
  100. height: 100%;
  101. box-sizing: border-box;
  102. .icon {
  103. width: 64rpx;
  104. height: 64rpx;
  105. background: $uni-bg-icon;
  106. border-radius: 50%;
  107. @include flex-center;
  108. .iconfont {
  109. background: linear-gradient(180deg, #46ACFF 0%, $uni-color-primary 100%);
  110. background-clip: text;
  111. text-fill-color: transparent;
  112. -webkit-background-clip: text;
  113. -webkit-text-fill-color: transparent;
  114. }
  115. }
  116. .cf-logistics-top {
  117. @include flex;
  118. margin-bottom: 32rpx;
  119. .icon {
  120. background: $uni-color-primary-light;
  121. margin-right: 24rpx;
  122. }
  123. .copy-icon {
  124. margin-left: 16rpx;
  125. }
  126. }
  127. .logistics-list {
  128. overflow-y: auto;
  129. flex: 1;
  130. height: calc(100% - 96rpx);
  131. .logistics-item {
  132. color: $uni-text-color-grey;
  133. display: flex;
  134. min-height: 140rpx;
  135. .logistics-item-left {
  136. @include flex;
  137. flex-direction: column;
  138. margin-right: 24rpx;
  139. .icon {
  140. .iconfont {
  141. background: linear-gradient(180deg, #C2CFE7 0%, #899AB9 100%);
  142. background-clip: text;
  143. text-fill-color: transparent;
  144. -webkit-background-clip: text;
  145. -webkit-text-fill-color: transparent;
  146. }
  147. &.is-finish {
  148. background: $uni-color-primary;
  149. color: #fff;
  150. }
  151. }
  152. .dot {
  153. width: 24rpx;
  154. height: 24rpx;
  155. background: $uni-border-color;
  156. border-radius: 50%;
  157. margin: 0 20rpx;
  158. }
  159. .line {
  160. flex: 1;
  161. // width: 1px;
  162. border-left: 1px dashed $uni-border-color;
  163. margin: 12rpx 0;
  164. }
  165. }
  166. .logistics-item-right {
  167. margin-bottom: 32rpx;
  168. font-size: 24rpx;
  169. line-height: $uni-line-height-sm;
  170. .logistics-item-title {
  171. font-size: 28rpx;
  172. line-height: $uni-line-height-base;
  173. margin-bottom: 8rpx;
  174. }
  175. .logistics-item-time {
  176. margin-bottom: 8rpx;
  177. }
  178. }
  179. &.is-finish {
  180. .logistics-item-left {
  181. .line {
  182. border-left: 1px dashed $uni-color-primary;
  183. }
  184. }
  185. .logistics-item-right {
  186. color: $uni-text-color;
  187. .logistics-item-title {
  188. font-weight: 800;
  189. }
  190. }
  191. }
  192. &:last-child {
  193. .logistics-item-left {
  194. .line {
  195. display: none;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. </style>