logistics.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view class="detail">
  3. <u-navbar title="物流详情" :border="true" :placeholder="true" :autoBack="true" bgColor="#fff" />
  4. <!-- 物流信息 -->
  5. <view class="detail-info">
  6. <view class="detail-info-one" v-for="(item,index) in list" :key="index" @click="jumpPosition(index)"
  7. :class="{'aside-active':listIndex === index}">
  8. 包裹{{index+1}}</view>
  9. </view>
  10. <view class="detail-info">
  11. <view class="detail-info-title">商品信息</view>
  12. <view class="detail-info-content">
  13. <view class="detail-info-content-goods">
  14. <view class="flex detail-info-content-goods__detail">
  15. <view class="detail-info-content-goods__detail__left">
  16. <view class="img">
  17. <image class="img" :src="list[listIndex].picUrl" mode="aspectFill">
  18. </image>
  19. </view>
  20. </view>
  21. <view class="detail-info-content-goods__detail__right">
  22. <view class="ells title">{{ list[listIndex].title }}</view>
  23. <view class="sku" v-if="list[listIndex].properties">规格:{{ list[listIndex].properties }}
  24. </view>
  25. <view class="num">数量:{{ list[listIndex].goodsNum }}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="detail-info">
  32. <view class="detail-info-content-desc">
  33. <view>配送方式:</view>
  34. <view>{{ list[listIndex].companyName ? "快递发货" : "无需物流" }}</view>
  35. </view>
  36. <view class="detail-info-content-desc" v-if="list[listIndex].companyName?true:false">
  37. <view>{{ list[listIndex].companyName }}:</view>
  38. <view class="copy" @click="copyDeliveryFlowId(list[listIndex].deliveryFlowId)">复制</view>
  39. <view>{{ list[listIndex].deliveryFlowId }}</view>
  40. </view>
  41. </view>
  42. <view class="detail-info" v-if="list[listIndex].companyName && logistics!==''?true:false">
  43. <u-steps current="1" direction="column" dot>
  44. <u-steps-item :desc="item.context" :title="item.status + ' ' + item.time"
  45. v-for="(item,index) in logistics">
  46. <!-- <text class="slot-icon" slot="icon" v-if="item.status == '签收'">签</text> -->
  47. <!-- <text class="slot-icon" slot="icon" v-else-if="item.status == '揽收'">揽</text>
  48. <text class="slot-icon" slot="icon" v-else-if="item.status == '在途'">途</text> -->
  49. </u-steps-item>
  50. </u-steps>
  51. </view>
  52. <view v-else-if="list[listIndex].companyName?true:false" class="detail-info">
  53. <view style="color: #b1b1b1;">
  54. 暂无物流信息
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import env from '../../config/env.js'
  61. import $http from '@/utils/request.js'
  62. export default {
  63. data() {
  64. return {
  65. info: '',
  66. list: [{
  67. picUrl: '',
  68. deliveryFlowId: '',
  69. deliveryId: '',
  70. }],
  71. orderId: '',
  72. deliverList: '',
  73. listIndex: 0,
  74. logistics: '',
  75. }
  76. },
  77. onLoad(opthios) {
  78. this.orderId = opthios.id
  79. this.getDetail()
  80. },
  81. methods: {
  82. getDetail() {
  83. // uni.showLoading({
  84. // title: '加载中'
  85. // });
  86. $http.post('/api/v1/mp/user/deliver/order/detail', {
  87. orderId: this.orderId
  88. }).then(res => {
  89. // uni.hideLoading();
  90. this.info = res.data
  91. res.data.items.forEach(item => {
  92. let picUrlArr = item.picUrl.split(',')
  93. item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170'
  94. })
  95. res.data.deliverList && res.data.deliverList.forEach((item) => {
  96. item.items.forEach((ele) => {
  97. let picUrlArr = ele.picUrl.split(",");
  98. ele.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/170';
  99. });
  100. });
  101. this.deliverList = res.data.deliverList;
  102. this.list = res.data.items
  103. this.logisticsQuery()
  104. }).catch(() => {
  105. // uni.hideLoading();
  106. })
  107. },
  108. jumpPosition(index) {
  109. this.listIndex = index
  110. this.logisticsQuery()
  111. },
  112. copyDeliveryFlowId(id) {
  113. uni.setClipboardData({
  114. data: id,
  115. });
  116. },
  117. logisticsQuery() {
  118. if (this.list[this.listIndex].deliveryFlowId == "") {
  119. return
  120. }
  121. let data = {
  122. deliveryFlowId: this.list[this.listIndex].deliveryFlowId,
  123. deliveryId: this.list[this.listIndex].deliveryId,
  124. }
  125. $http.post('/api/v1/mp/logistics/query', data).then(res => {
  126. if (res.code == 0) {
  127. this.logistics = res.data
  128. }
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scopen>
  135. .aside-active {
  136. color: #f27120;
  137. border-bottom: 2rpx solid #f27120;
  138. }
  139. </style>
  140. <style lang="scss" scoped>
  141. .detail {
  142. margin: 10rpx;
  143. padding-bottom: 160rpx;
  144. &-state {
  145. padding: 28rpx;
  146. margin-bottom: 20rpx;
  147. background-color: #FFFFFF;
  148. &-title {
  149. line-height: 40rpx;
  150. font-weight: bold;
  151. display: inline-block;
  152. }
  153. &-time {
  154. line-height: 40rpx;
  155. color: #b1b1b1;
  156. float: right;
  157. }
  158. }
  159. &-info {
  160. margin-bottom: 20rpx;
  161. padding: 20rpx 28rpx;
  162. background-color: #FFFFFF;
  163. &-one {
  164. height: 60rpx;
  165. padding: 1px;
  166. line-height: 60rpx;
  167. text-align: center;
  168. display: inline-block;
  169. margin-right: 20rpx;
  170. }
  171. &-title {
  172. line-height: 40rpx;
  173. font-weight: bold;
  174. }
  175. &-content {
  176. &-goods {
  177. &__detail {
  178. padding: 20rpx 0;
  179. justify-content: space-between;
  180. border-bottom: 1px solid rgba(236, 236, 236, 100);
  181. &__left {
  182. display: flex;
  183. height: 170rpx;
  184. .img {
  185. image {
  186. width: 170rpx;
  187. height: 170rpx;
  188. margin-right: 20rpx;
  189. }
  190. }
  191. }
  192. &__right {
  193. flex: 1;
  194. display: flex;
  195. height: 170rpx;
  196. flex-direction: column;
  197. justify-content: space-between;
  198. align-items: flex-start;
  199. font-size: 30rpx;
  200. .title {
  201. font-weight: bold;
  202. }
  203. .sku {
  204. color: #8C8C8C;
  205. }
  206. }
  207. }
  208. &__detail:last-child {
  209. border: none;
  210. }
  211. }
  212. &-money {
  213. margin-top: 40rpx;
  214. &__item {
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. line-height: 40rpx;
  219. margin-bottom: 24rpx;
  220. }
  221. }
  222. &-toatl {
  223. padding-top: 24rpx;
  224. display: flex;
  225. align-items: center;
  226. justify-content: flex-end;
  227. font-weight: bold;
  228. }
  229. &-desc {
  230. position: relative;
  231. display: flex;
  232. line-height: 40rpx;
  233. margin-top: 20rpx;
  234. margin-bottom: 24rpx;
  235. view:first-child {
  236. width: 150rpx;
  237. }
  238. view:last-child {
  239. width: calc(100% - 150rpx)
  240. }
  241. .copy {
  242. position: absolute;
  243. right: 0;
  244. top: -6rpx;
  245. width: 136rpx;
  246. height: 52rpx;
  247. line-height: 52rpx;
  248. text-align: center;
  249. color: rgba(149, 149, 149, 100);
  250. border: 1px solid rgba(187, 187, 187, 100);
  251. border-radius: 10rpx;
  252. }
  253. }
  254. &-desc:last-child {
  255. margin-bottom: 0;
  256. }
  257. &-deliver {
  258. &__detail {
  259. padding: 20rpx 0;
  260. justify-content: space-between;
  261. border-bottom: 1px solid rgba(236, 236, 236, 100);
  262. &__left {
  263. display: flex;
  264. height: 170rpx;
  265. .img {
  266. image {
  267. width: 170rpx;
  268. height: 170rpx;
  269. margin-right: 20rpx;
  270. }
  271. }
  272. }
  273. &__right {
  274. flex: 1;
  275. display: flex;
  276. height: 170rpx;
  277. flex-direction: column;
  278. justify-content: space-between;
  279. align-items: flex-end;
  280. .num {
  281. width: 100%;
  282. justify-content: space-between;
  283. .sku {
  284. color: #8C8C8C;
  285. }
  286. }
  287. }
  288. }
  289. &__detail:last-child {
  290. border: none;
  291. }
  292. }
  293. }
  294. .border {
  295. border-bottom: 1px solid rgba(236, 236, 236, 100);
  296. }
  297. .border:last-child {
  298. border: none;
  299. }
  300. }
  301. }
  302. </style>