index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view>
  3. <view class='logistics'>
  4. <view class='logisticsCon'>
  5. <view class='company acea-row row-between-wrapper'>
  6. <view class='picTxt acea-row row-between-wrapper'>
  7. <view class='iconfont icon-wuliu'></view>
  8. <view class='text'>
  9. <view><text class='name line1'>物流公司:</text> {{expressName?expressName:orderInfo.expName}}</view>
  10. <view class='express line1'><text class='name'>快递单号:</text> {{orderInfo.number}}</view>
  11. </view>
  12. </view>
  13. <!-- #ifndef H5 -->
  14. <view class='copy' @tap='copyOrderId'>复制单号</view>
  15. <!-- #endif -->
  16. <!-- #ifdef H5 -->
  17. <view class='copy copy-data' :data-clipboard-text="orderInfo.number">复制单号</view>
  18. <!-- #endif -->
  19. </view>
  20. <view class='item' v-for="(item,index) in expressList" :key="index">
  21. <view class='circular' :class='index === 0 ? "on":""'></view>
  22. <view class='text' :class='index===0 ? "on-font on":""'>
  23. <view>{{item.status}}</view>
  24. <view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. // +----------------------------------------------------------------------
  33. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  34. // +----------------------------------------------------------------------
  35. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  36. // +----------------------------------------------------------------------
  37. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  38. // +----------------------------------------------------------------------
  39. // | Author: CRMEB Team <admin@crmeb.com>
  40. // +----------------------------------------------------------------------
  41. import {
  42. express
  43. } from '@/api/order.js';
  44. import {
  45. secondHandExpress
  46. } from '@/api/secondHand.js';
  47. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  48. import {
  49. toLogin
  50. } from '@/libs/login.js';
  51. import {
  52. mapGetters
  53. } from "vuex";
  54. export default {
  55. data() {
  56. return {
  57. invoiceId: '',
  58. product: {
  59. productInfo: {}
  60. },
  61. orderInfo: {},
  62. expressList: [],
  63. hostProduct: [],
  64. orderType: '',
  65. loading: false,
  66. goodScroll: true,
  67. params: { //精品推荐分页
  68. page: 1,
  69. limit: 10,
  70. },
  71. expressName: '' //物流公司
  72. };
  73. },
  74. computed: mapGetters(['isLogin']),
  75. watch:{
  76. isLogin:{
  77. handler:function(newV,oldV){
  78. if(newV){
  79. this.getExpress();
  80. }
  81. },
  82. deep:true
  83. }
  84. },
  85. onLoad: function (options) {
  86. if (!options.invoiceId) return this.$util.Tips({title:'缺少订单号'});
  87. this.invoiceId = options.invoiceId;
  88. this.expressName = options.expressName;
  89. this.orderType=options.orderType;
  90. if (this.isLogin) {
  91. this.getExpress();
  92. } else {
  93. toLogin();
  94. }
  95. },
  96. onReady: function() {
  97. // #ifdef H5
  98. this.$nextTick(function() {
  99. const clipboard = new ClipboardJS(".copy-data");
  100. clipboard.on("success", () => {
  101. this.$util.Tips({
  102. title: '复制成功'
  103. });
  104. });
  105. });
  106. // #endif
  107. },
  108. methods: {
  109. copyOrderId:function(){
  110. uni.setClipboardData({ data: this.orderInfo.number });
  111. },
  112. getExpress:function(){
  113. let that=this;
  114. let api=this.orderType === 'secondHand' ?secondHandExpress:express;
  115. api(that.invoiceId).then(function(res){
  116. let result = res.data|| {};
  117. that.$set(that,'orderInfo',res.data);
  118. that.$set(that,'expressList',result.list || []);
  119. });
  120. }
  121. },
  122. }
  123. </script>
  124. <style scoped lang="scss">
  125. .logistics .header {
  126. padding: 23rpx 30rpx;
  127. background-color: #fff;
  128. height: 166rpx;
  129. box-sizing: border-box;
  130. }
  131. .logistics .header .pictrue {
  132. width: 120rpx;
  133. height: 120rpx;
  134. }
  135. .logistics .header .pictrue image {
  136. width: 100%;
  137. height: 100%;
  138. border-radius: 6rpx;
  139. }
  140. .logistics .header .text {
  141. width: 540rpx;
  142. font-size: 28rpx;
  143. color: #999;
  144. margin-top: 6rpx;
  145. }
  146. .logistics .header .text .name {
  147. width: 365rpx;
  148. color: #282828;
  149. }
  150. .logistics .header .text .money {
  151. text-align: right;
  152. }
  153. .logistics .logisticsCon {
  154. background-color: #fff;
  155. margin: 12rpx 0;
  156. }
  157. .logistics .logisticsCon .company {
  158. height: 120rpx;
  159. margin: 0 0 45rpx 30rpx;
  160. padding-right: 30rpx;
  161. border-bottom: 1rpx solid #f5f5f5;
  162. }
  163. .logistics .logisticsCon .company .picTxt {
  164. width: 520rpx;
  165. }
  166. .logistics .logisticsCon .company .picTxt .iconfont {
  167. width: 50rpx;
  168. height: 50rpx;
  169. background-color: #666;
  170. text-align: center;
  171. line-height: 50rpx;
  172. color: #fff;
  173. font-size: 35rpx;
  174. }
  175. .logistics .logisticsCon .company .picTxt .text {
  176. width: 450rpx;
  177. font-size: 26rpx;
  178. color: #282828;
  179. }
  180. .logistics .logisticsCon .company .picTxt .text .name {
  181. color: #999;
  182. }
  183. .logistics .logisticsCon .company .picTxt .text .express {
  184. margin-top: 5rpx;
  185. }
  186. .logistics .logisticsCon .company .copy {
  187. font-size: 20rpx;
  188. width: 106rpx;
  189. height: 40rpx;
  190. text-align: center;
  191. line-height: 40rpx;
  192. border-radius: 20rpx;
  193. border: 1rpx solid #999;
  194. }
  195. .logistics .logisticsCon .item {
  196. padding: 0 40rpx;
  197. position: relative;
  198. }
  199. .logistics .logisticsCon .item .circular {
  200. width: 20rpx;
  201. height: 20rpx;
  202. border-radius: 50%;
  203. position: absolute;
  204. top: -1rpx;
  205. left: 31.5rpx;
  206. background-color: #ddd;
  207. }
  208. .logistics .logisticsCon .item .circular.on {
  209. background-color: $theme-color;
  210. }
  211. .logistics .logisticsCon .item .text.on-font {
  212. color: $theme-color;
  213. }
  214. .logistics .logisticsCon .item .text .data.on-font {
  215. color: $theme-color;
  216. }
  217. .logistics .logisticsCon .item .text {
  218. font-size: 26rpx;
  219. color: #666;
  220. width: 615rpx;
  221. border-left: 1rpx solid #e6e6e6;
  222. padding: 0 0 60rpx 38rpx;
  223. }
  224. .logistics .logisticsCon .item .text.on {
  225. border-left-color: #f8c1bd;
  226. }
  227. .logistics .logisticsCon .item .text .data {
  228. font-size: 24rpx;
  229. color: #999;
  230. margin-top: 10rpx;
  231. }
  232. .logistics .logisticsCon .item .text .data .time {
  233. margin-left: 15rpx;
  234. }
  235. </style>