log.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!-- 物流追踪 -->
  2. <template>
  3. <s-layout title="物流追踪">
  4. <view class="log-wrap">
  5. <view class="log-card ss-flex ss-m-20 ss-r-10" v-if="goodsImages.length > 0">
  6. <uni-swiper-dot :info="goodsImages" :current="state.current" mode="round">
  7. <swiper class="swiper-box" @change="change">
  8. <swiper-item v-for="(item, index) in goodsImages" :key="index">
  9. <image class="log-card-img" :src="sheep.$url.static(item.image)"></image>
  10. </swiper-item>
  11. </swiper>
  12. </uni-swiper-dot>
  13. <view class="log-card-msg">
  14. <view class="ss-flex ss-m-b-8">
  15. <view>物流状态:</view>
  16. <view class="warning-color">{{ state.info.status_text }}</view>
  17. </view>
  18. <view class="ss-m-b-8">快递单号:{{ state.info.express_no }}</view>
  19. <view>快递公司:{{ state.info.express_name }}</view>
  20. </view>
  21. </view>
  22. <view class="log-content ss-m-20 ss-r-10">
  23. <view
  24. class="log-content-box ss-flex"
  25. v-for="(item, index) in state.info.logs"
  26. :key="item.title"
  27. >
  28. <view class="log-icon ss-flex-col ss-col-center ss-m-r-20">
  29. <text
  30. v-if="state.info.logs[index].status === state.info.logs[index - 1]?.status"
  31. class="cicon-title"
  32. ></text>
  33. <text
  34. v-if="state.info.logs[index].status != state.info.logs[index - 1]?.status"
  35. :class="[
  36. index === 0 ? 'activity-color' : 'info-color',
  37. item.status === 'transport'
  38. ? 'sicon-transport'
  39. : item.status === 'delivery'
  40. ? 'sicon-delivery'
  41. : item.status === 'collect'
  42. ? 'sicon-a-collectmaterials'
  43. : item.status === 'fail' || item.status === 'back' || item.status === 'refuse'
  44. ? 'sicon-circleclose'
  45. : item.status === 'signfor'
  46. ? 'sicon-circlecheck'
  47. : 'sicon-warning-outline',
  48. ]"
  49. ></text>
  50. <view v-if="state.info.logs.length - 1 != index" class="line"></view>
  51. </view>
  52. <view class="log-content-msg">
  53. <view
  54. v-if="
  55. item.status_text &&
  56. state.info.logs[index].status != state.info.logs[index - 1]?.status
  57. "
  58. class="log-msg-title ss-m-b-20"
  59. >{{ item.status_text }}</view
  60. >
  61. <view class="log-msg-desc ss-m-b-16">{{ item.content }}</view>
  62. <view class="log-msg-date ss-m-b-40">{{ item.change_date }}</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </s-layout>
  68. </template>
  69. <script setup>
  70. import sheep from '@/sheep';
  71. import { onLoad } from '@dcloudio/uni-app';
  72. import { computed, reactive } from 'vue';
  73. const state = reactive({
  74. info: [],
  75. current: 0,
  76. });
  77. const goodsImages = computed(() => {
  78. let array = [];
  79. if (state.info.items) {
  80. state.info.items.forEach((item) => {
  81. array.push({
  82. image: item.goods_image,
  83. });
  84. });
  85. }
  86. return array;
  87. });
  88. function change(e) {
  89. state.current = e.detail.current;
  90. }
  91. async function getExpressdetail(id, orderId) {
  92. const { data } = await sheep.$api.order.express(id, orderId);
  93. state.info = data;
  94. }
  95. onLoad((Option) => {
  96. getExpressdetail(Option.id, Option.orderId);
  97. });
  98. </script>
  99. <style lang="scss" scoped>
  100. .swiper-box {
  101. width: 200rpx;
  102. height: 200rpx;
  103. }
  104. .log-card {
  105. border-top: 2rpx solid rgba(#dfdfdf, 0.5);
  106. padding: 20rpx;
  107. background: #fff;
  108. margin-bottom: 20rpx;
  109. .log-card-img {
  110. width: 200rpx;
  111. height: 200rpx;
  112. margin-right: 20rpx;
  113. }
  114. .log-card-msg {
  115. font-size: 28rpx;
  116. font-weight: 500;
  117. width: 490rpx;
  118. color: #333333;
  119. .warning-color {
  120. color: #999;
  121. }
  122. }
  123. }
  124. .log-content {
  125. padding: 34rpx 20rpx 0rpx 20rpx;
  126. background: #fff;
  127. .log-content-box {
  128. align-items: stretch;
  129. }
  130. .log-icon {
  131. height: inherit;
  132. .cicon-title {
  133. color: #ccc;
  134. font-size: 40rpx;
  135. }
  136. .activity-color {
  137. color: #f0c785;
  138. font-size: 40rpx;
  139. }
  140. .info-color {
  141. color: #ccc;
  142. font-size: 40rpx;
  143. }
  144. .line {
  145. width: 1px;
  146. height: 100%;
  147. background: #d8d8d8;
  148. }
  149. }
  150. .log-content-msg {
  151. .log-msg-title {
  152. font-size: 28rpx;
  153. font-weight: bold;
  154. color: #333333;
  155. }
  156. .log-msg-desc {
  157. font-size: 24rpx;
  158. font-weight: 400;
  159. color: #333333;
  160. line-height: 36rpx;
  161. }
  162. .log-msg-date {
  163. font-size: 24rpx;
  164. font-weight: 500;
  165. color: #999999;
  166. }
  167. }
  168. }
  169. </style>