orderLogistics.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <view class="order-view">
  4. <view class="clearfix top-view">
  5. <view class="float_left">
  6. <text class="top-label">订单编号:</text>
  7. <text class="top-val">{{ order_detail.no }}</text>
  8. </view>
  9. <view class="float_right" @click="lianxi">
  10. <text class="ibonfont ibonkefu"></text>
  11. 联系卖家
  12. </view>
  13. </view>
  14. <view class="goods-ul clearfix">
  15. <view class="goods-li" v-for="(item, index) in order_detail.goodsData" :key="index">
  16. <view class="num-view">x{{ item.buyNum }}</view>
  17. <image :src="item.images[0]" mode="aspectFill"></image>
  18. </view>
  19. </view>
  20. <view class="logistics-view">
  21. <view class="logistics-li">
  22. <text class="logistics-label">运单号:</text>
  23. <text class="logistics-val">{{ express_info.nu }}</text>
  24. </view>
  25. <view class="logistics-li">
  26. <text class="logistics-label">国内承运人:</text>
  27. <text class="logistics-val">{{ express_info.expressName }}</text>
  28. </view>
  29. <!-- <view class="logistics-li">
  30. <text class="logistics-label">国内承运人电话:</text>
  31. <text class="logistics-val">95543</text>
  32. </view> -->
  33. </view>
  34. </view>
  35. <view class="logistics-line">
  36. <u-time-line v-if="express_info.list.length">
  37. <u-time-line-item v-for="(item, index) in express_info.list" :key="index">
  38. <template v-slot:node>
  39. <view class="u-node" :style="{ background: index === 0 ? '#19be6b' : '#999999' }"></view>
  40. </template>
  41. <template v-slot:content>
  42. <view>
  43. <view class="u-order-desc" :class="[index === 0 ? 'u-order-desc-on' : '']">{{ item.context }}</view>
  44. <view class="u-order-time">{{ item.time }}</view>
  45. </view>
  46. </template>
  47. </u-time-line-item>
  48. </u-time-line>
  49. <u-time-line v-else>
  50. <u-time-line-item>
  51. <template v-slot:node>
  52. <view class="u-node" style="background:#19be6b"></view>
  53. </template>
  54. <template v-slot:content>
  55. <view>
  56. <view class="u-order-desc u-order-desc-on">商品已下单</view>
  57. <view class="u-order-time">{{ $_utils.formatDate(order_detail.createTime) }}</view>
  58. </view>
  59. </template>
  60. </u-time-line-item>
  61. </u-time-line>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. express_info: {
  70. list: []
  71. },
  72. order_detail: {}
  73. };
  74. },
  75. onLoad(options) {
  76. this.order_id = options.id;
  77. this.getExpressInfoByOrderId();
  78. this.getOrderInfoById();
  79. },
  80. computed: {
  81. enterprisemobile() {
  82. return this.$store.state.enterpriseInfo.mobile;
  83. }
  84. },
  85. methods: {
  86. // 联系客服
  87. async lianxi() {
  88. uni.makePhoneCall({
  89. phoneNumber: this.enterprisemobile
  90. });
  91. },
  92. getExpressInfoByOrderId() {
  93. this.$u.api.getExpressInfoByOrderId(this.order_id).then(data => {
  94. this.express_info = data.data;
  95. });
  96. },
  97. // 获取订单详情
  98. getOrderInfoById() {
  99. this.$u.api.getOrderInfoById(this.order_id).then(data => {
  100. this.order_detail = data.data;
  101. });
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. page {
  108. background-color: #ffffff;
  109. }
  110. .order-view {
  111. padding: 24upx;
  112. font-size: 28upx;
  113. border-top: 1px solid #e7e7e7;
  114. border-bottom: 24upx solid #f7f7f7;
  115. .top-view {
  116. .top-label {
  117. color: #999999;
  118. }
  119. .float_right {
  120. font-size: 24upx;
  121. .ibonkefu {
  122. color: #999999;
  123. font-size: 32upx;
  124. margin-right: 10upx;
  125. }
  126. }
  127. }
  128. .goods-ul {
  129. padding: 24upx 0;
  130. .goods-li {
  131. display: inline-block;
  132. margin-right: 24upx;
  133. width: 150upx;
  134. height: 150upx;
  135. background-color: #f4f4f4;
  136. border-radius: 10upx;
  137. position: relative;
  138. image {
  139. width: 100%;
  140. height: 100%;
  141. }
  142. .num-view {
  143. position: absolute;
  144. bottom: 0;
  145. right: 0;
  146. color: #ffffff;
  147. background-color: rgba($color: #000000, $alpha: 0.6);
  148. padding: 0 6upx;
  149. line-height: 32upx;
  150. font-size: 24upx;
  151. text-align: center;
  152. z-index: 1;
  153. min-width: 46upx;
  154. }
  155. }
  156. }
  157. .logistics-view {
  158. padding-top: 24upx;
  159. border-top: 1px solid #e7e7e7;
  160. .logistics-li {
  161. padding-bottom: 10upx;
  162. .logistics-label {
  163. color: #999999;
  164. }
  165. }
  166. }
  167. }
  168. .logistics-line {
  169. padding: 24upx;
  170. padding-left: 48upx;
  171. .u-node {
  172. width: 20rpx;
  173. height: 20rpx;
  174. border-radius: 100rpx;
  175. display: flex;
  176. justify-content: center;
  177. align-items: center;
  178. background: #d0d0d0;
  179. }
  180. .u-order-title {
  181. color: #333333;
  182. font-weight: bold;
  183. font-size: 32rpx;
  184. }
  185. .u-order-desc {
  186. color: rgb(150, 150, 150);
  187. font-size: 28rpx;
  188. margin-bottom: 6rpx;
  189. }
  190. .u-order-desc-on {
  191. color: #333333;
  192. }
  193. .u-order-time {
  194. color: rgb(200, 200, 200);
  195. font-size: 26rpx;
  196. }
  197. }
  198. </style>