logistics_details.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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}}{{$t(`积分`)}}</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'>{{$t(`物流公司`)}}:</text> {{orderInfo.delivery_name}}</view>
  22. <view class='express line1'><text class='name'>{{$t(`快递单号`)}}:</text>
  23. {{orderInfo.delivery_id}}</view>
  24. </view>
  25. </view>
  26. <!-- #ifndef H5 -->
  27. <view class='copy' @tap='copyOrderId'>{{$t(`复制单号`)}}</view>
  28. <!-- #endif -->
  29. <!-- #ifdef H5 -->
  30. <view class='copy copy-data' :data-clipboard-text="orderInfo.delivery_id">{{$t(`复制单号`)}}</view>
  31. <!-- #endif -->
  32. </view>
  33. <view class='item' v-for="(item,index) in expressList" :key="index">
  34. <view class='circular' :class='index === 0 ? "on":""'></view>
  35. <view class='text' :class='index===0 ? "on-font on":""'>
  36. <view>{{item.status}}</view>
  37. <view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. <recommend :hostProduct='hostProduct'></recommend>
  42. </view>
  43. <!-- #ifdef MP -->
  44. <!-- <authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
  45. <!-- #endif -->
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. getProductHot
  51. } from '@/api/store.js';
  52. import {
  53. getLogisticsDetails
  54. } from '@/api/activity.js'
  55. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  56. import {
  57. toLogin
  58. } from '@/libs/login.js';
  59. import {
  60. mapGetters
  61. } from "vuex";
  62. import recommend from '@/components/recommend';
  63. // #ifdef MP
  64. import authorize from '@/components/Authorize';
  65. // #endif
  66. import colors from '@/mixins/color.js';
  67. export default {
  68. components: {
  69. recommend,
  70. // #ifdef MP
  71. authorize
  72. // #endif
  73. },
  74. mixins: [colors],
  75. data() {
  76. return {
  77. orderId: '',
  78. product: {
  79. productInfo: {}
  80. },
  81. orderInfo: {},
  82. expressList: [],
  83. hostProduct: []
  84. };
  85. },
  86. computed: mapGetters(['isLogin']),
  87. watch: {
  88. isLogin: {
  89. handler: function(newV, oldV) {
  90. if (newV) {
  91. this.getExpress();
  92. this.get_host_product();
  93. }
  94. },
  95. deep: true
  96. }
  97. },
  98. onLoad: function(options) {
  99. if (!options.order_id) return this.$util.Tips({
  100. title: this.$t(`缺少订单号`)
  101. });
  102. this.orderId = options.order_id;
  103. if (this.isLogin) {
  104. this.getExpress();
  105. this.get_host_product();
  106. } else {
  107. toLogin();
  108. }
  109. },
  110. onReady: function() {
  111. // #ifdef H5
  112. this.$nextTick(function() {
  113. const clipboard = new ClipboardJS(".copy-data");
  114. clipboard.on("success", () => {
  115. this.$util.Tips({
  116. title: this.$t(`复制成功`)
  117. });
  118. });
  119. });
  120. // #endif
  121. },
  122. // 滚动监听
  123. onPageScroll(e) {
  124. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  125. uni.$emit('scroll');
  126. },
  127. methods: {
  128. /**
  129. * 授权回调
  130. */
  131. onLoadFun: function() {
  132. this.getExpress();
  133. this.get_host_product();
  134. },
  135. copyOrderId: function() {
  136. uni.setClipboardData({
  137. data: this.orderInfo.delivery_id
  138. });
  139. },
  140. getExpress: function() {
  141. let that = this;
  142. getLogisticsDetails(that.orderId).then(function(res) {
  143. let result = res.data.express.result || {};
  144. // that.$set(that, 'product', res.data.order.cartInfo[0] || {});
  145. that.$set(that, 'orderInfo', res.data.order);
  146. that.$set(that, 'expressList', result.list || []);
  147. }).catch((error) => {
  148. this.$util.Tips({
  149. title: error
  150. });
  151. });
  152. },
  153. /**
  154. * 获取我的推荐
  155. */
  156. get_host_product: function() {
  157. let that = this;
  158. getProductHot().then(function(res) {
  159. that.$set(that, 'hostProduct', res.data);
  160. });
  161. },
  162. }
  163. }
  164. </script>
  165. <style scoped lang="scss">
  166. .logistics .header {
  167. padding: 23rpx 30rpx;
  168. background-color: #fff;
  169. height: 166rpx;
  170. box-sizing: border-box;
  171. }
  172. .logistics .header .pictrue {
  173. width: 120rpx;
  174. height: 120rpx;
  175. }
  176. .logistics .header .pictrue image {
  177. width: 100%;
  178. height: 100%;
  179. border-radius: 6rpx;
  180. }
  181. .logistics .header .text {
  182. width: 540rpx;
  183. font-size: 28rpx;
  184. color: #999;
  185. margin-top: 6rpx;
  186. }
  187. .logistics .header .text .name {
  188. width: 365rpx;
  189. color: #282828;
  190. }
  191. .logistics .header .text .money {
  192. text-align: right;
  193. }
  194. .logistics .logisticsCon {
  195. background-color: #fff;
  196. margin: 12rpx 0;
  197. }
  198. .logistics .logisticsCon .company {
  199. height: 120rpx;
  200. margin: 0 0 45rpx 30rpx;
  201. padding-right: 30rpx;
  202. border-bottom: 1rpx solid #f5f5f5;
  203. }
  204. .logistics .logisticsCon .company .picTxt {
  205. width: 520rpx;
  206. }
  207. .logistics .logisticsCon .company .picTxt .iconfont {
  208. width: 50rpx;
  209. height: 50rpx;
  210. background-color: #666;
  211. text-align: center;
  212. line-height: 50rpx;
  213. color: #fff;
  214. font-size: 35rpx;
  215. }
  216. .logistics .logisticsCon .company .picTxt .text {
  217. width: 450rpx;
  218. font-size: 26rpx;
  219. color: #282828;
  220. }
  221. .logistics .logisticsCon .company .picTxt .text .name {
  222. color: #999;
  223. }
  224. .logistics .logisticsCon .company .picTxt .text .express {
  225. margin-top: 5rpx;
  226. }
  227. .logistics .logisticsCon .company .copy {
  228. font-size: 20rpx;
  229. width: 106rpx;
  230. text-align: center;
  231. border-radius: 3rpx;
  232. border: 1px solid #999;
  233. padding: 3rpx 0;
  234. }
  235. .logistics .logisticsCon .item {
  236. padding: 0 40rpx;
  237. position: relative;
  238. }
  239. .logistics .logisticsCon .item .circular {
  240. width: 20rpx;
  241. height: 20rpx;
  242. border-radius: 50%;
  243. position: absolute;
  244. top: -1rpx;
  245. left: 31.5rpx;
  246. background-color: #ddd;
  247. }
  248. .logistics .logisticsCon .item .circular.on {
  249. background-color: var(--view-theme);
  250. }
  251. .logistics .logisticsCon .item .text.on-font {
  252. color: var(--view-theme);
  253. }
  254. .logistics .logisticsCon .item .text .data.on-font {
  255. color: var(--view-theme);
  256. }
  257. .logistics .logisticsCon .item .text {
  258. font-size: 26rpx;
  259. color: #666;
  260. width: 615rpx;
  261. border-left: 1rpx solid #e6e6e6;
  262. padding: 0 0 60rpx 38rpx;
  263. }
  264. .logistics .logisticsCon .item .text.on {
  265. border-left-color: var(--view-minorColor);
  266. }
  267. .logistics .logisticsCon .item .text .data {
  268. font-size: 24rpx;
  269. color: #999;
  270. margin-top: 10rpx;
  271. }
  272. .logistics .logisticsCon .item .text .data .time {
  273. margin-left: 15rpx;
  274. }
  275. </style>