1.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <script setup lang="ts">
  2. import CpmdHeader from '@/components/CpmdHeader.vue';
  3. import { onMounted, onUnmounted, ref } from 'vue'
  4. import { menuStatusStore, userInfoStore } from '@/stores'
  5. import { useRouter } from 'vue-router'
  6. import { userPlanApi } from '@/api/home';
  7. const userInfo = userInfoStore()
  8. const router = useRouter()
  9. const menuStatus = menuStatusStore();
  10. menuStatus.saveActiveIndex('1')
  11. //点击查看更多展开科普乐园的标志
  12. const moreFlag = ref<boolean>(false)
  13. const homeHeaderOut = ref<any>()
  14. const height = ref<number>()
  15. //心灵探索高度
  16. const xlts = ref<number>()
  17. //计划提醒的高度
  18. const plan_jihua = ref<number>()
  19. //显示标题及文本的标志
  20. const flag_text = ref<number>(1)
  21. //定时器标志
  22. const flag_time = ref<any>()
  23. //测试任务显示图标 圆图标
  24. const taskCircleFlag = ref<boolean>(true)
  25. //打开任务去看看
  26. const openSquare = () => {
  27. // taskSequareFlag.value = true
  28. goView()
  29. }
  30. //点击关闭按钮触发
  31. const closeSquare = () => {
  32. taskSequareFlag.value = false
  33. }
  34. //点击按钮去看看触发
  35. const goView = () => {
  36. //应该跳转到测试计划页面
  37. router.push({ name: 'plan' })
  38. }
  39. //点击查看更多==跳转到科普乐园
  40. const goMore = () => {
  41. //点击查看更多跳转到科普乐园
  42. // router.push({ name: 'popularizationScience' })
  43. //查看更多
  44. moreFlag.value = true;
  45. }
  46. //点击圆型图标--显示任务--去看看
  47. const taskSequareFlag = ref<boolean>(false)
  48. //刚进入页面就将高度设置为页面需要的
  49. onMounted(() => {
  50. setHeight()
  51. window.addEventListener('resize', setHeight);
  52. forStatus()
  53. planNumGet()
  54. //进到界面开始轮询
  55. })
  56. //界面销毁函数
  57. //轮旋切换页面的方法
  58. const forStatus = () => {
  59. clearInterval(flag_time.value)
  60. // flag_text.value == 2
  61. flag_time.value = setInterval(() => {
  62. flag_text.value = flag_text.value + 1
  63. if (flag_text.value > 4) {
  64. flag_text.value = 1
  65. }
  66. }, 3000)
  67. }
  68. const setHeight = () => {
  69. //-------设置背景图的高度---------//
  70. const width = homeHeaderOut.value
  71. height.value = width.offsetWidth * 1000 / 1920
  72. xlts.value = height.value - 100
  73. plan_jihua.value = height.value + 100
  74. }
  75. //退出页面销毁 方法
  76. onUnmounted(() => {
  77. clearInterval(flag_time.value)
  78. window.removeEventListener('resize', setHeight)
  79. })
  80. //鼠标移入事件--状态进行切换
  81. const brightStatus = (val: number) => {
  82. clearInterval(flag_time.value)
  83. flag_text.value = val
  84. }
  85. //鼠标移出事件事件--调用轮询器
  86. const brightStatusLevel = () => {
  87. forStatus()
  88. }
  89. //获取计划剩余多少个正在进行的
  90. //isHaveManage//
  91. //先判断是否登录
  92. const planNumGet = async () => {
  93. //如果在就是登录了
  94. if (userInfo.token) {
  95. let userNo = ''
  96. //登录的话
  97. //判断当前是否有后台管理
  98. userNo = userInfo.userInfo.userNo
  99. //调用根据用户查询计划的API
  100. let res: any = await userPlanApi(userNo)
  101. if (res.data.length > 0) {
  102. taskCircleFlag.value = true
  103. } else {
  104. taskCircleFlag.value = false
  105. }
  106. userInfo.savePlanCurrentNum(res.data.length)
  107. }
  108. }
  109. </script>
  110. <template>
  111. <div class="home_header_out" ref="homeHeaderOut">
  112. <div class="home_reset">
  113. <div class="home_header_inner">
  114. <CpmdHeader />
  115. <!-- <div :style="{ height: xlts + 'px' }"></div> -->
  116. <!-- <div :style="{ height: xlts + 'px' }"> -->
  117. <!-- style="padding-top:40px" -->
  118. <div class="home_header_inner_one">
  119. <img class="xlts_img" src="../assets/home/home_text.png" />
  120. <div class="chart_student">
  121. <div class="student1_group">
  122. <img class="student1_text" v-show="flag_text == 1" src="../assets/home/student1_text.png" />
  123. <img class="student1" v-on:mouseenter="brightStatus(1)" v-on:mouseleave="brightStatusLevel"
  124. v-show="flag_text !== 1" src="../assets/home/student1_default.png" />
  125. <img class="student1" v-on:mouseenter="brightStatus(1)" v-on:mouseleave="brightStatusLevel"
  126. v-show="flag_text == 1" src="../assets/home/student1_active.png" />
  127. </div>
  128. <div class="student2_group">
  129. <img class="student2_text" v-show="flag_text == 2" src="../assets/home/student2_text.png" />
  130. <img class="student2" v-on:mouseenter="brightStatus(2)" v-on:mouseleave="brightStatusLevel"
  131. v-show="flag_text !== 2" src="../assets/home/student2_default.png" />
  132. <img class="student2" v-on:mouseenter="brightStatus(2)" v-on:mouseleave="brightStatusLevel"
  133. v-show="flag_text == 2" src="../assets/home/student2_active.png" />
  134. </div>
  135. <img class="student3_text" v-show="flag_text == 3" src="../assets/home/student3_text.png" />
  136. <img class="student3" v-on:mouseenter="brightStatus(3)" v-on:mouseleave="brightStatusLevel"
  137. v-show="flag_text !== 3" src="../assets/home/student3_default.png" />
  138. <img class="student3" v-on:mouseenter="brightStatus(3)" v-on:mouseleave="brightStatusLevel"
  139. v-show="flag_text == 3" src="../assets/home/student3_active.png" />
  140. <img class="student4_text" v-show="flag_text == 4" src="../assets/home/student4_text.png" />
  141. <img class="student4" v-on:mouseenter="brightStatus(4)" v-on:mouseleave="brightStatusLevel"
  142. v-show="flag_text !== 4" src="../assets/home/student4_default.png" />
  143. <img class="student4" v-on:mouseenter="brightStatus(4)" v-on:mouseleave="brightStatusLevel"
  144. v-show="flag_text == 4" src="../assets/home/student4_active.png" />
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <!-- <div class="home_mid_plan_des" v-show="taskSequareFlag">
  150. <div class="home_mid_plan_close">
  151. <img style="right:0" width="20px" src="../assets/home/close.png" @click="closeSquare" />
  152. </div>
  153. <div class="home_mid_plan_title">测试任务</div>
  154. <div class="home_mid_plan_d">你的<span class="home_mid_plan_font">测试计划</span>中有新的<span
  155. class="home_mid_plan_font">测试任务</span>,赶紧点击下方按钮去看看吧!
  156. </div>
  157. <div class="home_mid_plan_button">
  158. <div class="see_button" @click="goView">去看看</div>
  159. </div>
  160. </div> -->
  161. <div class="home_mid">
  162. <div class="kepu_title">科普小课堂</div>
  163. <div class="kepu_title_sub">心灵成长不迷茫,科普小课堂为你点亮前行的方向</div>
  164. <div class="man1_group">
  165. <div class="man1">
  166. <img class="man1_img" src="../assets/home/people1.png" />
  167. </div>
  168. <div class="des">
  169. <div class="des_inner">
  170. &nbsp;&nbsp;&nbsp;&nbsp;大学生的焦虑情绪往往源自多重压力的叠加效应,其中学业负担与未来职业的不确定性占据主导地位。
  171. 一方面,大学教育的高标准与快节奏,如繁重的课程任务、竞争激烈的考试、科研项目的压力,以及对学术成就的追求,
  172. 都无形中增加了学生的心理负担,让他们时常处于紧张与不安之中。另一方面,步入社会的临近,使得就业市场的严酷现实成为心头大石,
  173. 学生们担忧自己的能力是否足够,能否在毕业后顺利找到理想工作,这种对未来的不确定感进一步加剧了焦虑情绪。
  174. </div>
  175. </div>
  176. </div>
  177. <div class="man2_group">
  178. <div class="des2">
  179. <div class="des2_inner">
  180. &nbsp;&nbsp;&nbsp;&nbsp;
  181. 失眠,对于许多大学生而言,已成为一种常见的困扰,它不仅影响睡眠质量,还可能波及到日常的学习效率与生活质量。
  182. 究其原因,多重因素交织其中。首先,学业压力无疑是首当其冲的罪魁祸首。
  183. 大学生活充满了挑战,无论是课程作业的紧迫、考试复习的重负,还是科研项目的压力,都可能让学生陷入焦虑与紧张之中,这种心理状态直接转化为夜晚辗转反侧的失眠。
  184. 其次,快节奏的生活方式与不规律的作息习惯也难辞其咎。深夜赶工、晨早赶课,加上社交媒体与电子产品的诱惑,打乱了生物钟的正常节律,使身体难以在需要的时候自然进入睡眠状态。
  185. 再者,生活环境的噪音与光线污染,或是室友的作息差异,也可能成为影响睡眠质量的外部因素。
  186. </div>
  187. </div>
  188. <div class="man2">
  189. <img class="man2_img" src="../assets/home/people2.png" />
  190. </div>
  191. </div>
  192. <div class="man1_group">
  193. <div class="man1">
  194. <img class="man1_img" src="../assets/home/people3.png" />
  195. </div>
  196. <div class="des">
  197. <div class="des_inner">
  198. &nbsp;&nbsp;&nbsp;&nbsp;刚刚步入大学校园的萌新们,是不是感觉到有些迷茫?
  199. 刚刚步入大学,周围的一切都充满了未知与惊喜,你可能会觉得有点晕头转向,就像是第一次迷路在了巨大的游乐场里。面对全新的环境、自由的时间管理以及未来的不确定性,感到迷茫是非常正常的情绪反应。
  200. 这是人生旅程中的一个重要转折点,意味着你需要从高中时期的被指导模式过渡到自主学习和自我管理的新阶段。
  201. </div>
  202. </div>
  203. </div>
  204. <div v-show="!moreFlag" class="get_more">
  205. <img src="../assets/home/get_more.png" @click="goMore" />
  206. </div>
  207. <div v-show="moreFlag">
  208. <div class="kepu_title_more" style="text-align: left;">
  209. <div class="kepu_title_des">
  210. 失眠抑郁问题科普
  211. </div>
  212. <!-- <div>
  213. <img src="../assets/kepu/title_right.png" />
  214. </div> -->
  215. </div>
  216. <div class="kply_inner_duan1">
  217. &nbsp; &nbsp; &nbsp;对于患有抑郁症的人群并不在少数,每一个人或多或少都会有纠结的时候,
  218. 所以为了预防和及时了解自己的情况,医学界给出来很多测量方式,
  219. 像最常见的自我测量答题表,专业的他测量表,以及日常行为的观察,就变得极其普遍和有效。(示例)
  220. </div>
  221. <div class="kply_inner_duan1">
  222. &nbsp; &nbsp; &nbsp;睡眠监测适用于各种睡眠障碍相关性疾病的诊断,比如失眠症、发作性睡病、
  223. 阻塞性睡眠呼吸暂停综合征、不安腿综合征等。睡眠监测仪器主要包括脑电图仪、
  224. 眼动图仪、肌电图仪等,需要进行睡眠检测的患者可以在医生的帮助下,将检查仪器穿戴完毕,然后入睡。
  225. </div>
  226. <img width="100%" style="margin-top:40px;" src="../assets/kepu/bg1.png" />
  227. <div class="kply_inner_duan1">
  228. &nbsp; &nbsp; &nbsp;对于患有抑郁症的人群并不在少数,每一个人或多或少都会有纠结的时候,
  229. 所以为了预防和及时了解自己的情况,医学界给出来很多测量方式,
  230. 像最常见的自我测量答题表,专业的他测量表,以及日常行为的观察,就变得极其普遍和有效。(示例)
  231. </div>
  232. <div class="kply_inner_duan1">
  233. &nbsp; &nbsp; &nbsp; 睡眠监测适用于各种睡眠障碍相关性疾病的诊断,比如失眠症、发作性睡病、
  234. 阻塞性睡眠呼吸暂停综合征、不安腿综合征等。睡眠监测仪器主要包括脑电图仪、
  235. 眼动图仪、肌电图仪等,需要进行睡眠检测的患者可以在医生的帮助下,将检查仪器穿戴完毕,然后入睡。
  236. </div>
  237. <img width="100%" style="margin-top:40px;" src="../assets/kepu/bg2.png" />
  238. </div>
  239. <div class="home_mid_plan" v-show="taskCircleFlag && userInfo.planCurrentNum != 0" @click="openSquare"
  240. ref="plan_jihua">
  241. <div class=" badge_custom">
  242. {{ userInfo.planCurrentNum }}
  243. </div>
  244. <img src="../assets/home/jihua_img.png" />
  245. </div>
  246. </div>
  247. </div>
  248. </template>
  249. <style lang="scss" scoped>
  250. .badge_custom {
  251. position: absolute;
  252. background-color: #ED2626;
  253. // left: 90px;
  254. right: 0;
  255. top: 0px;
  256. height: 30px;
  257. width: 30px;
  258. line-height: 30px;
  259. text-align: center;
  260. // line-height: 18px;
  261. color: 10px;
  262. padding: 8px;
  263. font-weight: 300;
  264. font-size: 16px;
  265. color: #ffffff;
  266. border-radius: 30px;
  267. }
  268. .home_header_out {
  269. flex: 1;
  270. position: relative;
  271. width: 100%;
  272. min-width: 1200px;
  273. // height: 100vh;
  274. // background-color: rgb(151, 163, 202);
  275. // height: 600px;
  276. // background-image: url('../assets/home/header_bg.png');
  277. // background-repeat: no-repeat;
  278. // background-size: auto 100vh;
  279. // background-size: cover;
  280. // background-position: center;
  281. // background-size: contain;
  282. // height: 106.667vw;
  283. // height: 41.667vw;
  284. // height: calc(100% * 1000px / 1920px);
  285. // height: calc(100vmax * 1000px / 1920px);
  286. //估计是需要动态
  287. //获取屏幕宽度home_header_out 这个div的宽度--然后宽度*1000再除1920即为当前div的宽度
  288. .home_reset {
  289. width: 100%;
  290. height: 100vh;
  291. background-image: url('../assets/home/header_bg.png');
  292. background-size: cover;
  293. }
  294. .home_mid_plan_des {
  295. border-top-left-radius: 30px;
  296. padding: 10px 5px 20px 10px;
  297. position: absolute;
  298. right: 0;
  299. // bottom: 26px;
  300. bottom: 0;
  301. width: 600px;
  302. background-color: #ffffff;
  303. .home_mid_plan_close {
  304. cursor: pointer;
  305. text-align: right;
  306. }
  307. .home_mid_plan_title {
  308. height: 38px;
  309. font-weight: normal;
  310. font-size: 20px;
  311. font-weight: 700;
  312. color: #000000;
  313. // line-height: 95px;
  314. }
  315. .home_mid_plan_d {
  316. height: 38px;
  317. font-weight: normal;
  318. font-size: 16px;
  319. font-weight: 500;
  320. color: #000000;
  321. // line-height: 95px;
  322. .home_mid_plan_font {
  323. color: #48D68E
  324. }
  325. }
  326. .home_mid_plan_button {
  327. width: 100%;
  328. display: flex;
  329. flex-direction: row;
  330. justify-content: end;
  331. // text-align: right;
  332. .see_button {
  333. cursor: pointer;
  334. // width: 100px;
  335. border-radius: 12px;
  336. border: 3px solid #48D68E;
  337. color: #ffffff;
  338. background-color: #000000;
  339. margin-right: 20px;
  340. padding: 8px 30px;
  341. cursor: pointer;
  342. display: flex;
  343. align-items: center;
  344. }
  345. }
  346. }
  347. .home_header_inner {
  348. // position: absolute;
  349. //需要水平居中
  350. // top: 0;
  351. // bottom: 0;
  352. height: 100vh;
  353. min-height: 1;
  354. left: 0;
  355. right: 0;
  356. margin: auto;
  357. // height: 100px;
  358. width: 1200px;
  359. .home_header_inner_one {
  360. height: calc(100vh - 80px);
  361. .xlts_img {
  362. padding-top: 40px;
  363. height: calc(36% - 40px) //还剩百分之64%
  364. // width: 100%;
  365. }
  366. .chart_student {
  367. height: 64%;
  368. position: relative;
  369. .student1_group {
  370. position: absolute;
  371. bottom: 50%;
  372. left: 22%;
  373. height: 200px;
  374. width: 200px;
  375. .student1 {
  376. cursor: pointer;
  377. position: absolute;
  378. bottom: -62%;
  379. left: -8%;
  380. height: 52%;
  381. }
  382. .student1_text {
  383. cursor: pointer;
  384. position: absolute;
  385. bottom: -42%;
  386. left: -86%;
  387. height: 80%;
  388. }
  389. }
  390. .student2_group {
  391. position: absolute;
  392. bottom: 27%;
  393. left: 34%;
  394. height: 200px;
  395. width: 200px;
  396. .student2 {
  397. cursor: pointer;
  398. position: absolute;
  399. bottom: -1%;
  400. left: 72%;
  401. height: 76%;
  402. }
  403. .student2_text {
  404. cursor: pointer;
  405. position: absolute;
  406. bottom: 60%;
  407. left: -8%;
  408. height: 77%;
  409. }
  410. }
  411. .student3 {
  412. cursor: pointer;
  413. position: absolute;
  414. bottom: 6%;
  415. left: 62%; // w
  416. height: 40%;
  417. }
  418. .student3_text {
  419. cursor: pointer;
  420. position: absolute;
  421. bottom: 44%;
  422. left: 61%;
  423. height: 40%;
  424. }
  425. .student4 {
  426. cursor: pointer;
  427. position: absolute;
  428. bottom: 30%;
  429. left: 89%; // w
  430. height: 40%;
  431. }
  432. .student4_text {
  433. cursor: pointer;
  434. position: absolute;
  435. bottom: 61%;
  436. left: 89%;
  437. height: 40%;
  438. }
  439. }
  440. }
  441. }
  442. }
  443. .home_mid {
  444. // background-color: blanchedalmond;
  445. width: 1200px;
  446. left: 0;
  447. right: 0;
  448. margin: auto;
  449. margin-top: 20px;
  450. // position: relative;
  451. // .home_mid_plan {
  452. // z-index: 111;
  453. // cursor: pointer;
  454. // // top: 1000px;
  455. // position: fixed;
  456. // width: 100%;
  457. // height: 200px;
  458. // top: 10px;
  459. // bottom: 0px;
  460. // left: 0px;
  461. // right: 0px;
  462. // // right: 200px;
  463. // // top: -30px;
  464. // img {
  465. // width: 100px;
  466. // }
  467. // }
  468. .kepu_title {
  469. text-align: center;
  470. font-size: 30px;
  471. color: #111111;
  472. line-height: 40px;
  473. display: block;
  474. margin-top: 40px;
  475. // width: 100%;
  476. // left: 0;
  477. // right: 0;
  478. // margin: auto
  479. }
  480. .kepu_title_sub {
  481. margin-top: 20px;
  482. text-align: center;
  483. font-size: 20px;
  484. color: #48D68E;
  485. // line-height: 26px;
  486. }
  487. .man1_group {
  488. margin-top: 60px;
  489. height: 100%;
  490. display: flex;
  491. .man1 {
  492. position: relative;
  493. width: 327px;
  494. // height: 100%;
  495. // height: 100%
  496. .man1_img {
  497. position: absolute;
  498. bottom: 0;
  499. /* bottom: 0px; */
  500. /* height: auto; */
  501. width: 100%;
  502. left: 100px
  503. }
  504. }
  505. .des {
  506. border: #48D68E solid 5px;
  507. border-radius: 40px;
  508. padding: 20px;
  509. letter-spacing: 6px;
  510. flex: 1;
  511. .des_inner {
  512. border: 1px dashed #48D68E;
  513. border-radius: 40px;
  514. padding-bottom: 40px;
  515. padding-top: 20px;
  516. padding-left: 100px;
  517. padding-right: 20px;
  518. letter-spacing: 6px;
  519. font-weight: normal;
  520. font-size: 18px;
  521. color: #333333;
  522. line-height: 30px;
  523. }
  524. }
  525. }
  526. .man2_group {
  527. margin-top: 60px;
  528. height: 100%;
  529. display: flex;
  530. .man2 {
  531. position: relative;
  532. width: 327px;
  533. // height: 100%;
  534. // height: 100%
  535. .man2_img {
  536. position: absolute;
  537. bottom: 0;
  538. /* bottom: 0px; */
  539. /* height: auto; */
  540. width: 100%;
  541. left: -100px
  542. }
  543. }
  544. .des2 {
  545. border: #48D68E solid 5px;
  546. border-radius: 40px;
  547. padding: 20px;
  548. letter-spacing: 6px;
  549. flex: 1;
  550. .des2_inner {
  551. border: 1px dashed #48D68E;
  552. border-radius: 40px;
  553. padding-bottom: 40px;
  554. padding-top: 20px;
  555. padding-left: 20px;
  556. padding-right: 100px;
  557. letter-spacing: 6px;
  558. font-weight: normal;
  559. font-size: 19px;
  560. color: #333333;
  561. line-height: 30px;
  562. }
  563. }
  564. }
  565. .get_more {
  566. text-align: center;
  567. img {
  568. width: 150px;
  569. margin-top: 20px;
  570. // margin-bottom: 20px;
  571. }
  572. }
  573. }
  574. .home_footer_out {
  575. width: 100%;
  576. background-color: #000000;
  577. }
  578. .home_mid_plan {
  579. z-index: 1;
  580. cursor: pointer;
  581. // top: 1000px;
  582. position: fixed;
  583. width: 100px;
  584. height: 100px;
  585. top: 0;
  586. right: 0;
  587. margin: auto;
  588. img {
  589. width: 100px;
  590. }
  591. }
  592. .kepu_title_more {
  593. margin-top: 20px;
  594. display: flex;
  595. flex-direction: row;
  596. justify-content: center;
  597. // align-items: ;
  598. .kepu_title_des {
  599. // width: 406px;
  600. // font-family: Alibaba PuHuiTi 2.0;
  601. // font-weight: 600;
  602. font-size: 30px;
  603. // color: #48D68E;
  604. margin-bottom: 20px;
  605. }
  606. img {
  607. width: 480px;
  608. }
  609. }
  610. .kply_inner_duan1 {
  611. margin-top: 0px;
  612. // font-family: Alibaba PuHuiTi 2.0;
  613. font-weight: normal;
  614. font-size: 18px;
  615. color: #333333;
  616. line-height: 30px;
  617. letter-spacing: 6px;
  618. }
  619. </style>