testResult.vue 9.3 KB

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