123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762 |
- <template>
- <view v-if="role" :class="['bg', `bg${roleList[role].type}`]">
- <view class="role_wrap">
- <image class="carton" v-if="role" :src="roleList[role].img" mode="widthFix">
- </image>
- <view class="role_char">
- <view class="char_item" v-for="item in getCharacteristic(resultObj.characteristic)">
- <view style="position: relative;">
- <text style="position: relative;z-index: 1;">
- {{item}}
- </text>
- <image class="shadow_img"
- :src="`https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/font_shadow${roleList[role].type}.png`"
- mode="widthFix">
- </image>
- </view>
- </view>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/rgtd_text.png"
- mode="widthFix"></image>
- <image class="emo_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/emo_img.png" mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content">
- <text>
- {{resultObj.evaluate.replace(/^\n/, '')}}
- </text>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/mrmj_text.png"
- mode="widthFix"></image>
- <image class="emo_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/emo_img.png" mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content mrmj_content" style="padding: 24rpx;">
- <!-- <text class="mr_name"
- :style="{background: roleList[role].mrBg, 'border-color': roleList[role].mrBorder, color: roleList[role].mrColor}"
- v-for="item in getCharacteristic(resultObj.representative)">
- {{item}}
- </text> -->
- <view class="mr_pic_box">
- <image class="mr_pic" v-for="item in getCharacteristic(resultObj.representative)"
- :src="`https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/people/${item}@3x.png`"
- mode="widthFix"></image>
- </view>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/zjzq_text.png"
- mode="widthFix"></image>
- <image class="emo_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/emo_img.png" mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content">
- <text>
- {{resultObj.pursuit.replace('\n', '')}}
- </text>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/zcjy_text.png"
- mode="widthFix"></image>
- <image class="star_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/star_img.png"
- mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content mrmj_content">
- <view class="advantage_title">工作中的优势</view>
- <view class="advantage_content">
- <template v-for="item in getAdvantage(resultObj.advantage)">
- <view class="ad_item_title"><text
- style="font-size: 20rpx;margin-right: 5rpx;">●</text><text>{{item.title}}</text>
- </view>
- <view class="ad_item_content">{{item.content}}</view>
- </template>
- </view>
- <view class="advantage_title">工作中的劣势</view>
- <view class="advantage_content" style="background: #FFFAEB;border: 1px solid #FFD031;">
- <template v-for="item in getAdvantage(resultObj.disadvantages)">
- <view class="ad_item_title" style="color: #FFC500;"><text
- style="font-size: 20rpx;margin-right: 5rpx;">●</text><text>{{item.title}}</text></view>
- <view class="ad_item_content">{{item.content}}</view>
- </template>
- </view>
- <view class="advantage_title">职业推荐</view>
- <view> <text>
- {{resultObj.recommendation.replace('\n', '')}}
- </text></view>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/czjy_text.png"
- mode="widthFix"></image>
- <image class="star_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/star_img.png"
- mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content mrmj_content">
- <template v-for="item in getAdvantage(resultObj.suggest)">
- <view class="ad_item_title">
- <image class="single_star"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/single_star.png"
- mode="widthFix"></image> <text style="color: #333333;">{{item.title}}</text>
- </view>
- <view class="ad_item_content">{{item.content}}</view>
- </template>
- </view>
- </view>
- <view class="rgtd_box">
- <view :class="['rgtd_title', `rgtd_title${roleList[role].type}`]">
- <image class="rgtd_text"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/labd_text.png"
- mode="widthFix"></image>
- <image class="heart_img"
- src="https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/heart_img.png"
- mode="widthFix">
- </image>
- </view>
- <view class="rgtg_content mrmj_content">
- <view class="lover_type_title">恋爱类型</view>
- <view class="lover_type">
- {{getLoveSuggestion(5, 8, resultObj.revered)}}
- </view>
- <view class="love_decode">
- {{getLoveSuggestion(9, resultObj.revered.length, resultObj.revered)}}
- </view>
- </view>
- </view>
- <view class="report_desc">
- <view class="desc_title">报告阅读说明</view>
- <view class="stext">谢谢您的参与,阅读本报告时,请注意以下内容:</view>
- <view style="display: flex;">
- <view class="list_mark">·</view>
- <view class="desc_txt">本结果仅供参考,不可作为临床诊断的依据;</view>
- </view>
- <view style="display: flex;">
- <view class="list_mark">·</view>
- <view class="desc_txt">如对报告有不理解的地方,建议咨询专业人员;</view>
- </view>
- <view style="display: flex;">
- <view class="list_mark">·</view>
- <view class="desc_txt">如结果与你自己或他人的感受有出入,可回忆在测试时是否有事情影响到你,或自己回答时是否有所顾虑。</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getRecordById
- } from "@/api/index.js";
- import {
- photoUrl
- } from "@/common/config.js"
- const photoUrls = `${photoUrl}api/show?filePath=./webo`
- console.log(photoUrl);
- export default {
- data() {
- return {
- photoUrl: photoUrl,
- isChecked: true,
- isShake: false,
- scaleDetail: {},
- questionList: [],
- currentQuestion: {},
- currentAnswerList: [],
- currentIndex: 0,
- userAnswerList: [],
- resultId: '',
- isLoading: false,
- isDisbale: false,
- roleList: {
- 'ENFJ': {
- type: 1,
- img: `${photoUrls}/Mbti/role/role_enfj.png`,
- mrBg: '#E4FFD3',
- mrBorder: '#66C666',
- mrColor: '#0B7000'
- },
- 'ENFP': {
- type: 1,
- img: `${photoUrls}/Mbti/role/role_enfp.png`,
- mrBg: '#E4FFD3',
- mrBorder: '#66C666',
- mrColor: '#0B7000'
- },
- 'ENTJ': {
- type: 3,
- img: `${photoUrls}/Mbti/role/role_entj.png`,
- mrBg: '#F7E9FF',
- mrBorder: '#B262E1',
- mrColor: '#962ED4'
- },
- 'ENTP': {
- type: 3,
- img: `${photoUrls}/Mbti/role/role_entp.png`,
- mrBg: '#F7E9FF',
- mrBorder: '#B262E1',
- mrColor: '#962ED4'
- },
- 'ESFJ': {
- type: 4,
- img: `${photoUrls}/Mbti/role/role_esfj.png`,
- mrBg: '#E2F9FF',
- mrBorder: '#50DCFF',
- mrColor: '#00CCFF'
- },
- 'ESFP': {
- type: 2,
- img: `${photoUrls}/Mbti/role/role_esfp.png`,
- mrBg: '#FFF6D8',
- mrBorder: '#FFA200',
- mrColor: '#FFA200'
- },
- 'ESTJ': {
- type: 4,
- img: `${photoUrls}/Mbti/role/role_estj.png`,
- mrBg: '#E2F9FF',
- mrBorder: '#50DCFF',
- mrColor: '#00CCFF'
- },
- 'ESTP': {
- type: 2,
- img: `${photoUrls}/Mbti/role/role_estp.png`,
- mrBg: '#FFF6D8',
- mrBorder: '#FFA200',
- mrColor: '#FFA200'
- },
- 'INFJ': {
- type: 1,
- img: `${photoUrls}/Mbti/role/role_infj.png`,
- mrBg: '#E4FFD3',
- mrBorder: '#66C666',
- mrColor: '#0B7000'
- },
- 'INFP': {
- type: 1,
- img: `${photoUrls}/Mbti/role/role_infp.png`,
- mrBg: '#E4FFD3',
- mrBorder: '#66C666',
- mrColor: '#0B7000'
- },
- 'INTJ': {
- type: 3,
- img: `${photoUrls}/Mbti/role/role_intj.png`,
- mrBg: '#F7E9FF',
- mrBorder: '#B262E1',
- mrColor: '#962ED4'
- },
- 'INTP': {
- type: 3,
- img: `${photoUrls}/Mbti/role/role_intp.png`,
- mrBg: '#F7E9FF',
- mrBorder: '#B262E1',
- mrColor: '#962ED4'
- },
- 'ISFJ': {
- type: 4,
- img: `${photoUrls}/Mbti/role/role_isfj.png`,
- mrBg: '#E2F9FF',
- mrBorder: '#50DCFF',
- mrColor: '#00CCFF'
- },
- 'ISFP': {
- type: 2,
- img: `${photoUrls}/Mbti/role/role_isfp.png`,
- mrBg: '#FFF6D8',
- mrBorder: '#FFA200',
- mrColor: '#FFA200'
- },
- 'ISTJ': {
- type: 4,
- img: `${photoUrls}/Mbti/role/role_istj.png`,
- mrBg: '#E2F9FF',
- mrBorder: '#50DCFF',
- mrColor: '#00CCFF'
- },
- 'ISTP': {
- type: 2,
- img: `${photoUrls}/Mbti/role/role_istp.png`,
- mrBg: '#FFF6D8',
- mrBorder: '#FFA200',
- mrColor: '#FFA200'
- }
- },
- resultObj: {},
- resultId: '',
- role: '',
- scoreNum: 0,
- maxScore: 0,
- minScore: 0,
- keywords: '',
- characteristic: '', // 特点
- }
- },
- onLoad(options) {
- if (options && options.resultId) {
- this.resultId = options.resultId
- this.getScaleTestResults(this.resultId);
- }
- },
- computed: {
- percentage() {
- return (((this.scoreNum / this.maxScore) * 318) - 318) + 'rpx'
- }
- },
- methods: {
- getScaleTestResults(id) {
- let _this = this;
- _this.$request
- .get({
- url: `${getRecordById}?id=${id}`,
- loadingTip: "加载中...",
- data: {},
- })
- .then(
- (res) => {
- if (res.code == 200) {
- _this.testResult = JSON.parse(res.data?.userRecordEntity?.testResult)[0];
- _this.role = _this.testResult.tableContext[0].value[0];
- _this.resultObj = _this.testResult.tableContext[1].value[0];
- } else if (res.code == 401) {} else {
- (res) => {
- console.log("世界上绝对绝对绝对绝对绝对的", res);
- }
- }
- })
- },
- trimStart(str) {
- return str.replace(/^\s+/, '');
- },
- getCharacteristic(str) {
- return str.split("、")
- },
- getAdvantage(str) {
- let tempArr = str.split("\n");
- let advantageList = [];
- tempArr.forEach(item => {
- if (item && item != '\r') {
- let arr = item.split(':')
- advantageList.push({
- title: arr[0].slice(2, arr[0].length),
- content: arr[1]
- })
- }
- })
- return advantageList;
- },
- getLoveSuggestion(s, e, str) {
- let temp = str.replace(/\r/, '')
- temp = temp.replace(/\n/, '')
- return temp.slice(s, e);
- }
- }
- }
- </script>
- <style scoped>
- .bg {
- width: 100%;
- min-height: 6186rpx;
- background: linear-gradient(0deg, #FB4643 0%, #FF8B59 100%);
- overflow: hidden;
- position: relative;
- }
- .bg1 {
- background: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/bg1.png') no-repeat top;
- background-size: 100% 100%;
- }
- .bg2 {
- background: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/bg2.png')no-repeat top;
- background-size: 100% 100%;
- }
- .bg3 {
- background: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/bg3.png')no-repeat top;
- background-size: 100% 100%;
- }
- .bg4 {
- background: url('https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/bg4.png')no-repeat top;
- background-size: 100% 100%;
- }
- .scale_name {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: bold;
- font-size: 42rpx;
- color: #FFFFFF;
- margin: 59rpx 0 0 39rpx;
- }
- .test_time {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 28rpx;
- color: #ffffff;
- margin-left: 39rpx;
- }
- .role_wrap {
- position: relative;
- }
- .role_char {
- width: 714rpx;
- height: 156rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- position: absolute;
- left: 18rpx;
- bottom: 0;
- }
- .char_item {
- width: 30%;
- font-family: 'ZhankuKuaiLeTi';
- font-weight: 800;
- font-size: 36rpx;
- color: #333333;
- line-height: 52rpx;
- text-align: center;
- }
- .shadow_img {
- display: block;
- width: 170rpx;
- position: absolute;
- left: 50%;
- bottom: -6rpx;
- transform: translateX(-50%);
- }
- .role_name {
- text-align: center;
- margin: 202rpx 0 0 0;
- }
- .role_name image {
- width: 550rpx;
- }
- .temp_type {
- width: 714rpx;
- margin: 0 auto;
- }
- .carton {
- width: 714rpx;
- margin: 54rpx 18rpx 0 18rpx;
- }
- .rgtd_box {
- margin: 24rpx auto;
- }
- .rgtd_title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 725rpx;
- height: 128rpx;
- margin: 0 auto;
- }
- .rgtd_title1 {
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/title_bg1.png) no-repeat;
- background-size: cover
- }
- .rgtd_title2 {
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/title_bg2.png) no-repeat;
- background-size: cover
- }
- .rgtd_title3 {
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/title_bg3.png) no-repeat;
- background-size: cover
- }
- .rgtd_title4 {
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/title_bg4.png) no-repeat;
- background-size: cover
- }
- .rgtd_text {
- width: 181rpx;
- margin: 6rpx 0 0 39rpx;
- }
- .emo_img {
- width: 112rpx;
- margin-right: 7rpx;
- }
- .rgtg_content {
- box-sizing: border-box;
- width: 714rpx;
- padding: 40rpx;
- background: #FFFFFF;
- border-radius: 35rpx;
- margin: 0 auto;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 28rpx;
- color: #333333;
- line-height: 1.8;
- letter-spacing: 2rpx;
- text-align: justify;
- }
- .mrmj_content {
- display: flex;
- flex-wrap: wrap;
- min-height: 255rpx;
- }
- .star_img {
- width: 92rpx;
- margin-right: 43rpx;
- }
- .mrmj_content .mr_name {
- height: 44rpx;
- padding: 0 34rpx;
- margin: 4rpx 10rpx;
- background: #E4FFD3;
- border-radius: 22rpx;
- border: 1px solid #66C666;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 28rpx;
- color: #0B7000;
- line-height: 44rpx;
- text-align: center;
- }
- .mr_pic_box {
- width: 100%;
- }
- .mr_pic {
- width: 316rpx;
- margin: 5rpx 8rpx;
- }
- .advantage_title {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: bold;
- font-size: 32rpx;
- color: #333333;
- margin: 25rpx 5rpx 8rpx;
- }
- .advantage_content {
- box-sizing: border-box;
- width: 632rpx;
- background: #E4FFD3;
- border-radius: 22rpx;
- border: 1px solid #66C666;
- padding: 28rpx;
- margin: 0 auto;
- }
- .ad_item_title {
- display: flex;
- align-items: center;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: bold;
- font-size: 32rpx;
- color: #156300;
- }
- .love_role {
- width: 571rpx;
- margin: 0 auto;
- }
- .single_star {
- width: 32rpx;
- margin: 0 8rpx 4rpx 0;
- }
- .heart_img {
- width: 93rpx;
- margin-right: 16rpx;
- }
- .lover_type_title {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: bold;
- font-size: 32rpx;
- color: #333333;
- line-height: 43rpx;
- }
- .lover_type {
- width: 571rpx;
- font-family: 'ZhankuKuaiLeTi';
- font-weight: 400;
- font-size: 133rpx;
- color: #333333;
- line-height: 149rpx;
- text-align: center;
- margin: 50rpx auto 30rpx;
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/role/lover_type_bg.png) no-repeat center bottom;
- background-size: 100% auto;
- }
- .love_decode {
- box-sizing: border-box;
- width: 632rpx;
- padding: 39rpx 30rpx;
- background: #FFE8FD;
- border-radius: 22rpx;
- border: 1px solid #FF59F1;
- margin: 0 auto;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 28rpx;
- color: #333333;
- }
- .result_box {
- width: 702rpx;
- min-height: 807rpx;
- background: #ffffff;
- box-shadow: 0rpx 3rpx 24rpx 0rpx rgba(126, 77, 0, 0.13);
- border-radius: 26rpx;
- margin: 168rpx auto 0;
- position: relative;
- }
- .pad_box {
- width: 100%;
- height: 200rpx;
- border-radius: 26rpx;
- overflow: hidden;
- }
- .title_img {
- width: 302rpx;
- position: relative;
- z-index: 3;
- margin: 31rpx 0 0 28rpx;
- }
- .result_box_r {
- box-sizing: border-box;
- width: 702rpx;
- min-height: 453rpx;
- margin: -188rpx auto 0;
- background: url(https://test.jue-ming.com:8849/api/show?filePath=./webo/Mbti/result_bg_r.png) no-repeat top;
- background-size: 100% auto;
- border-radius: 33rpx;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 32rpx;
- color: #555555;
- line-height: 50rpx;
- position: relative;
- z-index: 2;
- }
- .r_content {
- width: 600rpx;
- min-height: 307rpx;
- background: #FFE1E1;
- border-radius: 20rpx;
- border: 1px solid #FF6666;
- margin: 20rpx auto 0;
- padding: 30rpx;
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 32rpx;
- color: #333333;
- line-height: 50rpx;
- display: flex;
- align-items: flex-start;
- }
- .report_desc {
- padding: 30rpx 38rpx;
- letter-spacing: 1px;
- }
- .desc_title {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 28rpx;
- color: #333333;
- line-height: 46rpx;
- }
- .stext {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 20rpx;
- color: #999999;
- line-height: 30rpx;
- }
- .desc_txt {
- font-family: 'Alibaba PuHuiTi 2.0';
- font-weight: normal;
- font-size: 20rpx;
- color: #333333;
- line-height: 30rpx;
- }
- .list_mark {
- line-height: 0.7;
- font-size: 36rpx;
- color: #333333;
- font-weight: 600;
- margin-right: 5rpx;
- }
- .analysis_title {
- width: 362rpx;
- position: absolute;
- top: -30rpx;
- left: 50%;
- transform: translateX(-50%);
- }
- .paperclip {
- width: 55rpx;
- position: absolute;
- top: -40rpx;
- left: 38rpx;
- }
- </style>
|