logistics_details.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. import {
  46. getProductHot
  47. } from '@/api/store.js';
  48. import {
  49. getLogisticsDetails
  50. } from '@/api/activity.js'
  51. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  52. import {
  53. toLogin
  54. } from '@/libs/login.js';
  55. import {
  56. mapGetters
  57. } from "vuex";
  58. import recommend from '@/components/recommend';
  59. import colors from '@/mixins/color.js';
  60. export default {
  61. components: {
  62. recommend
  63. },
  64. mixins:[colors],
  65. data() {
  66. return {
  67. orderId: '',
  68. product: {
  69. productInfo: {}
  70. },
  71. orderInfo: {},
  72. expressList: [],
  73. hostProduct: []
  74. };
  75. },
  76. computed: mapGetters(['isLogin']),
  77. watch: {
  78. isLogin: {
  79. handler: function(newV, oldV) {
  80. if (newV) {
  81. this.getExpress();
  82. this.get_host_product();
  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. if (this.isLogin) {
  94. this.getExpress();
  95. this.get_host_product();
  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. /**
  117. * 授权回调
  118. */
  119. onLoadFun: function() {
  120. this.getExpress();
  121. this.get_host_product();
  122. },
  123. copyOrderId: function() {
  124. uni.setClipboardData({
  125. data: this.orderInfo.delivery_id
  126. });
  127. },
  128. getExpress: function() {
  129. let that = this;
  130. getLogisticsDetails(that.orderId).then(function(res) {
  131. let result = res.data.express.result || {};
  132. // that.$set(that, 'product', res.data.order.cartInfo[0] || {});
  133. that.$set(that, 'orderInfo', res.data.order);
  134. that.$set(that, 'expressList', result.list || []);
  135. }).catch((error) => {
  136. this.$util.Tips({
  137. title: error
  138. });
  139. });
  140. },
  141. /**
  142. * 获取我的推荐
  143. */
  144. get_host_product: function() {
  145. let that = this;
  146. getProductHot().then(function(res) {
  147. that.$set(that, 'hostProduct', res.data);
  148. });
  149. },
  150. }
  151. }
  152. </script>
  153. <style scoped lang="scss">
  154. .logistics .header {
  155. padding: 23rpx 30rpx;
  156. background-color: #fff;
  157. height: 166rpx;
  158. box-sizing: border-box;
  159. }
  160. .logistics .header .pictrue {
  161. width: 120rpx;
  162. height: 120rpx;
  163. }
  164. .logistics .header .pictrue image {
  165. width: 100%;
  166. height: 100%;
  167. border-radius: 6rpx;
  168. }
  169. .logistics .header .text {
  170. width: 540rpx;
  171. font-size: 28rpx;
  172. color: #999;
  173. margin-top: 6rpx;
  174. }
  175. .logistics .header .text .name {
  176. width: 365rpx;
  177. color: #282828;
  178. }
  179. .logistics .header .text .money {
  180. text-align: right;
  181. }
  182. .logistics .logisticsCon {
  183. background-color: #fff;
  184. margin: 12rpx 0;
  185. }
  186. .logistics .logisticsCon .company {
  187. height: 120rpx;
  188. margin: 0 0 45rpx 30rpx;
  189. padding-right: 30rpx;
  190. border-bottom: 1rpx solid #f5f5f5;
  191. }
  192. .logistics .logisticsCon .company .picTxt {
  193. width: 520rpx;
  194. }
  195. .logistics .logisticsCon .company .picTxt .iconfont {
  196. width: 50rpx;
  197. height: 50rpx;
  198. background-color: #666;
  199. text-align: center;
  200. line-height: 50rpx;
  201. color: #fff;
  202. font-size: 35rpx;
  203. }
  204. .logistics .logisticsCon .company .picTxt .text {
  205. width: 450rpx;
  206. font-size: 26rpx;
  207. color: #282828;
  208. }
  209. .logistics .logisticsCon .company .picTxt .text .name {
  210. color: #999;
  211. }
  212. .logistics .logisticsCon .company .picTxt .text .express {
  213. margin-top: 5rpx;
  214. }
  215. .logistics .logisticsCon .company .copy {
  216. font-size: 20rpx;
  217. width: 106rpx;
  218. text-align: center;
  219. border-radius: 3rpx;
  220. border: 1px solid #999;
  221. padding: 3rpx 0;
  222. }
  223. .logistics .logisticsCon .item {
  224. padding: 0 40rpx;
  225. position: relative;
  226. }
  227. .logistics .logisticsCon .item .circular {
  228. width: 20rpx;
  229. height: 20rpx;
  230. border-radius: 50%;
  231. position: absolute;
  232. top: -1rpx;
  233. left: 31.5rpx;
  234. background-color: #ddd;
  235. }
  236. .logistics .logisticsCon .item .circular.on {
  237. background-color: var(--view-theme);
  238. }
  239. .logistics .logisticsCon .item .text.on-font {
  240. color: var(--view-theme);
  241. }
  242. .logistics .logisticsCon .item .text .data.on-font {
  243. color: var(--view-theme);
  244. }
  245. .logistics .logisticsCon .item .text {
  246. font-size: 26rpx;
  247. color: #666;
  248. width: 615rpx;
  249. border-left: 1rpx solid #e6e6e6;
  250. padding: 0 0 60rpx 38rpx;
  251. }
  252. .logistics .logisticsCon .item .text.on {
  253. border-left-color: var(--view-minorColor);
  254. }
  255. .logistics .logisticsCon .item .text .data {
  256. font-size: 24rpx;
  257. color: #999;
  258. margin-top: 10rpx;
  259. }
  260. .logistics .logisticsCon .item .text .data .time {
  261. margin-left: 15rpx;
  262. }
  263. </style>