logistics.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <view class="container">
  3. <Navbar title="物流详情" background-color="#ffffff" color="#333333"></Navbar>
  4. <view class="pad" :class="{ theme }">
  5. <view class="top">
  6. <image class="log-img" :src="staticImg ? staticImg + 'logistics.png' : ''"></image>
  7. <view class="text flex-y">
  8. <text>快递公司:{{ company }}</text>
  9. <text>快递编号:{{ code }}</text>
  10. </view>
  11. </view>
  12. <view class="body flex-space-top" v-if="logList.length > 0">
  13. <view v-for="(item, index) in logList" :key="index">
  14. <view v-if="index == 0" class="step-item">
  15. <view class="active"></view>
  16. <view class="step">
  17. <view class="word14">{{ item.context }}</view>
  18. <text class="tips">{{ item.time }}</text>
  19. </view>
  20. </view>
  21. <view v-else class="step-item">
  22. <view class="circle"></view>
  23. <view class="step">
  24. <text class="word14-gray9">{{ item.context }}</text>
  25. <text class="tips-gray9">{{ item.time }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script lang="ts">
  34. import {
  35. Component,
  36. Prop,
  37. Vue,
  38. Emit
  39. } from 'vue-property-decorator';
  40. @Component({})
  41. export default class logistics extends Vue {
  42. staticImg: string = this.$oss_url;
  43. code: string = '';
  44. company: string = '';
  45. logList: any = [];
  46. oid: number | null = null; // 订单id
  47. id: number | null = null; // 订单id
  48. active: number = 0;
  49. onShow() {
  50. let query = this.$Route.query;
  51. if (query.oid) {
  52. this.oid = +query.oid;
  53. this.id = +query.id;
  54. this.getLogistics();
  55. }
  56. }
  57. getLogistics(): void {
  58. uni.showLoading({
  59. title: '加载中',
  60. });
  61. this.$http
  62. .get({
  63. url: this.$api.logistics,
  64. data: {
  65. oid: this.oid,
  66. id: this.id
  67. }
  68. })
  69. .then((res: any) => {
  70. this.code = res.code;
  71. this.company = res.company;
  72. this.logList = res.data;
  73. uni.hideLoading();
  74. })
  75. .catch((err: any) => {
  76. console.log(err);
  77. uni.hideLoading();
  78. });
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .icon {
  84. @include icon();
  85. }
  86. .flex-right {
  87. @include flex-x(flex-end);
  88. }
  89. .flex-space {
  90. width: 100%;
  91. margin-bottom: vw(10);
  92. @include flex-x();
  93. }
  94. .flex-space-top {
  95. @include flex-x(space-between, flex-start);
  96. }
  97. .flex-left {
  98. @include flex-x();
  99. }
  100. .flex-y {
  101. width: 100%;
  102. padding: 0 vw(5) vw(10);
  103. @include flex-y(flex-start, flex-start);
  104. }
  105. .word14 {
  106. @include word-vw(14);
  107. }
  108. .word14-gray9 {
  109. @include word-vw(14, $gray9);
  110. }
  111. .pad {
  112. width: 100vw;
  113. min-height: 100vh;
  114. background: border-color;
  115. background: #F6F6F6;
  116. .top {
  117. height: vw(80);
  118. @include flex-x(flex-start);
  119. background: white;
  120. padding: 0 vw(15);
  121. position: relative;
  122. .log-img {
  123. width: vw(48);
  124. height: vw(48);
  125. border-radius: 50%;
  126. background: #f5f5f5;
  127. margin-right: vw(5);
  128. @include flex-y();
  129. .icon {
  130. @include icon(24, gray9);
  131. }
  132. }
  133. .avatar {
  134. width: vw(60);
  135. height: vw(60);
  136. border-radius: 50%;
  137. background-color: #f5f5f5;
  138. @include flex-y();
  139. overflow: hidden;
  140. image {
  141. width: vw(60);
  142. height: vw(60);
  143. }
  144. .icon {
  145. @include icon(30, #d8d8d8);
  146. }
  147. }
  148. .text {
  149. padding: vw(15);
  150. flex: 1;
  151. text {
  152. line-height: 1.5;
  153. color: $gray3;
  154. font-size: vw(14);
  155. }
  156. }
  157. }
  158. .body {
  159. background-color: white;
  160. margin-top: vw(10);
  161. padding: 0 vw(15) vw(15);
  162. @include flex-y(flex-start);
  163. .step-item {
  164. @include flex-x(flex-start, flex-start);
  165. margin-top: 27px;
  166. }
  167. .active {
  168. width: vw(14);
  169. height: vw(14);
  170. background: $main-color;
  171. border-radius: 50%;
  172. margin: vw(8);
  173. flex-shrink: 0;
  174. position: relative;
  175. z-index: 1;
  176. &::after {
  177. content: '';
  178. position: absolute;
  179. top: vw(14);
  180. left: vw(6);
  181. width: 1px;
  182. height: 100px;
  183. background-color: $grayEF;
  184. z-index: 0;
  185. }
  186. }
  187. .circle {
  188. width: vw(8);
  189. height: vw(8);
  190. background: $grayEF;
  191. border-radius: 50%;
  192. margin: vw(8) vw(11) vw(10);
  193. flex-shrink: 0;
  194. position: relative;
  195. z-index: 1;
  196. &::after {
  197. content: '';
  198. position: absolute;
  199. top: vw(-50);
  200. left: vw(3);
  201. width: 1px;
  202. height: vw(110);
  203. background-color: $grayEF;
  204. z-index: 0;
  205. }
  206. }
  207. .tips {
  208. font-size: vw(12);
  209. color: $gray3;
  210. }
  211. .tips-gray9 {
  212. font-size: vw(12);
  213. color: $gray9;
  214. }
  215. .circle-empty {
  216. width: vw(20);
  217. }
  218. .step {
  219. @include flex-y(flex-start, flex-start);
  220. }
  221. }
  222. }
  223. </style>