express_feed.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="wrap">
  3. <u-navbar title="订单物流" :placeholder="true" bgColor="rgba(255,255,255,0.3)" leftText="返回" :autoBack="true" titleStyle="font-weight:bold;color:#7a5831"></u-navbar>
  4. <view class="main" v-if="hasLoad">
  5. <view class="box">
  6. <view class="b-row">
  7. <view class="b-tit">快递公司</view>
  8. <view class="b-cont">
  9. <text class="s-text">{{ state.company }}</text>
  10. </view>
  11. </view>
  12. <view class="b-row">
  13. <view class="b-tit">快递单号</view>
  14. <view class="b-cont">
  15. <text class="s-text">{{ state.number }}</text>
  16. <text class="s-copy" @click="onCopy(state.number)">点击复制</text>
  17. </view>
  18. </view>
  19. <view class="b-row">
  20. <view class="b-tit">发货时间</view>
  21. <view class="b-cont">
  22. <text class="s-text">{{ timeFormat(state.deployed_at) }}</text>
  23. </view>
  24. </view>
  25. <view class="b-row">
  26. <view class="b-tit">当前状态</view>
  27. <view class="b-cont">
  28. <text class="s-text">{{ state.state_text }}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="feed-detail">
  33. <view class="address-data">
  34. <view class="iconfont icon-pos"></view>
  35. <text class="b-address">
  36. <text class="s-tit">收货地址:</text>
  37. <text class="s-cont">{{ state.address }}</text>
  38. </text>
  39. </view>
  40. <view class="feed-data">
  41. <view class="iconfont icon-feed"></view>
  42. <view class="feed-list">
  43. <view class="b-row" v-for="(item, index) in state.track_list" :key="index">
  44. <view class="s-cont">{{ item.context }}</view>
  45. <view class="s-time">{{ item.time }}</view>
  46. </view>
  47. <view class="b-text" v-if="state.track_list.length === 0">暂无数据</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 加载中 -->
  53. <load-more :loadingType="loadingType" :loadingText="loadingText" :top="300"></load-more>
  54. </view>
  55. </template>
  56. <script>
  57. import { getExpressFeed } from '@/service/api/gift.js';
  58. // import mixinsCommon from '@/mixins/common.js';
  59. // import mixinsAuth from '../../mixins/auth.js';
  60. export default {
  61. // mixins: [mixinsCommon, mixinsAuth],
  62. data() {
  63. return {
  64. state: {},
  65. hasLoad: false,
  66. loadingType: 1,
  67. loadingText: ''
  68. };
  69. },
  70. onLoad(options) {
  71. this.loadFeed(options.id);
  72. },
  73. methods: {
  74. loadFeed(recordId) {
  75. getExpressFeed(recordId).then(([err, res]) => {
  76. console.log('getExpressFeed', err, res);
  77. if (!err) {
  78. this.hasLoad = true;
  79. this.loadingType = -1;
  80. this.state = res;
  81. } else {
  82. this.loadingType = 3;
  83. this.loadingText = err.data.msg || '加载失败';
  84. }
  85. });
  86. }
  87. }
  88. };
  89. </script>
  90. <style lang="scss">
  91. // page {
  92. // padding-bottom: env(safe-area-inset-bottom);
  93. // background: $pq-bg-color;
  94. // }
  95. .wrap {
  96. }
  97. .box {
  98. margin-top: 30upx;
  99. background: #fff;
  100. padding: 15upx 0;
  101. .b-row {
  102. padding: 15upx 30upx;
  103. display: flex;
  104. // justify-content: space-between;
  105. .b-tit {
  106. font-size: 28upx;
  107. width: 180upx;
  108. color: #666;
  109. }
  110. .b-cont {
  111. display: flex;
  112. align-items: center;
  113. font-size: 28upx;
  114. color: #333;
  115. }
  116. .s-copy {
  117. margin-left: 20upx;
  118. font-size: 24upx;
  119. color: #ffc300;
  120. }
  121. .s-province,
  122. .s-city,
  123. .s-area {
  124. margin-right: 10upx;
  125. }
  126. .s-phone {
  127. margin-left: 20upx;
  128. }
  129. .s-btn {
  130. padding: 0 30upx;
  131. background: #ffc300;
  132. color: #fff;
  133. font-size: 24upx;
  134. height: 60upx;
  135. line-height: 60upx;
  136. border-radius: 30upx;
  137. }
  138. }
  139. }
  140. .feed-detail {
  141. padding: 30upx;
  142. background: #fff;
  143. margin-top: 30upx;
  144. .address-data {
  145. display: flex;
  146. .iconfont {
  147. margin-right: 20upx;
  148. color: #999;
  149. font-size: 36upx;
  150. }
  151. .b-address {
  152. color: #999;
  153. font-size: 28upx;
  154. line-height: 40upx;
  155. .s-tit {
  156. margin-right: 10upx;
  157. }
  158. .s-cont {
  159. }
  160. }
  161. }
  162. .feed-data {
  163. margin-top: 60upx;
  164. display: flex;
  165. .iconfont {
  166. margin-right: 20upx;
  167. color: #aaa;
  168. font-size: 36upx;
  169. }
  170. .feed-list {
  171. .b-text {
  172. color: #999;
  173. font-size: 28upx;
  174. }
  175. .b-row {
  176. margin-bottom: 30upx;
  177. &:last-child {
  178. margin-bottom: 0;
  179. }
  180. &:first-child {
  181. .s-cont {
  182. color: #333;
  183. }
  184. .s-time {
  185. color: #666;
  186. }
  187. }
  188. .s-cont {
  189. color: #999;
  190. font-size: 28upx;
  191. }
  192. .s-time {
  193. margin-top: 10upx;
  194. color: #999;
  195. font-size: 26upx;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. </style>