testResult.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. <template>
  2. <view v-if="role" class="" :class="['bg', `bg${roleList[role].type}`]">
  3. <view class="scale_name">你的家庭关系健康吗?</view>
  4. <view class="test_time">测试时间:{{time}}</view>
  5. <view class="role_medal">
  6. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/result_title.png"
  7. mode="widthFix"></image>
  8. </view>
  9. <view class="rgtd_box" style="margin-top: 490rpx;">
  10. <view style="overflow: hidden;"></view>
  11. <view class="rgtd_box_wrap">
  12. <view class="rgtd_box_title">
  13. <image class="title_img"
  14. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/jgzp.png"
  15. mode="widthFix">
  16. </image>
  17. <image class="carton"
  18. :src="`https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/role_img${roleList[role].type}.png`"
  19. mode="widthFix"></image>
  20. </view>
  21. <view class="rgtd_box_content">
  22. {{resultObj[0].improvementSuggestions}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="rgtd_box">
  27. <view style="overflow: hidden;"></view>
  28. <view class="rgtd_box_wrap">
  29. <view class="rgtd_box_title">
  30. <image class="title_img"
  31. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/wtjj.png"
  32. mode="widthFix">
  33. </image>
  34. </view>
  35. <view class="remark_A">{{getAdvantage(resultObj[1].improvementSuggestions)['title']}}</view>
  36. <view class="rgtd_box_content">{{getAdvantage(resultObj[1].improvementSuggestions)['content']}}</view>
  37. <view class="jd">
  38. *{{resultObj[1].name + resultObj[1].nameExplain}}
  39. </view>
  40. </view>
  41. </view>
  42. <view class="rgtd_box">
  43. <view style="overflow: hidden;"></view>
  44. <view class="rgtd_box_wrap">
  45. <view class="rgtd_box_title">
  46. <image class="title_img"
  47. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/gtwt.png"
  48. mode="widthFix">
  49. </image>
  50. </view>
  51. <view class="remark_B">{{getAdvantage(resultObj[2].improvementSuggestions)['title']}}</view>
  52. <view class="rgtd_box_content">{{getAdvantage(resultObj[2].improvementSuggestions)['content']}}</view>
  53. <view class="jd">
  54. *{{resultObj[2].name + resultObj[2].nameExplain}}
  55. </view>
  56. </view>
  57. </view>
  58. <view class="rgtd_box">
  59. <view style="overflow: hidden;"></view>
  60. <view class="rgtd_box_wrap">
  61. <view class="rgtd_box_title">
  62. <image class="title_img"
  63. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/jsdw.png"
  64. mode="widthFix">
  65. </image>
  66. </view>
  67. <view class="remark_A">{{getAdvantage(resultObj[3].improvementSuggestions)['title']}}</view>
  68. <view class="rgtd_box_content">{{getAdvantage(resultObj[3].improvementSuggestions)['content']}}</view>
  69. <view class="jd">
  70. *{{resultObj[3].name + resultObj[3].nameExplain}}
  71. </view>
  72. </view>
  73. </view>
  74. <view class="rgtd_box">
  75. <view style="overflow: hidden;"></view>
  76. <view class="rgtd_box_wrap">
  77. <view class="rgtd_box_title">
  78. <image class="title_img"
  79. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/qgfy.png"
  80. mode="widthFix">
  81. </image>
  82. </view>
  83. <view class="remark_B">{{getAdvantage(resultObj[4].improvementSuggestions)['title']}}</view>
  84. <view class="rgtd_box_content">{{getAdvantage(resultObj[4].improvementSuggestions)['content']}}</view>
  85. <view class="jd">
  86. *{{resultObj[4].name + resultObj[4].nameExplain}}
  87. </view>
  88. </view>
  89. </view>
  90. <view class="rgtd_box">
  91. <view style="overflow: hidden;"></view>
  92. <view class="rgtd_box_wrap">
  93. <view class="rgtd_box_title">
  94. <image class="title_img"
  95. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/qgjr.png"
  96. mode="widthFix">
  97. </image>
  98. </view>
  99. <view class="remark_A">{{getAdvantage(resultObj[5].improvementSuggestions)['title']}}</view>
  100. <view class="rgtd_box_content">{{getAdvantage(resultObj[5].improvementSuggestions)['content']}}</view>
  101. <view class="jd">
  102. *{{resultObj[5].name + resultObj[5].nameExplain}}
  103. </view>
  104. </view>
  105. </view>
  106. <view class="rgtd_box">
  107. <view style="overflow: hidden;"></view>
  108. <view class="rgtd_box_wrap">
  109. <view class="rgtd_box_title">
  110. <image class="title_img"
  111. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/xwkz.png"
  112. mode="widthFix">
  113. </image>
  114. </view>
  115. <view class="remark_B">{{getAdvantage(resultObj[6].improvementSuggestions)['title']}}</view>
  116. <view class="rgtd_box_content">{{getAdvantage(resultObj[6].improvementSuggestions)['content']}}</view>
  117. <view class="jd">
  118. *{{resultObj[6].name + resultObj[6].nameExplain}}
  119. </view>
  120. </view>
  121. </view>
  122. <view class="rgtd_box">
  123. <view style="overflow: hidden;"></view>
  124. <view class="rgtd_box_wrap">
  125. <view class="rgtd_box_title">
  126. <image class="title_img"
  127. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/zdgn.png"
  128. mode="widthFix">
  129. </image>
  130. </view>
  131. <view class="remark_A">{{getAdvantage(resultObj[7].improvementSuggestions)['title']}}</view>
  132. <view class="rgtd_box_content">{{getAdvantage(resultObj[7].improvementSuggestions)['content']}}</view>
  133. <view class="jd">
  134. *{{resultObj[7].name + resultObj[7].nameExplain}}
  135. </view>
  136. </view>
  137. </view>
  138. <view class="report_desc">
  139. <view class="desc_title">报告阅读说明</view>
  140. <view class="stext">谢谢您的参与,阅读本报告时,请注意以下内容:</view>
  141. <view style="display: flex;">
  142. <view class="list_mark">·</view>
  143. <view class="desc_txt">本结果仅供参考,不可作为临床诊断的依据;</view>
  144. </view>
  145. <view style="display: flex;">
  146. <view class="list_mark">·</view>
  147. <view class="desc_txt">如对报告有不理解的地方,建议咨询专业人员;</view>
  148. </view>
  149. <view style="display: flex;">
  150. <view class="list_mark">·</view>
  151. <view class="desc_txt">如结果与你自己或他人的感受有出入,可回忆在测试时是否有事情影响到你,或自己回答时是否有所顾虑。</view>
  152. </view>
  153. </view>
  154. </view>
  155. </template>
  156. <script>
  157. import {
  158. getRecordById
  159. } from "@/api/index.js";
  160. import {
  161. photoUrl
  162. } from "@/common/config.js"
  163. import {
  164. getTestTime
  165. } from "@/utils/util.js"
  166. const photoUrls = `${photoUrl}api/show?filePath=./webo`
  167. export default {
  168. data() {
  169. return {
  170. photoUrl: photoUrl,
  171. isChecked: true,
  172. isShake: false,
  173. scaleDetail: {},
  174. questionList: [],
  175. currentQuestion: {},
  176. currentAnswerList: [],
  177. currentIndex: 0,
  178. userAnswerList: [],
  179. resultId: '',
  180. isLoading: false,
  181. isDisbale: false,
  182. roleList: {
  183. '家庭关系需用心经营': {
  184. type: 1,
  185. img: `${photoUrls}/Family/role/role_enfj.png`,
  186. mrBg: '#E4FFD3',
  187. mrBorder: '#66C666',
  188. mrColor: '#0B7000'
  189. },
  190. '家庭关系较为和睦': {
  191. type: 2,
  192. img: `${photoUrls}/Family/role/role_enfp.png`,
  193. mrBg: '#E4FFD3',
  194. mrBorder: '#66C666',
  195. mrColor: '#0B7000'
  196. },
  197. '家庭关系幸福美满': {
  198. type: 3,
  199. img: `${photoUrls}/Family/role/role_entj.png`,
  200. mrBg: '#F7E9FF',
  201. mrBorder: '#B262E1',
  202. mrColor: '#962ED4'
  203. }
  204. },
  205. resultObj: [],
  206. resultId: '',
  207. role: '',
  208. scoreNum: 0,
  209. maxScore: 0,
  210. minScore: 0,
  211. keywords: '',
  212. characteristic: '', // 特点
  213. }
  214. },
  215. onLoad(options) {
  216. if (options && options.resultId) {
  217. this.resultId = options.resultId
  218. this.getScaleTestResults(this.resultId);
  219. }
  220. },
  221. computed: {
  222. percentage() {
  223. return (((this.scoreNum / this.maxScore) * 318) - 318) + 'rpx'
  224. }
  225. },
  226. methods: {
  227. getScaleTestResults(id) {
  228. let _this = this;
  229. _this.$request
  230. .get({
  231. url: `${getRecordById}?id=${id}`,
  232. loadingTip: "加载中...",
  233. data: {},
  234. })
  235. .then(
  236. (res) => {
  237. if (res.code == 200) {
  238. _this.testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0];
  239. console.log(_this.testResult);
  240. _this.role = _this.testResult.tableContext[1].value[0];
  241. _this.resultObj = _this.testResult.newTableContext.result;
  242. _this.time = getTestTime(res.data.userRecordEntity.testDate);
  243. } else if (res.code == 401) {} else {
  244. (res) => {
  245. console.log("世界上绝对绝对绝对绝对绝对的", res);
  246. }
  247. }
  248. })
  249. },
  250. getAdvantage(str) {
  251. let tempArr = str.split("——");
  252. let advant = {
  253. title: tempArr[0],
  254. content: tempArr[1]
  255. }
  256. return advant
  257. }
  258. }
  259. }
  260. </script>
  261. <style scoped>
  262. .bg {
  263. width: 100%;
  264. min-height: 6365rpx;
  265. background: #FD654D;
  266. overflow: hidden;
  267. position: relative;
  268. padding-bottom: 200rpx;
  269. }
  270. .bg1 {
  271. background: #FD654D url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/bg1.png') no-repeat top;
  272. background-size: 100% auto;
  273. }
  274. .bg2 {
  275. background: #FD654D url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/bg2.png')no-repeat top;
  276. background-size: 100% auto;
  277. }
  278. .bg3 {
  279. background: #FD654D url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/bg3.png')no-repeat top;
  280. background-size: 100% auto;
  281. }
  282. .scale_name {
  283. font-family: 'Alibaba PuHuiTi 2.0';
  284. font-weight: bold;
  285. font-size: 40rpx;
  286. color: #FFFFFF;
  287. text-shadow: 0rpx 3rpx 3rpx rgba(147, 52, 105, 0.85);
  288. margin: 29rpx 0 0 39rpx;
  289. }
  290. .test_time {
  291. font-family: 'Alibaba PuHuiTi 2.0';
  292. font-weight: normal;
  293. font-size: 28rpx;
  294. color: #FFFEFE;
  295. margin-left: 39rpx;
  296. }
  297. .role_wrap {
  298. position: relative;
  299. }
  300. .role_char {
  301. width: 714rpx;
  302. height: 156rpx;
  303. display: flex;
  304. justify-content: space-around;
  305. align-items: center;
  306. position: absolute;
  307. left: 18rpx;
  308. bottom: 0;
  309. }
  310. .char_item {
  311. width: 30%;
  312. font-family: 'ZhankuKuaiLeTi';
  313. font-weight: 800;
  314. font-size: 36rpx;
  315. color: #333333;
  316. line-height: 52rpx;
  317. text-align: center;
  318. }
  319. .shadow_img {
  320. display: block;
  321. width: 170rpx;
  322. position: absolute;
  323. left: 50%;
  324. bottom: -6rpx;
  325. transform: translateX(-50%);
  326. }
  327. .role_name {
  328. text-align: center;
  329. margin: 202rpx 0 0 0;
  330. }
  331. .role_name image {
  332. width: 550rpx;
  333. }
  334. .temp_type {
  335. width: 714rpx;
  336. margin: 0 auto;
  337. }
  338. .carton {
  339. width: 286rpx;
  340. position: absolute;
  341. bottom: 8rpx;
  342. right: 27rpx;
  343. }
  344. .rgtd_box {
  345. width: 702rpx;
  346. background: #FF9429;
  347. border-radius: 44rpx;
  348. margin: 0 auto;
  349. position: relative;
  350. margin-top: 59rpx;
  351. }
  352. .rgtd_box_title {
  353. width: 100%;
  354. height: 86rpx;
  355. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/rgtd_box_title_bg.png) no-repeat 300rpx 10rpx;
  356. background-size: 383rpx auto;
  357. position: relative;
  358. }
  359. .remark_A {
  360. width: 588rpx;
  361. line-height: 83rpx;
  362. background: linear-gradient(90deg, #FFA400 0%, #FB3975 100%);
  363. border-radius: 42rpx;
  364. margin: 0 auto 18rpx;
  365. font-family: 'Alibaba PuHuiTi 2.0';
  366. font-weight: normal;
  367. font-size: 40rpx;
  368. color: #FFFEFE;
  369. text-align: center;
  370. letter-spacing: 2rpx;
  371. }
  372. .remark_B {
  373. width: 588rpx;
  374. line-height: 83rpx;
  375. background: linear-gradient(90deg, #FFF74B 0%, #77FF5F 100%);
  376. border-radius: 41rpx;
  377. margin: 0 auto 18rpx;
  378. font-family: 'Alibaba PuHuiTi 2.0';
  379. font-weight: normal;
  380. font-size: 40rpx;
  381. color: #333333;
  382. text-align: center;
  383. letter-spacing: 2rpx;
  384. }
  385. .rgtd_box_wrap {
  386. width: 692rpx;
  387. padding-bottom: 31rpx;
  388. background: #FFCB97;
  389. border-radius: 41rpx;
  390. margin: 5rpx;
  391. }
  392. .rgtd_box_content {
  393. box-sizing: border-box;
  394. width: 674rpx;
  395. min-height: 290rpx;
  396. padding: 28rpx 32rpx;
  397. background: #FFF9FA;
  398. border-radius: 18rpx;
  399. margin: 0 auto;
  400. font-family: 'Alibaba PuHuiTi 2.0';
  401. font-weight: normal;
  402. font-size: 32rpx;
  403. color: #333333;
  404. line-height: 50rpx;
  405. letter-spacing: 2rpx;
  406. text-align: justify;
  407. }
  408. .rgtd_text {
  409. width: 181rpx;
  410. margin: 6rpx 0 0 39rpx;
  411. }
  412. .emo_img {
  413. width: 112rpx;
  414. margin-right: 7rpx;
  415. }
  416. .rgtg_content {
  417. box-sizing: border-box;
  418. width: 714rpx;
  419. padding: 40rpx;
  420. background: #FFFFFF;
  421. border-radius: 35rpx;
  422. margin: 0 auto;
  423. font-family: 'Alibaba PuHuiTi 2.0';
  424. font-weight: normal;
  425. font-size: 28rpx;
  426. color: #333333;
  427. line-height: 1.8;
  428. letter-spacing: 2rpx;
  429. }
  430. .mrmj_content {
  431. display: flex;
  432. flex-wrap: wrap;
  433. min-height: 255rpx;
  434. }
  435. .star_img {
  436. width: 92rpx;
  437. margin-right: 43rpx;
  438. }
  439. .mrmj_content .mr_name {
  440. height: 44rpx;
  441. padding: 0 34rpx;
  442. margin: 4rpx 10rpx;
  443. background: #E4FFD3;
  444. border-radius: 22rpx;
  445. border: 1px solid #66C666;
  446. font-family: 'Alibaba PuHuiTi 2.0';
  447. font-weight: normal;
  448. font-size: 28rpx;
  449. color: #0B7000;
  450. line-height: 44rpx;
  451. text-align: center;
  452. }
  453. .mr_pic_box {
  454. width: 100%;
  455. }
  456. .mr_pic {
  457. width: 316rpx;
  458. margin: 5rpx 8rpx;
  459. }
  460. .advantage_title {
  461. font-family: 'Alibaba PuHuiTi 2.0';
  462. font-weight: bold;
  463. font-size: 32rpx;
  464. color: #333333;
  465. margin: 25rpx 5rpx 8rpx;
  466. }
  467. .advantage_content {
  468. box-sizing: border-box;
  469. width: 632rpx;
  470. background: #E4FFD3;
  471. border-radius: 22rpx;
  472. border: 1px solid #66C666;
  473. padding: 28rpx;
  474. margin: 0 auto;
  475. }
  476. .ad_item_title {
  477. display: flex;
  478. align-items: center;
  479. font-family: 'Alibaba PuHuiTi 2.0';
  480. font-weight: bold;
  481. font-size: 32rpx;
  482. color: #156300;
  483. }
  484. .love_role {
  485. width: 571rpx;
  486. margin: 0 auto;
  487. }
  488. .single_star {
  489. width: 32rpx;
  490. margin: 0 8rpx 4rpx 0;
  491. }
  492. .heart_img {
  493. width: 93rpx;
  494. margin-right: 16rpx;
  495. }
  496. .lover_type_title {
  497. font-family: 'Alibaba PuHuiTi 2.0';
  498. font-weight: bold;
  499. font-size: 32rpx;
  500. color: #333333;
  501. line-height: 43rpx;
  502. }
  503. .lover_type {
  504. width: 571rpx;
  505. font-family: 'ZhankuKuaiLeTi';
  506. font-weight: 400;
  507. font-size: 133rpx;
  508. color: #333333;
  509. line-height: 149rpx;
  510. text-align: center;
  511. margin: 50rpx auto 30rpx;
  512. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/role/lover_type_bg.png) no-repeat center bottom;
  513. background-size: 100% auto;
  514. }
  515. .love_decode {
  516. box-sizing: border-box;
  517. width: 632rpx;
  518. padding: 39rpx 30rpx;
  519. background: #FFE8FD;
  520. border-radius: 22rpx;
  521. border: 1px solid #FF59F1;
  522. margin: 0 auto;
  523. font-family: 'Alibaba PuHuiTi 2.0';
  524. font-weight: normal;
  525. font-size: 28rpx;
  526. color: #333333;
  527. }
  528. .result_box {
  529. width: 702rpx;
  530. min-height: 807rpx;
  531. background: #ffffff;
  532. box-shadow: 0rpx 3rpx 24rpx 0rpx rgba(126, 77, 0, 0.13);
  533. border-radius: 26rpx;
  534. margin: 168rpx auto 0;
  535. position: relative;
  536. }
  537. .pad_box {
  538. width: 100%;
  539. height: 200rpx;
  540. border-radius: 26rpx;
  541. overflow: hidden;
  542. }
  543. .title_img {
  544. width: 300rpx;
  545. position: absolute;
  546. top: -36rpx;
  547. left: -10rpx;
  548. }
  549. .result_box_r {
  550. box-sizing: border-box;
  551. width: 702rpx;
  552. min-height: 453rpx;
  553. margin: -188rpx auto 0;
  554. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Family/result_bg_r.png) no-repeat top;
  555. background-size: 100% auto;
  556. border-radius: 33rpx;
  557. font-family: 'Alibaba PuHuiTi 2.0';
  558. font-weight: normal;
  559. font-size: 32rpx;
  560. color: #555555;
  561. line-height: 50rpx;
  562. position: relative;
  563. z-index: 2;
  564. }
  565. .r_content {
  566. width: 600rpx;
  567. min-height: 307rpx;
  568. background: #FFE1E1;
  569. border-radius: 20rpx;
  570. border: 1px solid #FF6666;
  571. margin: 20rpx auto 0;
  572. padding: 30rpx;
  573. font-family: 'Alibaba PuHuiTi 2.0';
  574. font-weight: normal;
  575. font-size: 32rpx;
  576. color: #333333;
  577. line-height: 50rpx;
  578. display: flex;
  579. align-items: flex-start;
  580. }
  581. .report_desc {
  582. padding: 30rpx 38rpx;
  583. letter-spacing: 1px;
  584. }
  585. .desc_title {
  586. font-family: 'Alibaba PuHuiTi 2.0';
  587. font-weight: normal;
  588. font-size: 28rpx;
  589. color: #ffffff;
  590. line-height: 46rpx;
  591. }
  592. .stext {
  593. font-family: 'Alibaba PuHuiTi 2.0';
  594. font-weight: normal;
  595. font-size: 20rpx;
  596. color: #ffffff;
  597. line-height: 30rpx;
  598. }
  599. .desc_txt {
  600. font-family: 'Alibaba PuHuiTi 2.0';
  601. font-weight: normal;
  602. font-size: 20rpx;
  603. color: #ffffff;
  604. line-height: 30rpx;
  605. }
  606. .list_mark {
  607. line-height: 0.7;
  608. font-size: 36rpx;
  609. color: #ffffff;
  610. font-weight: 600;
  611. margin-right: 5rpx;
  612. }
  613. .analysis_title {
  614. width: 362rpx;
  615. position: absolute;
  616. top: -30rpx;
  617. left: 50%;
  618. transform: translateX(-50%);
  619. }
  620. .paperclip {
  621. width: 55rpx;
  622. position: absolute;
  623. top: -40rpx;
  624. left: 38rpx;
  625. }
  626. .role_medal {
  627. position: absolute;
  628. right: 38rpx;
  629. top: 32rpx;
  630. }
  631. .role_medal image {
  632. width: 205rpx;
  633. }
  634. .jd {
  635. padding: 32rpx;
  636. font-family: 'Alibaba PuHuiTi 2.0';
  637. font-weight: normal;
  638. font-size: 28rpx;
  639. color: #CD6A06;
  640. line-height: 50rpx;
  641. letter-spacing: 4rpx;
  642. }
  643. </style>