logistics_details.vue 6.6 KB

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