Cognize.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <script setup lang="ts">
  2. import CpmdHeader from '@/components/CpmdHeader.vue';
  3. import { onMounted, onUnmounted, ref } from 'vue'
  4. import pdf3 from '../assets/cognize/goNogo.pdf'
  5. import pdf4 from '../assets/cognize/dtc.pdf'
  6. import { useRoute, useRouter } from 'vue-router';
  7. import { queryCognizeDetailApi } from '@/api/plan';
  8. import { userInfoStore } from '@/stores';
  9. const isPass = userInfoStore().isPass
  10. const router = useRouter()
  11. const route = useRoute()
  12. const flag = ref<string>('')
  13. const planName = ref<string>('')
  14. const planId = ref<string>('')
  15. const type = ref<string>('')
  16. const cognizeDetail = ref<any>({})
  17. // 查看PDF
  18. //刚进入页面就将高度设置为页面需要的
  19. onMounted(() => {
  20. //获取参数传过来的ID
  21. //获取参数传过来的planId
  22. flag.value = route.params.flag as string;
  23. planId.value = route.params.planId as string
  24. planName.value = route.params.planName as string
  25. type.value = route.params.type as string
  26. //根据flag 查询认知任务详情
  27. //进到界面开始轮询
  28. if (type.value == '1') {
  29. queryScaleDetail()
  30. }
  31. })
  32. const queryScaleDetail = async () => {
  33. //根据flag查询量表详情
  34. let res: any = await queryCognizeDetailApi(flag.value)
  35. cognizeDetail.value = res.data
  36. }
  37. const centerDialogVisible = ref<boolean>(false)
  38. const viewPDF = () => {
  39. centerDialogVisible.value = true
  40. }
  41. // vue3+vite 实现动态加载图片
  42. const requireImg = (name: string) => {
  43. // return new URL(`${path}`, import.meta.url).href
  44. // ../assets/cognize/goNogo.pdf
  45. return new URL(`../assets/cognize/${name}.pdf`, import.meta.url).href
  46. }
  47. const startCog = (val: number) => {
  48. router.push(
  49. {
  50. name: 'shapeIntuitionRandom',
  51. params: { planId: planId.value, planName: planName.value, flag: flag.value, flagName: cognizeDetail.value.name, formalTest: val }
  52. })
  53. // if (num.value == '3') {
  54. // router.push({ name: 'cognizeGoNoGo', params: { currentType: val } })
  55. // } else if (num.value == '4') {
  56. // router.push({ name: 'cognizeFaceDot', params: { currentType: val } })
  57. // }
  58. }
  59. //界面销毁函数
  60. //轮旋切换页面的方法
  61. //退出页面销毁 方法
  62. onUnmounted(() => {
  63. })
  64. </script>
  65. <template>
  66. <div class="home_header_out" ref="homeHeaderOut">
  67. <div class=" home_header_inner">
  68. <CpmdHeader />
  69. <div style="text-align: center;">
  70. <!-- <img class="xlts_img" style="margin-top:20px" src="../assets/home/other_text.png" /> -->
  71. </div>
  72. </div>
  73. <div class="kply">
  74. <div class="kply_inner">
  75. <div style="padding :20px 40px">
  76. <div class="cognize_title">
  77. {{ cognizeDetail.name }}
  78. </div>
  79. <div class="cognize_img_out">
  80. <!-- <img src="../assets/kepu/czscz_default.png" width=" 100px" style="margin-right: 20px;" /> -->
  81. <!-- <img src="../assets/cognize/c2.png" v-show="num == '4'" width="100px"
  82. style="margin-right: 20px;" /> -->
  83. <div class="cognize_des">
  84. <span class="cpjs">测评介绍:</span>
  85. <span class="cpjs_detail">{{ cognizeDetail.testExplain }}</span>
  86. </div>
  87. </div>
  88. <div class="cpll">
  89. <span class="cpll_title">理论:</span>
  90. <span class="cpll_detail">{{ cognizeDetail.theory }}</span>
  91. </div>
  92. <div class="czsm">
  93. <span class="czsm_title">操作说明:</span>
  94. <span class="czsm_detail">
  95. {{ cognizeDetail.description }}
  96. {{ cognizeDetail.testDescription }}
  97. </span>
  98. </div>
  99. <div class="cognize_title2"> {{ cognizeDetail.name }}演示视频:</div>
  100. <div class="cognize_video">
  101. <!-- poster="../assets/cognize/bg_ty.png" -->
  102. <video width="60%" height="100%" controls style="border-radius: 40px;">
  103. <source src="../assets/cognize/yd.mp4" type="video/mp4">
  104. <!-- <source src="movie.ogg" type="video/ogg"> -->
  105. 您的浏览器不支持 video 标签。
  106. </video>
  107. </div>
  108. <div class="scale_button">
  109. <div class="scale_button_inner" v-show="!isPass">
  110. <div class="scale_button_self" @click="startCog(0)">练习测试
  111. </div>
  112. </div>
  113. <div :span="12" class="scale_button_inner" v-show="isPass">
  114. <div class="scale_button_self" @click="startCog(1)">开始测试</div>
  115. </div>
  116. </div>
  117. <div class="pdf_op">
  118. <div class="pdf_sc">
  119. <img @click="viewPDF" src="../assets/cognize/pdf.png" width="30px"
  120. style="margin-right:10px" />
  121. <div @click="viewPDF">测试手册</div>
  122. </div>
  123. <div class="pdf_sc">
  124. <!-- <img @click="viewPDF" width="40px" src="../assets/cognize/yan.png">
  125. <div @click="viewPDF" class="view">预览</div> -->
  126. </div>
  127. </div>
  128. <div class="reference_cla" v-if="cognizeDetail.reference">
  129. <div class="reference_title">参考文献:</div>
  130. <div class="reference_detail" v-for="item, index in cognizeDetail.reference.split('//')"
  131. :key="item">
  132. <div>[{{ index + 1 }}] </div>
  133. <div> {{ item }}</div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. <el-dialog v-model="centerDialogVisible" title="预览" width="90%" top="2vh" center>
  140. <span>
  141. <!-- :src="requireImg('../assets/cognize/goNogo.pdf')" -->
  142. <!-- <embed width="100%" height=500px v-show="num == '3'" src='../assets/cognize/goNogo.pdf'>
  143. </embed> -->
  144. <!-- <embed width="100%" height=500px v-show="num == '3'" :src="pdf3">
  145. </embed> -->
  146. <embed width="100%" height=700px :src="requireImg('yd')">
  147. </embed>
  148. <!-- <embed width="100%" height=500px v-show="num == '4'" :src="pdf4">
  149. </embed> -->
  150. </span>
  151. </el-dialog>
  152. </div>
  153. <!-- <div class="cognize_real_out">
  154. 我是认知任务
  155. </div> -->
  156. </template>
  157. <style lang="scss" scoped>
  158. .cognize_real_out {
  159. background-color: #b64d4d;
  160. color: #41348a;
  161. position: fixed;
  162. z-index: 100;
  163. top: 0;
  164. width: 100vw;
  165. height: 100vh;
  166. }
  167. .home_header_out {
  168. padding-bottom: 60px;
  169. width: 100%;
  170. min-width: 1200px;
  171. background-image: url('../assets/home/bg_ty.png');
  172. background-repeat: no-repeat;
  173. background-size: contain;
  174. background-color: #B3F1DA; //估计是需要动态
  175. .home_header_inner {
  176. min-height: 1;
  177. left: 0;
  178. right: 0;
  179. margin: auto;
  180. width: 1200px;
  181. .xlts_img {
  182. height: 40px;
  183. }
  184. }
  185. .kply {
  186. width: 100%;
  187. margin-top: 20px;
  188. .kply_inner {
  189. min-height: 500px;
  190. left: 0;
  191. right: 0;
  192. margin: auto;
  193. width: 860px;
  194. // padding: 20px 20px;
  195. background-color: #ffffff;
  196. border-radius: 40px;
  197. .reference_cla {
  198. margin-top: 10px;
  199. .reference_title {
  200. font-size: 14px;
  201. color: #a9a9a9;
  202. line-height: 24px;
  203. }
  204. .reference_detail {
  205. font-size: 14px;
  206. color: #a9a9a9;
  207. line-height: 24px;
  208. letter-spacing: 3px;
  209. display: flex;
  210. }
  211. }
  212. .cpll {
  213. margin-top: 10px;
  214. .cpll_title {
  215. font-size: 14px;
  216. color: #48D68E;
  217. font-weight: 700;
  218. }
  219. .cpll_detail {
  220. font-size: 14px;
  221. letter-spacing: 3px;
  222. line-height: 24px;
  223. }
  224. }
  225. .czsm {
  226. margin-top: 10px;
  227. .czsm_title {
  228. color: #48D68E;
  229. font-weight: 700;
  230. line-height: 24px;
  231. font-size: 14px;
  232. }
  233. .czsm_detail {
  234. line-height: 24px;
  235. font-size: 14px;
  236. letter-spacing: 3px;
  237. }
  238. }
  239. .cognize_title {
  240. font-size: 20px;
  241. letter-spacing: 3px;
  242. font-weight: 700;
  243. margin-bottom: 10px;
  244. }
  245. .cognize_title2 {
  246. font-size: 20px;
  247. letter-spacing: 3px;
  248. // font-weight: 700;
  249. margin-top: 10px;
  250. margin-bottom: 20px;
  251. }
  252. .cognize_img_out {
  253. display: flex;
  254. justify-content: center;
  255. .cognize_des {
  256. letter-spacing: 2px;
  257. line-height: 20px;
  258. font-size: 16px;
  259. .cpjs {
  260. color: #48D68E;
  261. font-weight: 700;
  262. font-size: 14px;
  263. line-height: 24px;
  264. }
  265. .cpjs_detail {
  266. line-height: 24px;
  267. letter-spacing: 3px;
  268. font-size: 14px;
  269. }
  270. }
  271. }
  272. .cognize_video {
  273. display: flex;
  274. justify-content: center;
  275. }
  276. .pdf_op {
  277. margin-top: 20px;
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. .pdf_sc {
  282. display: flex;
  283. // justify-content: space-between;
  284. align-items: center;
  285. cursor: pointer;
  286. .view {
  287. margin-left: 10px;
  288. color: #3E43FF;
  289. }
  290. }
  291. }
  292. .scale_button {
  293. margin-top: 30px;
  294. margin-bottom: 20px;
  295. display: flex;
  296. justify-content: space-around;
  297. .scale_button_inner {
  298. text-align: center;
  299. display: flex;
  300. justify-content: center;
  301. .scale_button_self {
  302. border-radius: 12px;
  303. border: 3px solid #48D68E;
  304. color: #ffffff;
  305. background-color: #000000;
  306. margin-right: 20px;
  307. padding: 10px 40px;
  308. cursor: pointer;
  309. display: flex;
  310. align-items: center;
  311. font-size: 16px;
  312. }
  313. }
  314. }
  315. }
  316. }
  317. }
  318. .home_mid {
  319. // background-color: blanchedalmond;
  320. width: 1200px;
  321. left: 0;
  322. right: 0;
  323. margin: auto;
  324. margin-top: 40px;
  325. // position: relative;
  326. .kepu_title {
  327. text-align: center;
  328. font-size: 50px;
  329. color: #111111;
  330. line-height: 95px;
  331. // width: 100%;
  332. // left: 0;
  333. // right: 0;
  334. // margin: auto
  335. }
  336. .kepu_title_sub {
  337. margin-top: 30px;
  338. text-align: center;
  339. font-size: 28px;
  340. color: #48D68E;
  341. line-height: 26px;
  342. }
  343. .man1_group {
  344. margin-top: 60px;
  345. height: 100%;
  346. display: flex;
  347. .man1 {
  348. position: relative;
  349. width: 327px;
  350. // height: 100%;
  351. // height: 100%
  352. .man1_img {
  353. position: absolute;
  354. bottom: 0;
  355. /* bottom: 0px; */
  356. /* height: auto; */
  357. width: 100%;
  358. left: 100px
  359. }
  360. }
  361. .des {
  362. border: #48D68E solid 5px;
  363. border-radius: 40px;
  364. padding: 20px;
  365. letter-spacing: 6px;
  366. flex: 1;
  367. .des_inner {
  368. border: 1px dashed #48D68E;
  369. border-radius: 40px;
  370. padding-bottom: 40px;
  371. padding-top: 30px;
  372. padding-left: 100px;
  373. padding-right: 20px;
  374. letter-spacing: 6px;
  375. font-weight: normal;
  376. font-size: 24px;
  377. color: #333333;
  378. line-height: 40px;
  379. }
  380. }
  381. }
  382. .man2_group {
  383. margin-top: 60px;
  384. height: 100%;
  385. display: flex;
  386. .man2 {
  387. position: relative;
  388. width: 327px;
  389. // height: 100%;
  390. // height: 100%
  391. .man2_img {
  392. position: absolute;
  393. bottom: 0;
  394. /* bottom: 0px; */
  395. /* height: auto; */
  396. width: 100%;
  397. left: -100px
  398. }
  399. }
  400. .des2 {
  401. border: #48D68E solid 5px;
  402. border-radius: 40px;
  403. padding: 20px;
  404. letter-spacing: 6px;
  405. flex: 1;
  406. .des2_inner {
  407. border: 1px dashed #48D68E;
  408. border-radius: 40px;
  409. padding-bottom: 40px;
  410. padding-top: 30px;
  411. padding-left: 20px;
  412. padding-right: 100px;
  413. letter-spacing: 6px;
  414. font-weight: normal;
  415. font-size: 24px;
  416. color: #333333;
  417. line-height: 40px;
  418. }
  419. }
  420. }
  421. .get_more {
  422. text-align: center;
  423. img {
  424. width: 300px;
  425. margin-top: 60px;
  426. margin-bottom: 60px;
  427. }
  428. }
  429. }
  430. // .home_footer_out {
  431. // width: 100%;
  432. // background-color: #000000;
  433. // }</style>