code-elf-guide.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="content">
  3. <swiper class="swiper"
  4. :autoplay="autoplay"
  5. :duration="duration"
  6. @change="swiperChange">
  7. <swiper-item>
  8. <view class="swiper-item">
  9. <view class="swiper-item-img"><image src="/static/img/splash1.png" mode="aspectFit"></image></view>
  10. </view>
  11. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  12. </swiper-item>
  13. <swiper-item>
  14. <view class="swiper-item">
  15. <view class="swiper-item-img"><image src="/static/img/splash2.png" mode="aspectFit"></image></view>
  16. </view>
  17. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  18. </swiper-item>
  19. <swiper-item>
  20. <view class="swiper-item">
  21. <view class="swiper-item-img"><image src="/static/img/splash3.png" mode="aspectFit"></image></view>
  22. </view>
  23. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  24. </swiper-item>
  25. </swiper>
  26. <view class="dots">
  27. <view class='dot' :class="currentSwiper == '0' ? ' active' : ''"></view>
  28. <view class='dot' :class="currentSwiper== '1'? ' active' : ''"></view>
  29. <view class='dot' :class="currentSwiper=='2' ? ' active' : ''"></view>
  30. </view>
  31. <button @click='launchFlag' v-if='show' class='experience'>立即体验</button>
  32. <!-- <view class="uniapp-img"><image src="../../static/guide/uniapp4@2x.png" mode="aspectFit"></image></view> -->
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. background: ['color1', 'color2', 'color3'],
  40. autoplay: false,
  41. duration: 500,
  42. jumpover: '跳过',
  43. experience: '立即体验',
  44. show:false,
  45. indicatorColor:'#F2F2F2',
  46. currentSwiper:0,
  47. indicatorActivecolor:'#22C572'
  48. }
  49. },
  50. methods: {
  51. launchFlag(){
  52. /**
  53. * 向本地存储中设置launchFlag的值,即启动标识;
  54. */
  55. uni.setStorage({
  56. key: 'launchFlag',
  57. data: true,
  58. });
  59. uni.switchTab({
  60. url: '/pages/sale/information'
  61. });
  62. },
  63. swiperChange(e){
  64. this.currentSwiper=e.detail.current
  65. if(e.detail.current==2){
  66. this.show=true
  67. }else{
  68. this.show=false
  69. }
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. page,
  76. .content{
  77. width: 100%;
  78. height: 100%;
  79. background-size: 100% auto ;
  80. padding: 0;
  81. }
  82. .swiper{
  83. width: 100%;
  84. height: 100%;
  85. background: #FFFFFF;
  86. }
  87. .swiper-item {
  88. width: 100%;
  89. height: 100%;
  90. text-align: center;
  91. position: relative;
  92. display: flex;
  93. /* justify-content: center; */
  94. align-items:flex-end;
  95. flex-direction:column-reverse
  96. }
  97. .swiper-item-img{
  98. width: 100%;
  99. height: 100%;
  100. margin: 0 auto;
  101. }
  102. .swiper-item-img image{
  103. width: 75%;
  104. margin:0 auto;
  105. }
  106. .uniapp-img{
  107. height: 20%;
  108. background: #FFFFFF;
  109. display: flex;
  110. justify-content: center;
  111. align-items:center;
  112. overflow: hidden;
  113. }
  114. .uniapp-img image{
  115. width: 40%;
  116. }
  117. .jump-over,.experience{
  118. position: absolute;
  119. height: 60upx;
  120. line-height: 60upx;
  121. padding: 0 40upx;
  122. /* border-radius: 30upx; */
  123. font-size: 30upx;
  124. color: #AFB3BF;
  125. background:#F3F3F3;
  126. z-index: 999;
  127. }
  128. .jump-over{
  129. right: 45upx;
  130. padding: 0 28upx;
  131. top: 125upx;
  132. border-radius:4px;
  133. }
  134. .experience{
  135. right: 50%;
  136. margin-right: -105upx;
  137. bottom: 30px;
  138. color: #fff;
  139. height: 80upx;
  140. line-height: 80upx;
  141. border-radius:30px;
  142. background:linear-gradient(#3BD072,#1BC771);
  143. box-shadow: 2px 2px 6px #C5EFDA;
  144. }
  145. .dots {
  146. width: 170rpx;
  147. height: 20rpx;
  148. display: flex;
  149. flex-direction: row;
  150. position: absolute;
  151. left: 50%;
  152. transform: translateX(-49%);
  153. bottom: 80rpx;
  154. }
  155. /*未选中时的小圆点样式 */
  156. .dot {
  157. width: 15rpx;
  158. height: 15rpx;
  159. border-radius: 14rpx;
  160. margin: 0 10px;
  161. background-color: #F2F2F2;
  162. }
  163. /*选中以后的小圆点样式 */
  164. .active {
  165. width: 40rpx;
  166. height: 15rpx;
  167. background-color: #29CA78;
  168. }
  169. </style>