testResult.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <view class="bg">
  3. <view class="introduce">
  4. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/introduce.png" mode="widthFix">
  5. </image>
  6. </view>
  7. <view class="process"></view>
  8. <view class="result_box">
  9. <view class="role_medal">
  10. <image v-if="roleList[role]" :src="roleList[role].medal" mode="widthFix"></image>
  11. </view>
  12. <view class="score_bar">
  13. <view class="score_title"><text>得分:</text><text class="score_num">{{scoreNum}}</text></view>
  14. <view class="score_percentage">
  15. <view class="score_wrap">
  16. <image class="process_bar" :style="{'left': percentage}"
  17. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/process_bar.png"
  18. mode="widthFix"></image>
  19. </view>
  20. <view class="score_text">{{parseInt(scoreNum)}}/{{parseInt(maxScore)}}</view>
  21. </view>
  22. <view class="score_explain">注: 得分越高,情商水平越高</view>
  23. </view>
  24. <view class="role_name">
  25. <image v-if="roleList[role]" :src="roleList[role].name" mode="heightFix"></image>
  26. </view>
  27. <view class="role_img">
  28. <image v-if="roleList[role]" :src="roleList[role].img" mode="heightFix"></image>
  29. </view>
  30. </view>
  31. <view class="result_box2">
  32. <image class="fx_title" src="https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/fx_title.png"
  33. mode="widthFix">
  34. </image>
  35. <view class="result_box_r">
  36. <view class="c_item" v-for="item in (segmentation(improvementSuggestions))">
  37. <view class="list_style_bg"></view>
  38. <text style="flex: 1;">{{item}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="report_desc">
  43. <view class="desc_title">报告阅读说明</view>
  44. <view class="stext">谢谢您的参与,阅读本报告时,请注意以下内容:</view>
  45. <view style="display: flex;">
  46. <view class="list_mark">·</view>
  47. <view class="desc_txt">本结果仅供参考,不可作为临床诊断的依据;</view>
  48. </view>
  49. <view style="display: flex;">
  50. <view class="list_mark">·</view>
  51. <view class="desc_txt">如对报告有不理解的地方,建议咨询专业人员;</view>
  52. </view>
  53. <view style="display: flex;">
  54. <view class="list_mark">·</view>
  55. <view class="desc_txt">如结果与你自己或他人的感受有出入,可回忆在测试时是否有事情影响到你,或自己回答时是否有所顾虑。</view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. import {
  62. getRecordById
  63. } from "@/api/index.js";
  64. import {
  65. photoUrl
  66. } from "@/common/config.js"
  67. const photoUrls = `${photoUrl}api/show?filePath=./webo`
  68. console.log(photoUrl);
  69. export default {
  70. data() {
  71. return {
  72. isChecked: true,
  73. isShake: false,
  74. scaleDetail: {},
  75. questionList: [],
  76. currentQuestion: {},
  77. currentAnswerList: [],
  78. currentIndex: 0,
  79. userAnswerList: [],
  80. resultId: '',
  81. isLoading: false,
  82. isDisbale: false,
  83. roleList: {
  84. '坚韧黑铁': {
  85. name: `${photoUrls}/EQtest/role/role_name1.png`,
  86. img: `${photoUrls}/EQtest/role/role_img1.png`,
  87. medal: `${photoUrls}/EQtest/role/role_medal1.png`
  88. },
  89. '英勇黄铜': {
  90. name: `${photoUrls}/EQtest/role/role_name2.png`,
  91. img: `${photoUrls}/EQtest/role/role_img2.png`,
  92. medal: `${photoUrls}/EQtest/role/role_medal1.png`
  93. },
  94. '英勇黄铜+': {
  95. name: `${photoUrls}/EQtest/role/role_name3.png`,
  96. img: `${photoUrls}/EQtest/role/role_img2.png`,
  97. medal: `${photoUrls}/EQtest/role/role_medal2.png`
  98. },
  99. '不屈白银': {
  100. name: `${photoUrls}/EQtest/role/role_name4.png`,
  101. img: `${photoUrls}/EQtest/role/role_img3.png`,
  102. medal: `${photoUrls}/EQtest/role/role_medal3.png`
  103. },
  104. '不屈白银+': {
  105. name: `${photoUrls}/EQtest/role/role_name5.png`,
  106. img: `${photoUrls}/EQtest/role/role_img3.png`,
  107. medal: `${photoUrls}/EQtest/role/role_medal3.png`
  108. },
  109. '荣耀黄金': {
  110. name: `${photoUrls}/EQtest/role/role_name6.png`,
  111. img: `${photoUrls}/EQtest/role/role_img4.png`,
  112. medal: `${photoUrls}/EQtest/role/role_medal4.png`
  113. },
  114. '荣耀黄金+': {
  115. name: `${photoUrls}/EQtest/role/role_name7.png`,
  116. img: `${photoUrls}/EQtest/role/role_img4.png`,
  117. medal: `${photoUrls}/EQtest/role/role_medal4.png`
  118. },
  119. '华贵铂金': {
  120. name: `${photoUrls}/EQtest/role/role_name8.png`,
  121. img: `${photoUrls}/EQtest/role/role_img5.png`,
  122. medal: `${photoUrls}/EQtest/role/role_medal5.png`
  123. },
  124. '华贵铂金+': {
  125. name: `${photoUrls}/EQtest/role/role_name9.png`,
  126. img: `${photoUrls}/EQtest/role/role_img5.png`,
  127. medal: `${photoUrls}/EQtest/role/role_medal5.png`
  128. },
  129. '流光翡翠': {
  130. name: `${photoUrls}/EQtest/role/role_name10.png`,
  131. img: `${photoUrls}/EQtest/role/role_img6.png`,
  132. medal: `${photoUrls}/EQtest/role/role_medal6.png`
  133. },
  134. '璀璨钻石': {
  135. name: `${photoUrls}/EQtest/role/role_name11.png`,
  136. img: `${photoUrls}/EQtest/role/role_img7.png`,
  137. medal: `${photoUrls}/EQtest/role/role_medal7.png`
  138. },
  139. '超凡大师': {
  140. name: `${photoUrls}/EQtest/role/role_name12.png`,
  141. img: `${photoUrls}/EQtest/role/role_img8.png`,
  142. medal: `${photoUrls}/EQtest/role/role_medal8.png`
  143. },
  144. '傲世宗师': {
  145. name: `${photoUrls}/EQtest/role/role_name13.png`,
  146. img: `${photoUrls}/EQtest/role/role_img9.png`,
  147. medal: `${photoUrls}/EQtest/role/role_medal9.png`
  148. },
  149. '最强王者': {
  150. name: `${photoUrls}/EQtest/role/role_name14.png`,
  151. img: `${photoUrls}/EQtest/role/role_img10.png`,
  152. medal: `${photoUrls}/EQtest/role/role_medal10.png`
  153. }
  154. },
  155. resultId: '',
  156. role: '',
  157. improvementSuggestions: '',
  158. scoreNum: 0,
  159. maxScore: 0,
  160. minScore: 0
  161. }
  162. },
  163. onLoad(options) {
  164. if (options && options.resultId) {
  165. this.resultId = options.resultId
  166. this.getScaleTestResults(this.resultId);
  167. }
  168. },
  169. computed: {
  170. percentage() {
  171. return (((this.scoreNum / this.maxScore) * 318) - 318) + 'rpx'
  172. }
  173. },
  174. methods: {
  175. getScaleTestResults(id) {
  176. let _this = this;
  177. _this.$request
  178. .get({
  179. url: `${getRecordById}?id=${id}`,
  180. loadingTip: "加载中...",
  181. data: {},
  182. })
  183. .then(
  184. (res) => {
  185. console.log('222:', new Date().getTime());
  186. console.log("----测试结果--->", res);
  187. if (res.code == 200) {
  188. _this.testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0];
  189. _this.role = _this.testResult.newTableContext.result[0].symptom;
  190. _this.improvementSuggestions = _this.testResult.newTableContext.result[0]
  191. .improvementSuggestions;
  192. _this.scoreNum = _this.testResult.newTableContext.result[0].score;
  193. _this.maxScore = _this.testResult.newTableContext.result[0].maxScore;
  194. } else if (res.code == 401) {} else {
  195. (res) => {
  196. console.log("世界上绝对绝对绝对绝对绝对的", res);
  197. }
  198. }
  199. })
  200. },
  201. getNameUrl() {
  202. console.log(`${photoUrls}/EQtest/role/role_name1.png`)
  203. return `${photoUrls}/EQtest/role/role_name1.png`
  204. },
  205. segmentation(str) {
  206. return str.split('\n');
  207. }
  208. }
  209. }
  210. </script>
  211. <style scoped>
  212. .bg {
  213. width: 100%;
  214. min-height: 1900rpx;
  215. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/test_result_bg.png) no-repeat top, url(https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/test_result_bg2.png) repeat center 1498rpx;
  216. background-size: 100% auto;
  217. padding-bottom: 40rpx;
  218. overflow: hidden;
  219. }
  220. .role_name {
  221. position: relative;
  222. margin: 40rpx 0 0 40rpx;
  223. z-index: 2;
  224. }
  225. .role_name image {
  226. height: 621rpx;
  227. }
  228. .role_img {
  229. position: absolute;
  230. top: 310rpx;
  231. right: -20rpx;
  232. }
  233. .role_img image {
  234. height: 570rpx;
  235. }
  236. .result_box {
  237. width: 706rpx;
  238. min-height: 956rpx;
  239. padding-bottom: 28rpx;
  240. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/result_bg_w.png) no-repeat top;
  241. background-size: 100% auto;
  242. overflow: hidden;
  243. margin: 18rpx auto;
  244. border-radius: 33rpx;
  245. position: relative;
  246. }
  247. .result_box2 {
  248. width: 706rpx;
  249. min-height: 548rpx;
  250. padding-bottom: 28rpx;
  251. background: #E5FAFA;
  252. overflow: hidden;
  253. margin: 0 auto;
  254. border-radius: 33rpx;
  255. position: relative;
  256. }
  257. .role_medal {
  258. position: absolute;
  259. right: 50rpx;
  260. top: 0;
  261. }
  262. .role_medal image {
  263. width: 155rpx;
  264. }
  265. .result_box_r {
  266. box-sizing: border-box;
  267. width: 660rpx;
  268. min-height: 283rpx;
  269. padding: 26rpx;
  270. margin: 0 auto 0;
  271. background: #FFFFFF url(https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/result_bg_r.png) no-repeat top;
  272. background-size: 100% auto;
  273. border-radius: 33rpx;
  274. font-family: 'Alibaba PuHuiTi 2.0';
  275. font-weight: normal;
  276. font-size: 32rpx;
  277. color: #333333;
  278. line-height: 1.8;
  279. text-align: justify;
  280. letter-spacing: 3rpx;
  281. }
  282. .c_item {
  283. display: flex;
  284. align-items: flex-start;
  285. text-align: justify;
  286. letter-spacing: 2px;
  287. margin-bottom: 16rpx;
  288. }
  289. .list_style_bg {
  290. width: 16rpx;
  291. height: 16rpx;
  292. background: #fd7884;
  293. background-size: 100% auto;
  294. border-radius: 50%;
  295. margin: 17rpx 10rpx 0 0;
  296. }
  297. .score_title {
  298. display: flex;
  299. align-items: center;
  300. font-family: 'Alibaba PuHuiTi 2.0';
  301. font-weight: bolder;
  302. font-size: 36rpx;
  303. color: #333333;
  304. line-height: 31rpx;
  305. margin: 110rpx 0 25rpx 32rpx;
  306. }
  307. .score_num {
  308. font-family: 'Alibaba PuHuiTi 2.0';
  309. font-weight: bold;
  310. font-size: 81rpx;
  311. color: #FF9C00;
  312. line-height: 51rpx;
  313. /* text-stroke: 4px #FFFFFF;
  314. background: linear-gradient(269deg, #FF443D 0%, #FF9C00 100%);
  315. -webkit-text-stroke: 4px #FFFFFF;
  316. -webkit-background-clip: text;
  317. -webkit-text-fill-color: transparent; */
  318. }
  319. .score_percentage {
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. width: 420rpx;
  324. height: 46rpx;
  325. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/EQtest/score_percentage_bg.png) no-repeat center;
  326. background-size: cover;
  327. margin: 4rpx 0 0 72rpx;
  328. }
  329. .score_wrap {
  330. width: 318rpx;
  331. height: 32rpx;
  332. margin: 0 0 0 12rpx;
  333. position: relative;
  334. overflow-x: hidden;
  335. border-radius: 25rpx;
  336. }
  337. .process {
  338. overflow: hidden;
  339. }
  340. .process_bar {
  341. width: 318rpx;
  342. position: absolute;
  343. left: -100rpx;
  344. }
  345. .score_text {
  346. font-family: Alibaba PuHuiTi 2.0;
  347. font-weight: normal;
  348. font-size: 18rpx;
  349. color: #FFFFFF;
  350. line-height: 16rpx;
  351. margin-right: 16rpx;
  352. }
  353. .sm_title {
  354. font-family: 'Alibaba PuHuiTi 2.0';
  355. font-weight: bold;
  356. font-size: 36rpx;
  357. color: #333333;
  358. line-height: 31rpx;
  359. margin-bottom: 22rpx;
  360. }
  361. .report_desc {
  362. margin: 30rpx 38rpx;
  363. letter-spacing: 1px;
  364. }
  365. .desc_title {
  366. font-family: 'Alibaba PuHuiTi 2.0';
  367. font-weight: normal;
  368. font-size: 28rpx;
  369. color: #FFFFFF;
  370. line-height: 46rpx;
  371. }
  372. .desc_txt {
  373. font-family: 'Alibaba PuHuiTi 2.0';
  374. font-weight: normal;
  375. font-size: 20rpx;
  376. color: #FFFFFF;
  377. line-height: 30rpx;
  378. }
  379. .list_mark {
  380. line-height: 0.7;
  381. font-size: 36rpx;
  382. color: #ffffff;
  383. font-weight: 600;
  384. margin-right: 5rpx;
  385. }
  386. .introduce {
  387. width: 702rpx;
  388. margin: 174rpx auto 0;
  389. }
  390. .introduce image {
  391. width: 100%;
  392. }
  393. .fx_title {
  394. width: 383rpx;
  395. margin: 32rpx 0 20rpx 24rpx;
  396. }
  397. .stext {
  398. font-family: 'Alibaba PuHuiTi 2.0';
  399. font-weight: normal;
  400. font-size: 20rpx;
  401. color: #ffffff;
  402. line-height: 30rpx;
  403. }
  404. .score_explain {
  405. font-family: 'Alibaba PuHuiTi 2.0';
  406. font-weight: normal;
  407. font-size: 20rpx;
  408. color: #999999;
  409. line-height: 31rpx;
  410. margin-left: 86rpx;
  411. }
  412. </style>