testResult.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <view class="bg">
  3. <view class="scale_name">你是拖延症患者吗</view>
  4. <view class="test_time">测试时间:{{time}}</view>
  5. <image class="temp_type" src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/result_title.png"
  6. mode="widthFix">
  7. </image>
  8. <view class="score_box">
  9. <view style="overflow: hidden;"></view>
  10. <view class="score_num" style="margin-top: 90rpx;">得分:{{scoreNum}}分</view>
  11. <view class="score_percentage">
  12. <view class="score_wrap">
  13. <view class="process_bar" :style="{'left': percentage}">
  14. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Career/process_bar.png"
  15. mode="widthFix"></image>
  16. <view class="score_text">{{parseInt(scoreNum)}}/{{parseInt(maxScore)}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="score_explain">注:得分越高,您的拖延症越严重</view>
  21. <!-- <view class="min_max"><text>0</text><text>60</text></view> -->
  22. <view class="score_num">结论:</view>
  23. <image v-if="role" class="role_name" :src="roleList[role].name" mode="widthFix"></image>
  24. <image v-if="role" class="role_img" :src="roleList[role].img" mode="widthFix"></image>
  25. </view>
  26. <view class="rgtd_box">
  27. <view style="overflow: hidden;"></view>
  28. <div class="result_title_bg">
  29. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/result_title_bg.png"
  30. mode="widthFix"></image>
  31. </div>
  32. <view class="rgtd_box_wrap">
  33. <view class="dimension_title dt1">
  34. 得&nbsp&nbsp;&nbsp;&nbsp;分 <text style="font-size: 28rpx;color: #999999;">(满分{{maxScore}})</text>
  35. </view>
  36. <view class="dimension_content dc1">
  37. <text>{{scoreNum}}</text>
  38. </view>
  39. <view class="dimension_title dt1">
  40. 维度结论
  41. </view>
  42. <view class="dimension_content dc1">
  43. <text>{{role}}</text>
  44. </view>
  45. <view class="dimension_title">
  46. 维度说明
  47. </view>
  48. <view class="dimension_content">
  49. {{nameExplain}}
  50. </view>
  51. <view class="dimension_title">
  52. 维度解读
  53. </view>
  54. <view class="dimension_content">
  55. {{improvementSuggestions}}
  56. </view>
  57. <view class="dimension_title">
  58. 建议
  59. </view>
  60. <view class="dimension_content ds">
  61. {{suggestion}}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="report_desc">
  66. <view class="desc_title">报告阅读说明</view>
  67. <view class="stext">谢谢您的参与,阅读本报告时,请注意以下内容:</view>
  68. <view style="display: flex;">
  69. <view class="list_mark">·</view>
  70. <view class="desc_txt">本结果仅供参考,不可作为临床诊断的依据;</view>
  71. </view>
  72. <view style="display: flex;">
  73. <view class="list_mark">·</view>
  74. <view class="desc_txt">如对报告有不理解的地方,建议咨询专业人员;</view>
  75. </view>
  76. <view style="display: flex;">
  77. <view class="list_mark">·</view>
  78. <view class="desc_txt">如结果与你自己或他人的感受有出入,可回忆在测试时是否有事情影响到你,或自己回答时是否有所顾虑。</view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import {
  85. getRecordById
  86. } from "@/api/index.js";
  87. import {
  88. photoUrl
  89. } from "@/common/config.js"
  90. const photoUrls = `${photoUrl}api/show?filePath=./webo`
  91. console.log(photoUrl);
  92. export default {
  93. data() {
  94. return {
  95. isChecked: true,
  96. isShake: false,
  97. scaleDetail: {},
  98. questionList: [],
  99. currentQuestion: {},
  100. currentAnswerList: [],
  101. currentIndex: 0,
  102. userAnswerList: [],
  103. resultId: '',
  104. isLoading: false,
  105. isDisbale: false,
  106. roleList: {
  107. '无拖延': {
  108. name: `${photoUrls}/Delay/role/role1.png`,
  109. img: `${photoUrls}/Delay/role/role_img1.png`,
  110. index: 1,
  111. 'roleWidth': {
  112. 'width': '375rpx'
  113. }
  114. },
  115. '中度拖延': {
  116. name: `${photoUrls}/Delay/role/role2.png`,
  117. img: `${photoUrls}/Delay/role/role_img2.png`,
  118. index: 2,
  119. 'roleWidth': {
  120. 'width': '375rpx'
  121. }
  122. },
  123. '重度拖延': {
  124. name: `${photoUrls}/Delay/role/role3.png`,
  125. img: `${photoUrls}/Delay/role/role_img3.png`,
  126. index: 3,
  127. 'roleWidth': {
  128. 'width': '375rpx'
  129. }
  130. }
  131. },
  132. resultId: '',
  133. role: '',
  134. improvementSuggestions: '',
  135. scoreNum: 0,
  136. maxScore: 0,
  137. minScore: 0,
  138. keywords: '',
  139. time: '',
  140. nameExplain: '',
  141. suggestion: ''
  142. }
  143. },
  144. onLoad(options) {
  145. if (options && options.resultId) {
  146. this.resultId = options.resultId
  147. this.getScaleTestResults(this.resultId);
  148. }
  149. },
  150. computed: {
  151. percentage() {
  152. return (((this.scoreNum / this.maxScore) * 312) - 318) + 'rpx'
  153. }
  154. },
  155. methods: {
  156. getScaleTestResults(id) {
  157. let _this = this;
  158. _this.$request
  159. .get({
  160. url: `${getRecordById}?id=${id}`,
  161. loadingTip: "加载中...",
  162. data: {},
  163. })
  164. .then(
  165. (res) => {
  166. console.log('222:', new Date().getTime());
  167. console.log("----测试结果--->", res);
  168. if (res.code == 200) {
  169. _this.testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0];
  170. let result = _this.testResult.newTableContext.result[0];
  171. _this.role = result.symptom;
  172. _this.maxScore = result.maxScore;
  173. _this.scoreNum = result.score;
  174. _this.improvementSuggestions = result.improvementSuggestions;
  175. _this.nameExplain = result.nameExplain;
  176. _this.suggestion = result.suggestion;
  177. _this.keywords = _this.trimStart(_this.improvementSuggestions.slice(0, 5));
  178. let testDateTime = res.data.userRecordEntity.testDate;
  179. let yearMonthDay = testDateTime
  180. .replace("年", "/")
  181. .replace("月", "/")
  182. .replace("日", " ")
  183. .replace("时", ":")
  184. .replace("分", ":")
  185. .replace("秒", "");
  186. _this.time = yearMonthDay;
  187. } else if (res.code == 401) {} else {
  188. (res) => {
  189. console.log("世界上绝对绝对绝对绝对绝对的", res);
  190. }
  191. }
  192. })
  193. },
  194. trimStart(str) {
  195. return str.replace(/^\s+/, '');
  196. },
  197. segmentation(str) {
  198. return str.split('\n');
  199. }
  200. }
  201. }
  202. </script>
  203. <style scoped>
  204. .bg {
  205. width: 100%;
  206. min-height: 1624rpx;
  207. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/test_result_bg.png) no-repeat top;
  208. background-size: 100% 100%;
  209. overflow: hidden;
  210. position: relative;
  211. }
  212. .scale_name {
  213. font-family: 'Alibaba PuHuiTi 2.0';
  214. font-weight: bold;
  215. font-size: 40rpx;
  216. color: #ffffff;
  217. margin: 32rpx 0 0 29rpx;
  218. }
  219. .test_time {
  220. font-family: 'Alibaba PuHuiTi 2.0';
  221. font-weight: normal;
  222. font-size: 28rpx;
  223. color: #ffffff;
  224. margin-left: 29rpx;
  225. }
  226. .temp_type {
  227. width: 205rpx;
  228. position: absolute;
  229. top: 29rpx;
  230. right: 38rpx;
  231. }
  232. .score_box {
  233. width: 712rpx;
  234. height: 425rpx;
  235. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/score_box_bg.png) no-repeat center;
  236. background-size: cover;
  237. border-radius: 28rpx;
  238. margin: 37rpx auto 0;
  239. position: relative;
  240. }
  241. .score_num {
  242. font-family: 'Alibaba PuHuiTi 2.0';
  243. font-weight: normal;
  244. font-size: 32rpx;
  245. color: #333333;
  246. line-height: 31rpx;
  247. margin: 14rpx 0 0 22rpx;
  248. }
  249. .score_percentage {
  250. display: flex;
  251. align-items: center;
  252. justify-content: space-between;
  253. width: 319rpx;
  254. height: 36rpx;
  255. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Career/score_percentage_bg.png) no-repeat center;
  256. background-size: cover;
  257. margin: 14rpx 0 8rpx 20rpx;
  258. }
  259. .score_wrap {
  260. width: 348rpx;
  261. height: 48rpx;
  262. margin: 0 0 0 12rpx;
  263. position: relative;
  264. overflow: hidden;
  265. border-radius: 25rpx;
  266. }
  267. .process {
  268. overflow: hidden;
  269. }
  270. .process_bar {
  271. width: 318rpx;
  272. position: absolute;
  273. left: -100rpx;
  274. top: 8rpx;
  275. }
  276. .process_bar image {
  277. width: 100%;
  278. }
  279. .score_text {
  280. width: 68rpx;
  281. height: 42rpx;
  282. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Career/socre_text_bg.png) no-repeat;
  283. background-size: cover;
  284. position: absolute;
  285. top: -6rpx;
  286. right: 6rpx;
  287. z-index: 2;
  288. font-family: 'Alibaba PuHuiTi 2.0';
  289. font-weight: bold;
  290. font-size: 20rpx;
  291. color: #EE5C00;
  292. line-height: 42rpx;
  293. text-align: center;
  294. }
  295. .min_max {
  296. width: 300rpx;
  297. display: flex;
  298. justify-content: space-between;
  299. font-family: 'Alibaba PuHuiTi 2.0';
  300. font-weight: normal;
  301. font-size: 20rpx;
  302. color: #999999;
  303. margin-left: 30rpx;
  304. }
  305. .role_name {
  306. width: 409rpx;
  307. margin: 10rpx 0 0 21rpx;
  308. position: relative;
  309. z-index: 2;
  310. }
  311. .role_img {
  312. width: 347rpx;
  313. position: absolute;
  314. top: -20rpx;
  315. right: -16rpx;
  316. }
  317. .result_box {
  318. width: 712rpx;
  319. min-height: 804rpx;
  320. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/result_box_bg.png) no-repeat;
  321. background-size: 100% 100%;
  322. box-shadow: 0rpx 3rpx 24rpx 0rpx rgba(126, 77, 0, 0.13);
  323. border-radius: 26rpx;
  324. margin: 13rpx auto 0;
  325. position: relative;
  326. z-index: 2;
  327. }
  328. .result_box_top {
  329. width: 712rpx;
  330. height: 109rpx;
  331. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/result_box_top.png);
  332. background-size: cover;
  333. margin: 0 auto;
  334. }
  335. .result_box_bottom {
  336. width: 700rpx;
  337. min-height: 109rpx;
  338. background-size: cover;
  339. background: #EAEDFE;
  340. border-radius: 0 0 28rpx 28rpx;
  341. margin: 0 auto;
  342. overflow: hidden;
  343. }
  344. .title_img {
  345. width: 302rpx;
  346. position: relative;
  347. z-index: 3;
  348. margin: 31rpx 0 0 28rpx;
  349. }
  350. .sm_title {
  351. font-family: 'Alibaba PuHuiTi 2.0';
  352. font-weight: normal;
  353. font-size: 36rpx;
  354. color: #333333;
  355. line-height: 31rpx;
  356. margin: 10rpx 0 0 26rpx;
  357. }
  358. .r_content {
  359. box-sizing: border-box;
  360. width: 94%;
  361. min-height: 307rpx;
  362. margin: 26rpx auto 40rpx;
  363. padding: 30rpx 26rpx;
  364. border-radius: 18rpx;
  365. background: #ffffff;
  366. font-family: 'Alibaba PuHuiTi 2.0';
  367. font-weight: normal;
  368. font-size: 32rpx;
  369. color: #333333;
  370. line-height: 50rpx;
  371. letter-spacing: 2rpx;
  372. }
  373. .c_item {
  374. display: flex;
  375. align-items: flex-start;
  376. text-align: justify;
  377. letter-spacing: 2px;
  378. margin-bottom: 16rpx;
  379. }
  380. .list_style_bg {
  381. width: 36rpx;
  382. height: 36rpx;
  383. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Delay/list_style_bg.png) no-repeat center;
  384. background-size: 100% auto;
  385. margin: 10rpx 8rpx 0 0;
  386. }
  387. .report_desc {
  388. padding: 30rpx 38rpx;
  389. letter-spacing: 1px;
  390. }
  391. .desc_title {
  392. font-family: 'Alibaba PuHuiTi 2.0';
  393. font-weight: normal;
  394. font-size: 28rpx;
  395. color: #ffffff;
  396. line-height: 46rpx;
  397. }
  398. .stext {
  399. font-family: 'Alibaba PuHuiTi 2.0';
  400. font-weight: normal;
  401. font-size: 20rpx;
  402. color: #ffffff;
  403. line-height: 30rpx;
  404. }
  405. .desc_txt {
  406. font-family: 'Alibaba PuHuiTi 2.0';
  407. font-weight: normal;
  408. font-size: 20rpx;
  409. color: #ffffff;
  410. line-height: 30rpx;
  411. }
  412. .list_mark {
  413. line-height: 0.7;
  414. font-size: 36rpx;
  415. color: #ffffff;
  416. font-weight: 600;
  417. margin-right: 5rpx;
  418. }
  419. .analysis_title {
  420. width: 362rpx;
  421. position: absolute;
  422. top: -30rpx;
  423. left: 50%;
  424. transform: translateX(-50%);
  425. }
  426. .paperclip {
  427. width: 55rpx;
  428. position: absolute;
  429. top: -40rpx;
  430. left: 38rpx;
  431. }
  432. .score_explain {
  433. font-family: 'Alibaba PuHuiTi 2.0';
  434. font-weight: normal;
  435. font-size: 24rpx;
  436. color: #999999;
  437. line-height: 31rpx;
  438. margin-left: 36rpx;
  439. }
  440. .rgtd_box {
  441. width: 702rpx;
  442. background: #EAEDFE;
  443. border-radius: 32rpx;
  444. margin: 34rpx auto 0;
  445. }
  446. .dimension_title {
  447. box-sizing: border-box;
  448. width: 100%;
  449. height: 60rpx;
  450. /* background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Burnout/list_style_bg.png) no-repeat 16rpx center;
  451. background-size: 19rpx auto; */
  452. padding: 26rpx 0 0 26rpx;
  453. font-family: 'Alibaba PuHuiTi 2.0';
  454. font-weight: bold;
  455. font-size: 32rpx;
  456. color: #333333;
  457. line-height: 24rpx;
  458. }
  459. .dt1 {
  460. margin-top: 18rpx;
  461. }
  462. .dimension_content {
  463. box-sizing: border-box;
  464. width: 674rpx;
  465. min-height: 91rpx;
  466. padding: 30rpx 24rpx;
  467. background: #FFFFFF;
  468. border-radius: 18rpx;
  469. margin: 20rpx auto;
  470. font-family: 'Alibaba PuHuiTi 2.0';
  471. font-weight: normal;
  472. font-size: 32rpx;
  473. color: #333333;
  474. line-height: 50rpx;
  475. text-align: justify;
  476. }
  477. .dc1 {
  478. border-radius: 50rpx;
  479. text-align: center;
  480. }
  481. .dc1 text {
  482. font-family: 'Alibaba PuHuiTi 2.0';
  483. font-weight: 600;
  484. font-size: 32rpx;
  485. color: #4F55B5;
  486. }
  487. .result_title_bg {
  488. margin: 25rpx 0 0 28rpx;
  489. image {
  490. width: 270rpx;
  491. height: auto;
  492. }
  493. }
  494. </style>