logistics.vue 7.5 KB

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