startPage.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="start-page">
  3. <view class="start-content">
  4. <swiper
  5. class="custom-swiper"
  6. autoplay
  7. circular
  8. :current="currentIndex"
  9. @change="onSwiperChange"
  10. >
  11. <swiper-item v-for="(item, index) in 3" :key="index">
  12. <view class="content">
  13. <image
  14. src="../../../static/images/jobApplicant/wumen.svg"
  15. class="wumen-img"
  16. mode="scaleToFill"
  17. />
  18. <view class="txt-box">
  19. <view class="start-logo">
  20. <image
  21. src="../../../static/images/jobApplicant/logo-column.svg"
  22. mode="scaleToFill"
  23. />
  24. </view>
  25. <view class="start-title">让你的逐梦之路更简单</view>
  26. <view class="start-desc"
  27. >星光不负逐梦人 <br />
  28. 愿你在亿职赞找到心仪的工作</view
  29. >
  30. </view>
  31. </view></swiper-item
  32. >
  33. </swiper>
  34. <!-- 自定义指示器 -->
  35. <view class="custom-indicator">
  36. <view
  37. v-for="(item, index) in 3"
  38. :key="index"
  39. class="indicator-dot"
  40. :class="{ active: currentIndex === index }"
  41. @click="switchBanner(index)"
  42. ></view>
  43. </view>
  44. </view>
  45. <view class="start-btn">开启探索之旅</view>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. currentIndex: 0,
  53. };
  54. },
  55. methods: {
  56. // 轮播图切换事件
  57. onSwiperChange(e) {
  58. this.currentIndex = e.detail.current;
  59. },
  60. // 切换轮播图
  61. switchBanner(index) {
  62. this.currentIndex = index;
  63. },
  64. // 点击轮播图
  65. handleBannerClick(item) {
  66. if (item.link) {
  67. uni.navigateTo({
  68. url: item.link,
  69. });
  70. }
  71. },
  72. // 暂停自动播放
  73. pauseAutoplay() {
  74. this.autoplay = false;
  75. },
  76. // 开始自动播放
  77. startAutoplay() {
  78. this.autoplay = true;
  79. },
  80. },
  81. onShow() {
  82. // 页面显示时恢复自动播放
  83. this.startAutoplay();
  84. },
  85. onHide() {
  86. // 页面隐藏时暂停自动播放
  87. this.pauseAutoplay();
  88. },
  89. };
  90. </script>
  91. <style lang="scss" scoped>
  92. .start-page {
  93. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  94. position: absolute;
  95. left: 0;
  96. right: 0;
  97. top: 0;
  98. bottom: 0;
  99. display: flex;
  100. flex-direction: column;
  101. padding: 20rpx 24rpx;
  102. box-sizing: border-box;
  103. .start-content {
  104. padding: 28rpx;
  105. box-sizing: border-box;
  106. padding-top: 5vh;
  107. box-sizing: border-box;
  108. flex: 1;
  109. .content {
  110. position: relative;
  111. margin-top: 780rpx;
  112. .wumen-img {
  113. width: 614rpx;
  114. height: 780rpx;
  115. position: absolute;
  116. left: 0;
  117. right: 0;
  118. top: -760rpx;
  119. margin: auto;
  120. z-index: 1;
  121. }
  122. .txt-box {
  123. position: relative;
  124. background-color: #fff;
  125. border-radius: 64rpx;
  126. padding: 64rpx 48rpx;
  127. box-sizing: border-box;
  128. z-index: 20;
  129. .start-logo {
  130. margin: auto;
  131. width: 240rpx;
  132. height: 66rpx;
  133. image {
  134. width: 100%;
  135. height: 100%;
  136. }
  137. }
  138. .start-title {
  139. color: #016bf6;
  140. font-family: DM Sans;
  141. font-size: 48rpx;
  142. font-weight: 700;
  143. line-height: 32px;
  144. letter-spacing: 0%;
  145. text-align: center;
  146. padding: 48rpx 0;
  147. box-sizing: border-box;
  148. }
  149. .start-desc {
  150. color: #9ca4ab;
  151. font-family: DM Sans;
  152. font-size: 28rpx;
  153. font-weight: 400;
  154. line-height: 44rpx;
  155. letter-spacing: 0%;
  156. text-align: center;
  157. }
  158. }
  159. }
  160. }
  161. .start-btn {
  162. flex-shrink: 0;
  163. color: #016bf6;
  164. font-family: DM Sans;
  165. font-size: 32rpx;
  166. font-weight: 400;
  167. line-height: 48rpx;
  168. letter-spacing: 0%;
  169. text-align: center;
  170. background-color: #fff;
  171. border-radius: 100rpx;
  172. padding: 16rpx 32rpx;
  173. box-sizing: border-box;
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. margin-bottom: 52rpx;
  178. }
  179. .custom-swiper {
  180. height: 100%;
  181. }
  182. .custom-indicator {
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. margin-top: -60rpx;
  187. gap: 16rpx;
  188. position: relative;
  189. z-index: 3;
  190. .indicator-dot {
  191. width: 20rpx;
  192. height: 20rpx;
  193. border-radius: 50%;
  194. background: #fff;
  195. transition: all 0.3s ease;
  196. &.active {
  197. width: 64rpx;
  198. border-radius: 20rpx;
  199. background: #fff;
  200. }
  201. }
  202. }
  203. }
  204. </style>