logistics_details.vue 6.7 KB

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