@@ -908,4 +908,10 @@ fix | |||
## v1.0.116 | |||
`2024.1.26` | |||
update | |||
- ‘焦虑’文字改成‘抑郁’ | |||
- ‘焦虑’文字改成‘抑郁’ | |||
## v1.0.117 | |||
`2024.3.21` | |||
update | |||
- ‘抑郁’文字 通过页面传过来的参数 改成‘焦虑’,否则不变 |
@@ -5,7 +5,10 @@ | |||
* @FilePath: \TelpoH5FrontendWeb\src\config\models.js | |||
* @description: | |||
*/ | |||
export const VERSION_MODEL = '1.0.116F'; //版本号 | |||
import store from "@/store"; | |||
// 情绪模型 | |||
const appTypeList = ['1']; | |||
export const VERSION_MODEL = '1.0.117F'; //版本号 | |||
export const IMAGE_URL = { | |||
production: 'http://zfb.ssjlai.com/web/', | |||
test: 'http://zfb.ssjlai.com/web/', | |||
@@ -24,17 +27,19 @@ export const BaiduStatisticsModel = { | |||
test: "https://hm.baidu.com/hm.js?edb76b471e997167b7782c1513382771", // 随手精灵百度流量统计 测试环境 | |||
development: "https://hm.baidu.com/hm.js?edb76b471e997167b7782c1513382771", // 随手精灵百度流量统计 测试环境 | |||
}; | |||
// 情绪模型 | |||
// 焦虑文字 | |||
export const anxietyText = appTypeList.indexOf(store.getters.appType) >-1 ? `焦虑`: `抑郁` | |||
export const EmotionModel = { | |||
// 抑郁 | |||
depression: { | |||
name: '抑郁', | |||
name: anxietyText, | |||
type: 2, | |||
title1: '抑郁倾向', | |||
article1: `<p>设备所检测的是个体的抑郁倾向。通过将个人的生理特征(脉搏波、心率变异性等)和行为习惯(运动、作息等)与临床诊断为抑郁症的患者的相应特征进行对比,判断出个体的抑郁倾向(即抑郁症的可能性)程度。抑郁倾向持续的时间越长、程度越严重,代表患有抑郁症的风险就越大。</p>`, | |||
title2: '抑郁倾向算法原理', | |||
article2: `<p>1.研究发现,抑郁症等情绪障碍可能会引起个体外周生理系统反应的钝化,因此患者可能在面临危险、压力等应激状态下表现出较低的生理反应唤醒水平。这一点能够通过皮肤电、心率变异性等生理特征的周期性变化来判断。</p> | |||
<p>2.抑郁症等情绪障碍的患者会出现明显的失眠、运动少、和生物钟紊乱,算法能够有效分析判断出这些异常的行为特征。</p>` | |||
title1: `${anxietyText}倾向`, | |||
article1: `<p>设备所检测的是个体的${anxietyText}倾向。通过将个人的生理特征(脉搏波、心率变异性等)和行为习惯(运动、作息等)与临床诊断为${anxietyText}症的患者的相应特征进行对比,判断出个体的${anxietyText}倾向(即${anxietyText}症的可能性)程度。${anxietyText}倾向持续的时间越长、程度越严重,代表患有${anxietyText}症的风险就越大。</p>`, | |||
title2: `${anxietyText}倾向算法原理`, | |||
article2: `<p>1.研究发现,${anxietyText}症等情绪障碍可能会引起个体外周生理系统反应的钝化,因此患者可能在面临危险、压力等应激状态下表现出较低的生理反应唤醒水平。这一点能够通过皮肤电、心率变异性等生理特征的周期性变化来判断。</p> | |||
<p>2.${anxietyText}症等情绪障碍的患者会出现明显的失眠、运动少、和生物钟紊乱,算法能够有效分析判断出这些异常的行为特征。</p>` | |||
}, | |||
// 压力 | |||
@@ -14,9 +14,10 @@ import '@/assets/css/reset.scss'; | |||
import dayjs from 'dayjs'; | |||
// ui库按需引入 | |||
import 'vant/lib/index.css'; | |||
import { replaceAll } from '@/utils'; | |||
// 引入echarts | |||
import * as echarts from 'echarts'; | |||
import { BaiduStatisticsModel } from '@/config/models'; | |||
import { BaiduStatisticsModel} from '@/config/models'; | |||
import { | |||
Button, | |||
Calendar, | |||
@@ -128,6 +129,7 @@ Vue.config.productionTip = false; | |||
Vue.prototype.$dayjs = dayjs; | |||
Vue.prototype.$echarts = echarts; | |||
Vue.prototype.$bus = new Vue(); | |||
Vue.prototype.$replaceAll = replaceAll; | |||
router.afterEach((to, from, next) => { | |||
// 创建百度统计js | |||
setTimeout(()=>{ | |||
@@ -24,6 +24,7 @@ export default new Vuex.Store({ | |||
fromSsjl: '', | |||
active: null, //点击左边树形图下标 | |||
tabClick: '', //心理监测点击tab | |||
appType: '', //应用类型 | |||
}, | |||
mutations: { | |||
imei(state, imei) { | |||
@@ -70,6 +71,11 @@ export default new Vuex.Store({ | |||
state.tabClick = tabClick; | |||
window.localStorage[prefix + 'tabClick'] = tabClick; | |||
}, | |||
appType(state, appType) { | |||
state.appType = appType; | |||
window.localStorage[prefix + 'appType'] = appType; | |||
}, | |||
}, | |||
getters: { | |||
@@ -117,7 +123,11 @@ export default new Vuex.Store({ | |||
if (state.tabClick != '') return state.tabClick; | |||
return window.localStorage[prefix + 'tabClick'] == null ? '' : window.localStorage[prefix + 'tabClick']; | |||
}, | |||
appType: state => { | |||
if (state.appType != '') return state.appType; | |||
return window.localStorage[prefix + 'appType'] == null ? '' : window.localStorage[prefix + 'appType']; | |||
}, | |||
}, | |||
actions: {}, | |||
modules: {} |
@@ -5,7 +5,7 @@ | |||
* @FilePath: \AntpayFrontEnd\src\utils\index.js | |||
* @description: 工具类 | |||
*/ | |||
import store from "@/store"; | |||
/** | |||
* 判断是否为空 | |||
@@ -88,4 +88,34 @@ export function isShowAntpay(array) { | |||
} else { | |||
return false; | |||
} | |||
} | |||
} | |||
// 将传入内容的某个文字全部替换成指定的文字 | |||
/** | |||
* | |||
* @param {*} target 目标字符串 | |||
* @param {*} searchValue 要搜索和替换的子串 | |||
* @param {*} replacement 替换的新字符串 | |||
* @returns | |||
*/ | |||
export function replaceAll(target, searchValue, replacement) { | |||
// 应用类型,目前1 是健康好蕴,其他则不替换 | |||
const appTypeList = ['1']; | |||
const appType = store.getters.appType; | |||
if(appTypeList.indexOf(appType) > -1) { | |||
if(isNotNull(target) && isNotNull(searchValue)) { | |||
if(target.includes(searchValue)) { | |||
return target.replace(new RegExp(searchValue, 'g'), replacement); | |||
} else { | |||
return target | |||
} | |||
} else { | |||
return target | |||
} | |||
} else { | |||
return target | |||
} | |||
} |
@@ -12,12 +12,7 @@ | |||
</van-nav-bar> | |||
<div class="main"> | |||
<div class="list"> | |||
<div | |||
v-for="(item, index) in healhtList" | |||
:key="index" | |||
:class="['item', item.class]" | |||
@click="onClick(item)" | |||
> | |||
<div v-for="(item, index) in healhtList" :key="index" :class="['item', item.class]" @click="onClick(item)"> | |||
<p class="health-value" :style="{ color: calcColor(item.value) }"> | |||
{{ item.value || "--" }} | |||
</p> | |||
@@ -48,12 +43,13 @@ | |||
<script> | |||
import axios from "axios"; | |||
import { isNotNull } from "@/utils/index"; | |||
import { PsyBaseUrl } from "@/config/models"; | |||
import { PsyBaseUrl, anxietyText } from "@/config/models"; | |||
import APICore from "@/api/core"; | |||
export default { | |||
name: "psychologicalMain", | |||
data() { | |||
return { | |||
healhtList: [ | |||
/* { value: 40, name: '抑郁指数', class: 'depression',result: '无抑郁倾向', time: '17:52', img: require('@/assets/img/regardless.png') }, | |||
{ value: 55, name: '压力指数', class: 'stress', result: '轻度压力', time: '17:52', img: require('@/assets/img/regardless.png') }, | |||
@@ -98,6 +94,10 @@ export default { | |||
this.uid = params.uid; | |||
this.routeDate = params.date; | |||
this.params = params; | |||
if (params.appType) { | |||
this.$store.commit("appType", params.appType); | |||
} | |||
if (!params.accessToken) { | |||
let authToken = await this.getAuth(); | |||
this.$store.commit("ssjlToken", authToken); | |||
@@ -159,9 +159,9 @@ export default { | |||
// 抑郁指数 | |||
{ | |||
value: data.DepScore, | |||
name: "抑郁指数", | |||
name: `${anxietyText}指数`, | |||
class: "depression", | |||
result: data.DepDesc, | |||
result: this.$replaceAll(data.DepDesc, '抑郁', '焦虑'), | |||
time: data.DepMeasureUpdateTime | |||
? this.$dayjs(data.DepMeasureUpdateTime).format("HH:mm") | |||
: "", | |||
@@ -173,8 +173,8 @@ export default { | |||
]; | |||
this.$toast.success("数据加载完成"); | |||
}) | |||
.catch(() => {}) | |||
.finally(() => {}); | |||
.catch(() => { }) | |||
.finally(() => { }); | |||
}, | |||
onClick(item) { | |||
this.params.name = item.class; | |||
@@ -190,9 +190,8 @@ export default { | |||
}, | |||
onNavBack() { | |||
if (this.isShowLeft) { | |||
window.location.href = `${this.$route.query.fromUrl}/#/${ | |||
this.$route.query.fromMenu || "device" | |||
}`; | |||
window.location.href = `${this.$route.query.fromUrl}/#/${this.$route.query.fromMenu || "device" | |||
}`; | |||
} else { | |||
this.$router.go(-1); | |||
} | |||
@@ -203,9 +202,8 @@ export default { | |||
/* imgUrl = require(`@/assets/img/psychological/${name}_${level}.png`); */ | |||
let numLevel = Number(level); | |||
console.log(`@/assets/img/psychological/${name}_${numLevel}.png`); | |||
imgUrl = require(`@/assets/img/psychological/${name}_${ | |||
numLevel + 1 | |||
}.png`); | |||
imgUrl = require(`@/assets/img/psychological/${name}_${numLevel + 1 | |||
}.png`); | |||
/* switch(level) { | |||
case '0': | |||
imgUrl = require(`@/assets/img/psychological/${name}_${numLevel + 1}.png`); | |||
@@ -1,11 +1,6 @@ | |||
<template> | |||
<div class="psychological-container"> | |||
<van-nav-bar | |||
:title="emoName + '监测'" | |||
:border="true" | |||
:left-arrow="true" | |||
@click-left="onNavBack" | |||
> | |||
<van-nav-bar :title="emoName + '监测'" :border="true" :left-arrow="true" @click-left="onNavBack"> | |||
<template #left> | |||
<van-icon name="arrow-left" size="24" style="padding: 0" /> | |||
<span>返回</span> | |||
@@ -14,15 +9,10 @@ | |||
<div class="tab-bar"> | |||
<div class="date-tab-con"> | |||
<div class="date-tab-list"> | |||
<div | |||
:class="[ | |||
'date-tab-item', | |||
{ active: current === index, notClick: false }, | |||
]" | |||
@click="onTabClick(item.value, index)" | |||
v-for="(item, index) in dateList" | |||
:key="index" | |||
> | |||
<div :class="[ | |||
'date-tab-item', | |||
{ active: current === index, notClick: false }, | |||
]" @click="onTabClick(item.value, index)" v-for="(item, index) in dateList" :key="index"> | |||
<img :src="tabImgUrl" alt v-if="index == 3" /> | |||
<span>{{ item.text }}</span> | |||
<img class="more" :src="selectDownImg" alt v-if="index == 3" /> | |||
@@ -34,15 +24,10 @@ | |||
<div class="psy-tab-bar"> | |||
<div class="psy-tab-con"> | |||
<div class="psy-tab-list"> | |||
<div | |||
:class="[ | |||
'psy-tab-item', | |||
{ active: psyCurrent === index, notClick: false }, | |||
]" | |||
@click="onPsyTabClick(item.name, index)" | |||
v-for="(item, index) in psyList" | |||
:key="index" | |||
> | |||
<div :class="[ | |||
'psy-tab-item', | |||
{ active: psyCurrent === index, notClick: false }, | |||
]" @click="onPsyTabClick(item.name, index)" v-for="(item, index) in psyList" :key="index"> | |||
<span>{{ item.text }}</span> | |||
</div> | |||
</div> | |||
@@ -62,30 +47,13 @@ | |||
</div> | |||
<!-- 日历 --> | |||
<van-dialog | |||
class="calenddar-dialog" | |||
v-model="calendarDialogShow" | |||
:show-confirm-button="false" | |||
:show-cancle-button="false" | |||
:close-on-click-overlay="true" | |||
ref="calenddarDialog" | |||
> | |||
<van-dialog class="calenddar-dialog" v-model="calendarDialogShow" :show-confirm-button="false" | |||
:show-cancle-button="false" :close-on-click-overlay="true" ref="calenddarDialog"> | |||
<template #default> | |||
<div class="calendar" ref="calendarCon"> | |||
<van-calendar | |||
v-model="calendarShow" | |||
:min-date="minDate" | |||
:max-date="maxDate" | |||
:default-date="defaultDate" | |||
:round="false" | |||
:poppable="false" | |||
color="#62BD48" | |||
:show-confirm="false" | |||
:show-title="false" | |||
:show-subtitle="false" | |||
:formatter="formatter" | |||
@select="onSelect" | |||
/> | |||
<van-calendar v-model="calendarShow" :min-date="minDate" :max-date="maxDate" :default-date="defaultDate" | |||
:round="false" :poppable="false" color="#62BD48" :show-confirm="false" :show-title="false" | |||
:show-subtitle="false" :formatter="formatter" @select="onSelect" /> | |||
</div> | |||
</template> | |||
</van-dialog> | |||
@@ -104,27 +72,20 @@ | |||
<div class="pie-chart-right"> | |||
<div class="list"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in pieRightList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in pieRightList" :key="index"> | |||
<div class="item-left"> | |||
<div | |||
class="circle" | |||
:style="{ backgroundColor: item.color }" | |||
></div> | |||
<div class="circle" :style="{ backgroundColor: item.color }"></div> | |||
<span class="text">{{ item.text || "--" }}</span> | |||
</div> | |||
<div class="item-right"> | |||
<span :style="{ color: item.color }">{{ | |||
item.count ? item.count + "次" : "0次" | |||
}}</span> | |||
item.count ? item.count + "次" : "0次" | |||
}}</span> | |||
<label :style="{ color: item.color }">{{ | |||
item.percentage ? "(" + item.percentage + "%" + ")" : "(0%)" | |||
}}</label> | |||
item.percentage ? "(" + item.percentage + "%" + ")" : "(0%)" | |||
}}</label> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -135,19 +96,15 @@ | |||
<div class="statistics"> | |||
<div class="list"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in statisticsList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in statisticsList" :key="index"> | |||
<div class="top"> | |||
<span>{{ item.label || "--" }}</span> | |||
</div> | |||
<div class="middle"> | |||
<span :style="{ color: calcColor(item.value) }">{{ | |||
item.value || "--" | |||
}}</span> | |||
item.value || "--" | |||
}}</span> | |||
</div> | |||
<div class="bottom"> | |||
@@ -185,21 +142,18 @@ | |||
<span class="title-reminder">结果解读</span> | |||
<p class="title-emo" :style="{ color: currentColor }"> | |||
{{ result }} | |||
{{ this.$replaceAll(result, '抑郁', '焦虑') }} | |||
</p> | |||
<span class="font-28" | |||
><!-- 继续保持积极乐观,培养健康的生活习惯,预防消极事件对情绪带来的不良影响。 -->{{ | |||
advice | |||
}}</span | |||
> | |||
<span class="font-28"><!-- 继续保持积极乐观,培养健康的生活习惯,预防消极事件对情绪带来的不良影响。 -->{{ | |||
advice | |||
}}</span> | |||
</div> | |||
<div class="friendly-reminder" v-if="emoType === 2"> | |||
<p :style="{ color: currentColor }">友情提示:</p> | |||
<span | |||
>如果您发现抑郁倾向分值升高或处于轻度水平,不需要过度紧张,这可能是由正常的情绪波动或者生活习惯(睡眠时间、运动量等)的改变造成的。如果您发现抑郁倾向分值连续7天及以上处于中度或重度水平,建议您寻求家人朋友或心理咨询师的帮助,及早进行干预。</span | |||
> | |||
<span>如果您发现{{ anxietyText }}倾向分值升高或处于轻度水平,不需要过度紧张,这可能是由正常的情绪波动或者生活习惯(睡眠时间、运动量等)的改变造成的。如果您发现{{ anxietyText | |||
}}倾向分值连续7天及以上处于中度或重度水平,建议您寻求家人朋友或心理咨询师的帮助,及早进行干预。</span> | |||
</div> | |||
<div class="warm-reminder"> | |||
@@ -212,15 +166,11 @@ | |||
<div class="title"> | |||
<span class="title-text">{{ surveyTitle }}</span> | |||
<div class="mood-list" v-if="emotionList.length > 0"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in emotionList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in emotionList" :key="index"> | |||
<p> | |||
<span :style="{ color: item.color }" class="day">{{ | |||
item.days | |||
}}</span> | |||
item.days | |||
}}</span> | |||
<span class="day-text">天</span> | |||
</p> | |||
@@ -244,12 +194,7 @@ | |||
<div class="main report" v-show="current == 3"> | |||
<div class="content"> | |||
<div class="list" v-if="weekList.length > 0"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in weekList" | |||
:key="index" | |||
@click="onClickItem(item.recordId)" | |||
> | |||
<div class="item" v-for="(item, index) in weekList" :key="index" @click="onClickItem(item.recordId)"> | |||
<div class="left"> | |||
<img :src="weekImg" alt /> | |||
<div class="middle"> | |||
@@ -286,9 +231,12 @@ | |||
<van-popup v-model="isPopup"> | |||
<div class="popup"> | |||
<div class="item science-tips first" v-if="emoType === 2"> | |||
<div class="tips"><h5>小科普</h5></div> | |||
<div class="tips"> | |||
<h5>小科普</h5> | |||
</div> | |||
<p> | |||
抑郁症是一种心理疾病,严重时可发展为精神障碍。然而当我们体会到了痛苦、悲伤、和郁闷等负面情绪,并不意味着我们就是抑郁症。日常的短时的喜、怒、哀、乐,都是正常的情绪变化,然而长期的低落情绪、兴趣缺失等可能会让我们有抑郁的风险。 | |||
{{ anxietyText }}症是一种心理疾病,严重时可发展为精神障碍。然而当我们体会到了痛苦、悲伤、和郁闷等负面情绪,并不意味着我们就是{{ anxietyText | |||
}}症。日常的短时的喜、怒、哀、乐,都是正常的情绪变化,然而长期的低落情绪、兴趣缺失等可能会让我们有{{ anxietyText }}的风险。 | |||
</p> | |||
</div> | |||
<div class="item"> | |||
@@ -306,12 +254,13 @@ | |||
</template> | |||
<script> | |||
import { EmotionModel, PsyBaseUrl } from "@/config/models"; | |||
import { EmotionModel, PsyBaseUrl, anxietyText } from "@/config/models"; | |||
import axios from "axios"; | |||
export default { | |||
name: "psychological-monitor", | |||
data() { | |||
return { | |||
anxietyText, | |||
// 日期选择标签 | |||
dateList: [ | |||
{ name: "today", text: "今天", value: 0 }, | |||
@@ -323,7 +272,7 @@ export default { | |||
psyList: [ | |||
{ name: "tiredness", text: "疲劳", value: 0 }, | |||
{ name: "stress", text: "压力", value: 1 }, | |||
{ name: "depression", text: "抑郁", value: 2 }, | |||
{ name: "depression", text: anxietyText, value: 2 }, | |||
], | |||
// 当前情绪下标 | |||
psyCurrent: 0, | |||
@@ -728,13 +677,12 @@ export default { | |||
return `${today}${this.emoName}数据图`; | |||
}, | |||
warmTips() { | |||
return `正常连续佩戴腕表,每${ | |||
this.emoType == 2 ? "一" : "半" | |||
}小时计算一个${this.emoName}分值。`; | |||
return `正常连续佩戴腕表,每${this.emoType == 2 ? "一" : "半" | |||
}小时计算一个${this.emoName}分值。`; | |||
/* return `正常连续佩戴手表,每半小时计算一个${this.emoName}分值,睡眠期间不进行计算。` */ | |||
}, | |||
title1() { | |||
return EmotionModel[this.params.name].title1; | |||
return this.params.name ? EmotionModel[this.params.name].title1 : '' | |||
}, | |||
article1() { | |||
return EmotionModel[this.params.name].article1; | |||
@@ -802,7 +750,7 @@ export default { | |||
if (params.date) { | |||
this.dateList[0].text = | |||
this.$dayjs(params.date).format("YYYY-MM-DD") === | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
? "今天" | |||
: this.$dayjs(params.date).format("MM-DD"); | |||
this.defaultDate = new Date( | |||
@@ -908,7 +856,7 @@ export default { | |||
let reqDate = date | |||
? this.$dayjs(date).format("YYYY-MM-DD") | |||
: this.routeDate || | |||
this.$dayjs(this.defaultDate).format("YYYY-MM-DD"); /* "2023-05-23" */ | |||
this.$dayjs(this.defaultDate).format("YYYY-MM-DD"); /* "2023-05-23" */ | |||
let reqParams = { | |||
uid: this.uid, | |||
startDate: startDate || reqDate, | |||
@@ -1180,7 +1128,7 @@ export default { | |||
message: "登录过期,请重新进入", | |||
}); | |||
}) | |||
.finally(() => {}); | |||
.finally(() => { }); | |||
}, | |||
// 计算百分比 | |||
calcPercentage(value, total) { | |||
@@ -1200,7 +1148,7 @@ export default { | |||
let text = this.emoName === "depression" ? "趋势" : ""; | |||
let today = | |||
this.$dayjs(this.defaultDate).format("YYYY-MM-DD") === | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
? "今天" | |||
: ""; | |||
this.result = `无${this.emoName}倾向`; | |||
@@ -1419,7 +1367,7 @@ export default { | |||
const selectDate = this.$dayjs(value).format("YYYY-MM-DD"); | |||
this.dateList[0].text = | |||
this.$dayjs(value).format("YYYY-MM-DD") === | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
this.$dayjs(new Date()).format("YYYY-MM-DD") | |||
? "今天" | |||
: this.$dayjs(value).format("MM-DD"); | |||
this.calendarDialogShow = false; | |||
@@ -1503,7 +1451,7 @@ export default { | |||
.replace(/-/g, ".") | |||
.replace(/~/g, "-"), | |||
recordId: item.RecordId, | |||
summary: item.Summary, | |||
summary: this.$replaceAll(item.Summary, '抑郁', '焦虑'), | |||
summaryLevel: item.SummaryLevel, | |||
type: this.emoType, | |||
}; | |||
@@ -1535,41 +1483,52 @@ export default { | |||
.calenddar-dialog { | |||
overflow: scroll; | |||
} | |||
.calendar { | |||
overflow: scroll; | |||
.van-calendar { | |||
height: 350px; | |||
.van-calendar__header { | |||
display: none; | |||
} | |||
.van-calendar__days .van-calendar__day { | |||
width: 27px; | |||
height: 27px; | |||
margin: 5px; | |||
font-size: 12px; | |||
&.custom-calendar { | |||
width: 27px; | |||
height: 27px; | |||
} | |||
&.highlight-border { | |||
border: 1px solid #62bd48; | |||
width: 27px; | |||
height: 27px; | |||
border-radius: 50%; | |||
&.none { | |||
border: 1px solid #62bd48; | |||
} | |||
&.mild { | |||
border: 1px solid #ffde00; | |||
} | |||
&.moderate { | |||
border: 1px solid #ff8a00; | |||
} | |||
&.severe { | |||
border: 1px solid #d70d0d; | |||
} | |||
} | |||
} | |||
.van-calendar__selected-day { | |||
width: 27px; | |||
height: 27px; | |||
@@ -10,12 +10,7 @@ | |||
<div class="report"> | |||
<van-nav-bar title="心理监测周报" :border="true" @click-left="onNavBack"> | |||
<template #left> | |||
<van-icon | |||
name="arrow-left" | |||
size="24" | |||
style="padding: 0" | |||
v-show="params.isShowLeft" | |||
/> | |||
<van-icon name="arrow-left" size="24" style="padding: 0" v-show="params.isShowLeft" /> | |||
<span v-show="params.isShowLeft">返回</span> | |||
</template> | |||
</van-nav-bar> | |||
@@ -26,18 +21,16 @@ | |||
<p class="space-between"> | |||
<span class="bold">本周总评</span> | |||
<span class="time">{{ | |||
resetDate(weekResult.StartDate, weekResult.EndDate) || "--" | |||
}}</span> | |||
resetDate(weekResult.StartDate, weekResult.EndDate) || "--" | |||
}}</span> | |||
</p> | |||
<p | |||
class="bold-pro" | |||
:style="{ color: calcResultColor(weekResult.SummaryLevel) || '--' }" | |||
> | |||
<p class="bold-pro" :style="{ color: calcResultColor(weekResult.SummaryLevel) || '--' }"> | |||
{{ weekResult.Summary }} | |||
</p> | |||
<p class="normal">监测次数: {{ weekResult.Total || "--" }}次</p> | |||
<p class="normal">{{ weekResult.Explain || "--" }}</p> | |||
</div> | |||
</div> | |||
<div class="line"></div> | |||
<div class="pie-chart-top"> | |||
@@ -55,48 +48,35 @@ | |||
<div class="pie-chart-right"> | |||
<div class="list"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in pieRightList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in pieRightList" :key="index"> | |||
<div class="item-left"> | |||
<div | |||
class="circle" | |||
:style="{ backgroundColor: item.color }" | |||
></div> | |||
<div class="circle" :style="{ backgroundColor: item.color }"></div> | |||
<span class="text">{{ item.text || "--" }}</span> | |||
</div> | |||
<div class="item-right"> | |||
<span :style="{ color: item.color }">{{ | |||
item.count ? item.count + "次" : "0次" | |||
}}</span> | |||
item.count ? item.count + "次" : "0次" | |||
}}</span> | |||
<label :style="{ color: item.color }">{{ | |||
item.percentage ? "(" + item.percentage + "%" + ")" : "(0%)" | |||
}}</label> | |||
item.percentage ? "(" + item.percentage + "%" + ")" : "(0%)" | |||
}}</label> | |||
</div> | |||
<div class="status"> | |||
<img | |||
:src="calcImg(item.percentage, item.lastPercentage)" | |||
alt="" | |||
/> | |||
<span | |||
:style="{ | |||
color: | |||
calcImg(item.percentage, item.lastPercentage, true) != 0 | |||
? item.color | |||
: '', | |||
}" | |||
>{{ | |||
calcImg(item.percentage, item.lastPercentage, true) | |||
? Math.abs( | |||
calcImg(item.percentage, item.lastPercentage, true) | |||
) + "%" | |||
: "持平" | |||
}}</span | |||
> | |||
<img :src="calcImg(item.percentage, item.lastPercentage)" alt="" /> | |||
<span :style="{ | |||
color: | |||
calcImg(item.percentage, item.lastPercentage, true) != 0 | |||
? item.color | |||
: '', | |||
}">{{ | |||
calcImg(item.percentage, item.lastPercentage, true) | |||
? Math.abs( | |||
calcImg(item.percentage, item.lastPercentage, true) | |||
) + "%" | |||
: "持平" | |||
}}</span> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -104,19 +84,15 @@ | |||
</div> | |||
<div class="statistics"> | |||
<div class="list"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in statisticsList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in statisticsList" :key="index"> | |||
<div class="top"> | |||
<span>{{ item.label || "--" }}</span> | |||
</div> | |||
<div class="middle"> | |||
<span :style="{ color: calcColor(item.value) }">{{ | |||
item.value || "--" | |||
}}</span> | |||
item.value || "--" | |||
}}</span> | |||
</div> | |||
<div class="bottom"> | |||
@@ -144,20 +120,16 @@ | |||
<div class="title"> | |||
<span class="title-text">{{ surveyTitle }}</span> | |||
<div class="mood-list"> | |||
<div | |||
class="item" | |||
v-for="(item, index) in emotionList" | |||
:key="index" | |||
> | |||
<div class="item" v-for="(item, index) in emotionList" :key="index"> | |||
<p> | |||
<span :style="{ color: item.color }" class="day">{{ | |||
item.days | |||
}}</span> | |||
item.days | |||
}}</span> | |||
<span class="day-text">天</span> | |||
<img :src="calcWeekImg(item.days, item.lastDay)" alt="" /> | |||
<span class="day-text status">{{ | |||
calcWeekImg(item.days, item.lastDay, true) | |||
}}</span> | |||
}}</span> | |||
</p> | |||
<p>{{ item.text }}</p> | |||
</div> | |||
@@ -180,7 +152,7 @@ | |||
</template> | |||
<script> | |||
import { EmotionModel, PsyBaseUrl } from "@/config/models"; | |||
import { EmotionModel, PsyBaseUrl, anxietyText } from "@/config/models"; | |||
import { isNotNull } from "@/utils/index"; | |||
import axios from "axios"; | |||
import APICore from "@/api/core"; | |||
@@ -188,6 +160,7 @@ export default { | |||
name: "", | |||
data() { | |||
return { | |||
anxietyText, | |||
pieRightList: [ | |||
/* { | |||
text: "无情绪倾向", | |||
@@ -278,6 +251,7 @@ export default { | |||
weekResult: {}, | |||
upImg: require("@/assets/img/psychological/up.png"), | |||
downImg: require("@/assets/img/psychological/down.png"), | |||
}; | |||
}, | |||
created() { | |||
@@ -610,6 +584,9 @@ export default { | |||
let params = this.$route.query; | |||
if (params) { | |||
this.params = params; | |||
if (params.appType) { | |||
this.$store.commit("appType", params.appType); | |||
} | |||
if (!params.accessToken) { | |||
let authToken = await this.getAuth(); | |||
this.$store.commit("ssjlToken", authToken); | |||
@@ -673,7 +650,7 @@ export default { | |||
title = "压力"; | |||
break; | |||
case 2: | |||
title = "抑郁"; | |||
title = anxietyText; | |||
break; | |||
case 3: | |||
title = "疲劳"; | |||
@@ -702,8 +679,8 @@ export default { | |||
const data = res.data.response; | |||
let chartData = data.ChartData | |||
? JSON.parse(data.ChartData).filter((item) => { | |||
return item.Key; | |||
}) | |||
return item.Key; | |||
}) | |||
: []; | |||
if (data) { | |||
this.monitoringCount = data.Total; | |||
@@ -711,6 +688,9 @@ export default { | |||
this.statisticsList = []; | |||
this.emotionList = []; | |||
this.weekResult = data; | |||
this.weekResult.Explain = this.$replaceAll(data.Explain, '抑郁', '焦虑') | |||
this.weekResult.Summary = this.$replaceAll(data.Summary, '抑郁', '焦虑') | |||
this.weekResult.Advice = this.$replaceAll(data.Advice, '抑郁', '焦虑') | |||
this.emoName = this.calcTitle(data.Type); | |||
} | |||
let None = { | |||
@@ -1,12 +1,6 @@ | |||
<template> | |||
<div class="page" v-if="isSHowPage"> | |||
<van-nav-bar | |||
title="" | |||
:border="true" | |||
:left-arrow="true" | |||
@click-left="onNavBack" | |||
v-if="showLeftArrow" | |||
> | |||
<van-nav-bar title="" :border="true" :left-arrow="true" @click-left="onNavBack" v-if="showLeftArrow"> | |||
<template #left> | |||
<van-icon name="arrow-left" size="23" style="padding: 0" />返回 | |||
</template> | |||
@@ -29,9 +23,7 @@ | |||
<div class="title"> | |||
<div class="text">情绪初始化评估</div> | |||
<div class="status success" v-if="info.initScaleState === 1"> | |||
<span class="icon" | |||
><i class="iconfont icon-caozuochenggong"></i | |||
></span> | |||
<span class="icon"><i class="iconfont icon-caozuochenggong"></i></span> | |||
<span>已完成</span> | |||
</div> | |||
<div class="status" v-else>待完成</div> | |||
@@ -40,14 +32,8 @@ | |||
完成一次“情绪初始化评估”,有助于建立您的个人情绪模型。 | |||
</div> | |||
<div class="step_button"> | |||
<van-button | |||
round | |||
type="info" | |||
style="width: 100%; height: 100%" | |||
v-if="info.initScaleState !== 1" | |||
@click="toQuestion" | |||
>去完成</van-button | |||
> | |||
<van-button round type="info" style="width: 100%; height: 100%" v-if="info.initScaleState !== 1" | |||
@click="toQuestion">去完成</van-button> | |||
</div> | |||
</div> | |||
@@ -57,29 +43,20 @@ | |||
<div class="title"> | |||
<div class="text">连续佩戴两小时</div> | |||
<div class="status success" v-if="info.progress === 1"> | |||
<span class="icon" | |||
><i class="iconfont icon-caozuochenggong"></i | |||
></span> | |||
<span class="icon"><i class="iconfont icon-caozuochenggong"></i></span> | |||
<span>已完成</span> | |||
</div> | |||
<div class="status" v-else>{{ stateText }}</div> | |||
</div> | |||
<div class="schedule"> | |||
<van-progress | |||
:percentage="info.progress * 100" | |||
stroke-width="10px" | |||
color="#638ee4" | |||
:show-pivot="true" | |||
></van-progress> | |||
<van-progress :percentage="info.progress * 100" stroke-width="10px" color="#638ee4" | |||
:show-pivot="true"></van-progress> | |||
</div> | |||
<div class="sub_title"> | |||
请连续佩戴不低于2小时,有助于为您输出更加精准的情绪分析指标。 | |||
</div> | |||
</div> | |||
<div | |||
class="completed" | |||
v-show="info.progress === 1 && info.initScaleState === 1" | |||
> | |||
<div class="completed" v-show="info.progress === 1 && info.initScaleState === 1"> | |||
<van-button round type="info">建模已完成</van-button> | |||
</div> | |||
</div> | |||
@@ -89,6 +66,7 @@ | |||
<script> | |||
import axios from "axios"; | |||
import APICore from "@/api/core"; | |||
import { anxietyText } from "@/config/models"; | |||
export default { | |||
name: "PsychologicalModeling", | |||
data() { | |||
@@ -108,8 +86,8 @@ export default { | |||
}, | |||
tips() { | |||
return this.info.isFirstModeling === 1 | |||
? "首次佩戴,需完成以下2步,建立情绪模型。完成初始化建模后,将为您计算抑郁、压力、疲劳分值。" | |||
: "由于您长时间未佩戴手表,需重新建模,请连续佩戴不低于2小时,佩戴完成后,将为您计算抑郁、压力、疲劳的分值。"; | |||
? `首次佩戴,需完成以下2步,建立情绪模型。完成初始化建模后,将为您计算${anxietyText}、压力、疲劳分值。` | |||
: `由于您长时间未佩戴手表,需重新建模,请连续佩戴不低于2小时,佩戴完成后,将为您计算${anxietyText}、压力、疲劳的分值。`; | |||
}, | |||
}, | |||
mounted() { | |||
@@ -122,6 +100,9 @@ export default { | |||
this.uid = params.uid; | |||
// 缓存从随手精灵传过来的token | |||
this.$store.commit("ssjlToken", params.accessToken || ""); | |||
if (params.appType) { | |||
this.$store.commit("appType", params.appType); | |||
} | |||
// 缓存从随手精灵传过来的标识 | |||
this.$store.commit("fromSsjl", params.fromSsjl); | |||
// 是否显示 返回标签 | |||
@@ -156,9 +137,8 @@ export default { | |||
let fromSsjl = this.$store.getters.fromSsjl === "true"; | |||
if (fromSsjl) { | |||
let baseUrl = this.fromUrl; | |||
window.location.href = `${baseUrl}/#/${ | |||
this.$route.query.fromMenu || "device" | |||
}`; | |||
window.location.href = `${baseUrl}/#/${this.$route.query.fromMenu || "device" | |||
}`; | |||
} else { | |||
this.$router.go(-1); | |||
} | |||
@@ -197,8 +177,7 @@ export default { | |||
) { | |||
// 2023.6.1 需求变更,建模完成直接跳到心理健康汇总页面 | |||
this.$router.replace( | |||
`/psychologicalMain?uid=${this.uid}&fromUrl=${ | |||
this.fromUrl || "" | |||
`/psychologicalMain?uid=${this.uid}&fromUrl=${this.fromUrl || "" | |||
}&fromMenu=${this.showLeftArrow ? "device" : ""}` | |||
); | |||
} | |||
@@ -261,7 +240,8 @@ export default { | |||
<style lang="scss" scoped> | |||
@font-face { | |||
font-family: "iconfont"; /* Project id 2652084 */ | |||
font-family: "iconfont"; | |||
/* Project id 2652084 */ | |||
src: url("data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAQoAAsAAAAACFQAAAPaAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDBgqEIIQDATYCJAMMCwgABCAFhGcHQRtqBxEVnBvJPhLjmMRz8aCJJho3wfN8ne+5817QmS/XTApqUAGT1kmpHaidloBWXGdzOaZE+Aj1S75l+ek70v5OL82zLE6hFEIiJEbx96dyFkjAnwUAJnXNTcUP1HiBAtaxhhUr2KsXyLuo1/rCrIx6BgFM6tACo12HbjZpk4bPmkIRGksqkFbKpPFjhxOWRnRLpRBGCEKXamQTATDWGo+AjeHn5RdRCYNBQGHt0mtM+1Hc+Zr+1VZ+0gf1Gl+CgIcbQABQQI2NmWVIu7MfKk7WQGHWKTUpDKIRjEkjySSEglIHt/zHM0CCWMoUTFVRGBclugwEvto8VnH9qyAIhIDrIApTOVMVOr2mNDQjKSPHeM4zz6ZrPrYDY3fjR7a4+xTrY15tvZVw5KkZtx/X+HznyRPHnvCeqZskVmTOjMmRnF1girdzz7F4ju3uiB/xc53CoFi1HdXMW9Vu1TonY+gTzqB98OucaHakkW3GjxWJhX9kQXymq/AjJ5sfbS5Hc9nm5+KfvW9ZiYfnRXbG8tzG6nK7+u265yW2Hv38lNG3PmqlJo7Hjv0enTXu0fJ0ouuAIf1WL94ysHiw9aA5vca2mth0ZPGOvtu99JioF7HtiBd95LA4E7Gj3qPSVmO6tC3erV1e54F9yvUsu3Bh2Z7l+lwiLGETNtvRp9ylmtsGlm7eieOF8GLvn+zifT/067/LLFd8TdeujrureHTFyFEf+hbPVft+SK96RrBXE7tqx8rt21XpUO2QwwZswmZvsZsOz8+pN3TsrzXZ143c71m5NwLL+4xyo30jdTbxttGdTvRcMG4rPzrU0SFdrfTjHqXWlOrxuHR1FdK1219m/7yFvU52Hh3x6th9I25U9b0QTS1XvFyq35thACTvqtuqZZiOq5kq9v9/w/jtj8cOTW/2P2xpAN5vbXsP+5NxDcwN4RfjFPjbqkFApFYhULpOcFsQQLEkk4cBmLYJfm81QBZvh6uzweUghMlOwSBEcVCEKYdpqhoEsIhCkDDNwaQ67VdbZPsIzBFdDKjEC4GQwRsM0rgKigw+mKa+ECCPHwTJ4A8mrqy2s6gkZs2oBC3oB9SGBudoJJR7QD92iqtiF+RY4wjkSVbM7HFAHmNGvPpCxIFj6mHHT8OuIwhMDRpJKpFQpqmre0liqJ+sYRCFgFgAzQOgxkAMOB8t+e87gHhGOhQMxC52JlKeyAdyEjIAtlcOoLYb6R254ikQBEdHORiiB9gpO9LZSQII9YMaEIOQUA2IB0pSgnJQZbK8un+5XYCJtaUSQ5Ro0kcqeo5kKhy8J7dhKXWs6skEAAA="); | |||
} | |||
@@ -289,6 +269,7 @@ export default { | |||
text-align: left; | |||
background: #f4f4f4; | |||
padding-bottom: 30vw; | |||
.tip { | |||
display: flex; | |||
font-size: 3.3vw; | |||
@@ -309,18 +290,22 @@ export default { | |||
border-radius: 50%; | |||
background: #fff5f1; | |||
} | |||
.info { | |||
width: calc(100% - 50px); | |||
line-height: 20px; | |||
text-align: left; | |||
.titie { | |||
color: #ff865a; | |||
} | |||
.content { | |||
color: gray; | |||
} | |||
} | |||
} | |||
.step { | |||
margin-top: 3vw; | |||
padding: 4vw 8vw; | |||
@@ -344,6 +329,7 @@ export default { | |||
margin-right: 1vw; | |||
} | |||
} | |||
.title { | |||
display: flex; | |||
justify-content: space-between; | |||
@@ -352,6 +338,7 @@ export default { | |||
.status { | |||
color: #ff865a; | |||
} | |||
.success { | |||
color: #638ee4; | |||
@@ -361,25 +348,30 @@ export default { | |||
} | |||
} | |||
} | |||
.sub_title { | |||
padding: 3vw 0; | |||
color: gray; | |||
} | |||
.step_button { | |||
height: 14vw; | |||
width: 60vw; | |||
margin: auto; | |||
.van-button--info { | |||
background-color: #638ee4; | |||
border: 1px solid #638ee4; | |||
} | |||
} | |||
} | |||
.completed { | |||
position: relative; | |||
margin-top: 3vw; | |||
height: 400px; | |||
@include center(); | |||
.van-button--info { | |||
height: 8vh; | |||
width: 75vw; | |||
@@ -387,6 +379,7 @@ export default { | |||
border: 1px solid #638ee4; | |||
} | |||
} | |||
.button { | |||
position: fixed; | |||
left: 0; | |||