express-detail.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <app-layout>
  3. <view v-if="is_show" class='express-box'>
  4. <view class='box-grow-1 top-box dir-left-wrap'>
  5. <view class='box-grow-0 cross-center main-center'>
  6. <image class='goods-pic' mode='aspectFill' :src='cover_pic'></image>
  7. </view>
  8. <view class='dir-top-wrap box-grow-1'>
  9. <view class='dir-left-nowrap'>
  10. <text class='box-grow-0 label'>物流状态:</text>
  11. <text class='box-grow-0 sign-text'>
  12. {{expressDetail.status_text ? expressDetail.status_text : '未知'}}
  13. </text>
  14. </view>
  15. <view class='dir-left-nowrap'>
  16. <text class='box-grow-0 label'>快递公司:</text>
  17. <text class='box-grow-0'>{{order.express}}</text>
  18. </view>
  19. <view class='dir-left-nowrap cross-center'>
  20. <text class='box-grow-0 label'>快递单号:</text>
  21. <text class='box-grow-1'>{{order.express_no}}</text>
  22. <view @click='copyText' class='box-grow-0 detail-btn'>复制</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class='logistics-box dir-top-wrap'>
  27. <block v-if='expressDetail.list'>
  28. <view class='item-box'>
  29. <view v-for='item in expressDetail.list' :key='item.id'
  30. :class="{'sign-text': index == 0 ? true : false}" class='dir-top item'>
  31. <image v-if='index == 0' class='sign-big'
  32. src='/static/image/icon/order/point-green.png'></image>
  33. <image v-else class='sign' src='/static/image/icon/order/point-gray.png'></image>
  34. <view>{{item.desc}}</view>
  35. <view>{{item.datetime}}</view>
  36. </view>
  37. </view>
  38. </block>
  39. <view v-else class='main-center empty-box'>
  40. <view>暂无物流信息</view>
  41. </view>
  42. </view>
  43. </view>
  44. </app-layout>
  45. </template>
  46. <script>
  47. import order from "../order.js";
  48. export default {
  49. data() {
  50. return {
  51. expressDetail: null,
  52. order: null,
  53. express: '',
  54. express_no: '',
  55. cover_pic: '',
  56. customer_name: '',
  57. is_show: false,
  58. }
  59. },
  60. methods: {
  61. getExpressDetail() {
  62. this.$showLoading();
  63. this.$request({
  64. url: this.$api.order.express_detail,
  65. data: {
  66. express: this.express,
  67. customer_name: this.customer_name,
  68. express_no: this.express_no
  69. }
  70. }).then(response => {
  71. this.$hideLoading();
  72. this.is_show = true;
  73. if (response.code === 0) {
  74. this.order = response.data.order;
  75. this.expressDetail = response.data.express;
  76. } else {
  77. uni.showModal({
  78. title: '',
  79. content: response.msg,
  80. showCancel: false,
  81. });
  82. }
  83. }).catch(() => {
  84. this.$hideLoading();
  85. });
  86. },
  87. copyText() {
  88. order.copyText(this.order.express_no)
  89. },
  90. },
  91. onLoad(options) {
  92. this.express = options.express;
  93. this.express_no = options.express_no;
  94. this.customer_name = options.customer_name;
  95. this.cover_pic = options.cover_pic;
  96. this.getExpressDetail();
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .express-box {
  102. position: absolute;
  103. height: 100%;
  104. width: 100%;
  105. }
  106. .express-box .top-box {
  107. padding: #{20rpx};
  108. background-color: #ffffff;
  109. }
  110. .express-box .label {
  111. margin-right: #{10rpx};
  112. }
  113. .express-box .goods-pic {
  114. width: #{130rpx};
  115. height: #{130rpx};
  116. margin-right: #{20rpx};
  117. }
  118. .logistics-box {
  119. padding: #{20rpx} #{25rpx};
  120. background-color: #fff;
  121. margin-top: #{25rpx};
  122. font-size: $uni-font-size-weak-two;
  123. color: $uni-general-color-two;
  124. }
  125. .logistics-box .item-box {
  126. border-left: #{1rpx} solid $uni-weak-color-one;
  127. padding-left: #{45rpx};
  128. position: relative;
  129. }
  130. .logistics-box .item {
  131. margin-bottom: #{25rpx};
  132. padding-bottom: #{25rpx};
  133. border-bottom: #{1rpx} solid $uni-weak-color-one;
  134. }
  135. .logistics-box .item .sign {
  136. width: #{16rpx};
  137. height: #{16rpx};
  138. position: absolute;
  139. left: #{-7rpx};
  140. }
  141. .logistics-box .item .sign-big {
  142. width: #{32rpx};
  143. height: #{32rpx};
  144. position: absolute;
  145. left: #{-16rpx};
  146. }
  147. .sign-text {
  148. color: #25ae5f;
  149. }
  150. .empty-box {
  151. font-size: $uni-font-size-general-one;
  152. }
  153. .detail-btn {
  154. border: 1#{rpx} solid #bbbbbb;
  155. border-radius: 30#{rpx};
  156. padding: 10#{rpx} 30#{rpx};
  157. }
  158. </style>