logistics.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view :style="viewColor">
  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> {{orderInfo.delivery_type}}</view>
  10. <view class='express line1'><text class='name'>快递单号:</text> {{orderInfo.delivery_id}}</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.delivery_id">复制单号</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. <recommend v-if="recommend_switch == 1" :hostProduct='hostProduct' :isLogin="isLogin"></recommend>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. // +----------------------------------------------------------------------
  34. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  35. // +----------------------------------------------------------------------
  36. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  37. // +----------------------------------------------------------------------
  38. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  39. // +----------------------------------------------------------------------
  40. // | Author: CRMEB Team <admin@crmeb.com>
  41. // +----------------------------------------------------------------------
  42. import { refundExpress } from '@/api/order.js';
  43. import { getProductHot } from '@/api/store.js';
  44. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  45. import { mapGetters } from "vuex";
  46. import { configMap } from '@/utils';
  47. import { toLogin } from '@/libs/login.js';
  48. import recommend from '@/components/recommend';
  49. export default {
  50. components: {
  51. recommend,
  52. },
  53. data() {
  54. return {
  55. orderId: '',
  56. product: {},
  57. orderInfo: {},
  58. expressList: [],
  59. hostProduct: []
  60. };
  61. },
  62. computed: configMap({recommend_switch:0},mapGetters(['isLogin','viewColor'])),
  63. onLoad: function (options) {
  64. if (!options.orderId) return this.$util.Tips({title:'缺少订单号'});
  65. this.orderId = options.orderId;
  66. if (this.isLogin) {
  67. this.getExpress();
  68. this.get_host_product();
  69. } else {
  70. toLogin()
  71. }
  72. },
  73. onReady: function() {
  74. // #ifdef H5
  75. this.$nextTick(function() {
  76. const clipboard = new ClipboardJS(".copy-data");
  77. clipboard.on("success", () => {
  78. this.$util.Tips({
  79. title: '复制成功'
  80. });
  81. });
  82. });
  83. // #endif
  84. },
  85. methods: {
  86. copyOrderId:function(){
  87. uni.setClipboardData({ data: this.orderInfo.delivery_id });
  88. },
  89. getExpress:function(){
  90. let that=this;
  91. refundExpress(that.orderId).then(function(res){
  92. that.$set(that, 'expressList', res.data.express || []);
  93. that.$set(that, 'orderInfo', res.data.refund);
  94. });
  95. },
  96. /**
  97. * 获取我的推荐
  98. */
  99. get_host_product: function () {
  100. let that = this;
  101. let data = { offset: 1, limit: 10 }
  102. getProductHot().then(function (res) {
  103. that.$set(that,'hostProduct',res.data.list);
  104. });
  105. },
  106. },
  107. // 滚动监听
  108. onPageScroll() {
  109. uni.$emit('scroll');
  110. },
  111. }
  112. </script>
  113. <style scoped lang="scss">
  114. .logistics .header {
  115. padding: 23rpx 30rpx;
  116. background-color: #fff;
  117. height: 166rpx;
  118. box-sizing: border-box;
  119. }
  120. .logistics .header .pictrue {
  121. width: 120rpx;
  122. height: 120rpx;
  123. }
  124. .logistics .header .pictrue image {
  125. width: 100%;
  126. height: 100%;
  127. border-radius: 6rpx;
  128. }
  129. .logistics .header .text {
  130. width: 540rpx;
  131. font-size: 28rpx;
  132. color: #999;
  133. margin-top: 6rpx;
  134. }
  135. .logistics .header .text .name {
  136. width: 365rpx;
  137. color: #282828;
  138. }
  139. .logistics .header .text .money {
  140. text-align: right;
  141. }
  142. .logistics .logisticsCon {
  143. background-color: #fff;
  144. margin: 12rpx 0;
  145. }
  146. .logistics .logisticsCon .company {
  147. height: 120rpx;
  148. margin: 0 0 45rpx 30rpx;
  149. padding-right: 30rpx;
  150. border-bottom: 1px solid #f5f5f5;
  151. }
  152. .logistics .logisticsCon .company .picTxt {
  153. width: 520rpx;
  154. }
  155. .logistics .logisticsCon .company .picTxt .iconfont {
  156. width: 50rpx;
  157. height: 50rpx;
  158. background-color: #666;
  159. text-align: center;
  160. line-height: 50rpx;
  161. color: #fff;
  162. font-size: 35rpx;
  163. }
  164. .logistics .logisticsCon .company .picTxt .text {
  165. width: 450rpx;
  166. font-size: 26rpx;
  167. color: #282828;
  168. }
  169. .logistics .logisticsCon .company .picTxt .text .name {
  170. color: #999;
  171. }
  172. .logistics .logisticsCon .company .picTxt .text .express {
  173. margin-top: 5rpx;
  174. }
  175. .logistics .logisticsCon .company .copy {
  176. font-size: 20rpx;
  177. width: 120rpx;
  178. height: 40rpx;
  179. text-align: center;
  180. line-height: 40rpx;
  181. border-radius: 3rpx;
  182. border: 1px solid #999;
  183. }
  184. .logistics .logisticsCon .item {
  185. padding: 0 40rpx;
  186. position: relative;
  187. }
  188. .logistics .logisticsCon .item .circular {
  189. width: 20rpx;
  190. height: 20rpx;
  191. border-radius: 50%;
  192. position: absolute;
  193. top: -1rpx;
  194. left: 31.5rpx;
  195. background-color: #ddd;
  196. }
  197. .logistics .logisticsCon .item .circular.on {
  198. background-color: var(--view-theme);
  199. }
  200. .logistics .logisticsCon .item .text.on-font {
  201. color: var(--view-theme);
  202. }
  203. .logistics .logisticsCon .item .text .data.on-font {
  204. color: var(--view-theme);
  205. }
  206. .logistics .logisticsCon .item .text {
  207. font-size: 26rpx;
  208. color: #666;
  209. width: 615rpx;
  210. border-left: 1rpx solid #e6e6e6;
  211. padding: 0 0 60rpx 38rpx;
  212. }
  213. .logistics .logisticsCon .item .text.on {
  214. border-left-color: var(--view-bntColor22);
  215. }
  216. .logistics .logisticsCon .item .text .data {
  217. font-size: 24rpx;
  218. color: #999;
  219. margin-top: 10rpx;
  220. }
  221. .logistics .logisticsCon .item .text .data .time {
  222. margin-left: 15rpx;
  223. }
  224. </style>