| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664 |
- <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" ref="tabTransition" @close="showTabTransition = false" />
- <!-- 登录态 — 直接内嵌,保持底签可见 -->
- <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"
- @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>
- <!-- 个性化推荐 -->
- <RecommendedSection
- v-if="recommendItems.length > 0"
- :items="recommendItems"
- :hasMore="recommendHasMore"
- @itemClick="onRecommendItemClick"
- @more="goMoreRecommend" />
- <!-- 圈子详情弹窗 -->
- <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" v-if="item.price && item.price > 0">¥{{ (item.price / 100).toFixed(0) }}</text>
- <text class="product-price-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="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 RecommendedSection from '../../components/RecommendedSection.vue'
- import recommendMixin from '../../mixins/recommend-mixin'
- 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 {
- mixins: [recommendMixin],
- components: {
- PageBanner,
- WuxingSandbox,
- TabTransition,
- FamilyMemberStrip,
- FamilyEnergyBar,
- DimensionTasks,
- DimensionActivities,
- DimensionProducts,
- DimensionArticles,
- CircleCard,
- CircleDetail,
- LoginGuideCard,
- FamilyChallengeCard,
- RecommendedSection
- },
- 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
- }
- },
- 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()
- this.loadRecommendations('action')
- },
- goMoreRecommend: function() {
- uni.navigateTo({ url: '/pages/discover/index' })
- },
- 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
- if (!this.currentChildId) return
- getMyCircles(this.currentChildId, 'child').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
- if (!this.currentChildId) return
- discoverCircles(this.currentChildId).then(function(res) {
- if (res.code === 200 && res.data) {
- self.discoverCirclesList = Array.isArray(res.data) ? res.data.slice(0, 3) : []
- }
- }).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' })
- },
- goActivityDetail: function(act) {
- if (!act || !act.id) return
- uni.navigateTo({ url: '/pages/activity/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/article-center/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()
- if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
- }
- })
- },
- _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/activity/activity-detail/activity-detail?id=' + act.id })
- },
- goArticles: function() {
- uni.navigateTo({ url: '/pages/mind-detail/articles' })
- },
- goArticleDetail: function(article) {
- var id = article && article.id ? article.id : article
- uni.navigateTo({ url: '/pages/article-center/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-detail/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>
|