log.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!-- 物流追踪 -->
  2. <template>
  3. <s-layout :title="$t('order.logistics_tracking')">
  4. <view class="log-wrap">
  5. <!-- 商品信息 -->
  6. <view class="log-card ss-flex ss-m-20 ss-r-10" v-if="goodsImages.length > 0">
  7. <uni-swiper-dot :info="goodsImages" :current="state.current" mode="round">
  8. <swiper class="swiper-box">
  9. <swiper-item v-for="(item, index) in goodsImages" :key="index">
  10. <view class="image-container" style="width: 100%; height: 100%;">
  11. <view style="width: 100%;height: 106rpx;padding-top: 15%;">
  12. <image class="log-card-img" mode="aspectFill" :src="sheep.$url.static(item.image)" style="width: 100%;height: 100%;object-fit: cover;"/>
  13. </view>
  14. </view>
  15. </swiper-item>
  16. </swiper>
  17. </uni-swiper-dot>
  18. <view class="log-card-msg">
  19. <!-- TODO 非繁人:优化点:展示状态 -->
  20. <!-- <view class="ss-flex ss-m-b-8">-->
  21. <!-- <view>物流状态:</view>-->
  22. <!-- <view class="warning-color">{{ state.info.status_text }}</view>-->
  23. <!-- </view>-->
  24. <view class="ss-m-b-16 TrackingNumber">{{$t('order.tracking_number')+":"+ state.info.logisticsNo }}</view>
  25. <view class="ss-m-b-16">{{$t('order.courier_company')+":"+ state.info.logisticsName }}</view>
  26. <view>
  27. {{ $t('order.shipping_time')+":"+ sheep.$helper.timeFormat(state.info.deliveryTime, 'yyyy-mm-dd hh:MM') }}</view>
  28. </view>
  29. </view>
  30. <!-- 物流轨迹 -->
  31. <view class="log-content ss-m-20 ss-r-10">
  32. <view class="log-content-box ss-flex" v-for="(item, index) in state.tracks" :key="item.title">
  33. <view class="log-icon ss-flex-col ss-col-center ss-m-r-20">
  34. <text class="cicon-title" />
  35. <view v-if="state.tracks.length - 1 !== index" class="line" />
  36. </view>
  37. <view class="log-content-msg">
  38. <!-- TODO 非繁人:优化点:展示状态 -->
  39. <!-- <view class="log-msg-title ss-m-b-20">-->
  40. <!-- {{ item.status_text }}-->
  41. <!-- </view>-->
  42. <view class="log-msg-desc ss-m-b-16">{{ item.content }}</view>
  43. <view class="log-msg-date ss-m-b-40">
  44. {{ sheep.$helper.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </s-layout>
  51. </template>
  52. <script setup>
  53. import sheep from '@/sheep';
  54. import {
  55. onLoad
  56. } from '@dcloudio/uni-app';
  57. import {
  58. computed,
  59. reactive
  60. } from 'vue';
  61. import OrderApi from '@/sheep/api/trade/order';
  62. const state = reactive({
  63. info: [],
  64. tracks: [],
  65. });
  66. const goodsImages = computed(() => {
  67. let array = [];
  68. if (state.info.items) {
  69. state.info.items.forEach((item) => {
  70. array.push({
  71. image: item.picUrl,
  72. });
  73. });
  74. }
  75. return array;
  76. });
  77. async function getExpressDetail(id) {
  78. const {
  79. data
  80. } = await OrderApi.getOrderExpressTrackList(id);
  81. state.tracks = data;
  82. }
  83. async function getOrderDetail(id) {
  84. const {
  85. data
  86. } = await OrderApi.getOrder(id)
  87. state.info = data;
  88. }
  89. onLoad((options) => {
  90. getExpressDetail(options.id);
  91. getOrderDetail(options.id);
  92. });
  93. </script>
  94. <style lang="scss" scoped>
  95. // .swiper-box {
  96. // width: 200rpx;
  97. // height: 200rpx;
  98. // }
  99. .log-card {
  100. border-top: 2rpx solid rgba(#dfdfdf, 0.5);
  101. padding: 20rpx;
  102. background: #fff;
  103. margin-bottom: 20rpx;
  104. display: flex;
  105. justify-content: stretch;
  106. .uni-swiper__warp {
  107. border-radius: 8rpx;
  108. margin-right: 16rpx;
  109. height: 156rpx;
  110. border: 2rpx solid #f6f6f6;
  111. }
  112. // .image-container {
  113. // width: 100%;
  114. // /* 容器宽度100% */
  115. // position: relative;
  116. // /* 相对定位 */
  117. // overflow: hidden;
  118. // /* 隐藏超出部分 */
  119. // padding-top: 56.25%;
  120. // /* 9 / 16 = 0.5625, 即56.25% */
  121. // }
  122. // .log-card-img {
  123. // position: absolute;
  124. // /* 绝对定位 */
  125. // top: 0;
  126. // left: 0;
  127. // width: 100%;
  128. // /* 图片宽度100% */
  129. // height: 100%;
  130. // /* 高度自动调整 */
  131. // object-fit: cover;
  132. // /* 覆盖填充方式,保持宽高比 */
  133. // }
  134. uni-image>div {
  135. background-size: contain;
  136. background-position: center;
  137. }
  138. uni-swiper-item{
  139. display: flex;
  140. align-items: center;
  141. }
  142. .log-card-msg {
  143. // flex:2;
  144. font-size: 28rpx;
  145. font-weight: 500;
  146. color: #333333;
  147. width: calc(100% - 200rpx);
  148. .TrackingNumber {
  149. width: 100%;
  150. overflow: hidden;
  151. text-overflow: ellipsis;
  152. display: -webkit-box;
  153. -webkit-line-clamp: 1;
  154. -webkit-box-orient: vertical;
  155. }
  156. .warning-color {
  157. color: #999;
  158. }
  159. }
  160. }
  161. .log-content {
  162. padding: 34rpx 20rpx 0rpx 20rpx;
  163. background: #fff;
  164. .log-content-box {
  165. align-items: stretch;
  166. }
  167. .log-icon {
  168. height: inherit;
  169. .cicon-title {
  170. color: #ccc;
  171. font-size: 40rpx;
  172. }
  173. .activity-color {
  174. color: #f0c785;
  175. font-size: 40rpx;
  176. }
  177. .info-color {
  178. color: #ccc;
  179. font-size: 40rpx;
  180. }
  181. .line {
  182. width: 1px;
  183. height: 100%;
  184. background: #d8d8d8;
  185. }
  186. }
  187. .log-content-msg {
  188. .log-msg-title {
  189. font-size: 28rpx;
  190. font-weight: bold;
  191. color: #333333;
  192. }
  193. .log-msg-desc {
  194. font-size: 24rpx;
  195. font-weight: 400;
  196. color: #333333;
  197. line-height: 36rpx;
  198. }
  199. .log-msg-date {
  200. font-size: 24rpx;
  201. font-weight: 500;
  202. color: #999999;
  203. }
  204. }
  205. }
  206. </style>