index.vue 8.0 KB

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