Scale.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <script setup lang="ts">
  2. import CpmdHeader from '@/components/CpmdHeader.vue';
  3. import { onMounted, onUnmounted, ref } from 'vue'
  4. import { Check } from '@element-plus/icons-vue'
  5. import { number } from 'echarts';
  6. import { ElMessage } from 'element-plus';
  7. //持久化设置 菜单状态
  8. // import { menuStatusStore } from '@/stores'
  9. // const menuStatus = menuStatusStore();
  10. // menuStatus.saveActiveIndex('3')
  11. const homeHeaderOut = ref<any>()
  12. //获取到的题目数组
  13. const scaleList = ref([
  14. {
  15. ti: '1.在学校做作业或者其他活动时,无法专注于细节的 部分或出现粗心的错误',
  16. radio: '没有;一点;常是;总是',
  17. isCheck: ''
  18. }, {
  19. ti: '2.在学校做作业或者其他活动时,无法专注于细节的 部分或出现粗心的错误',
  20. radio: '没有;一点;常是;总是',
  21. isCheck: ''
  22. }, {
  23. ti: '3.在学校做作业或者其他活动时,无法专注于细节的 部分或出现粗心的错误',
  24. radio: '没有;一点;常是;总是',
  25. isCheck: ''
  26. }, {
  27. ti: '4.在学校做作业或者其他活动时,无法专注于细节的 部分或出现粗心的错误',
  28. radio: '没有;一点;常是;总是',
  29. isCheck: ''
  30. }
  31. ])
  32. //当前题的对象
  33. //做过题的数组
  34. const completeList = ref([])
  35. //刚进页面时第几题
  36. const topicIndex = ref<number>(1)
  37. //下一题的方法
  38. const nextTopic = () => {
  39. //判断当前索引下的数组中是否有isCheck为空
  40. //先判断这个是不是
  41. if (scaleList.value[topicIndex.value - 1].isCheck == '') {
  42. ElMessage({
  43. message: '请选择当前题目',
  44. type: "warning",
  45. })
  46. return
  47. }
  48. //判断当前是不是最后一题
  49. //如果是最后一题就不++了
  50. if (topicIndex.value == scaleList.value.length) {
  51. // ElMessage({
  52. // message: '已经是最后一题了',
  53. // type: "warning",
  54. // })
  55. return
  56. }
  57. topicIndex.value++
  58. }
  59. //上一题的方法
  60. const lastTopic = () => {
  61. if (topicIndex.value == 1) {
  62. ElMessage({
  63. message: '已经是第一题了',
  64. type: "warning",
  65. })
  66. return
  67. }
  68. topicIndex.value--
  69. }
  70. //点击选中选项的事件
  71. const radioFun = () => {
  72. console.log(JSON.stringify(scaleList.value))
  73. nextTopic()
  74. }
  75. //刚进入页面就将高度设置为页面需要的
  76. onMounted(() => {
  77. //进到界面开始轮询
  78. })
  79. //界面销毁函数
  80. //轮旋切换页面的方法
  81. //退出页面销毁 方法
  82. onUnmounted(() => {
  83. })
  84. </script>
  85. <template>
  86. <div class="home_header_out" ref="homeHeaderOut">
  87. <div class=" home_header_inner">
  88. <CpmdHeader />
  89. <div class="report_top">
  90. <div class="report_jt">
  91. <span>心灵万花筒</span>
  92. <span class="des">请根据您的表现回答下列问题,每道题请选择最符合您的情况的选项。</span>
  93. </div>
  94. <img class="xlts_img" src="../assets/scale/scale.png" />
  95. </div>
  96. <el-progress :text-inside="true" :stroke-width="20" :percentage="(topicIndex / scaleList.length) * 100"
  97. color="#48D68E">
  98. <!-- <el-button type="success" :icon="Check" circle style='z-index: 10;' /> -->
  99. {{ topicIndex }}/{{ scaleList.length }}
  100. </el-progress>
  101. </div>
  102. <div class="kply">
  103. <div class="kply_inner">
  104. <div style="padding :20px 40px">
  105. <div>
  106. <div>{{ scaleList[topicIndex - 1].ti }}</div>
  107. <!-- <div v-for="item in scaleList[topicIndex - 1].radio.split(';')">
  108. {{ item }}
  109. </div> -->
  110. <el-radio-group v-model="scaleList[topicIndex - 1].isCheck">
  111. <el-radio v-for="item in scaleList[topicIndex - 1].radio.split(';')" @change="radioFun"
  112. :value="item" size="large" border>{{ item }}</el-radio>
  113. </el-radio-group>
  114. <div>
  115. <div style="background-color: aqua;margin-bottom: 10px;" @click="lastTopic">上一题</div>
  116. <div style="background-color: aqua;" @click="nextTopic">下一题</div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <style lang="scss" scoped>
  125. :deep(.el-progress-bar__outer) {
  126. background-color: #ffffff;
  127. border-radius: 100px;
  128. height: 6px;
  129. overflow: hidden;
  130. position: relative;
  131. vertical-align: middle;
  132. }
  133. .home_header_out {
  134. // position: relative;
  135. padding-bottom: 60px;
  136. width: 100%;
  137. min-width: 1200px;
  138. background-image: url('../assets/home/bg_ty.png');
  139. background-repeat: no-repeat;
  140. background-size: contain;
  141. background-color: #FAFAFA; //估计是需要动态
  142. //获取屏幕宽度home_header_out 这个div的宽度--然后宽度*1000再除1920即为当前div的宽度
  143. .home_header_inner {
  144. min-height: 1;
  145. left: 0;
  146. right: 0;
  147. margin: auto;
  148. // height: 100px;
  149. width: 1200px;
  150. .report_top {
  151. margin-top: 50px;
  152. display: flex;
  153. flex-direction: row;
  154. justify-content: space-between;
  155. align-items: center;
  156. margin-bottom: 40px;
  157. .xlts_img {
  158. margin-right: 100px;
  159. width: 200px;
  160. }
  161. .report_jt {
  162. display: flex;
  163. flex-direction: column;
  164. font-size: 50px;
  165. font-weight: 700;
  166. letter-spacing: 3px;
  167. .des {
  168. color: #888888;
  169. // opacity: 0.4;
  170. font-size: 20px;
  171. letter-spacing: 0px;
  172. margin-top: 10px;
  173. }
  174. }
  175. }
  176. }
  177. .kply {
  178. width: 100%;
  179. margin-top: 40px;
  180. // background-color: #FAFAFA;
  181. .kply_inner {
  182. border: 8px solid #B2F2D2;
  183. min-height: 500px;
  184. left: 0;
  185. right: 0;
  186. margin: auto;
  187. width: 1200px;
  188. // padding: 20px 20px;
  189. background-color: #ffffff;
  190. border-radius: 40px;
  191. // height: 1000px;
  192. // margin-bottom: 60px;
  193. .kepu_title {
  194. display: flex;
  195. flex-direction: row;
  196. justify-content: space-between;
  197. align-items: center;
  198. .kepu_title_des {
  199. font-family: Alibaba PuHuiTi 2.0;
  200. font-weight: 600;
  201. font-size: 30px;
  202. color: #000000;
  203. }
  204. .home_mid_plan_button {
  205. width: 100%;
  206. display: flex;
  207. flex-direction: row;
  208. justify-content: end;
  209. // text-align: right;
  210. .pub_button {
  211. cursor: pointer;
  212. // width: 100px;
  213. border-radius: 12px;
  214. border: 3px solid #48D68E;
  215. color: #ffffff;
  216. background-color: #000000;
  217. padding: 8px 30px;
  218. cursor: pointer;
  219. display: flex;
  220. align-items: center;
  221. }
  222. }
  223. }
  224. .com_out {
  225. min-height: 500px;
  226. .com_title {
  227. margin-top: 40px;
  228. display: flex;
  229. flex-direction: row;
  230. align-items: center;
  231. img {
  232. width: 66px
  233. }
  234. .com_des {
  235. margin-left: 5px;
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: space-between;
  239. height: 66px;
  240. .com_name {
  241. font-weight: normal;
  242. font-size: 20px;
  243. color: #222222;
  244. }
  245. .com_time {
  246. font-weight: normal;
  247. font-size: 16px;
  248. color: #000000;
  249. opacity: 0.4;
  250. }
  251. }
  252. }
  253. .com_content {
  254. letter-spacing: 3px;
  255. margin-top: 20px;
  256. background-color: #F7F7F7;
  257. padding: 10px 20px;
  258. border-radius: 15px;
  259. line-height: 24px;
  260. }
  261. .com_yan {
  262. margin-top: 20px;
  263. display: flex;
  264. align-items: center;
  265. justify-content: end;
  266. span {
  267. margin-left: 8px;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. .home_mid {
  275. // background-color: blanchedalmond;
  276. width: 1200px;
  277. left: 0;
  278. right: 0;
  279. margin: auto;
  280. margin-top: 40px;
  281. // position: relative;
  282. .kepu_title {
  283. text-align: center;
  284. font-size: 50px;
  285. color: #111111;
  286. line-height: 95px;
  287. // width: 100%;
  288. // left: 0;
  289. // right: 0;
  290. // margin: auto
  291. }
  292. .kepu_title_sub {
  293. margin-top: 30px;
  294. text-align: center;
  295. font-size: 28px;
  296. color: #48D68E;
  297. line-height: 26px;
  298. }
  299. .man1_group {
  300. margin-top: 60px;
  301. height: 100%;
  302. display: flex;
  303. .man1 {
  304. position: relative;
  305. width: 327px;
  306. // height: 100%;
  307. // height: 100%
  308. .man1_img {
  309. position: absolute;
  310. bottom: 0;
  311. /* bottom: 0px; */
  312. /* height: auto; */
  313. width: 100%;
  314. left: 100px
  315. }
  316. }
  317. .des {
  318. border: #48D68E solid 5px;
  319. border-radius: 40px;
  320. padding: 20px;
  321. letter-spacing: 6px;
  322. flex: 1;
  323. .des_inner {
  324. border: 1px dashed #48D68E;
  325. border-radius: 40px;
  326. padding-bottom: 40px;
  327. padding-top: 30px;
  328. padding-left: 100px;
  329. padding-right: 20px;
  330. letter-spacing: 6px;
  331. font-weight: normal;
  332. font-size: 24px;
  333. color: #333333;
  334. line-height: 40px;
  335. }
  336. }
  337. }
  338. .man2_group {
  339. margin-top: 60px;
  340. height: 100%;
  341. display: flex;
  342. .man2 {
  343. position: relative;
  344. width: 327px;
  345. // height: 100%;
  346. // height: 100%
  347. .man2_img {
  348. position: absolute;
  349. bottom: 0;
  350. /* bottom: 0px; */
  351. /* height: auto; */
  352. width: 100%;
  353. left: -100px
  354. }
  355. }
  356. .des2 {
  357. border: #48D68E solid 5px;
  358. border-radius: 40px;
  359. padding: 20px;
  360. letter-spacing: 6px;
  361. flex: 1;
  362. .des2_inner {
  363. border: 1px dashed #48D68E;
  364. border-radius: 40px;
  365. padding-bottom: 40px;
  366. padding-top: 30px;
  367. padding-left: 20px;
  368. padding-right: 100px;
  369. letter-spacing: 6px;
  370. font-weight: normal;
  371. font-size: 24px;
  372. color: #333333;
  373. line-height: 40px;
  374. }
  375. }
  376. }
  377. .get_more {
  378. text-align: center;
  379. img {
  380. width: 300px;
  381. margin-top: 60px;
  382. margin-bottom: 60px;
  383. }
  384. }
  385. }
  386. // .home_footer_out {
  387. // width: 100%;
  388. // background-color: #000000;
  389. // }</style>