| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666 |
- <template>
- <view>
- <!-- 冷启动 splash overlay — 覆盖首页直到数据加载完毕(tab 切回时不显示) -->
- <view class="splash-overlay" :class="{'fade-out': splashOverlayFading}" v-if="splashOverlay || splashOverlayFading">
- <view class="splash-overlay-bg">
- <view class="bg-circle bg-circle-1"></view>
- <view class="bg-circle bg-circle-2"></view>
- <view class="bg-circle bg-circle-3"></view>
- </view>
- <view class="splash-overlay-body">
- <view class="splash-logo-wrap">
- <image class="splash-logo-img" src="/static/logo.png" mode="aspectFit" />
- </view>
- <text class="splash-brand-name">浠艾福</text>
- <text class="splash-brand-en">Care Family</text>
- <view class="splash-dims-row">
- <view class="splash-dim-item">
- <view class="splash-dim-circle" style="background:rgba(255,140,66,0.3);"><text class="splash-dim-icon">🌏</text></view>
- <text class="splash-dim-label">身</text>
- </view>
- <view class="splash-dim-item">
- <view class="splash-dim-circle" style="background:rgba(255,107,157,0.3);"><text class="splash-dim-icon">🔥</text></view>
- <text class="splash-dim-label">心</text>
- </view>
- <view class="splash-dim-item">
- <view class="splash-dim-circle" style="background:rgba(99,102,241,0.3);"><text class="splash-dim-icon">⚡</text></view>
- <text class="splash-dim-label">智</text>
- </view>
- <view class="splash-dim-item">
- <view class="splash-dim-circle" style="background:rgba(16,185,129,0.3);"><text class="splash-dim-icon">🌿</text></view>
- <text class="splash-dim-label">行</text>
- </view>
- <view class="splash-dim-item">
- <view class="splash-dim-circle" style="background:rgba(245,158,11,0.3);"><text class="splash-dim-icon">💧</text></view>
- <text class="splash-dim-label">富</text>
- </view>
- </view>
- <text class="splash-tagline">给全家的一站式幸福提案</text>
- <view class="splash-overlay-loading">
- <view class="splash-overlay-dot"></view>
- <view class="splash-overlay-dot"></view>
- <view class="splash-overlay-dot"></view>
- </view>
- </view>
- </view>
- <!-- Tabbar 切换过渡页 -->
- <tab-transition v-if="showTabTransition" dimCode="action" />
- <!-- 登录态 — 直接内嵌,保持底签可见 -->
- <view v-if="currentRole" class="logged-in-container">
- <!-- 品牌头部 -->
- <PageBanner theme="action"
- tagline="知行合一 · 快乐成长"
- quote="千里之行,始于足下" />
- <!-- 能量沙盘 — Canvas 五行星图 -->
- <WuxingSandbox
- v-if="sandboxData"
- mode="live"
- :scores="sandboxScores"
- :overallScore="sandboxData.overallScore || 0"
- :members="sandboxData.members || []"
- showDimensionBar
- starHeight="480rpx" />
- <!-- 家庭成员选择条 -->
- <FamilyMemberStrip
- :members="familyMembersVisible"
- :selectedMemberId="selectedMemberId"
- :energyMap="energyMapForGraph"
- @select="onFamilyMemberSelect" />
- <!-- 五维能量条 -->
- <FamilyEnergyBar
- v-if="sandboxData"
- dimensionCode="action"
- :sandboxData="sandboxData"
- :dualDimension="dualDimension" />
- <!-- 家庭挑战任务 -->
- <view class="section challenge-section" v-if="isLoggedIn && activeChallenges.length > 0">
- <view class="section-header">
- <text class="section-title">🔥 家庭挑战</text>
- </view>
- <FamilyChallengeCard
- v-for="ch in activeChallenges"
- :key="ch.id"
- :challenge="ch" />
- </view>
- <!-- 今日行动任务 -->
- <DimensionTasks
- dimensionCode="action"
- :tasks="dimensionTasks"
- @taskClick="onTaskClick"
- @moreTasks="goTasks" />
- <DimensionActivities
- dimensionCode="action"
- :activities="dimensionActivities"
- :isLoggedIn="true"
- @activityClick="goActivityDetail"
- @moreActivities="goMoreActivities" />
- <DimensionArticles
- dimensionCode="action"
- :articles="actionArticles"
- :isLoggedIn="true"
- @articleClick="goArticleDetail"
- @moreArticles="goMoreArticles" />
- <DimensionProducts
- dimensionCode="action"
- :products="dimensionProducts"
- :isLoggedIn="true"
- @productClick="goProductDetail"
- @moreProducts="goMoreProducts" />
- <!-- ===== 我的圈子 ===== -->
- <view class="circle-section" v-if="isLoggedIn">
- <view class="circle-header">
- <text class="circle-section-title">🤝 我的圈子</text>
- <text class="circle-header-link" @click="goDiscoverCircles">发现更多 ›</text>
- </view>
- <scroll-view class="circle-scroll" scroll-x enable-flex v-if="myCircles.length > 0">
- <view class="circle-scroll-inner">
- <view class="circle-card-wrap" v-for="item in myCircles" :key="getCircleKey(item)" @click="onCircleClick(item)">
- <CircleCard :circle="item" compact />
- </view>
- </view>
- </scroll-view>
- <view class="circle-empty" v-else>
- <text class="circle-empty-text">暂未加入圈子,去发现看看</text>
- </view>
- <!-- ===== 发现推荐 ===== -->
- <view class="circle-discover" v-if="discoverCirclesList.length > 0">
- <view class="circle-header">
- <text class="circle-section-title">🔍 发现推荐</text>
- <text class="circle-header-link" @click="goDiscoverCircles">查看更多 ›</text>
- </view>
- <view class="discover-list">
- <view class="discover-item" v-for="item in discoverCirclesList" :key="getCircleKey(item)" @click="onCircleClick(item)">
- <CircleCard :circle="item" />
- </view>
- </view>
- </view>
- </view>
- <!-- 圈子详情弹窗 -->
- <CircleDetail
- :visible="circleDetailVisible"
- :circle="detailCircle"
- :isMember="selectedCircleIsMember"
- @close="circleDetailVisible = false"
- @join="onCircleJoin"
- @leave="onCircleLeave" />
- <!-- 功能入口 -->
- <view class="func-section">
- <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>
- <!-- 底部占位 -->
- <view class="bottom-spacer" style="height: 40rpx;"></view>
- </view>
- <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
- <view v-else class="discover-container">
- <!-- 品牌头部 -->
- <PageBanner theme="home"
- tagline="家庭健康成长俱乐部"
- quote="给全家的一站式幸福提案" />
- <!-- 五行沙盘预览 -->
- <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
- <!-- 活动/商品推荐 -->
- <view class="recommend-section">
- <view class="section-header">
- <text class="section-title">🔥 热门推荐</text>
- <text class="section-more" @click="goShop">查看更多 ›</text>
- </view>
- <scroll-view scroll-x enable-flex show-scrollbar="false" class="type-filter-scroll">
- <view
- v-for="item in typeList"
- :key="item.value"
- :class="['filter-chip', currentType === item.value ? 'active' : '']"
- @click="onTypeChange(item.value)"
- >
- {{ item.label }}
- </view>
- </scroll-view>
- <view v-if="loading" class="loading-state">
- <text class="loading-text">加载中...</text>
- </view>
- <view v-else-if="products.length === 0" class="empty-state">
- <text class="empty-text">暂无商品,去商城看看吧</text>
- </view>
- <view v-else class="product-grid">
- <view
- v-for="item in products"
- :key="item.id"
- class="product-card"
- @click="handleLogin()"
- >
- <image class="product-cover" :src="item.coverImage || '/static/default-product.png'" mode="aspectFill" />
- <view class="product-info">
- <text class="product-name">{{ item.name }}</text>
- <view class="product-price-row">
- <!-- 游客不显示价格 -->
- <text class="product-price-login">登录查看</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 热门活动(无条件展示) -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">🔥 热门活动</text>
- <text class="section-more" @click="goActivities">查看更多 ›</text>
- </view>
- <view v-if="dimensionActivities.length === 0" class="empty-state" style="padding: 40rpx 0;">
- <text class="empty-text">暂无活动</text>
- </view>
- <view class="activity-list" v-else>
- <view class="activity-card" v-for="act in dimensionActivities" :key="act.id" @click="goActivityDetail(act)">
- <image class="activity-cover" :src="act.coverImage || '/static/default-activity.png'" mode="aspectFill" />
- <view class="activity-info">
- <text class="activity-name line-clamp-1">{{ act.title }}</text>
- <view class="activity-meta">
- <text class="activity-time">{{ act.startTime }}</text>
- </view>
- <view class="activity-bottom">
- <text class="activity-status" :class="'status-' + (act.status || 'upcoming')">{{ act.status === 'ongoing' ? '进行中' : act.status === 'ended' ? '已结束' : '即将开始' }}</text>
- <text class="activity-fee" v-if="act.price && act.price > 0">¥{{ (act.price / 100).toFixed(0) }}</text>
- <text class="activity-fee fee-free" v-else>免费</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 推荐阅读(无条件展示) -->
- <view class="section">
- <view class="section-header">
- <text class="section-title">📖 推荐阅读</text>
- <text class="section-more" @click="goArticles">更多 ›</text>
- </view>
- <view class="article-list">
- <view v-if="articlesLoading" class="loading-state" style="padding: 40rpx 0;">
- <text class="loading-text">加载中...</text>
- </view>
- <!-- 无数据时显示占位卡片 -->
- <template v-else-if="indexArticles.length === 0">
- <view class="article-card" v-for="(item, i) in [1,2,3]" :key="i">
- <view class="article-category" :style="{ background: gradientColors[(i-1) % gradientColors.length] }">
- <text class="article-category-text">推荐文章</text>
- </view>
- <text class="article-title">暂无推荐文章</text>
- <text class="article-summary">精彩内容即将上线,敬请期待</text>
- <view class="article-meta">
- <view class="meta-item">
- <text class="meta-icon">📖</text>
- <text class="meta-text">0</text>
- </view>
- <text class="article-date">--</text>
- </view>
- </view>
- </template>
- <!-- 有数据时显示文章卡片 -->
- <template v-else>
- <view class="article-card" v-for="article in indexArticles" :key="article.id" @click="goArticleDetail(article.id)">
- <view class="article-category" :style="{ background: article.categoryColor }">
- <text class="article-category-text">{{ article.category }}</text>
- </view>
- <text class="article-title">{{ article.title }}</text>
- <text class="article-summary">{{ article.summary }}</text>
- <view class="article-meta">
- <view class="meta-item">
- <text class="meta-icon">📖</text>
- <text class="meta-text">{{ article.views }}</text>
- </view>
- <text class="article-date">{{ article.date }}</text>
- </view>
- </view>
- </template>
- </view>
- </view>
- <!-- 五维全景幸福矩阵 -->
- <view class="why-section">
- <view class="section-header">
- <text class="section-title">🌏 五维全景幸福矩阵 — 给全家的一站式幸福提案</text>
- </view>
- <view class="dim-matrix">
- <view
- v-for="dim in dimList" :key="dim.code"
- class="dim-card"
- :style="'border-left:6rpx solid ' + dim.color"
- @click="handleLogin"
- >
- <view class="dim-icon-circle" :style="'background:' + dim.bgColor">
- <text class="dim-icon">{{ dim.icon }}</text>
- </view>
- <view class="dim-tag" :style="'color:' + dim.color + ';background:' + dim.bgColor">{{ dim.name }} · {{ dim.title }}</view>
- <text class="dim-desc">{{ dim.desc }}</text>
- </view>
- </view>
- <!-- 五维能量环装饰 -->
- <view class="dim-energy-row">
- <view
- v-for="c in energyDotColors" :key="c"
- class="energy-dot"
- :style="'background:' + c"
- ></view>
- </view>
- </view>
- <!-- 底部登录按钮 -->
- <view class="login-footer">
- <button class="login-btn" @click="handleLogin">登录 / 注册</button>
- <text class="login-footer-text">登录即表示同意《用户协议》和《隐私政策》</text>
- </view>
- <!-- 底部占位 -->
- <view style="height: 120rpx;"></view>
- </view>
- </view>
- </template>
- <script>
- import PageBanner from '../../components/PageBanner.vue'
- import WuxingSandbox from '../../components/wuxing-sandbox.vue'
- import TabTransition from '../../components/tab-transition.vue'
- import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
- import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
- import DimensionTasks from '../../components/DimensionTasks.vue'
- import DimensionActivities from '../../components/DimensionActivities.vue'
- import DimensionProducts from '../../components/DimensionProducts.vue'
- import DimensionArticles from '../../components/DimensionArticles.vue'
- import CircleCard from '../../components/CircleCard.vue'
- import CircleDetail from '../../components/CircleDetail.vue'
- import LoginGuideCard from '../../components/LoginGuideCard.vue'
- import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
- import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getTodayTasksByCategory, getChildren, getEnergyOverview, getProductsByDomain, getChallengeList, getMyCircles, discoverCircles, joinGeneralCircle, leaveGeneralCircle } from '../../utils/api.js'
- var DIMENSIONS = [
- { code: 'body', name: '身', icon: '🌏', color: '#8D6E63', bgColor: 'rgba(141,110,99,0.15)', title: '主动健康', desc: '用最适合的方法,从根源调理家人体质,畅享高质量长寿生活' },
- { code: 'mind', name: '心', icon: '🔥', color: '#FF6B35', bgColor: 'rgba(255,107,53,0.15)', title: '大爱传承', desc: '将长辈陪护升华为家族纽带,让家风温暖代代相传' },
- { code: 'wisdom', name: '智', icon: '⚡', color: '#FFD700', bgColor: 'rgba(255,215,0,0.15)', title: '赋能未来', desc: '专业测评与素质培养,开启孩子面向未来的大智慧' },
- { code: 'action', name: '行', icon: '🌿', color: '#4CAF50', bgColor: 'rgba(76,175,80,0.15)', title: '知行合一', desc: '在亲子户外与沙龙中,让健康生活方式真正知行合一' },
- { code: 'wealth', name: '富', icon: '💧', color: '#42A5F5', bgColor: 'rgba(66,165,245,0.15)', title: '利他创富', desc: '依托创客生态,在利他分享中实现家庭第二收入曲线' }
- ]
- export default {
- components: {
- PageBanner,
- WuxingSandbox,
- TabTransition,
- FamilyMemberStrip,
- FamilyEnergyBar,
- DimensionTasks,
- DimensionActivities,
- DimensionProducts,
- DimensionArticles,
- CircleCard,
- CircleDetail,
- LoginGuideCard,
- FamilyChallengeCard
- },
- data() {
- // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
- var _token = uni.getStorageSync('token')
- var _currentRole = ''
- if (_token) {
- _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
- }
- // 冷启动标记(由 App.vue onLaunch 设置,仅在冷启动时存在)
- var _isFirstLaunch = (uni.getStorageSync('_showSplashOverlay') === '1')
- return {
- currentRole: _currentRole,
- // TabTransition 始终默认 true,确保首次渲染即出现;冷启动时被 splash overlay 覆盖不可见
- showTabTransition: true,
- // splash loading overlay(冷启动时展示,数据加载完关闭)
- splashOverlay: _isFirstLaunch,
- splashOverlayFading: false,
- _splashReady: false,
- typeList: [
- { label: '全部', value: '' },
- { label: '活动', value: 'activity' },
- { label: '课程', value: 'course' },
- { label: '实物', value: 'physical' },
- { label: '数字', value: 'digital' },
- { label: '服务', value: 'service' }
- ],
- currentType: '',
- products: [],
- loading: false,
- dimensionActivities: [],
- indexArticles: [],
- articlesLoading: false,
- gradientColors: [
- 'linear-gradient(135deg, #10B981, #34D399)',
- 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
- 'linear-gradient(135deg, #8B5CF6, #C084FC)',
- 'linear-gradient(135deg, #F97316, #FB923C)',
- 'linear-gradient(135deg, #6366F1, #818CF8)'
- ],
- // 登录态数据
- familyMembersVisible: [],
- selectedMemberId: null,
- sandboxData: null,
- dualDimension: null,
- dimensionTasks: [],
- dimensionActivities: [],
- dimensionProducts: [],
- articles: [],
- children: [],
- currentChildId: null,
- activeChallenges: [],
- myCircles: [],
- discoverCirclesList: [],
- circleDetailVisible: false,
- detailCircle: null,
- selectedCircleIsMember: false,
- funcList: [
- { icon: '\u{1F3CB}', label: '任务', needLogin: true, page: '/pages/tasks/tasks' },
- { icon: '\u{1F3C0}', label: '活动', needLogin: false, page: '/pages/discover/index?type=activity' },
- { icon: '\u{1F6CD}', label: '商城', needLogin: false, page: '/pages/discover/index?type=product' },
- { icon: '\u{1F3EB}', label: '课程', needLogin: false, page: '/pages/discover/index?type=course' }
- ],
- loggedInInitDone: false
- }
- },
- computed: {
- sandboxScores: function() {
- var d = this.sandboxData || {}
- return {
- body: d.bodyScore || 0,
- mind: d.mindScore || 0,
- wisdom: d.wisdomScore || 0,
- action: d.actionScore || 0,
- wealth: d.wealthScore || 0
- }
- },
- energyMapForGraph: function() {
- var map = {}
- var members = this.sandboxData && this.sandboxData.members || []
- for (var i = 0; i < members.length; i++) {
- var m = members[i]
- if (m.memberId && m.actionScore !== undefined) {
- map[m.memberId] = m.actionScore
- }
- }
- return map
- },
- actionArticles: 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('action') !== -1) {
- result.push(a)
- }
- }
- if (result.length === 0) return this.articles.slice(0, 5)
- return result.slice(0, 5)
- },
- dimList: function() {
- return DIMENSIONS
- },
- energyDotColors: function() {
- return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
- }
- },
- onLoad(options) {
- this._doInit(options)
- },
- onShow() {
- // splash overlay 已在 data() 中根据 storage 标记初始化,此处只需配置关闭条件
- if (this.splashOverlay) {
- uni.removeStorageSync('_showSplashOverlay')
- this._splashLoadCount = 0
- this._splashMinPassed = false
- var self = this
- // 最低展示 800ms
- setTimeout(function() {
- self._splashMinPassed = true
- self._tryHideSplash()
- }, 800)
- // 最多展示 5s
- setTimeout(function() {
- if (self.splashOverlay) self._hideSplashOverlay()
- }, 5000)
- } else {
- // tab 切回:TabTransition 已在 data() 中为 true,确保首次渲染即出现
- // 但组件缓存后再次切回时可能已被 _watchPageReady 置为 false,需要重置
- this.showTabTransition = true
- this._watchPageReady()
- }
- // 始终执行初始化,确保登录态变更后及时切换视图
- this._doInit()
- },
- methods: {
- _checkSplashReady() {
- this._splashLoadCount++
- this._tryHideSplash()
- },
- _tryHideSplash() {
- if (this.splashOverlayFading) return
- if (!this._splashMinPassed) return
- if (this.isLoggedIn()) {
- // 登录用户:等待子组件的 ready 信号
- if (this._splashReady) this._hideSplashOverlay()
- } else {
- // 游客:等待 3 个 API 全部返回
- if (this._splashLoadCount >= 3) this._hideSplashOverlay()
- }
- },
- _hideSplashOverlay() {
- if (this.splashOverlayFading) return
- this.splashOverlayFading = true
- // splash 关闭时同时隐藏 TabTransition(防止 splash 结束后闪现过渡页)
- this.showTabTransition = false
- var self = this
- setTimeout(function() {
- self.splashOverlay = false
- self.splashOverlayFading = false
- }, 400)
- },
- // ===== 登录态数据加载 =====
- loadLoggedInData: function() {
- this.loadFamilyMembers()
- this.loadChildren()
- },
- loadChildren: function() {
- var self = this
- getChildren().then(function(res) {
- if (res.code === 200 && res.data) {
- self.children = res.data
- var savedChildId = uni.getStorageSync('currentChildId')
- if (savedChildId) {
- self.currentChildId = savedChildId
- }
- self.loadDimensionData()
- }
- }).catch(function() {})
- },
- loadDimensionData: function() {
- this.loadEnergyData()
- this.loadSandboxData()
- this.loadDimensionTasks()
- this.loadActionActivities()
- this.loadActionProducts()
- this.loadActionArticles()
- this.loadChallenges()
- this.loadMyCircles()
- this.loadDiscoverCircles()
- },
- loadEnergyData: function() {
- var self = this
- if (!this.currentChildId) return
- getEnergyOverview(this.currentChildId).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() {})
- },
- loadSandboxData: function() {
- var self = this
- getFamilyEnergySandbox().then(function(res) {
- if (res && res.data) {
- self.sandboxData = res.data
- self._splashReady = true
- self._tryHideSplash()
- }
- }).catch(function() {})
- },
- loadDimensionTasks: function() {
- var self = this
- if (!this.currentChildId) return
- getTodayTasksByCategory(this.currentChildId, 'action').then(function(res) {
- if (res && res.data) {
- self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
- }
- }).catch(function() { self.dimensionTasks = [] })
- },
- loadActionActivities: function() {
- var self = this
- getActivityList({ dimensionCode: 'action', page: 1, size: 3 }).then(function(res) {
- if (res && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.dimensionActivities = list.slice(0, 3)
- }
- }).catch(function() { self.dimensionActivities = [] })
- },
- loadActionProducts: function() {
- var self = this
- getProductsByDomain('action', 1, 4).then(function(res) {
- if (res && res.data) {
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.dimensionProducts = list.slice(0, 4)
- }
- }).catch(function() { self.dimensionProducts = [] })
- },
- loadActionArticles: function() {
- var self = this
- getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
- if (res.code === 200 && res.data) {
- var gradientColors = [
- 'linear-gradient(135deg, #10B981, #34D399)',
- 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
- 'linear-gradient(135deg, #8B5CF6, #C084FC)',
- 'linear-gradient(135deg, #F97316, #FB923C)',
- 'linear-gradient(135deg, #6366F1, #818CF8)'
- ]
- var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
- self.articles = list.map(function(item, index) {
- return {
- id: item.id,
- category: item.categoryName || '行动社交',
- categoryColor: gradientColors[index % gradientColors.length],
- title: item.title || '',
- summary: item.summary || '',
- dimensionWeights: item.dimensionWeights || null,
- views: item.viewCount ? String(item.viewCount) : '0',
- likes: '0',
- date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
- relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions)
- }
- })
- }
- }).catch(function() {})
- },
- loadChallenges: function() {
- var familyId = uni.getStorageSync('familyId')
- if (!familyId) return
- var self = this
- getChallengeList({ familyId: familyId }).then(function(res) {
- if (res.code === 200 && Array.isArray(res.data)) {
- self.activeChallenges = res.data
- }
- }).catch(function() {
- self.activeChallenges = []
- })
- },
- loadMyCircles: function() {
- var self = this
- getMyCircles({}).then(function(res) {
- if (res.code === 200 && res.data) {
- self.myCircles = Array.isArray(res.data) ? res.data : (res.data.list || [])
- }
- }).catch(function() { self.myCircles = [] })
- },
- loadDiscoverCircles: function() {
- var self = this
- discoverCircles({ page: 1, size: 3 }).then(function(res) {
- if (res.code === 200 && res.data) {
- self.discoverCirclesList = Array.isArray(res.data) ? res.data : (res.data.list || [])
- }
- }).catch(function() { self.discoverCirclesList = [] })
- },
- getCircleKey: function(item) {
- return item.id || item.circleId || Math.random()
- },
- onCircleClick: function(item) {
- this.detailCircle = item
- this.selectedCircleIsMember = item.isMember || false
- this.circleDetailVisible = true
- },
- onCircleJoin: function(circle) {
- var self = this
- joinGeneralCircle({ circleId: circle.id }).then(function(res) {
- if (res.code === 200) {
- self.circleDetailVisible = false
- self.loadMyCircles()
- self.loadDiscoverCircles()
- uni.showToast({ title: '加入成功', icon: 'success' })
- }
- }).catch(function() {})
- },
- onCircleLeave: function(circle) {
- var self = this
- leaveGeneralCircle({ circleId: circle.id }).then(function(res) {
- if (res.code === 200) {
- self.circleDetailVisible = false
- self.loadMyCircles()
- self.loadDiscoverCircles()
- uni.showToast({ title: '已退出', icon: 'none' })
- }
- }).catch(function() {})
- },
- goDiscoverCircles: function() {
- uni.navigateTo({ url: '/pages/discover/circles' })
- },
- loadFamilyMembers: function() {
- var self = this
- getVisibleFamilyMembers().then(function(res) {
- if (res.code === 200 && res.data) {
- self.familyMembersVisible = Array.isArray(res.data) ? res.data : (res.data.list || [])
- }
- }).catch(function() {})
- },
- parseRelatedDimensions: function(val) {
- if (!val) return []
- if (Array.isArray(val)) return val
- if (typeof val === 'string') {
- try {
- var parsed = JSON.parse(val)
- return Array.isArray(parsed) ? parsed : []
- } catch (e) {
- return val.split(',').map(function(s) { return s.trim() }).filter(function(s) { return s })
- }
- }
- return []
- },
- onFamilyMemberSelect: function(member) {
- this.selectedMemberId = member.id
- },
- onTaskClick: function(task) {
- uni.navigateTo({ url: '/pages/tasks/tasks' })
- },
- goTasks: function() {
- uni.switchTab({ url: '/pages/tasks/tasks' })
- },
- goMemberDetail: function(member) {
- if (!member || !member.memberId) return
- uni.navigateTo({ url: '/pages/child/child-detail?id=' + member.memberId })
- },
- goActivityDetail: function(act) {
- if (!act || !act.id) return
- uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
- },
- goMoreActivities: function() {
- uni.navigateTo({ url: '/pages/activity/index' })
- },
- goProductDetail: function(prod) {
- uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
- },
- goMoreProducts: function() {
- uni.navigateTo({ url: '/pages/shop/index' })
- },
- goArticleDetail: function(article) {
- var id = article.id || article
- uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
- },
- goMoreArticles: function() {
- uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
- },
- onFuncClick: function(item) {
- var nativeTabs = ['/pages/tasks/tasks', '/pages/index-home/index', '/pages/body/index', '/pages/mind/index', '/pages/wisdom/index', '/pages/wealth/index']
- if (nativeTabs.indexOf(item.page) !== -1) {
- uni.switchTab({ url: item.page })
- } else {
- uni.navigateTo({ url: item.page })
- }
- },
- // 首页 TabTransition 动态关闭:检测关键内容是否就绪
- _watchPageReady() {
- var self = this
- var unwatch = this.$watch(function() {
- if (!self.isLoggedIn()) {
- return !!(self.products && self.products.length > 0) ||
- !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
- !!(self.indexArticles && self.indexArticles.length > 0)
- }
- // 登录用户:等待关键数据加载完成
- return !!(self.currentRole && self.sandboxData)
- }, function(val) {
- if (val) {
- if (unwatch) unwatch()
- self.showTabTransition = false
- }
- })
- // 5s 超时兜底
- setTimeout(function() {
- if (unwatch) unwatch()
- self.showTabTransition = false
- }, 5000)
- },
- _doInit(options) {
- options = options || {}
- if (!this.isLoggedIn()) {
- this.currentRole = ''
- this.loadProducts()
- this.loadDimensionActivities()
- this.loadFeaturedArticles()
- return
- }
- this.syncRoleAndTabBar()
- if (options.inviteCode && options.type === 'parent_invite') {
- this.handleParentInvite(options.inviteCode)
- return
- }
- var storedCode = uni.getStorageSync('inviteCode')
- var storedType = uni.getStorageSync('inviteType')
- if (storedCode && storedType === 'parent_invite') {
- this.handleParentInvite(storedCode)
- uni.removeStorageSync('inviteCode')
- uni.removeStorageSync('inviteType')
- return
- }
- // 登录用户:直接在 TabBar 页面内联渲染,保持底签可见
- if (!this.loggedInInitDone) {
- this.loggedInInitDone = true
- this.loadLoggedInData()
- }
- this._watchPageReady()
- },
- isLoggedIn() {
- return !!uni.getStorageSync('token')
- },
- normalizeCurrentRole() {
- const role = uni.getStorageSync('role') || 'parent'
- const currentRole = uni.getStorageSync('currentRole')
- if (!currentRole) {
- return role
- }
- // 非规划师账号不允许落到规划师首页
- if (currentRole === 'teacher' && role !== 'teacher') {
- return role
- }
- // 只有家长账号允许切换到孩子视角
- if (currentRole === 'child' && role !== 'parent') {
- return role
- }
- return currentRole
- },
- syncRoleAndTabBar() {
- this.currentRole = this.normalizeCurrentRole()
- uni.setStorageSync('currentRole', this.currentRole)
- },
- // ===== 发现页 / 未登录态方法 =====
- loadProducts: function() {
- this.loading = true
- var params = { page: 1, size: 10 }
- if (this.currentType) {
- params.productType = this.currentType
- }
- var self = this
- productList(params).then(function(res) {
- self.loading = false
- if (res && res.code === 200) {
- // res.data is the response wrapper, products are in res.data.data or res.data.records
- var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
- self.products = Array.isArray(rawData) ? rawData : []
- }
- self._checkSplashReady()
- }).catch(function() {
- self.loading = false
- self._checkSplashReady()
- })
- },
- loadDimensionActivities: function() {
- var self = this
- getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
- if (res && res.code === 200) {
- // res.data is the response wrapper, activities are in res.data.data or res.data.records
- var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
- self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
- }
- self._checkSplashReady()
- }).catch(function() {
- self._checkSplashReady()
- })
- },
- loadFeaturedArticles: function() {
- var self = this
- this.articlesLoading = true
- getFeaturedArticles({ size: 5 }).then(function(res) {
- self.articlesLoading = false
- if (res && res.code === 200) {
- var gradientColors = [
- 'linear-gradient(135deg, #10B981, #34D399)',
- 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
- 'linear-gradient(135deg, #8B5CF6, #C084FC)',
- 'linear-gradient(135deg, #F97316, #FB923C)',
- 'linear-gradient(135deg, #6366F1, #818CF8)'
- ]
- // res.data is the response wrapper, articles are in res.data.data
- var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
- var list = Array.isArray(rawList) ? rawList : []
- self.indexArticles = list.map(function(item, index) {
- return {
- id: item.id,
- category: item.categoryName || item.category || '热门文章',
- categoryColor: gradientColors[index % gradientColors.length],
- title: item.title || '',
- summary: item.summary || '',
- views: item.viewCount ? String(item.viewCount) : '0',
- date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
- }
- })
- }
- self._checkSplashReady()
- }).catch(function() {
- self.articlesLoading = false
- self._checkSplashReady()
- })
- },
- goActivities: function() {
- uni.navigateTo({ url: '/pages/discover/index?type=activity' })
- },
- goActivityDetail: function(act) {
- uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
- },
- goArticles: function() {
- uni.navigateTo({ url: '/pages/mind-detail/articles' })
- },
- goArticleDetail: function(id) {
- uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
- },
- onTypeChange(value) {
- this.currentType = value
- this.loadProducts()
- },
- goShop() {
- uni.navigateTo({ url: '/pages/discover/index' })
- },
- goDetail(id) {
- uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
- },
- handleLogin() {
- uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index-home/index') })
- },
- async handleParentInvite(code) {
- // 延迟显示,等待登录完成
- setTimeout(async () => {
- const hasToken = uni.getStorageSync('token')
- if (!hasToken) {
- // 未登录,先去登录
- uni.reLaunch({
- url: '/pages/login/login?inviteCode=' + code
- })
- return
- }
- // 已登录,显示确认框
- uni.showModal({
- title: '加入家庭',
- content: '您已被邀请加入家庭,是否接受?',
- success: async (res) => {
- if (res.confirm) {
- try {
- uni.showLoading({ title: '加入中...' })
- const result = await acceptParentInvite(code)
- uni.hideLoading()
- if (result.code === 200) {
- const { familyId, role, token } = result.data
- uni.setStorageSync('familyId', familyId)
- uni.setStorageSync('role', role)
- uni.setStorageSync('token', token)
- uni.showToast({ title: '加入成功', icon: 'success' })
- // 刷新页面
- setTimeout(() => {
- uni.switchTab({ url: '/pages/index-home/index' })
- }, 1500)
- }
- } catch (e) {
- uni.hideLoading()
- uni.showToast({ title: e.message || '加入失败', icon: 'none' })
- }
- }
- }
- })
- }, 500)
- },
- }
- }
- </script>
- <style>
- .discover-container {
- min-height: 100vh;
- background: #f5f7fa;
- padding-bottom: 100rpx;
- }
- /* ===== 推荐 ===== */
- .recommend-section {
- margin: 20rpx 30rpx;
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .section-more {
- font-size: 24rpx;
- color: #5B9BD5;
- }
- .type-filter-scroll {
- white-space: nowrap;
- margin-bottom: 20rpx;
- }
- .filter-chip {
- display: inline-block;
- padding: 8rpx 24rpx;
- font-size: 24rpx;
- color: #666;
- background: #f0f0f0;
- border-radius: 30rpx;
- margin-right: 16rpx;
- }
- .filter-chip.active {
- background: #5B9BD5;
- color: #fff;
- }
- .loading-state,
- .empty-state {
- display: flex;
- justify-content: center;
- padding: 60rpx 0;
- }
- .loading-text,
- .empty-text {
- font-size: 26rpx;
- color: #999;
- }
- .product-grid {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- }
- .product-card {
- width: 48%;
- background: #fff;
- border-radius: 16rpx;
- overflow: hidden;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
- }
- .product-cover {
- width: 100%;
- height: 200rpx;
- background: #f0f0f0;
- }
- .product-info {
- padding: 14rpx;
- }
- .product-name {
- display: block;
- font-size: 26rpx;
- color: #333;
- margin-bottom: 10rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .product-price-row {
- display: flex;
- align-items: baseline;
- }
- .product-price {
- font-size: 28rpx;
- color: #5B9BD5;
- font-weight: bold;
- margin-right: 10rpx;
- }
- .product-price-login {
- font-size: 24rpx;
- color: #999;
- }
- .product-member {
- font-size: 20rpx;
- color: #999;
- }
- /* ===== 五维全景幸福矩阵 ===== */
- .why-section {
- margin: 30rpx;
- }
- .dim-matrix {
- display: flex;
- flex-wrap: wrap;
- gap: 20rpx;
- justify-content: center;
- }
- .dim-card {
- width: calc(33.33% - 14rpx);
- box-sizing: border-box;
- background: #fff;
- border-radius: 20rpx;
- padding: 28rpx 16rpx 24rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
- transition: transform 0.2s ease, box-shadow 0.2s ease;
- position: relative;
- overflow: hidden;
- }
- .dim-card:active {
- transform: scale(0.96);
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
- }
- .dim-icon-circle {
- width: 72rpx;
- height: 72rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 14rpx;
- flex-shrink: 0;
- }
- .dim-icon {
- font-size: 36rpx;
- line-height: 1;
- }
- .dim-tag {
- font-size: 22rpx;
- font-weight: 600;
- padding: 4rpx 14rpx;
- border-radius: 20rpx;
- margin-bottom: 10rpx;
- max-width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .dim-desc {
- font-size: 20rpx;
- color: #888;
- line-height: 1.5;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- overflow: hidden;
- }
- /* 五维能量环 */
- .dim-energy-row {
- display: flex;
- justify-content: center;
- gap: 12rpx;
- margin-top: 24rpx;
- opacity: 0.5;
- }
- .energy-dot {
- width: 10rpx;
- height: 10rpx;
- border-radius: 50%;
- }
- /* ===== 底部登录 ===== */
- .login-footer {
- margin: 40rpx 30rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .login-btn {
- width: 100%;
- height: 88rpx;
- line-height: 88rpx;
- background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
- color: #fff;
- font-size: 32rpx;
- font-weight: bold;
- border-radius: 44rpx;
- text-align: center;
- border: none;
- }
- .login-btn::after {
- border: none;
- }
- .login-footer-text {
- font-size: 20rpx;
- color: #bbb;
- margin-top: 16rpx;
- }
- /* ===== 加载占位 ===== */
- .loading-container {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- }
- /* ===== 角色切换淡入淡出 ===== */
- .role-switch-wrapper {
- width: 100%;
- min-height: 100vh;
- }
- .fade-enter-active,
- .fade-leave-active {
- transition: opacity 0.3s ease;
- }
- .fade-enter,
- .fade-leave-to {
- opacity: 0;
- }
- /* ===== 通用区块样式 ===== */
- .section {
- margin: 20rpx 30rpx;
- }
- .section-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .section-more {
- font-size: 24rpx;
- color: #5B9BD5;
- }
- .empty-state {
- display: flex;
- justify-content: center;
- padding: 60rpx 0;
- }
- .empty-text {
- font-size: 26rpx;
- color: #999;
- }
- /* ===== 活动列表 ===== */
- .activity-list {
- display: flex;
- flex-direction: column;
- gap: 16rpx;
- }
- .activity-card {
- background: #fff;
- border-radius: 16rpx;
- overflow: hidden;
- display: flex;
- flex-direction: row;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .activity-card:active {
- opacity: 0.8;
- }
- .activity-cover {
- width: 200rpx;
- height: 160rpx;
- flex-shrink: 0;
- background: #f0f0f0;
- }
- .activity-info {
- flex: 1;
- padding: 16rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- }
- .activity-name {
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 8rpx;
- }
- .line-clamp-1 {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .activity-meta {
- display: flex;
- align-items: center;
- margin-bottom: 8rpx;
- }
- .activity-time {
- font-size: 22rpx;
- color: #999;
- }
- .activity-bottom {
- display: flex;
- align-items: center;
- gap: 12rpx;
- }
- .activity-status {
- font-size: 20rpx;
- padding: 2rpx 10rpx;
- border-radius: 8rpx;
- background: #E8F5E9;
- color: #2E7D32;
- }
- .activity-status.status-upcoming {
- background: #E3F2FD;
- color: #1565C0;
- }
- .activity-status.status-ended {
- background: #F5F5F5;
- color: #999;
- }
- .activity-fee {
- font-size: 24rpx;
- color: #F97316;
- font-weight: bold;
- }
- .activity-fee.fee-free {
- color: #4CAF50;
- }
- /* ===== 文章列表 ===== */
- .article-list {
- display: flex;
- flex-direction: column;
- gap: 16rpx;
- }
- .article-card {
- background: #fff;
- border-radius: 16rpx;
- padding: 24rpx;
- box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
- }
- .article-card:active {
- opacity: 0.8;
- }
- .article-category {
- display: inline-block;
- padding: 4rpx 14rpx;
- border-radius: 8rpx;
- margin-bottom: 10rpx;
- }
- .article-category-text {
- font-size: 20rpx;
- color: #fff;
- }
- .article-title {
- display: block;
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 8rpx;
- line-height: 1.4;
- }
- .article-summary {
- display: block;
- font-size: 24rpx;
- color: #888;
- line-height: 1.5;
- margin-bottom: 12rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .article-meta {
- display: flex;
- align-items: center;
- gap: 16rpx;
- }
- .meta-item {
- display: flex;
- align-items: center;
- gap: 4rpx;
- }
- .meta-icon {
- font-size: 24rpx;
- }
- .meta-text {
- font-size: 22rpx;
- color: #999;
- }
- .article-date {
- font-size: 22rpx;
- color: #bbb;
- }
- /* ===== Splash Loading Overlay(冷启动蒙板,来自 merge splash.vue) ===== */
- .splash-overlay {
- position: fixed;
- top: 0; left: 0; right: 0; bottom: 0;
- z-index: 9999;
- display: flex;
- align-items: center;
- justify-content: center;
- background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
- overflow: hidden;
- opacity: 1;
- transition: opacity 0.4s ease;
- }
- .splash-overlay.fade-out {
- opacity: 0;
- pointer-events: none;
- }
- /* ---- bg circles from splash.vue ---- */
- .splash-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
- .bg-circle {
- position: absolute;
- border-radius: 50%;
- opacity: 0.12;
- }
- .bg-circle-1 {
- width: 400rpx; height: 400rpx;
- background: #FF8C42;
- top: -100rpx; right: -80rpx;
- animation: splash-float-1 4s ease-in-out infinite;
- }
- .bg-circle-2 {
- width: 280rpx; height: 280rpx;
- background: #FF6B9D;
- bottom: 80rpx; left: -60rpx;
- animation: splash-float-2 5s ease-in-out infinite;
- }
- .bg-circle-3 {
- width: 180rpx; height: 180rpx;
- background: #6366F1;
- top: 50%; right: -40rpx;
- animation: splash-float-3 6s ease-in-out infinite;
- }
- @keyframes splash-float-1 {
- 0%, 100% { transform: translateY(0) scale(1); }
- 50% { transform: translateY(-30rpx) scale(1.05); }
- }
- @keyframes splash-float-2 {
- 0%, 100% { transform: translateY(0) scale(1); }
- 50% { transform: translateY(20rpx) scale(1.08); }
- }
- @keyframes splash-float-3 {
- 0%, 100% { transform: translateY(0) rotate(0deg); }
- 50% { transform: translateY(-20rpx) rotate(10deg); }
- }
- /* ---- body fade-in ---- */
- .splash-overlay-body {
- display: flex;
- flex-direction: column;
- align-items: center;
- animation: splash-body-in 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
- }
- @keyframes splash-body-in {
- from { opacity: 0; transform: translateY(40rpx) scale(0.96); }
- to { opacity: 1; transform: translateY(0) scale(1); }
- }
- /* ---- logo ---- */
- .splash-logo-wrap {
- width: 160rpx; height: 160rpx;
- border-radius: 40rpx;
- background: rgba(255,255,255,0.95);
- display: flex; align-items: center; justify-content: center;
- margin-bottom: 16rpx;
- box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
- animation: splash-logo-pulse 2.5s ease-in-out infinite;
- }
- @keyframes splash-logo-pulse {
- 0%, 100% { box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25); }
- 50% { box-shadow: 0 8rpx 48rpx rgba(249,115,22,0.45); }
- }
- .splash-logo-img { width: 100rpx; height: 100rpx; }
- /* ---- brand ---- */
- .splash-brand-name {
- font-size: 64rpx; font-weight: 800;
- color: #7C2D12;
- letter-spacing: 10rpx;
- margin-bottom: 2rpx;
- }
- .splash-brand-en {
- font-size: 20rpx;
- color: rgba(124,45,18,0.5);
- letter-spacing: 6rpx;
- margin-bottom: 30rpx;
- }
- .splash-tagline {
- font-size: 26rpx;
- color: rgba(124,45,18,0.7);
- letter-spacing: 4rpx;
- margin-top: 24rpx;
- }
- /* ---- dims row from splash.vue (rounded circles) ---- */
- .splash-dims-row {
- display: flex; flex-direction: row;
- align-items: center; justify-content: center;
- gap: 28rpx;
- }
- .splash-dim-item {
- display: flex; flex-direction: column;
- align-items: center; gap: 8rpx;
- }
- .splash-dim-circle {
- width: 80rpx; height: 80rpx;
- border-radius: 50%;
- display: flex; align-items: center; justify-content: center;
- }
- .splash-dim-icon { font-size: 36rpx; line-height: 1; }
- .splash-dim-label {
- font-size: 22rpx; font-weight: 500;
- color: rgba(124,45,18,0.75);
- line-height: 1;
- }
- /* ---- staggered dim entry from splash.vue ---- */
- .splash-dim-item:nth-child(1) { animation: splash-dim-in 0.5s ease 0.1s both; }
- .splash-dim-item:nth-child(2) { animation: splash-dim-in 0.5s ease 0.2s both; }
- .splash-dim-item:nth-child(3) { animation: splash-dim-in 0.5s ease 0.3s both; }
- .splash-dim-item:nth-child(4) { animation: splash-dim-in 0.5s ease 0.4s both; }
- .splash-dim-item:nth-child(5) { animation: splash-dim-in 0.5s ease 0.5s both; }
- @keyframes splash-dim-in {
- from { opacity: 0; transform: translateY(16rpx) scale(0.8); }
- to { opacity: 1; transform: translateY(0) scale(1); }
- }
- /* ---- loading dots ---- */
- .splash-overlay-loading {
- position: absolute;
- bottom: 120rpx;
- left: 0; right: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 12rpx;
- }
- .splash-overlay-dot {
- width: 14rpx; height: 14rpx;
- border-radius: 50%;
- background: rgba(249,115,22,0.6);
- animation: splash-dot-bounce 1.4s ease-in-out infinite both;
- }
- .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
- .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
- .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
- @keyframes splash-dot-bounce {
- 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
- 40% { transform: scale(1); opacity: 1; }
- }
- /* ---- 登录态内容布局 ---- */
- .logged-in-container {
- padding-bottom: 40rpx;
- }
- /* ===== 功能入口(原action页样式) ===== */
- .func-section {
- margin: -40rpx 20rpx 0;
- position: relative;
- z-index: 2;
- }
- .func-grid {
- background: #fff;
- border-radius: 24rpx;
- padding: 30rpx 16rpx;
- display: flex;
- box-shadow: 0 4rpx 20rpx 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: #FFF7ED;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 10rpx;
- }
- .func-icon {
- font-size: 40rpx;
- }
- .func-label {
- font-size: 24rpx;
- color: #333;
- font-weight: 500;
- }
- /* ===== 圈子卡片 ===== */
- .circle-section {
- margin: 20rpx 30rpx;
- }
- .circle-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 20rpx;
- }
- .circle-section-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .circle-header-link {
- font-size: 24rpx;
- color: #5B9BD5;
- }
- .circle-scroll {
- white-space: nowrap;
- }
- .circle-scroll-inner {
- display: inline-flex;
- gap: 16rpx;
- }
- .circle-card-wrap {
- display: inline-block;
- }
- .circle-empty {
- padding: 40rpx 0;
- text-align: center;
- }
- .circle-empty-text {
- font-size: 26rpx;
- color: #999;
- }
- .circle-discover {
- margin-top: 30rpx;
- }
- .discover-list {
- display: flex;
- flex-direction: column;
- gap: 16rpx;
- }
- .discover-item {
- background: #fff;
- border-radius: 16rpx;
- overflow: hidden;
- }
- </style>
|