index.vue 8.5 KB

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