detail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view>
  3. <view class="w-full header_bg" :style="{'height': (174 + sysHeight) * 2 + 'rpx'}">
  4. <view class="w-full abs-lb white_jianbian"></view>
  5. </view>
  6. <!-- #ifdef MP -->
  7. <NavBar titleText="发货记录" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack></NavBar>
  8. <!-- #endif -->
  9. <view class="relative px-20 z-20 express_box">
  10. <view class="h-66 b-r-16rpx light px-24 flex-between-center fs-22">
  11. <text>{{orderInfo.expName}} {{orderInfo.number}}</text>
  12. <text class="inline-block copy_btn fs-22 text--w111-333" @tap="copyOrderId">复制单号</text>
  13. </view>
  14. </view>
  15. <view class="px-20 mt-20 relative">
  16. <view class="bg--w111-fff rd-16rpx pt-32 pr-24 pl-24 pb-32">
  17. <view class="flex-between-center">
  18. <view class="fs-32 fw-500 text--w111-333">
  19. <text>物流详情</text>
  20. </view>
  21. </view>
  22. <view class="logisticsCon mt-50 relative" v-if="expressList.length">
  23. <view class='item' v-for="(item,index) in logisticList" :key="index">
  24. <view class='circular' :class='index === 0 ? "on text-center":""'>
  25. <text class="iconfont icon-a-ic_CompleteSelect text--w111-fff fs-24" v-if="index == 0"></text>
  26. </view>
  27. <view class='text' :class='index===0 ? "on-font on":""'>
  28. <view>{{item.status}}</view>
  29. <view class='data' :class='index===0 ? "on-font on":""'>{{item.time}}</view>
  30. </view>
  31. </view>
  32. <view class="more-text fs-24" @tap="checkShowMore">
  33. <text>{{showMore ? '收起' : '查看更多物流信息'}}</text>
  34. <text class="iconfont fs-24 pl-8" :class="showMore ? 'icon-ic_uparrow' : 'icon-ic_downarrow'"></text>
  35. </view>
  36. </view>
  37. <emptyPage title="暂无物流信息" :imgSrc="urlDomain+'crmebimage/presets/nowuliu.png'" v-else></emptyPage>
  38. </view>
  39. <view class="safe-area-inset-bottom"></view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  45. import {
  46. express
  47. } from '@/api/order.js';
  48. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  49. import {
  50. toLogin
  51. } from '@/libs/login.js';
  52. import {
  53. mapGetters
  54. } from "vuex";
  55. import {
  56. HTTP_REQUEST_URL
  57. } from '@/config/app';
  58. // #ifdef MP
  59. import NavBar from '../components/NavBar.vue'
  60. // #endif
  61. import emptyPage from '@/components/emptyPage.vue'
  62. export default {
  63. components: {
  64. // #ifdef MP
  65. NavBar,
  66. // #endif
  67. emptyPage,
  68. },
  69. data() {
  70. return {
  71. urlDomain: this.$Cache.get("imgHost"),
  72. sysHeight: sysHeight,
  73. imgHost: HTTP_REQUEST_URL,
  74. orderId: '',
  75. type: '',
  76. product: [],
  77. orderInfo: {},
  78. expressList: [],
  79. hostProduct: [],
  80. isShowAuth: false,
  81. pageScrollStatus: false,
  82. showMore: true,
  83. // #ifdef MP
  84. iconColor: '#FFFFFF',
  85. isScrolling: false,
  86. // #endif
  87. };
  88. },
  89. computed: {
  90. ...mapGetters(['isLogin']),
  91. logisticList() {
  92. if (this.showMore) {
  93. return this.expressList
  94. } else {
  95. return this.expressList.slice(0, 1)
  96. }
  97. }
  98. },
  99. watch: {
  100. isLogin: {
  101. handler: function(newV, oldV) {
  102. if (newV) {
  103. //#ifndef MP
  104. this.getExpress();
  105. // this.get_host_product();
  106. //#endif
  107. }
  108. },
  109. deep: true
  110. }
  111. },
  112. onLoad: function(options) {
  113. this.orderId = options.invoiceId;
  114. if (this.isLogin) {
  115. this.getExpress();
  116. }
  117. },
  118. onReady: function() {
  119. // #ifdef H5
  120. this.$nextTick(function() {
  121. const clipboard = new ClipboardJS(".copy-data");
  122. clipboard.on("success", () => {
  123. this.$util.Tips({
  124. title: '复制成功'
  125. });
  126. });
  127. });
  128. // #endif
  129. },
  130. onPageScroll(object) {
  131. if (object.scrollTop > 100) {
  132. this.pageScrollStatus = true;
  133. } else if (object.scrollTop < 100) {
  134. this.pageScrollStatus = false;
  135. }
  136. // #ifdef MP
  137. if (object.scrollTop > 50) {
  138. this.isScrolling = true;
  139. this.iconColor = '#333333';
  140. } else if (object.scrollTop < 50) {
  141. this.isScrolling = false;
  142. this.iconColor = '#FFFFFF';
  143. }
  144. // #endif
  145. uni.$emit('scroll');
  146. },
  147. onShow() {
  148. if (!this.isLogin) {
  149. toLogin()
  150. }
  151. },
  152. methods: {
  153. // 授权关闭
  154. authColse: function(e) {
  155. this.isShowAuth = e
  156. },
  157. /**
  158. * 授权回调
  159. */
  160. onLoadFun: function() {
  161. this.getExpress();
  162. this.isShowAuth = false;
  163. },
  164. copyOrderId: function() {
  165. uni.setClipboardData({
  166. data: this.orderInfo.number
  167. });
  168. },
  169. getExpress: function() {
  170. let that = this;
  171. express(that.orderId).then(function(res) {
  172. that.$set(that, 'orderInfo', res.data);
  173. that.$set(that, 'expressList', res.data.list || []);
  174. }).catch((error) => {
  175. this.$util.Tips({
  176. title: error
  177. });
  178. });
  179. },
  180. checkShowMore() {
  181. this.showMore = !this.showMore
  182. },
  183. goPage(type, url) {
  184. if (type == 1) {
  185. uni.navigateTo({
  186. url
  187. })
  188. } else if (type == 2) {
  189. uni.switchTab({
  190. url
  191. })
  192. } else if (type == 3) {
  193. uni.navigateBack();
  194. }
  195. },
  196. }
  197. }
  198. </script>
  199. <style scoped lang="scss">
  200. .safe-area-inset-bottom {
  201. height: calc(100rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  202. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  203. padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  204. padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  205. }
  206. .header_bg {
  207. position: absolute;
  208. top: 0;
  209. left: 0;
  210. width: 100%;
  211. height: 369rpx;
  212. background: linear-gradient(270deg, #01ABF8 0%, #2A7EFB 100%);
  213. }
  214. .white_jianbian {
  215. height: 180rpx;
  216. background: linear-gradient(0deg, #F5F5F5 0%, rgba(245, 245, 245, 0) 100%);
  217. }
  218. .light {
  219. background: rgba(255, 255, 255, 0.9);
  220. }
  221. .express_box {
  222. padding-top: 30rpx;
  223. }
  224. .copy_btn {
  225. width: 112rpx;
  226. height: 34rpx;
  227. background: #fff;
  228. border-radius: 20rpx;
  229. text-align: center;
  230. line-height: 34rpx;
  231. }
  232. .city-box {
  233. &:before {
  234. content: '';
  235. width: 1px;
  236. height: 64rpx;
  237. background-color: #eee;
  238. position: absolute;
  239. top: 40rpx;
  240. left: 0;
  241. }
  242. }
  243. .more-text {
  244. position: absolute;
  245. left: 40rpx;
  246. bottom: -12rpx;
  247. &:before {
  248. content: '';
  249. width: 14rpx;
  250. height: 14rpx;
  251. border-radius: 50%;
  252. background-color: #ddd;
  253. position: absolute;
  254. left: -26rpx;
  255. top: 8rpx;
  256. }
  257. }
  258. .logisticsCon .item {
  259. padding: 0 20rpx;
  260. position: relative;
  261. }
  262. .logisticsCon .item .circular {
  263. width: 14rpx;
  264. height: 14rpx;
  265. border-radius: 50%;
  266. position: absolute;
  267. left: 15rpx;
  268. background-color: #ddd;
  269. }
  270. .logisticsCon .item .circular.on {
  271. width: 0;
  272. height: 0;
  273. left: 6rpx;
  274. .icon-a-ic_CompleteSelect{
  275. color: #2A7EFB;
  276. }
  277. }
  278. .logisticsCon .item .text {
  279. font-size: 26rpx;
  280. color: #666;
  281. width: 615rpx;
  282. border-left: 1rpx solid #e6e6e6;
  283. padding: 0 0 40rpx 38rpx;
  284. }
  285. .logisticsCon .item .text .data {
  286. font-size: 24rpx;
  287. color: #999;
  288. margin-top: 10rpx;
  289. }
  290. .logisticsCon .item .text .data .time {
  291. margin-left: 15rpx;
  292. }
  293. .z-99 {
  294. z-index: 99;
  295. }
  296. .b-r-16rpx{
  297. border-radius: 16rpx;
  298. }
  299. .product~.product {
  300. margin-top: 20rpx;
  301. }
  302. </style>