logistics.vue 6.0 KB

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