code-elf-guide.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="content">
  3. <swiper class="swiper"
  4. :autoplay="autoplay"
  5. :duration="duration">
  6. <swiper-item>
  7. <view class="swiper-item">
  8. <view class="swiper-item-img"><image src="../../static/img/splash1.png" mode="aspectFit"></image></view>
  9. </view>
  10. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  11. </swiper-item>
  12. <swiper-item>
  13. <view class="swiper-item">
  14. <view class="swiper-item-img"><image src="../../static/img/splash2.png" mode="aspectFit"></image></view>
  15. </view>
  16. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  17. </swiper-item>
  18. <swiper-item>
  19. <view class="swiper-item">
  20. <view class="swiper-item-img"><image src="../../static/img/splash3.png" mode="aspectFit"></image></view>
  21. </view>
  22. <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view>
  23. </swiper-item>
  24. </swiper>
  25. <!-- <view class="uniapp-img"><image src="../../static/guide/uniapp4@2x.png" mode="aspectFit"></image></view> -->
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. background: ['color1', 'color2', 'color3'],
  33. autoplay: false,
  34. duration: 500,
  35. jumpover: '跳过',
  36. experience: '立即体验'
  37. }
  38. },
  39. methods: {
  40. launchFlag: function(){
  41. /**
  42. * 向本地存储中设置launchFlag的值,即启动标识;
  43. */
  44. uni.setStorage({
  45. key: 'launchFlag',
  46. data: true,
  47. });
  48. uni.switchTab({
  49. url: '/pages/tabBar/component/component'
  50. });
  51. }
  52. }
  53. }
  54. </script>
  55. <style>
  56. page,
  57. .content{
  58. width: 100%;
  59. height: 100%;
  60. background-size: 100% auto ;
  61. padding: 0;
  62. }
  63. .swiper{
  64. width: 100%;
  65. height: 80%;
  66. background: #FFFFFF;
  67. }
  68. .swiper-item {
  69. width: 100%;
  70. height: 100%;
  71. text-align: center;
  72. position: relative;
  73. display: flex;
  74. /* justify-content: center; */
  75. align-items:flex-end;
  76. flex-direction:column-reverse
  77. }
  78. .swiper-item-img{
  79. width: 100%;
  80. height: auto;
  81. margin: 0 auto;
  82. }
  83. .swiper-item-img image{
  84. width: 80%;
  85. }
  86. .uniapp-img{
  87. height: 20%;
  88. background: #FFFFFF;
  89. display: flex;
  90. justify-content: center;
  91. align-items:center;
  92. overflow: hidden;
  93. }
  94. .uniapp-img image{
  95. width: 40%;
  96. }
  97. .jump-over,.experience{
  98. position: absolute;
  99. height: 60upx;
  100. line-height: 60upx;
  101. padding: 0 40upx;
  102. border-radius: 30upx;
  103. font-size: 32upx;
  104. color: #454343;
  105. border: 1px solid #454343;
  106. z-index: 999;
  107. }
  108. .jump-over{
  109. right: 45upx;
  110. top: 125upx;
  111. }
  112. .experience{
  113. right: 50%;
  114. margin-right: -105upx;
  115. bottom: 0;
  116. }
  117. </style>