| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468 |
- <template>
- <view class="container" :style="{ '--font-scale': fontScale }">
- <!-- 登录浮层(全局组件,页面内弹出底部登录) -->
- <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
- <!-- Tabbar 切换过渡页 -->
- <tab-transition v-if="showTabTransition" dimCode="action" ref="tabTransition" @close="showTabTransition = false" />
- <!-- 品牌头部 -->
- <PageBanner theme="action"
- tagline="人际和谐 · 关系滋养"
- quote="和谐关系滋养幸福家庭" />
- <DimensionPageSkeleton v-if="pageLoading" dim-code="action" />
- <!-- 品牌定位语(登录前显示) -->
- <view class="brand-strap" v-if="!isLoggedIn">
- <text class="brand-strap-text">改善全家关系与沟通能力</text>
- </view>
- <!-- 家庭成员选择条 -->
- <MemberSelector
- variant="strip"
- v-if="currentView === 'self' && isLoggedIn"
- :members="familyMembersVisible"
- :selectedMemberId="selectedMemberId"
- @select="onFamilyMemberSelect"
- @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="action"
- card-title="行维度 · 关系滋养"
- :benefits="[
- '家庭关系图谱与关键人分析',
- '章鱼图 / 珍珠图能力资产',
- '家庭关系质量与改善建议'
- ]"
- cta-text="登录绘制关系网络"
- secondary-text="了解关系维度"
- secondary-url="/pages/action-detail/dimension-intro"
- preview-text="登录后绘制你的家庭关系网络图" />
- <!-- 登录后:五维能量条 -->
- <FamilyEnergyBar
- v-if="isLoggedIn"
- dimensionCode="action"
- :sandboxData="sandboxData"
- :dualDimension="dualDimension" />
- <!-- 关系解读 -->
- <view class="section score-explain-card" :class="scoreExplainClass" v-if="isLoggedIn && currentView === 'self' && actionScore != null">
- <view class="explain-header">
- <view class="explain-icon-wrap" :class="'explain-icon-' + scoreExplainLevel">
- <text class="explain-icon">{{ actionScore >= 80 ? '\u2713' : actionScore >= 60 ? '\u26A0' : '\u2715' }}</text>
- </view>
- <view class="explain-info">
- <text class="explain-title">关系解读</text>
- <text class="explain-score">{{ actionScore }}<text class="explain-score-unit">分</text></text>
- </view>
- </view>
- <text class="explain-text">{{ actionScore >= 80 ? '家庭关系和谐,家人沟通顺畅。' : actionScore >= 60 ? '家庭关系一般,建议多花时间陪伴家人。' : '家庭关系需要改善,建议进行家庭沟通活动。' }}</text>
- </view>
- <!-- 行维度画像 - 总体说明 -->
- <view class="dimension-portrait-section" v-if="isLoggedIn && actionPortrait">
- <view class="section-header">
- <text class="section-title">🧭 行维度画像</text>
- <text class="portrait-tier">{{ actionPortrait.tierLabel }}</text>
- </view>
- <view class="portrait-summary">
- <text class="portrait-desc">{{ actionPortrait.summary }}</text>
- </view>
- <view class="portrait-dimensions">
- <view class="portrait-dim-item" v-for="dim in actionPortrait.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="actionPortrait.tip">
- <text class="portrait-tip-text">💡 {{ actionPortrait.tip }}</text>
- </view>
- </view>
- <!-- 关系六维 -->
- <dimension-sub-dims
- v-if="isLoggedIn && actionSubDims.length > 0"
- title="🌲 关系六维"
- subtitle="家庭关系的六个方面"
- :accent-color="successColor"
- :dims="actionSubDims" />
- <!-- 登录后:家庭关系(行维度核心) -->
- <view class="section" v-if="isLoggedIn">
- <view class="section-header">
- <view class="section-title-wrap">
- <text class="help-icon" @tap="showHelp('家庭关系', '了解每位家人的关系质量,改善沟通方式。点击家人节点,查看关系详情。')">?</text>
- <view>
- <text class="section-title">家庭关系</text>
- <text class="section-sub">了解每位家人的关系质量,改善沟通方式 · 点击家人节点查看详情</text>
- </view>
- </view>
- </view>
- <FamilyRelationGraph
- dimensionCode="action"
- :selfId="selfId"
- :members="graphMembers"
- :energyMap="energyMapForGraph"
- :intimacyMap="intimacyMapForGraph"
- :interactive="true" />
- </view>
- <!-- 登录后:章鱼图(关键人拓展) -->
- <view class="section" v-if="isLoggedIn">
- <view class="section-header">
- <view class="section-title-wrap">
- <text class="help-icon" @tap="showHelp('章鱼图', '从成效出发,挖掘关键人,画出拓展路径。记录感恩时刻,建立有温度的人脉网络。')">?</text>
- <view>
- <text class="section-title">🐙 章鱼图</text>
- <text class="section-sub">从成效出发,挖掘关键人,画出拓展路径</text>
- </view>
- </view>
- <text class="section-link section-link-octopus" @tap="goOctopusEffectsList" v-if="currentView === 'self'">+ 感恩记录</text>
- </view>
- <OctopusDiagram
- ref="octopusDiagram"
- :selfId="selfId"
- :effects="octopusDiagramData"
- :expansions="currentView === 'family' ? [] : octopusExpansions"
- :interactive="true"
- :family-mode="currentView === 'family'"
- :member-legend="familyOctopusLegend"
- @effect-click="onEffectClick"
- @expansion-click="onExpansionClick"
- @add-effect="goOctopusAddEffect"
- @reanalyze="onReanalyze" />
- </view>
- <!-- 登录后:珍珠图(我有什么) -->
- <view class="section" v-if="isLoggedIn">
- <view class="section-header">
- <view class="section-title-wrap">
- <text class="help-icon" @tap="showHelp('珍珠图', '把可调用的资源串成珍珠项链——盘点我有什么。登记人脉、资源、信息缺口,画出一条清晰的成长珍珠链。')">?</text>
- <view>
- <text class="section-title">🫧 珍珠图</text>
- <text class="section-sub">把可调用的资源串成珍珠项链——盘点我有什么</text>
- </view>
- </view>
- <text class="section-link section-link-pearl" @tap="goPearlAddResource" v-if="currentView === 'self'">+ 登记</text>
- </view>
- <PearlDiagram
- ref="pearlDiagram"
- :selfId="selfId"
- :resources="pearlDiagramData"
- :overdue-map="currentView === 'family' ? null : overdueMap"
- :interactive="true"
- :family-mode="currentView === 'family'"
- :member-legend="familyPearlLegend"
- @add="goPearlAddResource"
- @delete="onDeletePearlResource" />
- </view>
- <!-- 登录后:能力图(谁会什么) -->
- <view class="section" v-if="isLoggedIn">
- <view class="section-header">
- <view class="section-title-wrap">
- <text class="help-icon" @tap="showHelp('能力图', '身边藏着什么技能——谁有能力帮到你。记录技能类帮助后,这里会画出大家的能力图谱。')">?</text>
- <view>
- <text class="section-title">💡 能力图</text>
- <text class="section-sub">身边藏着什么技能——谁有能力帮到你</text>
- </view>
- </view>
- <text class="section-link section-link-ability" @tap="goInteractionLog">+ 记录帮助</text>
- </view>
- <AbilityDiagram
- ref="abilityDiagram"
- :selfId="selfId"
- :abilities="abilityData"
- :interactive="true" />
- </view>
- <!-- 行6维关系域雷达图(登录后) -->
- <view class="section" v-if="isLoggedIn && currentMemberEnergies">
- <view class="section-header">
- <text class="section-title">🫂 关系质量</text>
- </view>
- <RadarChart
- :dimensions="actionDimensions"
- :scores="actionScores"
- :avg-scores="actionFamilyScores"
- :population-scores="actionPopulationScores"
- :fillColor="successColor"
- :gridColor="gridColor"
- :labelColor="labelColor"
- :width="580"
- :height="580" />
- </view>
- <!-- 功能入口 -->
- <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>
- <!-- 登录后:今日任务 -->
- <DimensionTasks
- v-if="isLoggedIn"
- :memberId="activeChildId"
- @taskClick="onTaskClick"
- @moreTasks="goTasks" />
- <!-- 登录后:活动 -->
- <DimensionActivities
- v-if="isLoggedIn"
- :isLoggedIn="true"
- @activityClick="goActivityDetail"
- @moreActivities="goMoreActivities" />
- <!-- 登录后:商品 -->
- <DimensionProducts
- v-if="isLoggedIn"
- :isLoggedIn="true"
- dimension-code="action"
- @productClick="goProductDetail"
- @moreProducts="goMoreProducts" />
- <!-- 行维度介绍卡片(登录后显示) -->
- <DimensionIntroCard dimCode="action" v-if="isLoggedIn" learn-more-url="/pages/action-detail/dimension-intro" />
- <!-- 底部占位 -->
- <view class="bottom-spacer"></view>
- <FloatingAvatar />
- <!-- 帮助说明弹窗 -->
- <view class="help-mask" v-if="helpPopup.visible" @tap="closeHelp">
- <view class="help-dialog" @tap.stop>
- <view class="help-dialog-header">
- <text class="help-dialog-title">{{ helpPopup.title }}</text>
- <text class="help-dialog-close" @tap="closeHelp">✕</text>
- </view>
- <text class="help-dialog-content">{{ helpPopup.content }}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { BrandColors } from '../../utils/brand-colors.js'
- import TabTransition from '../../components/tab-transition.vue'
- import PageBanner from '../../components/PageBanner.vue'
- import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
- import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
- import PearlDiagram from '@/pages/action-detail/components/PearlDiagram.vue'
- import AbilityDiagram from '@/pages/action-detail/components/AbilityDiagram.vue'
- import OctopusDiagram from '@/pages/action-detail/components/OctopusDiagram.vue'
- import MemberSelector from '@/components/MemberSelector.vue'
- import DimensionTasks from '../../components/DimensionTasks.vue'
- import DimensionActivities from '../../components/DimensionActivities.vue'
- import DimensionProducts from '../../components/DimensionProducts.vue'
- import DimensionIntroCard from '../../components/DimensionIntroCard.vue'
- import DimensionVisitorCard from '../../components/DimensionVisitorCard.vue'
- import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
- import RadarChart from '../../components/RadarChart.vue'
- import DimensionSubDims from './components/DimensionSubDims.vue'
- import DimensionPageSkeleton from '../../components/DimensionPageSkeleton.vue'
- import { getVisibleSections, getEnergyOverview, getChildren, getFamilyEnergySandbox, getEnergySandbox, getFamilyMemberList, getOctopusTentacles, getPearlResources, deletePearlResource, getAbilityMap, getRadarData, getPearlReminders, getOctopusEffects, getOctopusAnalysisSummary, getOctopusExpansionSuggest, getOctopusEffectKeyPersons, getFamilyPearlResources, getFamilyOctopusEffects } from '../../utils/api.js'
- import fontScaleMixin from '@/mixins/font-scale.js'
- export default {
- mixins: [fontScaleMixin],
- components: { TabTransition, PageBanner, FamilyEnergyBar, FamilyRelationGraph, PearlDiagram, AbilityDiagram, OctopusDiagram, MemberSelector, DimensionTasks, DimensionActivities, DimensionProducts, DimensionIntroCard, DimensionVisitorCard, FloatingAvatar, RadarChart, DimensionSubDims, DimensionPageSkeleton },
- data() {
- return {
- gridColor: BrandColors.emerald100,
- labelColor: BrandColors.emerald800,
- successColor: BrandColors.success,
- pageLoading: false,
- isLoggedIn: false,
- role: null,
- showTabTransition: true,
- activeChildId: null,
- selectedMemberId: null,
- activeChildName: '',
- userName: '',
- children: [],
- familyMembersVisible: [],
- childrenChecked: false,
- membersChecked: false,
- actionSubDims: [],
- sandboxData: null,
- actionPopulationScoreMap: {},
- currentView: 'self', // 'self' | 'family'
- dualDimension: null,
- selfId: null,
- visibleSections: [],
- pearlData: null,
- abilityData: null,
- octopusEffects: null,
- octopusExpansions: [],
- octopusKeyPersons: {},
- overdueMap: null,
- // 家庭汇集数据
- familyPearlData: null,
- familyOctopusEffects: null,
- familyLoading: false,
- // 帮助弹窗
- helpPopup: { visible: false, title: '', content: '' },
- funcList: [
- { icon: '\u{1F4AC}', label: '记录互动', needLogin: true, page: '/pages/action-detail/interaction-log' },
- { icon: '\u{1F4DD}', label: '关系问卷', needLogin: true, page: '/pages/action-detail/relationship-questionnaire' },
- { icon: '\u{1F465}', label: '家庭成员', needLogin: true, page: '/pages/profile-extra/family-members' },
- { icon: '\u{1F4CB}', label: '任务中心', needLogin: true, page: '/pages/tasks/tasks' }
- ]
- }
- },
- computed: {
- /** 关系图谱:成员节点(来自沙盘数据) */
- graphMembers: function() {
- if (!this.sandboxData || !this.sandboxData.members) return []
- return this.sandboxData.members.map(function(m) {
- return {
- id: m.memberId || m.id,
- nickname: m.name || m.nickname || '成员',
- memberType: m.memberType || 'child'
- }
- })
- },
- /** 关系图谱:节点能量映射 */
- energyMapForGraph: function() {
- var map = {}
- if (this.sandboxData && this.sandboxData.members) {
- for (var i = 0; i < this.sandboxData.members.length; i++) {
- var m = this.sandboxData.members[i]
- map[m.memberId || m.id] = {
- bodyScore: m.bodyScore || 0,
- mindScore: m.mindScore || 0,
- actionScore: m.actionScore || 0
- }
- }
- }
- return map
- },
- intimacyMapForGraph: function() {
- return {}
- },
- /** 每月引导语 */
- monthlyGuidance: function() {
- var month = new Date().getMonth()
- var messages = [
- '一月:新年伊始,增进家庭沟通',
- '二月:春节团聚,珍惜亲子时光',
- '三月:春暖花开,多陪伴成员',
- '四月:清明踏青,共享家庭活动',
- '五月:劳动教育,培养家庭责任感',
- '六月:儿童节,倾听成员心声',
- '七月:暑期陪伴,增进亲子关系',
- '八月:开学准备,共同规划',
- '九月:新学期,建立家庭规则',
- '十月:国庆假期,家庭协作时光',
- '十一月:感恩季节,表达家庭关爱',
- '十二月:年终总结,回顾家庭成长'
- ]
- return messages[month] || messages[0]
- },
- /** 当前选中成员的能量数据(从 sandboxData.members 中查找) */
- currentMemberEnergies: function() {
- if (!this.sandboxData || !this.sandboxData.members) return null
- var members = this.sandboxData.members
- var targetId = this.selectedMemberId || this.activeChildId
- for (var i = 0; i < members.length; i++) {
- var m = members[i]
- if (m && (m.memberId === targetId)) return m
- }
- return members[0] || null
- },
- /** 行6维关系域维度定义(根据角色切换本人版/成员版) */
- actionDimensions: function() {
- var role = this.role || uni.getStorageSync('currentRole') || ''
- var isParent = (role === 'parent')
- if (isParent) {
- return [
- { key: 'actionParentChild', label: '亲子关系' },
- { key: 'actionMarital', label: '夫妻关系' },
- { key: 'actionParental', label: '父母关系' },
- { key: 'actionLeadership', label: '领导关系' },
- { key: 'actionSociality', label: '社会性' },
- { key: 'actionInterpersonal', label: '人际韧性' }
- ]
- } else {
- return [
- { key: 'actionChildParentChild', label: '亲子关系' },
- { key: 'actionSibling', label: '同胞关系' },
- { key: 'actionRelative', label: '亲属关系' },
- { key: 'actionTeacherStudent', label: '师生关系' },
- { key: 'actionChildSociality', label: '社会性' },
- { key: 'actionChildInterpersonal', label: '人际韧性' }
- ]
- }
- },
- /** 当前选中成员的行维度分数 */
- actionScore: function() {
- var member = this.currentMemberEnergies
- return member ? (member.actionScore || 0) : null
- },
- /** 行6维分值(从当前成员中提取,与 dimensions 顺序对应) */
- actionScores: function() {
- var member = this.currentMemberEnergies
- if (!member) return []
- var dims = this.actionDimensions
- var scores = []
- for (var i = 0; i < dims.length; i++) {
- scores.push(member[dims[i].key] || 0)
- }
- return scores
- },
- /** 行6维家庭平均分(从 sandboxData.members 各成员同维度均值) */
- actionFamilyScores: function() {
- if (!this.sandboxData || !this.sandboxData.members) return []
- var members = this.sandboxData.members
- var dims = this.actionDimensions
- var scores = []
- for (var i = 0; i < dims.length; i++) {
- var key = dims[i].key
- var sum = 0, count = 0
- for (var j = 0; j < members.length; j++) {
- var val = members[j][key]
- if (val !== undefined && val !== null && val > 0) { sum += val; count++ }
- }
- scores.push(count > 0 ? Math.round(sum / count) : 0)
- }
- return scores
- },
- /** 行6维人群位置分数(按 actionDimensions 顺序从 map 取值) */
- actionPopulationScores: function() {
- var dims = this.actionDimensions
- var scores = []
- for (var i = 0; i < dims.length; i++) {
- scores.push(this.actionPopulationScoreMap[dims[i].key] || 0)
- }
- return scores
- },
- /** 关系解读状态:good(≥80) | warn(≥60) | bad(<60) */
- scoreExplainLevel: function() {
- var s = this.actionScore
- if (s == null) return 'bad'
- if (s >= 80) return 'good'
- if (s >= 60) return 'warn'
- return 'bad'
- },
- /** 关系解读卡片状态类(用于 :class 绑定) */
- scoreExplainClass: function() {
- return 'score-explain-' + this.scoreExplainLevel
- },
- actionPortrait: function() {
- var self = this
- if (!this.isLoggedIn) return null
- var member = this.currentMemberEnergies
- if (!member) return null
- var role = this.role || uni.getStorageSync('currentRole') || ''
- var isParent = (role === 'parent')
- var parentDims = [
- { key: 'actionParentChild', label: '亲子关系', color: BrandColors.success, desc: '与子女的沟通与陪伴质量' },
- { key: 'actionMarital', label: '夫妻关系', color: BrandColors.mind, desc: '夫妻间的理解与支持' },
- { key: 'actionParental', label: '父母关系', color: BrandColors.wealth, desc: '与长辈的相处模式' },
- { key: 'actionLeadership', label: '领导关系', color: BrandColors.wisdom, desc: '职场上下级沟通能力' },
- { key: 'actionSociality', label: '社会性', color: BrandColors.body, desc: '社会交往与参与度' },
- { key: 'actionInterpersonal', label: '人际韧性', color: BrandColors.cyan500, desc: '应对人际关系挫折的能力' }
- ]
- var childDims = [
- { key: 'actionChildParentChild', label: '亲子关系', color: BrandColors.success, desc: '与父母的互动质量' },
- { key: 'actionSibling', label: '同胞关系', color: BrandColors.mind, desc: '兄弟姐妹间的关系' },
- { key: 'actionRelative', label: '亲属关系', color: BrandColors.wealth, desc: '与亲戚的交往频率' },
- { key: 'actionTeacherStudent', label: '师生关系', color: BrandColors.wisdom, desc: '与老师的沟通情况' },
- { key: 'actionChildSociality', label: '社会性', color: BrandColors.body, desc: '学校与社会参与度' },
- { key: 'actionChildInterpersonal', label: '人际韧性', color: BrandColors.cyan500, desc: '应对社交困难的能力' }
- ]
- var dims = isParent ? parentDims : childDims
- 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 = member[key] || 0
- if (isNaN(score)) score = 0
- score = Math.max(0, Math.min(100, Number(score)))
- total += score
- count++
- dimList.push({
- code: key,
- name: dims[i].label,
- score: Math.round(score),
- color: dims[i].color,
- desc: dims[i].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
- },
- /** 当前是否处于「全家」汇集视图 */
- isFamilyView: function() {
- return this.currentView === 'family'
- },
- /** 珍珠图数据源:family 视图取家庭汇集(members 合并展开),否则取个人数据 */
- pearlDiagramData: function() {
- if (this.currentView === 'family') {
- return this.familyPearlDiagram
- }
- return this.pearlData
- },
- /** 章鱼图数据源:family 视图取家庭汇集(members 合并展开),否则取个人数据 */
- octopusDiagramData: function() {
- if (this.currentView === 'family') {
- return this.familyOctopusDiagram
- }
- return this.octopusEffects
- },
- /** 家庭珍珠图:将 members[].items 合并展开为 PearlDiagram 可消费结构,每项带成员标注 */
- familyPearlDiagram: function() {
- if (!this.familyPearlData) return null
- var members = this.familyPearlData.members
- if (!members || !Array.isArray(members)) return null
- var groupMap = {}
- var groupOrder = []
- for (var i = 0; i < members.length; i++) {
- var m = members[i]
- if (!m || !Array.isArray(m.items)) continue
- for (var j = 0; j < m.items.length; j++) {
- var item = m.items[j]
- if (!item) continue
- // 归属组:优先按连接类型/资源类型字段归组,缺失则归入 INFO(历史资源)
- var type = item.connectionType || item.type || item.groupType || 'INFO'
- var stamped = Object.assign({}, item, {
- memberId: m.memberId,
- memberName: m.memberName || '',
- memberType: m.memberType || '',
- colorKey: m.colorKey || ''
- })
- if (!groupMap[type]) {
- groupMap[type] = { type: type, typeName: item.groupTypeName || item.typeName || type, items: [] }
- groupOrder.push(type)
- }
- groupMap[type].items.push(stamped)
- }
- }
- var groups = []
- for (var k = 0; k < groupOrder.length; k++) {
- groups.push(groupMap[groupOrder[k]])
- }
- return { groups: groups, legacyGroups: [] }
- },
- /** 家庭章鱼图:将 members[].effects 合并展开为 OctopusDiagram 可消费结构,每项带成员标注 */
- familyOctopusDiagram: function() {
- if (!this.familyOctopusEffects) return null
- var members = this.familyOctopusEffects.members
- if (!members || !Array.isArray(members)) return null
- var list = []
- for (var i = 0; i < members.length; i++) {
- var m = members[i]
- if (!m || !Array.isArray(m.effects)) continue
- for (var j = 0; j < m.effects.length; j++) {
- var effect = m.effects[j]
- if (!effect) continue
- list.push(Object.assign({}, effect, {
- memberId: m.memberId,
- memberName: m.memberName || '',
- memberType: m.memberType || '',
- colorKey: m.colorKey || ''
- }))
- }
- }
- return { list: list }
- },
- /** 珍珠图成员图例(家庭视图) */
- familyPearlLegend: function() {
- if (!this.familyPearlData || !this.familyPearlData.members) return []
- return this.familyPearlData.members.map(function(m) {
- return { memberId: m.memberId, name: m.memberName || '成员', colorKey: m.colorKey || '', memberType: m.memberType || '' }
- })
- },
- /** 章鱼图成员图例(家庭视图) */
- familyOctopusLegend: function() {
- if (!this.familyOctopusEffects || !this.familyOctopusEffects.members) return []
- return this.familyOctopusEffects.members.map(function(m) {
- return { memberId: m.memberId, name: m.memberName || '成员', colorKey: m.colorKey || '', memberType: m.memberType || '' }
- })
- }
- },
- 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.selfId = uni.getStorageSync('userId') || null
- }
- this.loadSectionConfig()
- if (this.isLoggedIn) {
- this.loadChildren()
- this.loadFamilyMembersVisible()
- this.loadPearlResources()
- this.loadAbilityMap()
- this.loadOctopusData()
- this.loadActionRadarPopulationData()
- }
- this._watchPageReady()
- },
- methods: {
- loadSectionConfig: function() {
- var baseSections = ['func_entries']
- if (!uni.getStorageSync('token')) {
- this.visibleSections = baseSections
- return
- }
- var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || null
- var self = this
- getVisibleSections({ pageKey: 'action', 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']
- })
- },
- loadChildren: function() {
- var self = this
- getChildren().then(function(res) {
- if (res.code === 200 && res.data) {
- self.children = res.data
- var savedChildId = uni.getStorageSync('currentChildId')
- var found = false
- for (var i = 0; i < self.children.length; i++) {
- if (self.children[i].memberId === savedChildId) {
- self.activeChildId = savedChildId
- self.activeChildName = self.children[i].name || self.children[i].nickname || '成员'
- found = true
- break
- }
- }
- if (!found && self.children.length > 0) {
- self.activeChildId = self.children[0].memberId
- self.activeChildName = self.children[0].name || self.children[0].nickname || '成员'
- uni.setStorageSync('currentChildId', self.activeChildId)
- }
- if (self.activeChildId) {
- self.loadDashboardData()
- }
- }
- self.childrenChecked = true
- }).catch(function(e) {
- console.log('获取成员列表失败', e)
- self.childrenChecked = true
- })
- },
- loadDashboardData: function() {
- if (!this.activeChildId) return
- this.loadEnergyData()
- this.loadSandboxData()
- },
- loadSandboxData: function() {
- var self = this
- getFamilyEnergySandbox().then(function(res) {
- if (res && res.data) {
- self.sandboxData = res.data
- }
- }).catch(function(e) {
- console.log('获取沙盘数据失败', e)
- })
- },
- loadActionRadarPopulationData: function() {
- var self = this
- var memberId = this.selectedMemberId || this.activeChildId
- if (!memberId) return
- getRadarData({
- memberId: memberId,
- dimensions: ['actionParentChild','actionMarital','actionParental','actionLeadership','actionSociality','actionInterpersonal',
- 'actionChildParentChild','actionSibling','actionRelative','actionTeacherStudent','actionChildSociality','actionChildInterpersonal']
- }).then(function(res) {
- if (res && res.data && res.data.populationScores) {
- var dims = res.data.dimensions || []
- var scores = res.data.populationScores
- var map = {}
- for (var i = 0; i < dims.length && i < scores.length; i++) {
- map[dims[i]] = scores[i]
- }
- self.actionPopulationScoreMap = map
- }
- }).catch(function(e) { console.warn('[action] radar-data failed', e) })
- },
- switchView: function(view) {
- this.currentView = view
- var self = this
- if (view === 'family') {
- this.selectedMemberId = null
- // 全家视图:同时加载家庭汇集珍珠图/章鱼图(只读合并展示)
- this.loadFamilyCollectData()
- getEnergySandbox('family').then(function(res) {
- if (res && res.data && !res.data.locked) {
- self.sandboxData = res.data.familyData || res.data
- }
- }).catch(function(e) { console.log('获取家庭数据失败', e) })
- } else {
- // 切回自己视图:恢复个人珍珠图/章鱼图数据
- this.loadSandboxData()
- this.loadPearlResources()
- this.loadOctopusData()
- }
- },
- /** 加载家庭汇集珍珠图/章鱼图数据(Promise.all 并发,任一失败不白屏) */
- loadFamilyCollectData: function() {
- var self = this
- this.familyLoading = true
- Promise.all([getFamilyPearlResources(), getFamilyOctopusEffects()]).then(function(resArr) {
- var pearlRes = resArr[0]
- var octopusRes = resArr[1]
- self.familyPearlData = (pearlRes && pearlRes.code === 200 && pearlRes.data) ? pearlRes.data : null
- self.familyOctopusEffects = (octopusRes && octopusRes.code === 200 && octopusRes.data) ? octopusRes.data : null
- self.familyLoading = false
- }).catch(function(e) {
- console.log('获取家庭汇集数据失败', e)
- self.familyPearlData = null
- self.familyOctopusEffects = null
- self.familyLoading = false
- })
- },
- loadEnergyData: function() {
- var self = this
- getEnergyOverview(this.activeChildId).then(function(res) {
- if (res && res.data) {
- var dims = res.data.dimensions
- if (dims && dims.length > 0) {
- for (var i = 0; i < dims.length; i++) {
- if (dims[i].code === 'action') {
- self.dualDimension = dims[i]
- break
- }
- }
- }
- }
- }).catch(function(e) {
- console.log('获取能量概览失败', e)
- })
- },
- onFamilyMemberSelect: function(member) {
- this.selectedMemberId = member.id
- },
- loadFamilyMembersVisible: function() {
- var self = this
- getFamilyMemberList({ visibleOnly: true }).then(function(res) {
- self.familyMembersVisible = res.data || []
- self.membersChecked = true
- }).catch(function(e) {
- console.log('获取可见家庭成员失败', e)
- self.familyMembersVisible = []
- self.membersChecked = true
- })
- },
- sectionVisible: function(key) {
- return this.visibleSections.length === 0 || this.visibleSections.indexOf(key) !== -1
- },
- // 登录浮层成功回调:刷新行动维度数据
- onLoginSuccess: function() {
- this.loadDashboardData()
- },
- onFuncClick: function(item) {
- if (item.needLogin && !this.isLoggedIn) {
- uni.showModal({
- title: '提示',
- content: '请先登录后使用此功能',
- success: (res) => {
- if (res.confirm) this.openLoginSheet()
- }
- })
- return
- }
- if (item.page) uni.navigateTo({ url: item.page })
- },
- /** 加载珍珠图数据 */
- loadPearlResources: function() {
- var self = this
- getPearlResources().then(function(res) {
- self.pearlData = (res.code === 200 && res.data) ? res.data : null
- }).catch(function(e) {
- console.log('获取珍珠图数据失败', e)
- self.pearlData = null
- })
- // 构建逾期映射
- getPearlReminders().then(function(res) {
- var map = {}
- if (res.code === 200 && res.data) {
- for (var i = 0; i < res.data.length; i++) {
- map['' + res.data[i].resourceItemId] = res.data[i].daysSinceLast
- }
- }
- self.overdueMap = map
- }).catch(function(e) {
- self.overdueMap = null
- })
- },
- /** 登记珍珠图资源入口 */
- goPearlAddResource: function() {
- uni.navigateTo({ url: '/pages/action-detail/pearl-add-resource' })
- },
- /** 能力图记录帮助入口(跳转互动记录,记录技能类帮助) */
- goInteractionLog: function() {
- uni.navigateTo({ url: '/pages/action-detail/interaction-log' })
- },
- /** 删除珍珠图资源 */
- onDeletePearlResource: function(item) {
- if (!item || !item.id) return
- var self = this
- uni.showModal({
- title: '提示',
- content: '确定删除该资源吗?',
- success: function(res) {
- if (!res.confirm) return
- deletePearlResource({ itemId: item.id }).then(function(r) {
- if (r.code === 200) {
- uni.showToast({ title: '已删除', icon: 'success' })
- self.loadPearlResources()
- } else {
- uni.showToast({ title: r.message || '删除失败', icon: 'none' })
- }
- }).catch(function(e) {
- console.log('删除珍珠图资源失败', e)
- uni.showToast({ title: '删除失败', icon: 'none' })
- })
- }
- })
- },
- /** 加载能力图数据 */
- loadAbilityMap: function() {
- var self = this
- getAbilityMap().then(function(res) {
- self.abilityData = (res.code === 200 && Array.isArray(res.data)) ? res.data : []
- }).catch(function(e) {
- console.log('获取能力图数据失败', e)
- self.abilityData = []
- })
- },
- /** 加载章鱼图数据 */
- loadOctopusData: function() {
- var self = this
- getOctopusEffects().then(function(res) {
- self.octopusEffects = (res.code === 200 && res.data) ? res.data : null
- }).catch(function(e) {
- console.log('获取章鱼图数据失败', e)
- self.octopusEffects = null
- })
- getOctopusAnalysisSummary().then(function(res) {
- if (res.code === 200 && res.data && res.data.directions) {
- self.octopusExpansions = res.data.directions
- }
- }).catch(function(e) {
- console.log('获取拓展方向失败', e)
- })
- },
- /** 跳转成效录入页 */
- goOctopusAddEffect: function() {
- uni.navigateTo({ url: '/pages/action-detail/octopus-add-effect' })
- },
- /** 跳转感恩记录维护列表 */
- goOctopusEffectsList: function() {
- uni.navigateTo({ url: '/pages/action-detail/octopus-effects-list' })
- },
- /** 点击成效节点 */
- onEffectClick: function(effect) {
- var self = this
- if (!self.octopusKeyPersons[effect.id]) {
- getOctopusEffectKeyPersons({ effectId: effect.id }).then(function(res) {
- if (res.code === 200) self.$set(self.octopusKeyPersons, effect.id, res.data || [])
- }).catch(function(e) { console.log('获取关键人失败', e) })
- }
- },
- /** 点击拓展方向节点 */
- onExpansionClick: function(expansion) {
- var prefill = encodeURIComponent(JSON.stringify(expansion.prefill || {}))
- uni.navigateTo({ url: '/pages/action-detail/octopus-add-key-person?prefill=' + prefill })
- },
- /** 重新分析 */
- onReanalyze: function() {
- this.loadOctopusData()
- },
- /** 显示帮助弹窗 */
- showHelp: function(title, content) {
- this.helpPopup = { visible: true, title: title, content: content }
- },
- closeHelp: function() {
- this.helpPopup.visible = false
- },
- onTaskClick: function(task) {
- uni.navigateTo({ url: '/pages/tasks/tasks' })
- },
- goActivityDetail: function(act) {
- if (act && act.id) uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
- },
- goMoreActivities: function() {
- uni.navigateTo({ url: '/pages/activity/index' })
- },
- goProductDetail: function(prod) {
- if (prod && prod.id) uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
- },
- goMoreProducts: function() {
- uni.navigateTo({ url: '/pages/shop/index/index' })
- },
- goTasks: function() {
- uni.navigateTo({ url: '/pages/tasks/tasks' })
- },
- _watchPageReady() {
- var self = this
- var unwatch = this.$watch(function() {
- if (self.isLoggedIn) {
- return !!(self.dualDimension || self.sandboxData)
- }
- return true
- }, function(val) {
- if (val) {
- if (unwatch) unwatch()
- if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
- }
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- // 薄荷极浅底(单页专有;vs $status-success-tint $status-success-tint 全局浅档)
- $c-tint-mint-wash: #E6FFF2;
- // 页面级局部调色板:仅本页专有色阶,跨页共性一律走 uni.scss 全局令牌
- // 信息蓝
- $c-info: $uni-info;
- $c-action-light: $status-success-light-3;
- $c-action-lighter: $status-success-light-2;
- // 信息蓝·亮阶
- $c-info-light: $status-info-light;
- // 危险·亮阶(渐变尾)
- $c-danger-light: $status-danger-light;
- // 次级文字
- $c-text-soft: $uni-text-color-secondary;
- // 深次级文字
- $c-text-deep: $facade-text-slate-deep;
- // 下沉底 / 分隔
- $c-surface-sunken: $facade-fill-slate;
- // 成功·亮阶(渐变尾)
- $c-success-light: $status-success-light;
- // 薄荷极浅底
- $c-tint-mint: $c-tint-mint-wash;
- .container {
- min-height: 100vh;
- background: linear-gradient(180deg, $dim-action-tint 0%, $app-bg 40%);
- padding-bottom: 120rpx;
- }
- /* 品牌定位语 */
- .brand-strap {
- margin: 24rpx $uni-space-lg 0;
- padding: 28rpx 32rpx;
- background: linear-gradient(135deg, $dim-action 0%, $c-action-light 50%, $c-action-lighter 100%);
- border-radius: 24rpx;
- box-shadow: 0 8rpx 24rpx rgba(16, 185, 129, 0.25);
- position: relative;
- overflow: hidden;
- }
- .brand-strap::before {
- content: '';
- position: absolute;
- top: -30rpx;
- right: -30rpx;
- width: 120rpx;
- height: 120rpx;
- background: rgba(255, 255, 255, 0.15);
- border-radius: 50%;
- }
- .brand-strap::after {
- content: '';
- position: absolute;
- bottom: -20rpx;
- left: 20rpx;
- width: 60rpx;
- height: 60rpx;
- background: rgba(255, 255, 255, 0.1);
- border-radius: 50%;
- }
- .brand-strap-text {
- font-size: calc(30rpx * var(--font-scale, 1));
- color: $app-surface;
- font-weight: 600;
- text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
- position: relative;
- z-index: 1;
- }
- /* 每月引导语 */
- .monthly-guidance {
- margin: 20rpx $uni-space-lg 0;
- padding: 24rpx 28rpx;
- background: linear-gradient(135deg, $app-surface 0%, $dim-action-tint 100%);
- border-radius: 24rpx;
- border: 1rpx solid rgba(16, 185, 129, 0.15);
- box-shadow: 0 4rpx 16rpx rgba(16, 185, 129, 0.08);
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .guidance-icon { font-size: calc(36rpx * var(--font-scale, 1)); }
- .guidance-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $status-success-strong;
- font-weight: 500;
- }
- /* ===== 通用区块 ===== */
- .section {
- margin: 24rpx $uni-space-lg 0;
- position: relative;
- }
- .section::before {
- content: '';
- position: absolute;
- top: 0;
- left: 24rpx;
- right: 24rpx;
- height: 3rpx;
- border-radius: 8rpx 8rpx 0 0;
- background: linear-gradient(90deg, $dim-action, $c-action-light);
- opacity: 0.7;
- }
- .section-header {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 12rpx;
- }
- .section-title-wrap {
- display: flex;
- flex-direction: row;
- align-items: center;
- gap: 8rpx;
- border-left: 8rpx solid $dim-action;
- padding-left: 16rpx;
- }
- .help-icon {
- position: relative;
- width: 36rpx;
- height: 36rpx;
- border-radius: 50%;
- border: 2rpx solid $app-border-strong;
- color: $app-text-muted;
- font-size: calc(22rpx * var(--font-scale, 1));
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- transition: opacity 0.2s $ease-standard, transform 0.2s $ease-standard;
- background: $app-surface;
- }
- /* 触摸目标扩展至 88rpx(微信最小可点区域):帮助图标 36x36 -> 88x88,视觉零变化 */
- .help-icon::after {
- content: '';
- position: absolute;
- left: -26rpx;
- right: -26rpx;
- top: -26rpx;
- bottom: -26rpx;
- }
- .help-icon:active {
- border-color: $dim-action;
- color: $dim-action;
- background: $dim-action-tint;
- transform: scale(1.1);
- }
- .section-title {
- font-size: calc(34rpx * var(--font-scale, 1));
- font-weight: 700;
- color: $app-text;
- letter-spacing: 0.5rpx;
- }
- .section-sub {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- margin-top: 4rpx;
- line-height: 1.4;
- }
- .section-link {
- display: inline-flex;
- align-items: center;
- padding: 12rpx 28rpx;
- border-radius: 24rpx;
- font-size: calc(24rpx * var(--font-scale, 1));
- font-weight: 500;
- white-space: nowrap;
- transition: opacity 0.2s $ease-standard, transform 0.2s $ease-standard;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
- }
- .section-link:active {
- opacity: 0.85;
- transform: scale(0.98);
- }
- .section-link-octopus {
- background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
- color: $app-surface;
- box-shadow: 0 4rpx 16rpx rgba(249,115,22,0.3);
- }
- .section-link-pearl {
- background: linear-gradient(135deg, $c-info, $c-info-light);
- color: $app-surface;
- box-shadow: 0 4rpx 16rpx rgba(14,165,233,0.3);
- }
- .section-link-ability {
- background: linear-gradient(135deg, $dim-action, $c-action-light);
- color: $app-surface;
- box-shadow: 0 4rpx 16rpx rgba(16,185,129,0.3);
- }
- /* 关系解读卡片 — 状态色 */
- .score-explain-card {
- background: linear-gradient(135deg, $app-surface 0%, $dim-action-tint 100%);
- border-radius: 24rpx;
- padding: 28rpx 32rpx;
- border: 1rpx solid rgba(16, 185, 129, 0.12);
- box-shadow: 0 4rpx 16rpx rgba(16, 185, 129, 0.08);
- }
- .score-explain-good {
- background: linear-gradient(135deg, $app-surface 0%, $status-success-soft 100%);
- border-color: rgba(16, 185, 129, 0.25);
- box-shadow: 0 4rpx 20rpx rgba(16, 185, 129, 0.15);
- }
- .score-explain-warn {
- background: linear-gradient(135deg, $app-surface 0%, $status-warning-soft 100%);
- border-color: rgba(245, 158, 11, 0.25);
- box-shadow: 0 4rpx 20rpx rgba(245, 158, 11, 0.12);
- }
- .score-explain-bad {
- background: linear-gradient(135deg, $app-surface 0%, $status-danger-soft 100%);
- border-color: rgba(239, 68, 68, 0.25);
- box-shadow: 0 4rpx 20rpx rgba(239, 68, 68, 0.12);
- }
- .explain-header {
- display: flex;
- flex-direction: row;
- align-items: center;
- gap: 16rpx;
- margin-bottom: 12rpx;
- }
- .explain-icon-wrap {
- width: 56rpx;
- height: 56rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-shrink: 0;
- transition: transform 0.2s;
- }
- .explain-icon-wrap:active { transform: scale(0.95); }
- .explain-icon-good { background: linear-gradient(135deg, $dim-action, $c-action-light); box-shadow: 0 4rpx 12rpx rgba(16,185,129,0.3); }
- .explain-icon-warn { background: linear-gradient(135deg, $dim-wealth, $status-warning); box-shadow: 0 4rpx 12rpx rgba(245,158,11,0.3); }
- .explain-icon-bad { background: linear-gradient(135deg, $status-danger, $c-danger-light); box-shadow: 0 4rpx 12rpx rgba(239,68,68,0.3); }
- .explain-icon {
- font-size: calc(28rpx * var(--font-scale, 1));
- color: $app-surface;
- font-weight: 700;
- }
- .explain-info {
- display: flex;
- flex-direction: column;
- }
- .explain-title {
- font-size: calc(28rpx * var(--font-scale, 1));
- font-weight: 600;
- color: $app-text;
- line-height: 1.3;
- }
- .explain-score {
- font-size: calc(48rpx * var(--font-scale, 1));
- font-weight: $uni-font-weight-extra-heavy;
- line-height: 1;
- letter-spacing: -2rpx;
- }
- .score-explain-good .explain-score { color: $dim-action; }
- .score-explain-warn .explain-score { color: $status-warning-deep; }
- .score-explain-bad .explain-score { color: $status-danger-deep; }
- .explain-score-unit {
- font-size: calc(24rpx * var(--font-scale, 1));
- font-weight: 500;
- color: $app-text-subtle;
- margin-left: 2rpx;
- letter-spacing: 0;
- }
- .explain-text {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $c-text-soft;
- line-height: 1.7;
- }
- /* 帮助说明弹窗 */
- .help-mask {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.5);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 999;
- }
- .help-dialog {
- background: $app-surface;
- border-radius: 24rpx;
- width: 85%;
- max-width: 520rpx;
- max-height: 75vh;
- overflow: hidden;
- box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
- }
- .help-dialog-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 28rpx 32rpx 20rpx;
- border-bottom: 1rpx solid $c-surface-sunken;
- background: linear-gradient(135deg, $dim-action-tint, $app-surface);
- }
- .help-dialog-title {
- font-size: calc(32rpx * var(--font-scale, 1));
- font-weight: 700;
- color: $app-text;
- }
- .help-dialog-close {
- position: relative;
- font-size: calc(36rpx * var(--font-scale, 1));
- color: $app-text-subtle;
- cursor: pointer;
- width: 48rpx;
- height: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 50%;
- transition: background 0.2s;
- }
- /* 触摸目标扩展至 88rpx(微信最小可点区域):关闭按钮 48x48 -> 88x88,视觉零变化 */
- .help-dialog-close::after {
- content: '';
- position: absolute;
- left: -20rpx;
- right: -20rpx;
- top: -20rpx;
- bottom: -20rpx;
- }
- .help-dialog-close:active {
- background: $c-surface-sunken;
- }
- .help-dialog-content {
- padding: 28rpx 32rpx;
- font-size: calc(28rpx * var(--font-scale, 1));
- color: $c-text-soft;
- line-height: 1.8;
- }
- /* 功能入口网格 */
- .func-section {
- margin: 24rpx $uni-space-lg 0;
- }
- .func-grid {
- display: flex;
- flex-direction: row;
- justify-content: space-around;
- background: linear-gradient(135deg, $app-surface 0%, $dim-action-tint 100%);
- border-radius: 24rpx;
- padding: 32rpx 16rpx;
- box-shadow: 0 8rpx 24rpx rgba(16, 185, 129, 0.1);
- border: 1rpx solid rgba(16, 185, 129, 0.08);
- }
- .func-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- flex: 1;
- padding: 8rpx;
- }
- .func-icon-wrap {
- width: 96rpx;
- height: 96rpx;
- border-radius: 24rpx;
- background: linear-gradient(135deg, $status-success-soft, $c-success-light);
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 12rpx;
- box-shadow: 0 4rpx 12rpx rgba(16, 185, 129, 0.15);
- transition: opacity 0.2s $ease-standard, transform 0.2s $ease-standard;
- }
- .func-item:active .func-icon-wrap {
- transform: scale(0.95);
- box-shadow: 0 2rpx 8rpx rgba(16, 185, 129, 0.2);
- }
- .func-icon {
- font-size: calc(44rpx * var(--font-scale, 1));
- }
- .func-label {
- font-size: calc(24rpx * var(--font-scale, 1));
- color: $c-text-deep;
- font-weight: 500;
- }
- .bottom-spacer {
- height: 40rpx;
- }
- /* 维度画像样式 */
- .dimension-portrait-section {
- margin: 24rpx $uni-space-lg;
- background: $app-surface;
- border-radius: 24rpx;
- padding: 32rpx 24rpx;
- box-shadow: 0 4rpx 20rpx rgba(16, 185, 129, 0.12);
- border: 2rpx solid rgba(16, 185, 129, 0.1);
- }
- .portrait-tier {
- font-size: calc(26rpx * var(--font-scale, 1));
- color: $dim-action;
- 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));
- background: linear-gradient(135deg, $status-success-soft, $c-success-light);
- }
- .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-action;
- margin-right: 12rpx;
- }
- .portrait-dim-bar-track {
- height: 10rpx;
- background: $status-success-soft;
- 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-secondary;
- display: block;
- }
- .portrait-tip {
- padding: 16rpx 20rpx;
- background: linear-gradient(135deg, $dim-action-tint, $c-tint-mint);
- border-radius: 16rpx;
- border-left: 8rpx solid $dim-action;
- margin-top: 16rpx;
- }
- .portrait-tip-text {
- font-size: calc(22rpx * var(--font-scale, 1));
- color: $status-success-strong;
- line-height: 1.5;
- }
- </style>
|