index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="flex-col" :style="{height: winHeight + 'px'}">
  3. <!-- #ifdef MP -->
  4. <view class="cart_nav">
  5. <nav-bar iconColor='#fff' ref="navBarRef" navTitle="代取快递" backgroundColor="#FF6702" :isBackgroundColor="false">
  6. </nav-bar>
  7. </view>
  8. <!-- #endif -->
  9. <view class='newsList tui-skeleton' style="background-color: #fff;flex: 1;">
  10. <view class='nav'>
  11. <scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
  12. <block v-for="(item,index) in navList" :key="index">
  13. <view class='item borRadius14 tui-skeleton-rect' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
  14. <view class="line1">{{item.name}}</view>
  15. <view class='line bg_color' v-if="active==item.id"></view>
  16. </view>
  17. </block>
  18. </scroll-view>
  19. </view>
  20. <view class='list'>
  21. <template v-if="active == 1">
  22. <take-fast-mail></take-fast-mail>
  23. </template>
  24. <template v-if="active == 2">
  25. <send-fast-mail></send-fast-mail>
  26. </template>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. // +----------------------------------------------------------------------
  33. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  34. // +----------------------------------------------------------------------
  35. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  36. // +----------------------------------------------------------------------
  37. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  38. // +----------------------------------------------------------------------
  39. // | Author: CRMEB Team <admin@crmeb.com>
  40. // +----------------------------------------------------------------------
  41. import navBar from '@/components/navBar';
  42. import animationType from '@/utils/animationType.js'
  43. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  44. import sendFastMail from '../send_fast_mail/index.vue'
  45. import takeFastMail from '../take_fast_mail/index.vue'
  46. let app = getApp();
  47. export default {
  48. components: {
  49. tuiSkeleton,
  50. navBar,
  51. sendFastMail,
  52. takeFastMail
  53. },
  54. data() {
  55. return {
  56. winHeight: 0,
  57. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  58. autoplay: true,
  59. navList: [{
  60. id: 1,
  61. name: '取快递'
  62. }, {
  63. id: 2,
  64. name: '寄快递'
  65. }],
  66. active: 1,
  67. scrollLeft: 0,
  68. };
  69. },
  70. onLoad() {
  71. let that = this;
  72. uni.getSystemInfo({
  73. success: function(res) {
  74. that.winHeight = res.windowHeight
  75. },
  76. });
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function() {},
  82. methods: {
  83. tabSelect(active, e) {
  84. this.active = active;
  85. this.scrollLeft = e * 60;
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .newsList .swiper {
  92. width: 100%;
  93. position: relative;
  94. box-sizing: border-box;
  95. padding: 0 30rpx;
  96. }
  97. .newsList .swiper swiper {
  98. width: 100%;
  99. height: 365rpx;
  100. position: relative;
  101. }
  102. .newsList .swiper .slide-image {
  103. width: 100%;
  104. height: 335rpx;
  105. border-radius: 14rpx;
  106. }
  107. // #ifdef MP-WEIXIN
  108. .newsList .swiper .wx-swiper-dot {
  109. width: 12rpx !important;
  110. height: 12rpx !important;
  111. border-radius: 0;
  112. transform: rotate(-45deg);
  113. transform-origin: 0 100%;
  114. }
  115. .newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
  116. margin-left: 5rpx;
  117. }
  118. .newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
  119. margin-bottom: -15rpx;
  120. }
  121. // #endif
  122. // #ifdef APP-PLUS || H5
  123. .newsList .swiper .uni-swiper-dot {
  124. width: 12rpx !important;
  125. height: 12rpx !important;
  126. border-radius: 0;
  127. transform: rotate(-45deg);
  128. transform-origin: 0 100%;
  129. }
  130. .newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
  131. margin-left: 5rpx;
  132. }
  133. .newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
  134. margin-bottom: -15rpx;
  135. }
  136. // #endif
  137. .newsList .nav {
  138. padding: 0 24rpx;
  139. width: 100%;
  140. white-space: nowrap;
  141. box-sizing: border-box;
  142. padding-top: 43rpx;
  143. border-top-right-radius: 23rpx;
  144. }
  145. .newsList .nav .item {
  146. // max-width: 156rpx;
  147. display: inline-block;
  148. font-size: 32rpx;
  149. color: #999;
  150. }
  151. .newsList .nav .item.on {
  152. color: #282828;
  153. }
  154. .newsList .nav .item~.item {
  155. margin-left: 46rpx;
  156. }
  157. .newsList .nav .item .line {
  158. // width: 24rpx;
  159. height: 10rpx;
  160. border-radius: 6rpx;
  161. margin: 10rpx auto 0 auto;
  162. background-color: $bg-color-primary;
  163. }
  164. .newsList .nav .item .line1 {
  165. color: $bg-color-primary;
  166. }
  167. </style>