startPage.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="start-page">
  3. <image class="circle" src="../../../static/images/jobApplicant/Circle.svg" mode="aspectFill"></image>
  4. <view class="start-content">
  5. <swiper
  6. class="custom-swiper"
  7. autoplay
  8. :current="currentIndex"
  9. @change="onSwiperChange"
  10. >
  11. <swiper-item v-for="(item, index) in ads" :key="index">
  12. <view v-if="currentIndex<ads.length-1" @click="goLogin" class="skip">Skip</view>
  13. <view class="content">
  14. <image
  15. :src="item.cover"
  16. class="wumen-img"
  17. mode="aspectFill"
  18. />
  19. <view class="txt-box">
  20. <view class="start-logo">
  21. <image
  22. src="../../../static/images/jobApplicant/logo-column.svg"
  23. mode="scaleToFill"
  24. />
  25. </view>
  26. <view class="start-title">{{item.title}}</view>
  27. <view class="start-desc"
  28. >{{item.desc}} <br />
  29. {{item.desc1}}</view
  30. >
  31. </view>
  32. </view></swiper-item
  33. >
  34. </swiper>
  35. <!-- 自定义指示器 -->
  36. <view class="custom-indicator">
  37. <view
  38. v-for="(item, index) in ads"
  39. :key="index"
  40. class="indicator-dot"
  41. :class="{ active: currentIndex === index }"
  42. @click="switchBanner(index)"
  43. ></view>
  44. </view>
  45. </view>
  46. <view class="start-btn" @click="goLogin">开启探索之旅</view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. currentIndex: 0,
  54. ads:[
  55. {
  56. cover:'../../../static/images/jobApplicant/wumen.svg',
  57. title:'让你的逐梦之路更简单',
  58. desc:'星光不负逐梦人',
  59. desc1:'愿你在亿职赞找到心仪的工作',
  60. },
  61. {
  62. cover:'../../../static/images/jobApplicant/wumen1.svg',
  63. title:'垂直跨境岗 精准配才强',
  64. desc:'跨境人才直通车',
  65. desc1:'招聘求职零弯路',
  66. },
  67. {
  68. cover:'../../../static/images/jobApplicant/wumen2.svg',
  69. title:'人才秒配 跨境不等待',
  70. desc:'跨境电商',
  71. desc1:'垂直人才精准链接平台人',
  72. }
  73. ]
  74. };
  75. },
  76. methods: {
  77. // 轮播图切换事件
  78. onSwiperChange(e) {
  79. this.currentIndex = e.detail.current;
  80. },
  81. // 切换轮播图
  82. switchBanner(index) {
  83. this.currentIndex = index;
  84. },
  85. // 点击轮播图
  86. handleBannerClick(item) {
  87. if (item.link) {
  88. uni.navigateTo({
  89. url: item.link,
  90. });
  91. }
  92. },
  93. goLogin() {
  94. // uni.navigateTo({
  95. // url: "/pages/my/jobApplicant/login",
  96. // });
  97. uni.navigateTo({
  98. url: "/pages/public/login",
  99. });
  100. },
  101. // 暂停自动播放
  102. pauseAutoplay() {
  103. this.autoplay = false;
  104. },
  105. // 开始自动播放
  106. startAutoplay() {
  107. this.autoplay = true;
  108. },
  109. },
  110. onShow() {
  111. // 页面显示时恢复自动播放
  112. this.startAutoplay();
  113. },
  114. onHide() {
  115. // 页面隐藏时暂停自动播放
  116. this.pauseAutoplay();
  117. },
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .skip{
  122. color: #fff;
  123. text-align: right;
  124. position: absolute;
  125. right: 4%;
  126. top: 4%;
  127. }
  128. .circle{
  129. width: 100vw;
  130. height:100vw;
  131. top:-16vw;
  132. left:-15vw;
  133. position:absolute;
  134. z-index: 0;
  135. transform: rotate(160deg) scale(2.5);
  136. }
  137. .start-page {
  138. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  139. // position: absolute;
  140. // left: 0;
  141. // right: 0;
  142. // top: 0;
  143. // bottom: 0;
  144. display: flex;
  145. flex-direction: column;
  146. padding: 20rpx 24rpx;
  147. box-sizing: border-box;
  148. height: 100vh;
  149. box-sizing: border-box;
  150. // background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  151. // position: fixed;
  152. // top: 0;
  153. // left: 0;
  154. // width: 100%;
  155. // height: 100%;
  156. // height: calc(100vh + constant(safe-area-inset-bottom));
  157. // height: calc(100vh + env(safe-area-inset-bottom));
  158. // display: flex;
  159. // flex-direction: column;
  160. // padding: 20rpx 24rpx;
  161. // box-sizing: border-box;
  162. // overflow: hidden;
  163. // z-index: 0;
  164. .start-content {
  165. padding: 28rpx;
  166. box-sizing: border-box;
  167. padding-top: 5vh;
  168. box-sizing: border-box;
  169. flex: 1;
  170. .content {
  171. position: relative;
  172. margin-top: 780rpx;
  173. .wumen-img {
  174. // width: 614rpx;
  175. height: 780rpx;
  176. position: absolute;
  177. left: 0;
  178. right: 0;
  179. top: -760rpx;
  180. margin: auto;
  181. z-index: 1;
  182. }
  183. .txt-box {
  184. position: relative;
  185. background-color: #fff;
  186. border-radius: 64rpx;
  187. padding: 64rpx 48rpx;
  188. box-sizing: border-box;
  189. z-index: 20;
  190. .start-logo {
  191. margin: auto;
  192. width: 240rpx;
  193. height: 66rpx;
  194. image {
  195. width: 100%;
  196. height: 100%;
  197. }
  198. }
  199. .start-title {
  200. color: #016bf6;
  201. font-family: DM Sans;
  202. font-size: 48rpx;
  203. font-weight: 700;
  204. line-height: 32px;
  205. letter-spacing: 0%;
  206. text-align: center;
  207. padding: 48rpx 0;
  208. box-sizing: border-box;
  209. }
  210. .start-desc {
  211. color: #9ca4ab;
  212. font-family: DM Sans;
  213. font-size: 28rpx;
  214. font-weight: 400;
  215. line-height: 44rpx;
  216. letter-spacing: 0%;
  217. text-align: center;
  218. }
  219. }
  220. }
  221. }
  222. .start-btn {
  223. flex-shrink: 0;
  224. color: #016bf6;
  225. font-family: DM Sans;
  226. font-size: 32rpx;
  227. font-weight: 400;
  228. line-height: 48rpx;
  229. letter-spacing: 0%;
  230. text-align: center;
  231. background-color: #fff;
  232. border-radius: 100rpx;
  233. padding: 16rpx 32rpx;
  234. box-sizing: border-box;
  235. display: flex;
  236. justify-content: center;
  237. align-items: center;
  238. margin-bottom: 52rpx;
  239. }
  240. .custom-swiper {
  241. height: 100%;
  242. }
  243. .custom-indicator {
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. margin-top: -60rpx;
  248. gap: 16rpx;
  249. position: relative;
  250. z-index: 3;
  251. .indicator-dot {
  252. width: 20rpx;
  253. height: 20rpx;
  254. border-radius: 50%;
  255. background: #fff;
  256. transition: all 0.3s ease;
  257. &.active {
  258. width: 64rpx;
  259. border-radius: 20rpx;
  260. background: #fff;
  261. }
  262. }
  263. }
  264. }
  265. </style>