| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354 |
- <template>
- <view class="wisdom-container" :style="{ '--font-scale': fontScale }">
- <!-- 通用登录浮层 -->
- <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
- <!-- Tabbar 切换过渡页 -->
- <tab-transition v-if="showTabTransition" dimCode="wisdom" ref="tabTransition" @close="showTabTransition = false" />
- <!-- 品牌头部 -->
- <PageBanner theme="wisdom" tagline="认知成长 · 提升学习效率" quote="认知成长 · 智慧人生" />
- <DimensionPageSkeleton v-if="pageLoading" dim-code="wisdom" />
- <!-- 品牌定位语(登录前显示) -->
- <view class="brand-strap" v-if="!isLoggedIn">
- <text class="brand-strap-text">提升全家认知能力与学习效率</text>
- </view>
- <!-- 2. 学习能力评估图(始终显示,无数据时仅显示人群平均值) -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">学习能力评估</text>
- <text class="section-sub">通过测评了解全家认知能力,找出可以提升的方向</text>
- <text class="avg-badge" v-if="!cognitiveReport">同龄平均值 · 完成认知测评后显示个人数据</text>
- <text class="section-more" v-if="isLoggedIn" @click="goCognitiveReport">查看详情 ›</text>
- </view>
- <RadarChart
- :dimensions="cognitiveDimensions"
- :scores="cognitiveScores"
- :avg-scores="cognitiveFamilyScores"
- :population-scores="cognitivePopulationScores"
- :childName="activeChildName"
- :fillColor="wisdomColor"
- :gridColor="gridColor"
- :labelColor="labelColor" />
- </view>
- <!-- 家庭成员选择条 -->
- <MemberSelector
- variant="tabs"
- v-if="currentView === 'self' && isLoggedIn"
- :members="familyMembersVisible"
- :selectedMemberId="selectedMemberId"
- dimension-code="wisdom"
- :score-map="memberScoreMap"
- @select="onFamilyMemberSelect"
- @longpress="onMemberLongPress"
- @manage="onMemberManage"
- @removed="loadFamilyMembersVisible" />
- <!-- 游客引导语 -->
- <view class="monthly-guidance" v-if="!isLoggedIn">
- <text class="guidance-icon">⚡</text>
- <text class="guidance-text">{{ monthlyGuidance }}</text>
- </view>
- <!-- 游客价值卡(统一组件:维度色 CTA + 价值预览) -->
- <DimensionVisitorCard
- v-if="!isLoggedIn"
- dimCode="wisdom"
- card-title="智维度 · 认知成长"
- :benefits="[
- '全家认知能力评估与强项分析',
- '学习解读与认知训练建议',
- '认知趋势与同龄对比'
- ]"
- cta-text="登录做认知测评"
- secondary-text="了解认知维度"
- secondary-url="/pages/wisdom-detail/dimension-intro"
- preview-text="登录后展示你的认知能力雷达图" />
- <!-- 4. 五维能量条(登录后) -->
- <FamilyEnergyBar
- v-if="isLoggedIn"
- dimensionCode="wisdom"
- :sandboxData="sandboxData"
- :dualDimension="dualDimension" />
- <!-- 认知指标卡片 -->
- <view class="indicator-cards-section" v-if="isLoggedIn && wisdomIndicators.length > 0">
- <view class="section-header">
- <text class="section-title">⚡ 认知指标</text>
- <text class="section-more" @click="goWisdomDetail">更多 ›</text>
- </view>
- <view class="indicator-cards">
- <view
- v-for="(ind, i) in wisdomIndicators"
- :key="ind.code"
- class="indicator-card"
- :class="{ 'no-data': !ind.value }"
- @click="goWisdomDetail()"
- >
- <view class="indicator-header">
- <text class="indicator-name">{{ ind.name }}</text>
- <text class="indicator-unit" v-if="ind.unit">{{ ind.unit }}</text>
- </view>
- <view class="indicator-body">
- <text class="indicator-value" v-if="ind.value || ind.numericValue !== null">{{ ind.value || formatNumeric(ind.numericValue) }}</text>
- <text class="indicator-placeholder" v-else>暂无数据</text>
- </view>
- <view class="indicator-footer">
- <text class="indicator-range" v-if="ind.refRange">参考: {{ ind.refRange }}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 学习解读 -->
- <view class="section score-explain-card" v-if="isLoggedIn && currentView === 'self' && dualDimension">
- <view class="explain-header">
- <text class="explain-icon">{{ (dualDimension.primary && dualDimension.primary.score || 0) >= 80 ? '✅' : (dualDimension.primary && dualDimension.primary.score || 0) >= 60 ? '⚠️' : '❗' }}</text>
- <text class="explain-title">学习解读</text>
- </view>
- <text class="explain-text">{{ (dualDimension.primary && dualDimension.primary.score || 0) >= 80 ? '学习能力良好,继续保持学习节奏。' : (dualDimension.primary && dualDimension.primary.score || 0) >= 60 ? '学习能力一般,建议多做认知训练。' : '学习能力需要提升,建议进行专业评估。' }}</text>
- </view>
- <!-- ===== 认知强项与提升空间 ===== -->
- <view class="section cognitive-insight" v-if="isLoggedIn && cognitiveReport">
- <view class="section-header">
- <text class="section-title">📈 认知强项与提升</text>
- </view>
- <template v-if="cogStrengths.length > 0 || cogImproves.length > 0">
- <view class="insight-group" v-if="cogStrengths.length > 0">
- <text class="insight-group-title">💪 你的强项</text>
- <view class="insight-item" v-for="(item, idx) in cogStrengths" :key="getInsightKey('s', idx)">
- <text class="insight-item-name">{{ item.label }}</text>
- <text class="insight-item-score">{{ item.score }}分</text>
- <text class="insight-item-tag tag-strong">强项</text>
- </view>
- </view>
- <view class="insight-group" v-if="cogImproves.length > 0">
- <text class="insight-group-title">🌱 提升空间</text>
- <view class="insight-item" v-for="(item, idx) in cogImproves" :key="getInsightKey('i', idx)">
- <text class="insight-item-name">{{ item.label }}</text>
- <text class="insight-item-score">{{ item.score }}分</text>
- <text class="insight-item-tag tag-improve">待提升</text>
- </view>
- </view>
- <view class="insight-tip" v-if="cogStrengths.length > 0 && cogImproves.length > 0">
- <text class="insight-tip-text">强项保持,薄弱维建议通过训练中心针对性提升</text>
- </view>
- </template>
- <view class="insight-empty" v-else-if="!cognitiveReport || !hasCognitiveScore">
- <text class="insight-empty-text">完成认知测评,查看强项与提升建议</text>
- <button class="insight-btn" @click="goCognitiveReport">去测评</button>
- </view>
- </view>
- <!-- 心维度画像 - 总体说明 -->
- <view class="dimension-portrait-section" v-if="isLoggedIn && wisdomPortrait">
- <view class="section-header">
- <text class="section-title">🧭 心维度画像</text>
- <text class="portrait-tier">{{ wisdomPortrait.tierLabel }}</text>
- </view>
- <view class="portrait-summary">
- <text class="portrait-desc">{{ wisdomPortrait.summary }}</text>
- </view>
- <view class="portrait-dimensions">
- <view class="portrait-dim-item" v-for="dim in wisdomPortrait.dims" :key="dim.code">
- <view class="portrait-dim-header">
- <view class="portrait-dim-icon" :style="{ background: dim.color }">{{ dim.icon }}</view>
- <text class="portrait-dim-name">{{ dim.name }}</text>
- <text class="portrait-dim-score">{{ dim.score }}</text>
- </view>
- <view class="portrait-dim-bar-track">
- <view class="portrait-dim-bar-fill" :style="{ width: dim.score + '%', background: dim.color }"></view>
- </view>
- <text class="portrait-dim-desc">{{ dim.desc }}</text>
- </view>
- </view>
- <view class="portrait-tip" v-if="wisdomPortrait.tip">
- <text class="portrait-tip-text">💡 {{ wisdomPortrait.tip }}</text>
- </view>
- </view>
- <!-- ===== DAN 报告(登录后) ===== -->
- <view class="section" v-if="isLoggedIn">
- <view class="section-header">
- <text class="section-title">📊 DAN 报告</text>
- <text class="section-more" @click="goDanUpload">上传 +</text>
- </view>
- <view class="dan-card" v-for="report in danReports" :key="report.id" @click="viewDanReport(report)">
- <view class="dan-card-header">
- <text class="dan-report-date">{{ formatDate(report.assessmentDate) }}</text>
- <text :class="['dan-status', report.draftStatus === 'confirmed' ? 'confirmed' : 'pending']">
- {{ report.draftStatus === 'confirmed' ? '已确认' : '待确认' }}
- </text>
- </view>
- <text class="dan-report-desc">DAN B4 智维度测评报告</text>
- </view>
- <view class="dan-empty" v-if="danReports.length === 0">
- <text class="dan-empty-text">暂无 DAN 报告,点击上方「上传 +」上传测评报告</text>
- </view>
- </view>
- <!-- 肠胃与认知卡片(有菌群报告显示认知指标,无报告引导上传) -->
- <view class="section gut-cognition-card" v-if="isLoggedIn">
- <view class="section-header">
- <text class="section-title">🦠 肠胃与认知</text>
- </view>
- <text class="gut-cog-subtitle">肠脑轴 · 肠道菌群,影响学习与思维</text>
- <template v-if="cognitionGutIndicators && cognitionGutIndicators.length > 0">
- <view class="gut-indicator-list">
- <view class="gut-indicator-item" v-for="ind in cognitionGutIndicators" :key="ind.id">
- <view class="gut-indicator-left">
- <text class="gut-indicator-name">{{ ind.indicatorName || ind.name }}</text>
- <text class="gut-indicator-impact" v-if="cognitiveImpactLabel(ind.indicatorName || ind.name)">影响{{ cognitiveImpactLabel(ind.indicatorName || ind.name) }}</text>
- </view>
- <view class="gut-indicator-bar-track">
- <view class="gut-indicator-bar-fill" :style="{ width: indicatorBarWidth(ind), background: indicatorColor(ind.status) }"></view>
- </view>
- <text class="gut-indicator-value">{{ formatIndicatorValue(ind) }}{{ ind.unit || '%' }}</text>
- <text :class="['gut-indicator-status', 'status-' + (ind.status || 'normal')]">{{ statusLabel(ind.status) }}</text>
- </view>
- </view>
- </template>
- <view class="gut-empty" v-else>
- <text class="gut-empty-icon">📄</text>
- <text class="gut-empty-text">上传菌群报告,查看认知相关指标</text>
- <button class="gut-upload-btn" @click="goReportUpload">去上传</button>
- </view>
- </view>
- <!-- 6. 功能入口 -->
- <view class="func-section" v-if="sectionVisible('func_entries')">
- <view class="func-grid">
- <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
- <view class="func-icon-wrap">
- <text class="func-icon">{{ item.icon }}</text>
- </view>
- <text class="func-label">{{ item.label }}</text>
- </view>
- </view>
- </view>
- <!-- 智维度介绍卡片(登录后显示) -->
- <DimensionIntroCard dimCode="wisdom" v-if="isLoggedIn" learn-more-url="/pages/wisdom-detail/dimension-intro" />
- <!-- 底部占位 -->
- <view class="bottom-spacer"></view>
- <FloatingAvatar />
- </view>
- </template>
- <script>
- import { BrandColors } from '../../utils/brand-colors.js'
- import nav from '../../utils/nav'
- import TabTransition from '../../components/tab-transition.vue'
- import RadarChart from '../../components/RadarChart.vue'
- import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
- import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
- import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
- import DimensionVisitorCard from '../../components/DimensionVisitorCard.vue'
- import DimensionPageSkeleton from '../../components/DimensionPageSkeleton.vue'
- import MemberSelector from '@/components/MemberSelector.vue'
- import { getVisibleSections, getChildren, getFamilyEnergySandbox, getEnergySandbox, getAssessmentLatestResult, getDanReportByChild, getGutCognitionIndicators, getLatestIndicators, getRadarData, getFamilyMemberList, kickFamilyMemberById } from '../../utils/api.js'
- import { parseDate } from '../../utils/format.js'
- import fontScaleMixin from '@/mixins/font-scale.js'
- export default {
- mixins: [fontScaleMixin],
- components: { TabTransition, RadarChart, FamilyEnergyBar, FloatingAvatar, MemberSelector, DimensionIntroCard, DimensionVisitorCard, DimensionPageSkeleton },
- data() {
- return {
- gridColor: BrandColors.indigo100,
- labelColor: BrandColors.indigo800,
- wisdomColor: BrandColors.wisdom,
- memberScoreMap: {},
- pageLoading: false,
- isLoggedIn: false,
- role: null,
- showTabTransition: true,
- activeChildId: null,
- activeChildName: '',
- userName: '',
- children: [],
- familyMembersVisible: [],
- selectedMemberId: null,
- wisdomSubDims: [],
- wisdomIndicators: [],
- sandboxData: null,
- currentView: 'self', // 'self' | 'family'
- dualDimension: null,
- visibleSections: [],
- cognitiveReport: null,
- articles: [],
- /** 认知雷达图:家庭平均分(默认取同龄同性 P50 常模) */
- cognitiveFamilyScores: [],
- /** 认知雷达图:人群位置(同龄同性 P50 常模,接口返回,失败时不显示假数据) */
- cognitivePopulationScores: [],
- danReports: [],
- cognitionGutIndicators: [],
- funcList: [
- { icon: '\u{1F4CA}', label: '认知报告', needLogin: true, page: '/pages/wisdom-detail/cognitive-report' },
- { icon: '\u{1F9E0}', label: '训练中心', needLogin: true, page: '/pages/wisdom-detail/training-hub' },
- { icon: '\u{1F3AF}', label: '测评预约', needLogin: false, page: '/pages/assessment/apply' },
- { icon: '\u{1F4D6}', label: '阅读天地', needLogin: false, page: '/pages/article-center/index?dimension=wisdom' }
- ]
- }
- },
- computed: {
- wisdomArticles: function() {
- if (!this.articles || this.articles.length === 0) return []
- var result = []
- for (var i = 0; i < this.articles.length; i++) {
- var a = this.articles[i]
- if (a.relatedDimensions && a.relatedDimensions.indexOf('wisdom') !== -1) {
- result.push(a)
- }
- }
- if (result.length === 0) return this.articles.slice(0, 5)
- return result.slice(0, 5)
- },
- cognitiveDimensions: function() {
- return [
- { label: '感知能力', key: 'perceptionScore' },
- { label: '专注力', key: 'focusScore' },
- { label: '记忆力', key: 'memoryScore' },
- { label: '逻辑思维', key: 'logicScore' },
- { label: '空间思维', key: 'spatialScore' },
- { label: '加工速度', key: 'processingSpeedScore' },
- { label: '成长型思维', key: 'wisdomGrowthMindset' }
- ]
- },
- cognitiveScores: function() {
- if (!this.cognitiveReport) return []
- var dims = this.cognitiveDimensions
- var scores = []
- // 解析 structuredAnalysis 中的成长型思维
- var growthMindset = 0
- if (this.cognitiveReport.structuredAnalysis) {
- try {
- var analysis = JSON.parse(this.cognitiveReport.structuredAnalysis)
- if (analysis && analysis.extra && analysis.extra.growthMindset) {
- var gm = analysis.extra.growthMindset
- var vals = Object.values(gm)
- if (vals.length > 0) growthMindset = parseInt(vals[0]) || 0
- }
- } catch (e) { /* ignore parse error */ }
- }
- for (var i = 0; i < dims.length; i++) {
- var key = dims[i].key
- if (key === 'wisdomGrowthMindset') {
- scores.push(growthMindset)
- } else {
- scores.push(this.cognitiveReport[key] || 0)
- }
- }
- return scores
- },
- /** 认知测评是否已有有效得分(任一维度 > 0) */
- hasCognitiveScore: function() {
- if (!this.cognitiveReport) return false
- var dims = this.cognitiveDimensions
- for (var i = 0; i < dims.length; i++) {
- var key = dims[i].key
- var v = 0
- if (key === 'wisdomGrowthMindset') {
- v = this.cognitiveScores[this.cognitiveDimensions.length - 1] || 0
- } else {
- v = this.cognitiveReport[key] || 0
- }
- if (v > 0) return true
- }
- return false
- },
- /** 认知强项:得分 ≥75 的维度 */
- cogStrengths: function() {
- var dims = this.cognitiveDimensions
- var result = []
- for (var i = 0; i < dims.length; i++) {
- var score = this.cognitiveScores[i] || 0
- if (score >= 75) {
- result.push({ label: dims[i].label, score: score })
- }
- }
- return result
- },
- /** 认知提升空间:得分 <60 的维度 */
- cogImproves: function() {
- var dims = this.cognitiveDimensions
- var result = []
- for (var i = 0; i < dims.length; i++) {
- var score = this.cognitiveScores[i] || 0
- if (score > 0 && score < 60) {
- result.push({ label: dims[i].label, score: score })
- }
- }
- return result
- },
- /** 每月引导语 */
- monthlyGuidance: function() {
- var month = new Date().getMonth()
- var messages = [
- '一月:新年新目标,制定学习计划',
- '二月:春节收获知识,拓展认知边界',
- '三月:植树节到,播种智慧种子',
- '四月:清明踏青,激发创造力',
- '五月:劳动节后,专注能力提升',
- '六月:考试季,科学备考策略',
- '七月:暑期黄金期,查漏补缺',
- '八月:开学准备,提前规划学习',
- '九月:新学期,设定学习目标',
- '十月:国庆假期,阅读充电',
- '十一月:年终冲刺,巩固知识',
- '十二月:年度总结,规划来年学习'
- ]
- return messages[month] || messages[0]
- },
- wisdomPortrait: function() {
- var self = this
- if (!this.isLoggedIn || !this.cognitiveReport) return null
- var cognitiveReport = this.cognitiveReport
- var dims = [
- { key: 'perceptionScore', label: '感知能力', color: BrandColors.mind, desc: '感官获取信息的能力' },
- { key: 'focusScore', label: '专注力', color: BrandColors.wealth, desc: '保持注意力集中的能力' },
- { key: 'memoryScore', label: '记忆力', color: BrandColors.wisdom, desc: '记忆和回忆信息的能力' },
- { key: 'logicScore', label: '逻辑思维', color: BrandColors.success, desc: '分析和推理能力' },
- { key: 'spatialScore', label: '空间思维', color: BrandColors.wealth, desc: '操作空间关系的能力' },
- { key: 'processingSpeedScore', label: '加工速度', color: BrandColors.body, desc: '快速处理信息的能力' },
- { key: 'growthMindset', label: '成长型思维', color: BrandColors.pink, desc: '相信能力可提升的信念' }
- ]
- var result = { overall: 0, tierLabel: '', summary: '', dims: [], tip: '' }
- var total = 0
- var count = 0
- var dimList = []
- for (var i = 0; i < dims.length; i++) {
- var key = dims[i].key
- var score = 0
- if (key === 'growthMindset' && cognitiveReport.structuredAnalysis) {
- try {
- var analysis = JSON.parse(cognitiveReport.structuredAnalysis)
- if (analysis && analysis.extra && analysis.extra.growthMindset) {
- var gm = analysis.extra.growthMindset
- var vals = Object.values(gm)
- if (vals.length > 0) score = parseInt(vals[0]) || 0
- }
- } catch (e) { /* ignore parse error */ }
- } else {
- score = cognitiveReport[key] || 0
- }
- if (isNaN(score)) score = 0
- score = Math.max(0, Math.min(100, Number(score)))
- total += score
- count++
- var matched = dims.find(function(d) { return d.key === key })
- dimList.push({
- code: key,
- name: matched ? matched.label : key,
- score: Math.round(score),
- color: matched ? matched.color : BrandColors.mind,
- desc: matched ? matched.desc : ''
- })
- }
- if (count === 0) return null
- result.overall = Math.round(total / count)
- result.dims = dimList
- var o = result.overall
- if (o >= 80) {
- result.tierLabel = '认知卓越者'
- result.summary = '您的认知能力卓越,各项能力均衡强劲,学习效率高。'
- result.tip = '保持学习节奏,可进一步拓展更广的知识边界'
- } else if (o >= 60) {
- result.tierLabel = '认知进取者'
- result.summary = '您的认知能力处于良好水平,具备较强的学习潜力。'
- result.tip = '针对薄弱维度进行针对性训练,逐步突破瓶颈'
- } else if (o >= 40) {
- result.tierLabel = '认知探索者'
- result.summary = '您的认知能力正在建立基础,关注学习习惯的养成很重要。'
- result.tip = '从最容易提升的维度开始,每天投入少量学习时间'
- } else {
- result.tierLabel = '认知起步者'
- result.summary = '您的认知能力需要更多关注和引导,建议从基础认能训练开始。'
- result.tip = '建议咨询专业教育者,制定个性化认知发展计划'
- }
- return result
- }
- },
- created() {
- // 首屏加载骨架:已登录用户的数据请求期间占位,稳态视觉零变化
- // 未登录走静态内容,不进 loading,故此处不读 isLoggedIn
- var token = uni.getStorageSync('token')
- if (token) {
- this.pageLoading = true
- var self = this
- setTimeout(function() { self.pageLoading = false }, 600)
- }
- },
- onShow() {
- this.showTabTransition = true
- var token = uni.getStorageSync('token')
- this.isLoggedIn = !!token
- if (this.isLoggedIn) {
- this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '本人'
- }
- this.loadSectionConfig()
- if (this.isLoggedIn) {
- this.loadChildren()
- this.loadFamilyMembersVisible()
- this.loadCognitiveReport()
- this.loadDanReports()
- this.loadGutCognitionData()
- }
- // 游客也能浏览文章
- this._watchPageReady()
- },
- methods: {
- getInsightKey: function(prefix, idx) { return prefix + idx },
- // 切换成员:同步成员ID并持久化,重载该页全部成员相关数据
- onFamilyMemberSelect: function(member) {
- if (!member || member.id === this.selectedMemberId) return
- this.selectedMemberId = member.id
- this.activeChildId = member.id
- uni.setStorageSync('currentChildId', member.id)
- this.reloadForMember()
- },
- // 切换成员后的统一重载入口
- reloadForMember: function() {
- if (!this.isLoggedIn) return
- this.loadCognitiveReport()
- this.loadDanReports()
- this.loadGutCognitionData()
- },
- // 成员标签长按:唤出管理动作面板
- onMemberLongPress: function(member) {
- this.showMemberActions(member)
- },
- // 成员标签管理入口
- onMemberManage: function() {
- uni.navigateTo({ url: '/pages/profile-extra/family-members' })
- },
- // 成员管理动作面板(系统 ActionSheet,触摸目标由微信保证)
- showMemberActions: function(member) {
- if (!member) return
- var self = this
- var items = ['切换到该成员视角', '编辑资料', '移除成员']
- uni.showActionSheet({
- itemList: items,
- success: function(res) {
- if (res.tapIndex === 0) {
- uni.navigateTo({ url: '/pages/action-detail/relationship-questionnaire?memberId=' + member.id })
- } else if (res.tapIndex === 1) {
- uni.navigateTo({ url: '/pages/family/add-member?memberId=' + member.id })
- } else if (res.tapIndex === 2) {
- uni.showModal({
- title: '确认移除',
- content: '确定要移除 ' + (member.nickname || '该成员') + ' 吗?',
- success: function(m) {
- if (m.confirm) {
- uni.showLoading({ title: '移除中...' })
- kickFamilyMemberById(member.id).then(function() {
- uni.hideLoading()
- uni.showToast({ title: '已移除', icon: 'success' })
- self.loadFamilyMembersVisible()
- }).catch(function(err) {
- uni.hideLoading()
- uni.showToast({ title: (err && err.message) || '移除失败', icon: 'none' })
- })
- }
- }
- })
- }
- }
- })
- },
- loadSectionConfig: function() {
- var baseSections = ['func_entries', 'recommended_reading']
- if (!uni.getStorageSync('token')) {
- this.visibleSections = baseSections
- return
- }
- var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- var self = this
- getVisibleSections({ pageKey: 'wisdom', role: role }).then(function(res) {
- if (res.code === 200 && res.data) {
- var keys = res.data.map(function(s) { return s.sectionKey })
- var merged = baseSections.slice()
- keys.forEach(function(k) { if (merged.indexOf(k) === -1) merged.push(k) })
- self.visibleSections = merged
- }
- }).catch(function(e) {
- self.visibleSections = ['func_entries', 'recommended_reading']
- })
- },
- loadChildren: function() {
- var self = this
- getChildren().then(function(res) {
- if (res.code === 200 && res.data) {
- self.children = res.data
- if (self.children.length > 0) {
- var activeId = uni.getStorageSync('currentChildId')
- if (activeId) {
- for (var i = 0; i < self.children.length; i++) {
- if (self.children[i].id == activeId) {
- self.activeChildId = activeId
- self.activeChildName = self.children[i].nickname || self.children[i].name || ''
- break
- }
- }
- }
- // Fallback: 首次进入或未选成员时,默认选第一个成员以加载认知数据(仅本地状态,不触发全局切换)
- if (!self.activeChildId && self.children.length > 0) {
- self.activeChildId = self.children[0].id
- self.activeChildName = self.children[0].nickname || self.children[0].name || ''
- }
- }
- // Load cognitive report if activeChildId is available
- if (self.activeChildId) {
- self.loadCognitiveReport()
- }
- }
- }).catch(function(e) {})
- },
- loadWisdomIndicators: function(memberId) {
- var self = this
- getLatestIndicators({ memberId: memberId, domain: 'wisdom' }).then(function(res) {
- if (res.code === 200) self.wisdomIndicators = res.data || []
- }).catch(function(e) { console.log('[wisdom] loadWisdomIndicators failed', e) })
- },
- goWisdomDetail: function() {
- var id = this.activeChildId || uni.getStorageSync('currentChildId')
- if (!id) return
- uni.navigateTo({ url: '/pages/wisdom-detail/member-wisdom-detail?memberId=' + id })
- },
- formatNumeric: function(v) {
- if (v === null || v === undefined) return ''
- var n = parseFloat(v)
- if (isNaN(n)) return String(v)
- return n % 1 === 0 ? String(n) : n.toFixed(1)
- },
- loadFamilyMembersVisible: function() {
- var self = this
- getFamilyMemberList({}).then(function(res) {
- if (res.code === 200 && res.data) {
- // 保留后端全字段:成员标签需要 relationship/relativeLabel/roleLabel/effectiveRole/isSelf 等
- self.familyMembersVisible = res.data.map(function(m) {
- return {
- id: m.id,
- memberId: m.memberId,
- nickname: m.nickname,
- avatar: m.avatar,
- relationship: m.relationship,
- relativeLabel: m.relativeLabel,
- roleLabel: m.roleLabel,
- effectiveRole: m.effectiveRole,
- generation: m.generation,
- phone: m.phone,
- isSelf: m.isSelf,
- isSwitchable: m.isSwitchable
- }
- })
- }
- }).catch(function(e) { console.log('获取家庭成员失败', e) })
- },
- loadCognitiveReport: function() {
- var self = this
- var memberId = this.activeChildId
- if (!memberId) return
- getAssessmentLatestResult(memberId).then(function(res) {
- if (res.code === 200 && res.data) {
- self.cognitiveReport = res.data
- self.wisdomSubDims = (function() { var r = self.cognitiveReport || {}; return [{label:'感知能力', score:r.perceptionScore||0, desc:'通过感官获取信息'}, {label:'专注力', score:r.focusScore||0, desc:'保持注意力集中'}, {label:'记忆力', score:r.memoryScore||0, desc:'记忆和回忆信息'}, {label:'逻辑思维', score:r.logicScore||0, desc:'分析和推理能力'}, {label:'空间思维', score:r.spatialScore||0, desc:'操作空间关系'}, {label:'加工速度', score:r.processingSpeedScore||0, desc:'快速处理信息'}, {label:'成长型思维', score:r.growthMindset||0, desc:'相信能力可提升'}]; })();
- self.loadWisdomIndicators(memberId)
- self.loadCognitiveRadarData(memberId)
- }
- }).catch(function(e) {})
- },
- loadCognitiveRadarData: function(memberId) {
- var self = this
- if (!memberId) return
- getRadarData({ memberId: memberId, dimensions: ['perception','focus','memory','logic','spatial','processingSpeed','wisdomGrowthMindset'] }).then(function(res) {
- if (res && res.data) {
- self.cognitiveFamilyScores = res.data.familyScores || []
- self.cognitivePopulationScores = res.data.populationScores || []
- }
- }).catch(function(e) {
- console.warn('[wisdom] radar-data failed', e)
- })
- },
- onChildChanged: function(memberId) {
- this.activeChildId = memberId
- // FIX: 同步提交到 Vuex store
- this.$store.commit('switchToChild', memberId)
- for (var i = 0; i < this.children.length; i++) {
- if (this.children[i].id == memberId) {
- this.activeChildName = this.children[i].nickname || this.children[i].name || ''
- break
- }
- }
- this.loadFamilyMembersVisible()
- this.loadCognitiveReport()
- this.loadDanReports()
- },
- sectionVisible: function(key) {
- return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
- },
- onFuncClick: function(item) {
- if (item.needLogin && !this.isLoggedIn) {
- uni.showModal({
- title: '提示',
- content: '请先登录后使用此功能',
- success: (res) => { if (res.confirm) this.openLoginSheet() }
- })
- return
- }
- if (item.page) {
- nav.goPage(item.page)
- }
- },
- scrollToSection: function(section) {},
- // 登录成功:刷新登录态数据(镜像 onShow 已登录分支)
- onLoginSuccess: function() {
- this.isLoggedIn = true
- this.role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- this.userName = uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '本人'
- this.loadSectionConfig()
- this.loadChildren()
- this.loadFamilyMembersVisible()
- this.loadCognitiveReport()
- this.loadDanReports()
- this.loadGutCognitionData()
- this._watchPageReady()
- },
- goCognitiveReport: function() {
- uni.navigateTo({ url: '/pages/wisdom-detail/cognitive-report' })
- },
- _watchPageReady() {
- var self = this
- var unwatch = this.$watch(function() {
- if (self.isLoggedIn) {
- return !!(self.cognitiveReport || self.sandboxData)
- } }, function(val) {
- if (val) {
- if (unwatch) unwatch()
- if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
- }
- })
- },
- // ===== DAN 报告 =====
- loadDanReports: function() {
- var self = this
- var memberId = self.activeChildId
- if (!memberId) return
- getDanReportByChild(memberId, 'wisdom').then(function(res) {
- if (res.code === 200 && res.data) {
- self.danReports = res.data
- }
- }).catch(function() {})
- },
- // ===== 肠胃与认知(肠脑轴认知指标) =====
- loadGutCognitionData: function() {
- var self = this
- var memberId = self.activeChildId
- if (!memberId) return
- getGutCognitionIndicators(memberId).then(function(res) {
- if (res.code === 200 && res.data) {
- var list = res.data
- self.cognitionGutIndicators = Array.isArray(list) ? list.slice(0, 6) : []
- } else {
- self.cognitionGutIndicators = []
- }
- }).catch(function() {
- self.cognitionGutIndicators = []
- })
- },
- // 认知影响映射:指标名 → 影响的认知功能
- cognitiveImpactLabel: function(name) {
- if (!name) return ''
- if (name.indexOf('多巴胺') !== -1 || name.indexOf('Dopamine') !== -1) return '专注力'
- if (name.indexOf('谷氨酸') !== -1 || name.indexOf('Glutamate') !== -1) return '学习记忆'
- if (name.indexOf('乙酰胆碱') !== -1) return '记忆力'
- if (name.indexOf('色氨酸') !== -1 || name.indexOf('Tryptophan') !== -1) return '睡眠·记忆'
- if (name.indexOf('丁酸') !== -1 || name.indexOf('Butyrate') !== -1) return '脑健康'
- if (name.indexOf('丙酸') !== -1 || name.indexOf('Propionate') !== -1) return '脑健康'
- if (name.indexOf('乙酸') !== -1 || name.indexOf('Acetate') !== -1) return '脑健康'
- if (name.indexOf('组胺') !== -1 || name.indexOf('Histamine') !== -1) return '注意力·觉醒'
- if (name.indexOf('短链脂肪酸') !== -1) return '脑健康'
- return ''
- },
- indicatorColor: function(status) {
- if (status === 'abnormal' || status === '偏高' || status === '偏低' || status === '过高' || status === '缺乏') return BrandColors.danger
- if (status === 'warning' || status === '注意' || status === '不足') return BrandColors.wealth
- return BrandColors.success
- },
- statusLabel: function(status) {
- if (status === 'normal') return '正常'
- if (status === 'abnormal') return '异常'
- if (status === 'warning') return '警讯'
- if (status === '过高' || status === '过多') return '偏高'
- if (status === '缺乏' || status === '不足') return '偏低'
- return status || '正常'
- },
- // 指标值展示:后端字段为 indicatorValue,兼容数值型(如 0.32)
- formatIndicatorValue: function(ind) {
- if (!ind) return ''
- var v = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
- if (v === undefined || v === null || v === '') return ''
- return String(v)
- },
- // 指标条宽度:将指标值归一化为 0-100 百分比(仅对纯数字有效,否则按状态给默认宽度)
- indicatorBarWidth: function(ind) {
- var raw = ind.value !== undefined && ind.value !== null ? ind.value : ind.indicatorValue
- var n = parseFloat(raw)
- if (!isNaN(n) && n >= 0 && n <= 100) return n + '%'
- if (!isNaN(n) && n > 100) return '100%'
- // 非数值(如 "偏低"/"未检出"),按状态给默认可视化宽度
- var st = ind.status || ''
- if (st === '偏低' || st === '缺乏' || st === '不足' || st === 'abnormal') return '30%'
- if (st === '过高' || st === '过多' || st === 'warning') return '75%'
- return '55%'
- },
- goReportUpload: function() {
- uni.navigateTo({ url: '/pages/health/report-upload' })
- },
- goDanUpload: function() {
- uni.navigateTo({ url: '/pages/health/report-upload?type=a2' })
- },
- viewDanReport: function(report) {
- var reportId = report.sourceReportId || report.id
- uni.navigateTo({ url: '/pages/dan-assessment/report-result?reportId=' + reportId })
- },
- formatDate: function(dateStr) {
- if (!dateStr) return ''
- var d = parseDate(dateStr)
- if (!d) return ''
- return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
- }
- }
- }
- </script>
- <style scoped lang="scss">
- // 页面级局部调色板:仅本页专有色阶,跨页共性一律走 uni.scss 全局令牌
- // 浅蓝底 B(单页专有;vs $dim-wisdom-tint-3 $dim-wisdom-tint-3 全局邻档)
- $c-tint-b: #F8FAFF;
- // 浅蓝底 D(单页专有;vs $dim-wisdom-tint-2 $dim-wisdom-tint-2 全局邻档)
- $c-tint-d: #E8F1FE;
- // 强文字(深色块内;单页专有;vs $facade-text-strong $facade-text-strong 全局深档)
- $c-ink-strong: #1D1D1F;
- .wisdom-container {
- min-height: 100vh;
- background: $app-bg;
- padding-bottom: 120rpx;
- }
- .func-section {
- margin: 20rpx 20rpx 0;
- }
- .func-grid {
- background: $app-surface;
- border-radius: 24rpx;
- padding: $uni-space-lg 16rpx;
- display: flex;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .func-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .func-item:active {
- opacity: 0.7;
- }
- .func-icon-wrap {
- width: 88rpx;
- height: 88rpx;
- border-radius: 50%;
- background: rgba(99,102,241,0.12);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 10rpx;
- }
- .func-icon {
- font-size: calc(40rpx * var(--font-scale, 1));
- }
- .func-label {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text;
- font-weight: 500;
- }
- /* ===== Section ===== */
- .section {
- margin: 20rpx 20rpx;
- }
- .section-header {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: calc(30rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $app-text;
- }
- /* 页面说明(独占一行,避免与标题挤在同一行) */
- .section-sub {
- flex: 1 1 100%;
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- line-height: 1.4;
- margin-top: 6rpx;
- display: block;
- }
- .section-more {
- position: relative;
- flex-shrink: 0;
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- }
- /* 触摸目标扩展至 88rpx(微信最小可点区域):文字链 ~34rpx -> 88rpx,视觉零变化 */
- .section-more::after {
- content: '';
- position: absolute;
- left: -8rpx;
- right: -16rpx;
- top: -27rpx;
- bottom: -27rpx;
- }
- /* 得分解读卡片 */
- .score-explain-card {
- background: $app-surface;
- border-radius: 24rpx;
- padding: 28rpx 24rpx;
- border-left: 8rpx solid $dim-wisdom;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .explain-header {
- display: flex;
- align-items: center;
- margin-bottom: 14rpx;
- }
- .explain-icon {
- font-size: calc(36rpx * var(--font-scale, 1));
- margin-right: 10rpx;
- }
- .explain-title {
- font-size: calc(30rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $app-text;
- }
- .explain-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- line-height: 1.6;
- display: block;
- }
- /* 主按钮 */
- .primary-btn {
- background: linear-gradient(135deg, $dim-wisdom, $dim-wisdom-deep);
- color: $app-surface;
- font-size: calc(26rpx * var(--font-scale, 1));
- font-weight: bold;
- border: none;
- border-radius: 24rpx;
- padding: 18rpx 56rpx;
- line-height: 1.6;
- margin: 0;
- box-shadow: 0 4rpx 16rpx rgba(79,70,229,0.35);
- }
- .primary-btn:active {
- opacity: 0.88;
- }
- /* ===== 底部占位 ===== */
- .indicator-cards-section { margin: 20rpx $uni-space-lg; }
- .indicator-cards { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16rpx; }
- .indicator-card { width: calc(50% - 8rpx); background: $app-surface; border-radius: 24rpx; padding: 24rpx 20rpx; box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06); }
- .indicator-card.no-data { opacity: 0.5; }
- .indicator-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12rpx; }
- .indicator-name { font-size: calc(26rpx * var(--font-scale, 1)); color: $app-text-secondary; font-weight: 500; }
- .indicator-unit { font-size: calc(22rpx * var(--font-scale, 1)); color: $app-text-muted; }
- .indicator-body { margin-bottom: 8rpx; }
- .indicator-value { font-size: calc(40rpx * var(--font-scale, 1)); font-weight: bold; color: $dim-wisdom; }
- .indicator-placeholder { font-size: calc(26rpx * var(--font-scale, 1)); color: $app-border; }
- .indicator-range { font-size: calc(20rpx * var(--font-scale, 1)); color: $app-border; }
- .bottom-spacer { height: 120rpx; }
- /* DAN 报告卡片 */
- .dan-card {
- background: $app-surface;
- border-radius: 16rpx;
- padding: 24rpx;
- margin-bottom: 16rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
- }
- .dan-card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 12rpx;
- }
- .dan-report-date {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- }
- .dan-status {
- font-size: calc(22rpx * var(--font-scale, 1));
- padding: 4rpx 16rpx;
- border-radius: 8rpx;
- }
- .dan-status.confirmed {
- background: $status-success-soft;
- color: $status-success-strong;
- }
- .dan-status.pending {
- background: $status-warning-soft;
- color: $status-warning-strong;
- }
- .dan-report-desc {
- font-size: calc(28rpx * var(--font-scale, 1));
- color: $app-text;
- font-weight: 500;
- margin-bottom: 12rpx;
- display: block;
- }
- .dan-card-footer {
- text-align: right;
- }
- .dan-view-link {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- }
- .dan-empty {
- background: $app-surface;
- border-radius: 16rpx;
- padding: 40rpx 24rpx;
- text-align: center;
- }
- .dan-empty-text {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-muted;
- }
- .avg-badge {
- flex: 1 1 100%;
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- margin-top: 6rpx;
- display: block;
- }
- /* 品牌定位语 */
- .brand-strap {
- margin: 16rpx $uni-space-lg 0;
- padding: 24rpx 28rpx;
- background: linear-gradient(135deg, $dim-wisdom-tint, rgba(99,102,241,0.16));
- border-radius: 16rpx;
- border-left: 8rpx solid $dim-wisdom;
- box-shadow: 0 2rpx 12rpx rgba(99,102,241,0.12);
- }
- .brand-strap-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $dim-wisdom-ink;
- font-weight: bold;
- line-height: 1.5;
- }
- /* 每月引导语 */
- .monthly-guidance {
- margin: 16rpx $uni-space-lg 0;
- padding: 20rpx 28rpx;
- background: linear-gradient(135deg, $dim-wisdom-tint, rgba(99,102,241,0.08));
- border-radius: 16rpx;
- border-left: 8rpx solid $dim-wisdom;
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .guidance-icon { font-size: calc(32rpx * var(--font-scale, 1)); }
- .guidance-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $dim-wisdom-ink;
- font-weight: 500;
- }
- /* ===== 肠胃与认知卡片 ===== */
- .gut-cog-subtitle {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- margin-bottom: 16rpx;
- display: block;
- }
- .gut-indicator-list {
- display: flex;
- flex-direction: column;
- gap: 12rpx;
- }
- .gut-indicator-item {
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .gut-indicator-left {
- width: 110rpx;
- flex-shrink: 0;
- }
- .gut-indicator-name {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- font-weight: 500;
- display: block;
- }
- .gut-indicator-impact {
- font-size: calc(18rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- display: block;
- margin-top: 2rpx;
- }
- .gut-indicator-bar-track {
- flex: 1;
- height: 16rpx;
- background: $app-surface-subtle;
- border-radius: 8rpx;
- overflow: hidden;
- }
- .gut-indicator-bar-fill {
- height: 100%;
- border-radius: 8rpx;
- transition: width 0.3s;
- }
- .gut-indicator-value {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- width: 60rpx;
- text-align: right;
- }
- .gut-indicator-status {
- font-size: calc(20rpx * var(--font-scale, 1));
- padding: 2rpx 12rpx;
- border-radius: 8rpx;
- width: 60rpx;
- text-align: center;
- }
- .status-normal {
- background: $status-success-soft;
- color: $status-success-deep;
- }
- .status-abnormal {
- background: $status-danger-soft;
- color: $status-danger-deep;
- }
- .status-warning {
- background: $status-warning-soft;
- color: $status-warning-deep;
- }
- .gut-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 40rpx 0;
- }
- .gut-empty-icon {
- font-size: calc($uni-font-size-display * var(--font-scale, 1));
- margin-bottom: 16rpx;
- }
- .gut-empty-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text-muted;
- margin-bottom: 24rpx;
- }
- .gut-upload-btn {
- background: linear-gradient(135deg, $dim-wisdom, $dim-wisdom-light);
- color: $app-surface;
- font-size: calc(26rpx * var(--font-scale, 1));
- font-weight: 600;
- border: none;
- border-radius: 24rpx;
- padding: 16rpx 64rpx;
- line-height: 1.6;
- margin: 0;
- }
- /* ===== 认知强项与提升卡片 ===== */
- .insight-group {
- margin-bottom: 16rpx;
- }
- .insight-group-title {
- font-size: calc(26rpx * var(--font-scale, 1));
- font-weight: 600;
- color: $app-text;
- margin-bottom: 10rpx;
- display: block;
- }
- .insight-item {
- display: flex;
- align-items: center;
- padding: 12rpx 16rpx;
- background: $c-tint-b;
- border-radius: 16rpx;
- margin-bottom: 8rpx;
- }
- .insight-item-name {
- flex: 1;
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text;
- }
- .insight-item-score {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- margin-right: 12rpx;
- }
- .insight-item-tag {
- font-size: calc(20rpx * var(--font-scale, 1));
- padding: 4rpx 16rpx;
- border-radius: 8rpx;
- font-weight: 500;
- }
- .insight-item-tag.tag-strong {
- background: $status-success-soft;
- color: $status-success-deep;
- }
- .insight-item-tag.tag-improve {
- background: $status-warning-soft;
- color: $status-warning-deep;
- }
- .insight-tip {
- padding: 12rpx 16rpx;
- background: $dim-wisdom-tint-2;
- border-radius: 16rpx;
- }
- .insight-tip-text {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- }
- .insight-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: $uni-space-lg 0;
- }
- .insight-empty-text {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-muted;
- margin-bottom: 20rpx;
- }
- .insight-btn {
- background: linear-gradient(135deg, $dim-wisdom, $dim-wisdom-light);
- color: $app-surface;
- font-size: calc(26rpx * var(--font-scale, 1));
- font-weight: 600;
- border: none;
- border-radius: 24rpx;
- padding: 14rpx 60rpx;
- line-height: 1.6;
- margin: 0;
- }
- /* 维度画像样式 */
- .dimension-portrait-section {
- margin: 24rpx $uni-space-lg;
- background: $app-surface;
- border-radius: 24rpx;
- padding: 32rpx 24rpx;
- box-shadow: 0 4rpx 20rpx rgba(99, 102, 241, 0.12);
- border: 2rpx solid rgba(99, 102, 241, 0.1);
- }
- .portrait-tier {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $dim-wisdom;
- font-weight: bold;
- margin-left: 16rpx;
- }
- .portrait-summary {
- margin-bottom: 24rpx;
- }
- .portrait-desc {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $app-text-secondary;
- line-height: 1.6;
- display: block;
- }
- .portrait-dimensions {
- margin-bottom: 20rpx;
- }
- .portrait-dim-item {
- margin-bottom: 18rpx;
- }
- .portrait-dim-header {
- display: flex;
- align-items: center;
- margin-bottom: 6rpx;
- }
- .portrait-dim-icon {
- width: 36rpx;
- height: 36rpx;
- border-radius: 16rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 10rpx;
- font-size: calc(20rpx * var(--font-scale, 1));
- }
- .portrait-dim-name {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text;
- flex: 1;
- }
- .portrait-dim-score {
- font-size: calc(26rpx * var(--font-scale, 1));
- font-weight: bold;
- color: $dim-wisdom;
- margin-right: 12rpx;
- }
- .portrait-dim-bar-track {
- height: 10rpx;
- background: $dim-wisdom-tint-3;
- border-radius: 8rpx;
- overflow: hidden;
- margin-bottom: 4rpx;
- flex: 1;
- }
- .portrait-dim-bar-fill {
- height: 100%;
- border-radius: 8rpx;
- transition: width 0.3s ease;
- }
- .portrait-dim-desc {
- font-size: calc(20rpx * var(--font-scale, 1));
- color: $app-text-muted;
- display: block;
- }
- .portrait-tip {
- padding: 16rpx 20rpx;
- background: linear-gradient(135deg, $dim-wisdom-tint-3, $c-tint-d);
- border-radius: 16rpx;
- border-left: 8rpx solid $dim-wisdom;
- margin-top: 16rpx;
- }
- .portrait-tip-text {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $c-ink-strong;
- line-height: 1.5;
- }
- </style>
|