log.vue 5.1 KB

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