testResult.vue 10 KB

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