logistics-info.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="logistics_info">
  3. <view v-if="status === 1" class="send_all">
  4. 您的快递包裹已全部发货完毕,请注意查收!
  5. </view>
  6. <view>
  7. <view v-for="item in logisticsList" :key="item.id" v-show="logisticsList.length > 0" @click="logisticsDetail(item)" class="logistics_info">
  8. <view class="top">
  9. <view>
  10. <view style="color:#333333;">物流单号:{{ item.express_number }}</view>
  11. <view class="status">
  12. <text class="state" :class="[item.status == 0 ? 'state0' : item.status == 1 ? 'state1' : 'state2']"></text>
  13. <text style="margin-left:10rpx" :class="[item.status == 0 ? 'color0' : item.status == 1 ? 'color1' : 'color2']">
  14. {{ item.status == 0 ? '运输中' : item.status == 1 ? '已签收' : '物流异常' }}
  15. </text>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="center">
  20. <view class="logistics_name">{{ item.express_com }}</view>
  21. <view class="info">
  22. <view>
  23. <view>郑州市</view>
  24. <view class="small">管城区</view>
  25. </view>
  26. <view class="flow">
  27. <view class="query">查询物流</view>
  28. <image src="../../static/icon/arrows.png" mode=""></image>
  29. </view>
  30. <view>
  31. <view>{{ item.city }}</view>
  32. <view class="small">{{ item.area }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="bottom">
  37. <view class="commodity">
  38. <view class="detail">商品详情:</view>
  39. <view style="color:#999999;display: flex;flex-wrap: wrap;">{{item.note}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import { _API_GetLogistics } from '../../apis/order.js';
  48. export default {
  49. data() {
  50. return {
  51. logisticsList: [], //物流信息列表
  52. id: '',
  53. status: 0
  54. };
  55. },
  56. onLoad(options) {
  57. console.log(options,'options')
  58. if (options.order_no) {
  59. this.getLogistics(options.order_no);
  60. }
  61. if(options.status) {
  62. this.status = Number(options.status)
  63. }
  64. // if (options.order_id) {
  65. // this.getExpressTrack(options.order_id);
  66. // }
  67. },
  68. methods: {
  69. getLogistics(order_no) {
  70. uni.showLoading({
  71. title: '加载中'
  72. });
  73. _API_GetLogistics({
  74. order_num: order_no
  75. }).then(res => {
  76. uni.hideLoading();
  77. if (res.code === 200) {
  78. if(res.data.length > 0) {
  79. this.logisticsList = res.data;
  80. } else {
  81. uni.showModal({
  82. content: res.data.message || '物流信息不存在',
  83. showCancel: false,
  84. success() {
  85. uni.navigateBack()
  86. }
  87. });
  88. return false;
  89. }
  90. console.log(res.data, '物流信息');
  91. }
  92. }).catch(() => {
  93. uni.showModal({
  94. content: '服务器发生错误',
  95. showCancel: false
  96. });
  97. });
  98. },
  99. logisticsDetail(item) {
  100. console.log(item.express_number);
  101. uni.navigateTo({
  102. url: '../logistics-details/logistics-details?id=' + item.id + '&express_com=' + item.express_com + '&express_number=' + item.express_number
  103. });
  104. }
  105. }
  106. };
  107. </script>
  108. <style lang="scss" scoped>
  109. .logistics_info {
  110. min-height: 100%;
  111. background: $app-base-bg;
  112. .send_all {
  113. height: 72rpx;
  114. line-height: 72rpx;
  115. width: 100%;
  116. padding: 0 31rpx;
  117. box-sizing: border-box;
  118. color: #FFFFFF;
  119. font-size: 28rpx;
  120. background-color: #F76353;
  121. }
  122. .logistics_info {
  123. width: 100%;
  124. background: #fff;
  125. margin-bottom: 20rpx;
  126. .top {
  127. width: 100%;
  128. border-bottom: 1rpx solid #f2f2f2;
  129. .status {
  130. display: flex;
  131. align-items: center;
  132. .state {
  133. display: inline-block;
  134. height: 12rpx;
  135. width: 12rpx;
  136. border-radius: 50%;
  137. }
  138. .state0 {
  139. background-color: #f76454;
  140. }
  141. .state1 {
  142. background-color: #999999;
  143. }
  144. .state2 {
  145. background-color: #f00;
  146. }
  147. .color0 {
  148. color: #333333;
  149. }
  150. .color1 {
  151. color: #999999;
  152. }
  153. .color2 {
  154. color: #f00;
  155. }
  156. }
  157. }
  158. .top > view {
  159. margin: 0 30rpx;
  160. height: 72rpx;
  161. display: flex;
  162. justify-content: space-between;
  163. align-items: center;
  164. }
  165. .center {
  166. height: 160rpx;
  167. font-size: 36rpx;
  168. font-weight: bold;
  169. color: #181818;
  170. display: flex;
  171. justify-content: space-between;
  172. align-items: center;
  173. padding: 0 30rpx;
  174. .logistics_name {
  175. font-size: 32rpx;
  176. width: 30%;
  177. }
  178. .info {
  179. display: flex;
  180. justify-content: space-between;
  181. align-items: center;
  182. width: 70%;
  183. view {
  184. text-align: center;
  185. }
  186. .small {
  187. font-size: 28rpx;
  188. font-weight: noraml;
  189. margin-top: 12rpx;
  190. }
  191. .flow {
  192. display: flex;
  193. flex-direction: column;
  194. align-items: center;
  195. position: relative;
  196. view {
  197. height: 48rpx;
  198. width: 128rpx;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. font-size: 24rpx;
  203. color: #fff;
  204. background-color: #f76454;
  205. border-radius: 24rpx;
  206. font-weight: normal;
  207. }
  208. .query {
  209. position: absolute;
  210. top: -45rpx;
  211. left: 15rpx;
  212. }
  213. image {
  214. margin-top: 12rpx;
  215. height: 12rpx;
  216. width: 160rpx;
  217. }
  218. }
  219. }
  220. }
  221. .bottom {
  222. border-top: 1rpx solid #f2f2f2;
  223. .commodity {
  224. padding: 20rpx 30rpx;
  225. display: flex;
  226. font-size: 28rpx;
  227. .detail {
  228. color: #333333;
  229. width: 150rpx;
  230. flex-shrink: 0;
  231. }
  232. }
  233. }
  234. }
  235. }
  236. </style>