logistics.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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 == 500) {
  125. uni.hideToast();
  126. }
  127. if (res.code == 0) {
  128. this.logistics = res.data
  129. }
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scopen>
  136. .aside-active {
  137. color: #f27120;
  138. border-bottom: 2rpx solid #f27120;
  139. }
  140. </style>
  141. <style lang="scss" scoped>
  142. .detail {
  143. margin: 10rpx;
  144. padding-bottom: 160rpx;
  145. &-state {
  146. padding: 28rpx;
  147. margin-bottom: 20rpx;
  148. background-color: #FFFFFF;
  149. &-title {
  150. line-height: 40rpx;
  151. font-weight: bold;
  152. display: inline-block;
  153. }
  154. &-time {
  155. line-height: 40rpx;
  156. color: #b1b1b1;
  157. float: right;
  158. }
  159. }
  160. &-info {
  161. margin-bottom: 20rpx;
  162. padding: 20rpx 28rpx;
  163. background-color: #FFFFFF;
  164. &-one {
  165. height: 60rpx;
  166. padding: 1px;
  167. line-height: 60rpx;
  168. text-align: center;
  169. display: inline-block;
  170. margin-right: 20rpx;
  171. }
  172. &-title {
  173. line-height: 40rpx;
  174. font-weight: bold;
  175. }
  176. &-content {
  177. &-goods {
  178. &__detail {
  179. padding: 20rpx 0;
  180. justify-content: space-between;
  181. border-bottom: 1px solid rgba(236, 236, 236, 100);
  182. &__left {
  183. display: flex;
  184. height: 170rpx;
  185. .img {
  186. image {
  187. width: 170rpx;
  188. height: 170rpx;
  189. margin-right: 20rpx;
  190. }
  191. }
  192. }
  193. &__right {
  194. flex: 1;
  195. display: flex;
  196. height: 170rpx;
  197. flex-direction: column;
  198. justify-content: space-between;
  199. align-items: flex-start;
  200. font-size: 30rpx;
  201. .title {
  202. font-weight: bold;
  203. }
  204. .sku {
  205. color: #8C8C8C;
  206. }
  207. }
  208. }
  209. &__detail:last-child {
  210. border: none;
  211. }
  212. }
  213. &-money {
  214. margin-top: 40rpx;
  215. &__item {
  216. display: flex;
  217. align-items: center;
  218. justify-content: space-between;
  219. line-height: 40rpx;
  220. margin-bottom: 24rpx;
  221. }
  222. }
  223. &-toatl {
  224. padding-top: 24rpx;
  225. display: flex;
  226. align-items: center;
  227. justify-content: flex-end;
  228. font-weight: bold;
  229. }
  230. &-desc {
  231. position: relative;
  232. display: flex;
  233. line-height: 40rpx;
  234. margin-top: 20rpx;
  235. margin-bottom: 24rpx;
  236. view:first-child {
  237. width: 150rpx;
  238. }
  239. view:last-child {
  240. width: calc(100% - 150rpx)
  241. }
  242. .copy {
  243. position: absolute;
  244. right: 0;
  245. top: -6rpx;
  246. width: 136rpx;
  247. height: 52rpx;
  248. line-height: 52rpx;
  249. text-align: center;
  250. color: rgba(149, 149, 149, 100);
  251. border: 1px solid rgba(187, 187, 187, 100);
  252. border-radius: 10rpx;
  253. }
  254. }
  255. &-desc:last-child {
  256. margin-bottom: 0;
  257. }
  258. &-deliver {
  259. &__detail {
  260. padding: 20rpx 0;
  261. justify-content: space-between;
  262. border-bottom: 1px solid rgba(236, 236, 236, 100);
  263. &__left {
  264. display: flex;
  265. height: 170rpx;
  266. .img {
  267. image {
  268. width: 170rpx;
  269. height: 170rpx;
  270. margin-right: 20rpx;
  271. }
  272. }
  273. }
  274. &__right {
  275. flex: 1;
  276. display: flex;
  277. height: 170rpx;
  278. flex-direction: column;
  279. justify-content: space-between;
  280. align-items: flex-end;
  281. .num {
  282. width: 100%;
  283. justify-content: space-between;
  284. .sku {
  285. color: #8C8C8C;
  286. }
  287. }
  288. }
  289. }
  290. &__detail:last-child {
  291. border: none;
  292. }
  293. }
  294. }
  295. .border {
  296. border-bottom: 1px solid rgba(236, 236, 236, 100);
  297. }
  298. .border:last-child {
  299. border: none;
  300. }
  301. }
  302. }
  303. </style>