index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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 ClipboardJS from "@/plugin/clipboard/clipboard.js";
  45. import {
  46. toLogin
  47. } from '@/libs/login.js';
  48. import {
  49. mapGetters
  50. } from "vuex";
  51. export default {
  52. data() {
  53. return {
  54. invoiceId: '',
  55. product: {
  56. productInfo: {}
  57. },
  58. orderInfo: {},
  59. expressList: [],
  60. hostProduct: [],
  61. loading: false,
  62. goodScroll: true,
  63. params: { //精品推荐分页
  64. page: 1,
  65. limit: 10,
  66. },
  67. expressName: '' //物流公司
  68. };
  69. },
  70. computed: mapGetters(['isLogin']),
  71. watch:{
  72. isLogin:{
  73. handler:function(newV,oldV){
  74. if(newV){
  75. this.getExpress();
  76. }
  77. },
  78. deep:true
  79. }
  80. },
  81. onLoad: function (options) {
  82. if (!options.invoiceId) return this.$util.Tips({title:'缺少订单号'});
  83. this.invoiceId = options.invoiceId;
  84. this.expressName = options.expressName;
  85. if (this.isLogin) {
  86. this.getExpress();
  87. } else {
  88. toLogin();
  89. }
  90. },
  91. onReady: function() {
  92. // #ifdef H5
  93. this.$nextTick(function() {
  94. const clipboard = new ClipboardJS(".copy-data");
  95. clipboard.on("success", () => {
  96. this.$util.Tips({
  97. title: '复制成功'
  98. });
  99. });
  100. });
  101. // #endif
  102. },
  103. methods: {
  104. copyOrderId:function(){
  105. uni.setClipboardData({ data: this.orderInfo.number });
  106. },
  107. getExpress:function(){
  108. let that=this;
  109. express(that.invoiceId).then(function(res){
  110. let result = res.data|| {};
  111. that.$set(that,'orderInfo',res.data);
  112. that.$set(that,'expressList',result.list || []);
  113. });
  114. }
  115. },
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .logistics .header {
  120. padding: 23rpx 30rpx;
  121. background-color: #fff;
  122. height: 166rpx;
  123. box-sizing: border-box;
  124. }
  125. .logistics .header .pictrue {
  126. width: 120rpx;
  127. height: 120rpx;
  128. }
  129. .logistics .header .pictrue image {
  130. width: 100%;
  131. height: 100%;
  132. border-radius: 6rpx;
  133. }
  134. .logistics .header .text {
  135. width: 540rpx;
  136. font-size: 28rpx;
  137. color: #999;
  138. margin-top: 6rpx;
  139. }
  140. .logistics .header .text .name {
  141. width: 365rpx;
  142. color: #282828;
  143. }
  144. .logistics .header .text .money {
  145. text-align: right;
  146. }
  147. .logistics .logisticsCon {
  148. background-color: #fff;
  149. margin: 12rpx 0;
  150. }
  151. .logistics .logisticsCon .company {
  152. height: 120rpx;
  153. margin: 0 0 45rpx 30rpx;
  154. padding-right: 30rpx;
  155. border-bottom: 1rpx solid #f5f5f5;
  156. }
  157. .logistics .logisticsCon .company .picTxt {
  158. width: 520rpx;
  159. }
  160. .logistics .logisticsCon .company .picTxt .iconfont {
  161. width: 50rpx;
  162. height: 50rpx;
  163. background-color: #666;
  164. text-align: center;
  165. line-height: 50rpx;
  166. color: #fff;
  167. font-size: 35rpx;
  168. }
  169. .logistics .logisticsCon .company .picTxt .text {
  170. width: 450rpx;
  171. font-size: 26rpx;
  172. color: #282828;
  173. }
  174. .logistics .logisticsCon .company .picTxt .text .name {
  175. color: #999;
  176. }
  177. .logistics .logisticsCon .company .picTxt .text .express {
  178. margin-top: 5rpx;
  179. }
  180. .logistics .logisticsCon .company .copy {
  181. font-size: 20rpx;
  182. width: 106rpx;
  183. height: 40rpx;
  184. text-align: center;
  185. line-height: 40rpx;
  186. border-radius: 20rpx;
  187. border: 1rpx solid #999;
  188. }
  189. .logistics .logisticsCon .item {
  190. padding: 0 40rpx;
  191. position: relative;
  192. }
  193. .logistics .logisticsCon .item .circular {
  194. width: 20rpx;
  195. height: 20rpx;
  196. border-radius: 50%;
  197. position: absolute;
  198. top: -1rpx;
  199. left: 31.5rpx;
  200. background-color: #ddd;
  201. }
  202. .logistics .logisticsCon .item .circular.on {
  203. background-color: $theme-color;
  204. }
  205. .logistics .logisticsCon .item .text.on-font {
  206. color: $theme-color;
  207. }
  208. .logistics .logisticsCon .item .text .data.on-font {
  209. color: $theme-color;
  210. }
  211. .logistics .logisticsCon .item .text {
  212. font-size: 26rpx;
  213. color: #666;
  214. width: 615rpx;
  215. border-left: 1rpx solid #e6e6e6;
  216. padding: 0 0 60rpx 38rpx;
  217. }
  218. .logistics .logisticsCon .item .text.on {
  219. border-left-color: #f8c1bd;
  220. }
  221. .logistics .logisticsCon .item .text .data {
  222. font-size: 24rpx;
  223. color: #999;
  224. margin-top: 10rpx;
  225. }
  226. .logistics .logisticsCon .item .text .data .time {
  227. margin-left: 15rpx;
  228. }
  229. </style>