startPage.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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" @click="goLogin">开启探索之旅</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. goLogin() {
  73. // uni.navigateTo({
  74. // url: "/pages/my/jobApplicant/login",
  75. // });
  76. uni.navigateTo({
  77. url: "/pages/public/login",
  78. });
  79. },
  80. // 暂停自动播放
  81. pauseAutoplay() {
  82. this.autoplay = false;
  83. },
  84. // 开始自动播放
  85. startAutoplay() {
  86. this.autoplay = true;
  87. },
  88. },
  89. onShow() {
  90. // 页面显示时恢复自动播放
  91. this.startAutoplay();
  92. },
  93. onHide() {
  94. // 页面隐藏时暂停自动播放
  95. this.pauseAutoplay();
  96. },
  97. };
  98. </script>
  99. <style lang="scss" scoped>
  100. .start-page {
  101. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  102. position: absolute;
  103. left: 0;
  104. right: 0;
  105. top: 0;
  106. bottom: 0;
  107. display: flex;
  108. flex-direction: column;
  109. padding: 20rpx 24rpx;
  110. box-sizing: border-box;
  111. .start-content {
  112. padding: 28rpx;
  113. box-sizing: border-box;
  114. padding-top: 5vh;
  115. box-sizing: border-box;
  116. flex: 1;
  117. .content {
  118. position: relative;
  119. margin-top: 780rpx;
  120. .wumen-img {
  121. width: 614rpx;
  122. height: 780rpx;
  123. position: absolute;
  124. left: 0;
  125. right: 0;
  126. top: -760rpx;
  127. margin: auto;
  128. z-index: 1;
  129. }
  130. .txt-box {
  131. position: relative;
  132. background-color: #fff;
  133. border-radius: 64rpx;
  134. padding: 64rpx 48rpx;
  135. box-sizing: border-box;
  136. z-index: 20;
  137. .start-logo {
  138. margin: auto;
  139. width: 240rpx;
  140. height: 66rpx;
  141. image {
  142. width: 100%;
  143. height: 100%;
  144. }
  145. }
  146. .start-title {
  147. color: #016bf6;
  148. font-family: DM Sans;
  149. font-size: 48rpx;
  150. font-weight: 700;
  151. line-height: 32px;
  152. letter-spacing: 0%;
  153. text-align: center;
  154. padding: 48rpx 0;
  155. box-sizing: border-box;
  156. }
  157. .start-desc {
  158. color: #9ca4ab;
  159. font-family: DM Sans;
  160. font-size: 28rpx;
  161. font-weight: 400;
  162. line-height: 44rpx;
  163. letter-spacing: 0%;
  164. text-align: center;
  165. }
  166. }
  167. }
  168. }
  169. .start-btn {
  170. flex-shrink: 0;
  171. color: #016bf6;
  172. font-family: DM Sans;
  173. font-size: 32rpx;
  174. font-weight: 400;
  175. line-height: 48rpx;
  176. letter-spacing: 0%;
  177. text-align: center;
  178. background-color: #fff;
  179. border-radius: 100rpx;
  180. padding: 16rpx 32rpx;
  181. box-sizing: border-box;
  182. display: flex;
  183. justify-content: center;
  184. align-items: center;
  185. margin-bottom: 52rpx;
  186. }
  187. .custom-swiper {
  188. height: 100%;
  189. }
  190. .custom-indicator {
  191. display: flex;
  192. justify-content: center;
  193. align-items: center;
  194. margin-top: -60rpx;
  195. gap: 16rpx;
  196. position: relative;
  197. z-index: 3;
  198. .indicator-dot {
  199. width: 20rpx;
  200. height: 20rpx;
  201. border-radius: 50%;
  202. background: #fff;
  203. transition: all 0.3s ease;
  204. &.active {
  205. width: 64rpx;
  206. border-radius: 20rpx;
  207. background: #fff;
  208. }
  209. }
  210. }
  211. }
  212. </style>