index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view v-if="!isLoading" class="container">
  3. <!-- 物流信息 -->
  4. <view class="express i-card">
  5. <view class="info-item">
  6. <view class="item-lable">物流公司</view>
  7. <view class="item-content">
  8. <text>{{ express.express_name }}</text>
  9. </view>
  10. </view>
  11. <view class="info-item">
  12. <view class="item-lable">物流单号</view>
  13. <view class="item-content">
  14. <text>{{ express.express_no }}</text>
  15. <view class="act-copy" @click.stop="handleCopy(express.express_no)">
  16. <text>复制</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. <!-- 物流动态 -->
  22. <view class="logis-detail">
  23. <view class="logis-item" :class="{ first: index === 0 }" v-for="(item, index) in express.list" :key="index">
  24. <view class="logis-item-content">
  25. <view class="logis-item-content__describe">
  26. <text class="f-26">{{ item.context }}</text>
  27. </view>
  28. <view class="logis-item-content__time">
  29. <text class="f-22">{{ item.ftime }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import * as OrderApi from '@/api/order'
  38. export default {
  39. data() {
  40. return {
  41. // 正在加载
  42. isLoading: true,
  43. // 当前订单ID
  44. orderId: null,
  45. // 物流信息
  46. express: {}
  47. }
  48. },
  49. /**
  50. * 生命周期函数--监听页面加载
  51. */
  52. onLoad({ orderId }) {
  53. this.orderId = orderId
  54. // 获取当前订单的物流信息
  55. this.getExpress()
  56. },
  57. methods: {
  58. // 获取当前订单的物流信息
  59. getExpress() {
  60. const app = this
  61. app.isLoading = true
  62. OrderApi.express(app.orderId)
  63. .then(result => {
  64. app.express = result.data.express
  65. app.isLoading = false
  66. })
  67. },
  68. // 复制指定内容
  69. handleCopy(value) {
  70. const app = this
  71. uni.setClipboardData({
  72. data: value,
  73. success() {
  74. app.$toast('复制成功')
  75. }
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. // 通栏卡片
  83. .i-card {
  84. background: #fff;
  85. padding: 24rpx 24rpx;
  86. // width: 94%;
  87. box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
  88. // margin: 0 auto 20rpx auto;
  89. // border-radius: 20rpx;
  90. }
  91. // 物流公司
  92. .express {
  93. // margin-top: 24rpx;
  94. .info-item {
  95. display: flex;
  96. margin-bottom: 24rpx;
  97. &:last-child {
  98. margin-bottom: 0;
  99. }
  100. .item-lable {
  101. display: flex;
  102. align-items: center;
  103. font-size: 24rpx;
  104. color: #999;
  105. margin-right: 30rpx;
  106. }
  107. .item-content {
  108. flex: 1;
  109. display: flex;
  110. align-items: center;
  111. font-size: 26rpx;
  112. color: #333;
  113. .act-copy {
  114. margin-left: 20rpx;
  115. padding: 2rpx 20rpx;
  116. font-size: 22rpx;
  117. color: #666;
  118. border: 1rpx solid #c1c1c1;
  119. border-radius: 16rpx;
  120. }
  121. }
  122. }
  123. }
  124. .logis-detail {
  125. padding: 30rpx;
  126. background-color: #fff;
  127. .logis-item {
  128. position: relative;
  129. padding: 10px 0 10px 25px;
  130. box-sizing: border-box;
  131. border-left: 2px solid #ccc;
  132. &.first {
  133. border-left: 2px solid #f40;
  134. &:after {
  135. background: #f40;
  136. }
  137. .logis-item-content {
  138. background: #ff6e39;
  139. color: #fff;
  140. &:after {
  141. border-bottom-color: #ff6e39;
  142. }
  143. }
  144. }
  145. &:after {
  146. content: ' ';
  147. display: inline-block;
  148. position: absolute;
  149. left: -6px;
  150. top: 30px;
  151. width: 6px;
  152. height: 6px;
  153. border-radius: 10px;
  154. background: #bdbdbd;
  155. border: 2px solid #fff;
  156. }
  157. .logis-item-content {
  158. position: relative;
  159. background: #f9f9f9;
  160. padding: 10rpx 20rpx;
  161. box-sizing: border-box;
  162. color: #666;
  163. &:after {
  164. content: '';
  165. display: inline-block;
  166. position: absolute;
  167. left: -10px;
  168. top: 18px;
  169. border-left: 10px solid #fff;
  170. border-bottom: 10px solid #f3f3f3;
  171. }
  172. }
  173. }
  174. }
  175. </style>