testResult.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <view class="bg">
  3. <view class="role_img">
  4. <image class="temp_type" v-if="keywords" :src="roleList[role][keywords]" mode="widthFix">
  5. </image>
  6. <image class="carton" v-if="roleList[role]" :src="roleList[role].img" mode="widthFix"></image>
  7. </view>
  8. <view class="result_box">
  9. <view style="overflow: hidden;"></view>
  10. <image class="paperclip" src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/paperclip.png"
  11. mode="widthFix"></image>
  12. <image class="analysis_title"
  13. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/analysis_title.png" mode="widthFix">
  14. </image>
  15. <view class="role_medal">
  16. <image v-if="roleList[role]" :src="roleList[role].name" mode="widthFix"></image>
  17. </view>
  18. <!-- <view class="score_bar">
  19. <view class="score_title">得分:</view>
  20. <view class="score_num">{{scoreNum}}</view>
  21. <view class="score_percentage">
  22. <view class="score_wrap">
  23. <image class="process_bar" :style="{'left': percentage}"
  24. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/process_bar.png"
  25. mode="widthFix"></image>
  26. </view>
  27. <view class="score_text">{{parseInt(scoreNum)}}/{{parseInt(maxScore)}}</view>
  28. </view>
  29. </view> -->
  30. <view class="result_box_r">
  31. <view class="cardiac">
  32. <view style="text-align: left;">
  33. <image class="cardiac_title"
  34. src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/cardiac_title_img.png"
  35. mode="widthFix"></image>
  36. </view>
  37. <image v-if="role" class="cardiac_index" :src="roleList[role].score" mode="widthFix"></image>
  38. </view>
  39. <view class="sm_title">
  40. <image src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/sm_title.png"
  41. mode="widthFix"></image>
  42. </view>
  43. {{improvementSuggestions}}
  44. </view>
  45. <view class="report_desc">
  46. <view class="desc_title">报告阅读说明</view>
  47. <view class="desc_txt">谢谢您的参与,阅读本报告时,请注意以下内容:</view>
  48. <view style="display: flex;">
  49. <view class="list_mark">·</view>
  50. <view class="desc_txt">本结果仅供参考,不可作为临床诊断的依据;</view>
  51. </view>
  52. <view style="display: flex;">
  53. <view class="list_mark">·</view>
  54. <view class="desc_txt">如对报告有不理解的地方,建议向专业资质人员进行咨询;</view>
  55. </view>
  56. <view style="display: flex;">
  57. <view class="list_mark">·</view>
  58. <view class="desc_txt">如结果与你自己或他人感知的有出入,可回忆在测试时是否有事情影响到你,或自己答辩时是否有所顾虑;</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {
  66. getRecordById
  67. } from "@/api/index.js";
  68. import {
  69. photoUrl
  70. } from "@/common/config.js"
  71. const photoUrls = `${photoUrl}api/show?filePath=./webo`
  72. console.log(photoUrl);
  73. export default {
  74. data() {
  75. return {
  76. isChecked: true,
  77. isShake: false,
  78. scaleDetail: {},
  79. questionList: [],
  80. currentQuestion: {},
  81. currentAnswerList: [],
  82. currentIndex: 0,
  83. userAnswerList: [],
  84. resultId: '',
  85. isLoading: false,
  86. isDisbale: false,
  87. roleList: {
  88. '88%': {
  89. name: `${photoUrls}/Charm/result_type/comment88.png`,
  90. img: `${photoUrls}/Charm/result_type/people_img88.png`,
  91. score: `${photoUrls}/Charm/result_type/score88.png`,
  92. '魅不可挡': `${photoUrls}/Charm/result_type/mbkd88.png`,
  93. '魅力撩人': `${photoUrls}/Charm/result_type/mllr88.png`,
  94. '魅力迷人': `${photoUrls}/Charm/result_type/mlmr88.png`,
  95. '魅力无穷': `${photoUrls}/Charm/result_type/mlwq88.png`,
  96. '气质成谜': `${photoUrls}/Charm/result_type/qzcm88.png`,
  97. },
  98. '99%': {
  99. name: `${photoUrls}/Charm/result_type/comment99.png`,
  100. img: `${photoUrls}/Charm/result_type/people_img99.png`,
  101. score: `${photoUrls}/Charm/result_type/score99.png`,
  102. '热情奔放': `${photoUrls}/Charm/result_type/rqbf99.png`,
  103. '热情豪爽': `${photoUrls}/Charm/result_type/rqhs99.png`,
  104. '热情澎湃': `${photoUrls}/Charm/result_type/rqpp99.png`,
  105. '热情如火': `${photoUrls}/Charm/result_type/rqrh99.png`,
  106. '热情洋溢': `${photoUrls}/Charm/result_type/rqyy99.png`,
  107. },
  108. '160%': {
  109. name: `${photoUrls}/Charm/result_type/comment160.png`,
  110. img: `${photoUrls}/Charm/result_type/people_img160.png`,
  111. score: `${photoUrls}/Charm/result_type/score160.png`,
  112. '怦然心动': `${photoUrls}/Charm/result_type/prxd160.png`,
  113. '神魂颠倒': `${photoUrls}/Charm/result_type/shdd160.png`,
  114. '神韵动人': `${photoUrls}/Charm/result_type/sydr160.png`,
  115. '心动不已': `${photoUrls}/Charm/result_type/xdby160.png`,
  116. '心花怒放': `${photoUrls}/Charm/result_type/xhnf160.png`,
  117. },
  118. '300%': {
  119. name: `${photoUrls}/Charm/result_type/comment300.png`,
  120. img: `${photoUrls}/Charm/result_type/people_img300.png`,
  121. score: `${photoUrls}/Charm/result_type/score300.png`,
  122. '瞬间倾心': `${photoUrls}/Charm/result_type/sjqx300.png`,
  123. '一见倾心': `${photoUrls}/Charm/result_type/yjqx300.png`,
  124. '爱情闪现': `${photoUrls}/Charm/result_type/aqsx300.png`,
  125. '一见心动': `${photoUrls}/Charm/result_type/yjxd300.png`,
  126. '一见钟情': `${photoUrls}/Charm/result_type/yjzq300.png`,
  127. }
  128. },
  129. resultId: '',
  130. role: '',
  131. improvementSuggestions: '',
  132. scoreNum: 0,
  133. maxScore: 0,
  134. minScore: 0,
  135. keywords: ''
  136. }
  137. },
  138. onLoad(options) {
  139. if (options && options.resultId) {
  140. this.resultId = options.resultId
  141. this.getScaleTestResults(this.resultId);
  142. }
  143. },
  144. computed: {
  145. percentage() {
  146. return (((this.scoreNum / this.maxScore) * 318) - 318) + 'rpx'
  147. }
  148. },
  149. methods: {
  150. getScaleTestResults(id) {
  151. let _this = this;
  152. _this.$request
  153. .get({
  154. url: `${getRecordById}?id=${id}`,
  155. loadingTip: "加载中...",
  156. data: {},
  157. })
  158. .then(
  159. (res) => {
  160. console.log('222:', new Date().getTime());
  161. console.log("----测试结果--->", res);
  162. if (res.code == 200) {
  163. _this.testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0];
  164. _this.role = _this.testResult.newTableContext.result[0].symptom;
  165. _this.improvementSuggestions = _this.testResult.newTableContext.result[0]
  166. .improvementSuggestions;
  167. _this.keywords = _this.trimStart(_this.improvementSuggestions.slice(0, 5));
  168. _this.scoreNum = _this.testResult.newTableContext.result[0].score;
  169. _this.maxScore = _this.testResult.newTableContext.result[0].maxScore;
  170. } else if (res.code == 401) {} else {
  171. (res) => {
  172. console.log("世界上绝对绝对绝对绝对绝对的", res);
  173. }
  174. }
  175. })
  176. },
  177. getNameUrl() {
  178. console.log(`${photoUrls}/Charm/result_type/role_name1.png`)
  179. return `${photoUrls}/Charm/result_type/role_name1.png`
  180. },
  181. trimStart(str) {
  182. return str.replace(/^\s+/, '');
  183. }
  184. }
  185. }
  186. </script>
  187. <style scoped>
  188. .bg {
  189. width: 100%;
  190. min-height: 1900rpx;
  191. background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/test_result_bg.png) no-repeat top;
  192. background-size: 100% auto;
  193. overflow: hidden;
  194. }
  195. .role_name {
  196. text-align: center;
  197. margin: 202rpx 0 0 0;
  198. }
  199. .role_name image {
  200. width: 550rpx;
  201. }
  202. .role_img {
  203. display: flex;
  204. align-items: center;
  205. text-align: center;
  206. margin-top: 223rpx;
  207. }
  208. .role_img .temp_type {
  209. width: 224rpx;
  210. margin-left: 88rpx;
  211. }
  212. .role_img .carton {
  213. width: 459rpx;
  214. margin-left: -60rpx;
  215. }
  216. .result_box {
  217. width: 702rpx;
  218. height: 1275rpx;
  219. background: linear-gradient(0deg, #EA1750 0%, #FF8189 100%);
  220. border-radius: 26rpx;
  221. margin: 10rpx auto 0;
  222. position: relative;
  223. }
  224. .role_medal {
  225. margin-top: 55rpx;
  226. text-align: center;
  227. }
  228. .role_medal image {
  229. width: 550rpx;
  230. }
  231. .result_box_r {
  232. box-sizing: border-box;
  233. width: 674rpx;
  234. min-height: 553rpx;
  235. padding: 26rpx;
  236. margin: 0 auto 0;
  237. background: #FFFFFF url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Charm/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: #555555;
  244. line-height: 50rpx;
  245. }
  246. .sm_title image {
  247. width: 67rpx;
  248. }
  249. .cardiac {
  250. text-align: center;
  251. }
  252. .cardiac_title {
  253. width: 213rpx;
  254. }
  255. .cardiac_index {
  256. width: 436rpx;
  257. text-align: center;
  258. }
  259. .report_desc {
  260. margin: 30rpx 38rpx;
  261. letter-spacing: 1px;
  262. }
  263. .desc_title {
  264. font-family: 'Alibaba PuHuiTi 2.0';
  265. font-weight: normal;
  266. font-size: 28rpx;
  267. color: #FFFFFF;
  268. line-height: 46rpx;
  269. }
  270. .desc_txt {
  271. font-family: 'Alibaba PuHuiTi 2.0';
  272. font-weight: normal;
  273. font-size: 20rpx;
  274. color: #FFFFFF;
  275. line-height: 30rpx;
  276. }
  277. .list_mark {
  278. line-height: 0.7;
  279. font-size: 36rpx;
  280. color: #ffffff;
  281. font-weight: 600;
  282. margin-right: 5rpx;
  283. }
  284. .analysis_title {
  285. width: 362rpx;
  286. position: absolute;
  287. top: -30rpx;
  288. left: 50%;
  289. transform: translateX(-50%);
  290. }
  291. .paperclip {
  292. width: 55rpx;
  293. position: absolute;
  294. top: -40rpx;
  295. left: 38rpx;
  296. }
  297. </style>