ruleCenter.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <template>
  2. <view class="rule-center">
  3. <view class="detail-bg"></view>
  4. <nav-bar title="亿职赞规则中心"></nav-bar>
  5. <view class="rule-content">
  6. <view class="rule-title">规则中心</view>
  7. <image
  8. src="@/static/images/my/guizezhongxin.png"
  9. class="rule-image"
  10. mode="scaleToFill"
  11. />
  12. <!-- 自定义轮播图 -->
  13. <view class="banner-box">
  14. <view class="banner-container">
  15. <!-- 轮播图主体 -->
  16. <swiper
  17. class="custom-swiper"
  18. :current="currentIndex"
  19. :autoplay="autoplay"
  20. :interval="interval"
  21. :duration="duration"
  22. circular
  23. @change="onSwiperChange"
  24. >
  25. <swiper-item v-for="(item, index) in bannerList" :key="index">
  26. <view class="banner-item" @click="handleBannerClick(item)">
  27. <view class="banner-content">
  28. <image
  29. src="@/static/images/my/icon/paopao.svg"
  30. mode="aspectFill"
  31. class="paopao paopao-one"
  32. />
  33. <image
  34. src="@/static/images/my/icon/paopao.svg"
  35. mode="aspectFill"
  36. class="paopao paopao-two"
  37. />
  38. <image
  39. src="@/static/images/my/icon/paopao.svg"
  40. mode="aspectFill"
  41. class="paopao paopao-three"
  42. />
  43. <view class="banner-txt">
  44. <view class="banner-title">{{ item.title }}</view>
  45. <view class="banner-subtitle">{{ item.subtitle }}</view>
  46. </view>
  47. <view class="banner-btn">去看看</view>
  48. </view>
  49. </view>
  50. </swiper-item>
  51. </swiper>
  52. <!-- 自定义指示器 -->
  53. <view class="custom-indicator">
  54. <view
  55. v-for="(item, index) in bannerList"
  56. :key="index"
  57. class="indicator-dot"
  58. :class="{ active: currentIndex === index }"
  59. @click="switchBanner(index)"
  60. ></view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="rule-txt-box">
  65. <view class="rule-text">
  66. <view class="rule-text-title">平台总则</view>
  67. <view class="rule-text-desc">亿职赞规则公约</view>
  68. </view>
  69. <view class="rule-txt-icon">
  70. <image src="@/static/images/my/icon/pingtaizongze.svg" mode="scaleToFill" />
  71. </view>
  72. </view>
  73. <view class="notice">
  74. <view class="notice-item">平台公告</view>
  75. <view class="notice-item">诚信求职共建真实求职环境</view>
  76. <view class="notice-item">求职文明公约</view>
  77. <view class="notice-item">关于冒用平台名义发布虚假信息的通告</view>
  78. </view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import navBar from "@/components/nav-bar/index.vue";
  84. export default {
  85. data() {
  86. return {
  87. currentIndex: 0,
  88. autoplay: true,
  89. interval: 3000,
  90. duration: 500,
  91. bannerList: [
  92. {
  93. title: "招聘文明公约",
  94. subtitle: "平等尊重 生态共建",
  95. // image: require('@/static/images/banner/banner1.jpg'),
  96. link: "/pages/rules/convention",
  97. },
  98. {
  99. title: "用户服务协议",
  100. subtitle: "诚信合作 互利共赢",
  101. // image: require('@/static/images/banner/banner2.jpg'),
  102. link: "/pages/rules/agreement",
  103. },
  104. {
  105. title: "隐私保护政策",
  106. subtitle: "安全可靠 数据保障",
  107. // image: require('@/static/images/banner/banner3.jpg'),
  108. link: "/pages/rules/privacy",
  109. },
  110. ],
  111. };
  112. },
  113. components: {
  114. navBar,
  115. },
  116. methods: {
  117. // 轮播图切换事件
  118. onSwiperChange(e) {
  119. this.currentIndex = e.detail.current;
  120. },
  121. // 切换轮播图
  122. switchBanner(index) {
  123. this.currentIndex = index;
  124. },
  125. // 点击轮播图
  126. handleBannerClick(item) {
  127. if (item.link) {
  128. uni.navigateTo({
  129. url: item.link,
  130. });
  131. }
  132. },
  133. // 暂停自动播放
  134. pauseAutoplay() {
  135. this.autoplay = false;
  136. },
  137. // 开始自动播放
  138. startAutoplay() {
  139. this.autoplay = true;
  140. },
  141. },
  142. onShow() {
  143. // 页面显示时恢复自动播放
  144. this.startAutoplay();
  145. },
  146. onHide() {
  147. // 页面隐藏时暂停自动播放
  148. this.pauseAutoplay();
  149. },
  150. };
  151. </script>
  152. <style lang="scss" scoped>
  153. .rule-center {
  154. position: absolute;
  155. left: 0;
  156. right: 0;
  157. bottom: 0;
  158. top: 0;
  159. background: #f7f7f7;
  160. .detail-bg {
  161. height: 744rpx;
  162. width: 100%;
  163. background: linear-gradient(180deg, rgba(255, 102, 0, 1), rgba(255, 102, 0, 0) 100%);
  164. position: absolute;
  165. left: 0;
  166. top: 0;
  167. }
  168. .rule-content {
  169. position: relative;
  170. z-index: 2;
  171. padding: 40rpx;
  172. box-sizing: border-box;
  173. .rule-title {
  174. color: #fff;
  175. font-size: 50rpx;
  176. font-weight: 600;
  177. font-family: DM Sans;
  178. margin-bottom: 30rpx;
  179. }
  180. .rule-image {
  181. width: 144rpx;
  182. height: 144rpx;
  183. position: absolute;
  184. right: 44rpx;
  185. top: -24rpx;
  186. }
  187. }
  188. .banner-box {
  189. width: 100%;
  190. height: 172rpx;
  191. margin-top: 40rpx;
  192. }
  193. .rule-txt-box {
  194. display: flex;
  195. justify-content: space-between;
  196. align-items: center;
  197. padding: 56rpx 46rpx;
  198. box-sizing: border-box;
  199. border-radius: 12rpx;
  200. background: rgba(255, 255, 255, 1);
  201. margin-top: 20rpx;
  202. border: 1rpx solid rgba(227, 231, 236, 1);
  203. .rule-text {
  204. .rule-text-title {
  205. color: rgba(51, 51, 51, 1);
  206. font-family: DM Sans;
  207. font-size: 24rpx;
  208. font-weight: 400;
  209. line-height: 32rpx;
  210. letter-spacing: 0px;
  211. }
  212. .rule-text-desc {
  213. color: rgba(153, 153, 153, 1);
  214. font-family: DM Sans;
  215. font-size: 20rpx;
  216. font-weight: 400;
  217. line-height: 26rpx;
  218. }
  219. }
  220. .rule-txt-icon {
  221. image {
  222. width: 40rpx;
  223. height: 40rpx;
  224. }
  225. }
  226. }
  227. .notice {
  228. display: flex;
  229. flex-direction: column;
  230. gap: 24rpx;
  231. box-sizing: border-box;
  232. border: 1rpx solid rgba(227, 231, 236, 1);
  233. border-radius: 12rpx;
  234. background: #fdfdfd;
  235. padding: 32rpx;
  236. padding-bottom: 42rpx;
  237. box-sizing: border-box;
  238. margin-top: 20rpx;
  239. .notice-item {
  240. color: rgba(29, 33, 41, 1);
  241. font-family: DM Sans;
  242. font-size: 24rpx;
  243. font-weight: 600;
  244. line-height: 32rpx;
  245. text-align: left;
  246. }
  247. }
  248. .banner-container {
  249. width: 100%;
  250. height: 100%;
  251. position: relative;
  252. }
  253. .custom-swiper {
  254. width: 100%;
  255. height: 172rpx !important;
  256. overflow: hidden;
  257. border-radius: 12rpx;
  258. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  259. }
  260. .banner-item {
  261. width: 100%;
  262. height: 100%;
  263. position: relative;
  264. border-radius: 12rpx;
  265. overflow: hidden;
  266. .banner-bg {
  267. width: 100%;
  268. height: 100%;
  269. position: absolute;
  270. top: 0;
  271. left: 0;
  272. z-index: 1;
  273. }
  274. .banner-content {
  275. position: absolute;
  276. top: 0;
  277. left: 0;
  278. width: 100%;
  279. height: 100%;
  280. z-index: 2;
  281. padding: 40rpx;
  282. box-sizing: border-box;
  283. display: flex;
  284. align-items: center;
  285. justify-content: space-between;
  286. .paopao {
  287. position: absolute;
  288. width: 306rpx;
  289. height: 306rpx;
  290. z-index: -1;
  291. }
  292. .paopao-one {
  293. left: 86rpx;
  294. }
  295. .paopao-two {
  296. top: 60rpx;
  297. right: 124rpx;
  298. }
  299. .paopao-three {
  300. right: -84rpx;
  301. top: -108rpx;
  302. }
  303. }
  304. .banner-txt {
  305. }
  306. .banner-btn {
  307. padding: 7rpx 40rpx;
  308. box-sizing: border-box;
  309. color: rgba(1, 107, 246, 1);
  310. font-family: DM Sans;
  311. font-size: 16rpx;
  312. font-weight: 400;
  313. line-height: 20rpx;
  314. letter-spacing: 0%;
  315. text-align: center;
  316. background-color: #fff;
  317. border-radius: 100rpx;
  318. }
  319. .banner-title {
  320. font-size: 36rpx;
  321. font-weight: bold;
  322. color: #ffffff;
  323. margin-bottom: 12rpx;
  324. text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.5);
  325. }
  326. .banner-subtitle {
  327. font-size: 26rpx;
  328. color: #ffffff;
  329. opacity: 0.9;
  330. margin-bottom: 30rpx;
  331. text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.5);
  332. }
  333. }
  334. .custom-indicator {
  335. display: flex;
  336. justify-content: center;
  337. align-items: center;
  338. margin-top: -20rpx;
  339. gap: 16rpx;
  340. .indicator-dot {
  341. width: 6rpx;
  342. height: 6rpx;
  343. border-radius: 50%;
  344. background: #fff;
  345. transition: all 0.3s ease;
  346. &.active {
  347. width: 19rpx;
  348. border-radius: 10rpx;
  349. background: linear-gradient(90deg, #ff6600, #ff9900);
  350. }
  351. }
  352. }
  353. }
  354. </style>