| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086 |
- <template>
- <view>
- <!-- 首次进入的 splash loading 蒙板 — 覆盖首页直到数据加载完毕 -->
- <view class="splash-overlay" :class="{'fade-out': splashOverlayFading}" v-if="splashOverlay || splashOverlayFading">
- <view class="splash-overlay-bg">
- <view class="splash-overlay-circle c1"></view>
- <view class="splash-overlay-circle c2"></view>
- <view class="splash-overlay-circle c3"></view>
- </view>
- <view class="splash-overlay-body">
- <view class="splash-overlay-logo-wrap">
- <image class="splash-overlay-logo" src="/static/logo.png" mode="aspectFit" />
- </view>
- <text class="splash-overlay-brand">浠艾福</text>
- <text class="splash-overlay-en">Care Family</text>
- <view class="splash-overlay-dims">
- <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🌏</text><text class="splash-overlay-dim-label">身</text></view>
- <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🔥</text><text class="splash-overlay-dim-label">心</text></view>
- <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">⚡</text><text class="splash-overlay-dim-label">智</text></view>
- <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🌿</text><text class="splash-overlay-dim-label">行</text></view>
- <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">💧</text><text class="splash-overlay-dim-label">富</text></view>
- </view>
- <text class="splash-overlay-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="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 v-if="articlesLoading" class="loading-state">
- <text class="loading-text">加载中...</text>
- </view>
- <view v-else-if="indexArticles.length === 0" class="empty-state" style="padding: 40rpx 0;">
- <text class="empty-text">暂无文章</text>
- </view>
- <view class="article-list" 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>
- </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 v-else class="role-switch-wrapper">
- <transition name="fade" mode="out-in">
- <parent-index v-if="currentRole === 'parent'" key="parent" @ready="onChildReady" />
- <child-index v-else-if="currentRole === 'child'" key="child" @ready="onChildReady" />
- <!-- teacher-index 已废弃,教师功能折入 parent-index -->
- <view v-else class="loading-container" key="loading">
- <text>加载中...</text>
- </view>
- </transition>
- <AIFloatingAvatar />
- </view>
- </view>
- </template>
- <script>
- import ParentIndex from './parent-index.vue'
- import ChildIndex from './child-index.vue'
- // TeacherIndex 已废弃,教师功能折入 parent-index
- import PageBanner from '../../components/PageBanner.vue'
- import WuxingSandbox from '../../components/wuxing-sandbox.vue'
- import TabTransition from '../../components/tab-transition.vue'
- import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
- import { acceptParentInvite, productList, getActivityList, getFeaturedArticles } 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: {
- ParentIndex,
- ChildIndex,
- PageBanner,
- WuxingSandbox,
- TabTransition,
- AIFloatingAvatar
- },
- data() {
- // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
- var _token = uni.getStorageSync('token')
- var _currentRole = ''
- if (_token) {
- _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
- }
- return {
- currentRole: _currentRole,
- showTabTransition: true,
- // splash loading ovarlay(首次进入时展示,数据加载完关闭)
- splashOverlay: false,
- 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
- }
- },
- onLoad(options) {
- this._doInit(options)
- },
- onShow() {
- // 从 splash 首次进入:展示 splash overlay,数据加载完后自动关闭
- var showOverlay = uni.getStorageSync('_showSplashOverlay')
- var isFirstLaunch = (showOverlay === '1')
- if (isFirstLaunch) {
- uni.removeStorageSync('_showSplashOverlay')
- this._showSplashOverlayMask()
- }
- // 首次启动由 flash 覆盖加载过程,跳过 TabTransition;后续 tab 切换才显示
- if (!isFirstLaunch) {
- this.showTabTransition = true
- this._watchPageReady()
- }
- // 始终执行初始化,确保登录态变更后及时切换视图
- this._doInit()
- },
- methods: {
- // ===== Splash overlay (首次进入蒙板) =====
- _showSplashOverlayMask() {
- this.splashOverlay = true
- this._splashLoadCount = 0
- this._splashMinPassed = false
- // 最小展示 800ms,让 overlay 有足够时间呈现
- var self = this
- setTimeout(function() {
- self._splashMinPassed = true
- self._tryHideSplash()
- }, 800)
- // 最长 5 秒强制关闭,防止 API 卡死导致蒙板不消失
- setTimeout(function() {
- if (self.splashOverlay) {
- self._hideSplashOverlay()
- }
- }, 5000)
- },
- _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
- var self = this
- setTimeout(function() {
- self.splashOverlay = false
- self.splashOverlayFading = false
- }, 400)
- },
- onChildReady() {
- this._splashReady = true
- this._tryHideSplash()
- },
- // 首页 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)
- }
- // 登录用户:currentRole 存在代表子组件已渲染
- return !!self.currentRole
- }, 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)
- } else {
- var storedCode = uni.getStorageSync('inviteCode')
- var storedType = uni.getStorageSync('inviteType')
- if (storedCode && storedType === 'parent_invite') {
- this.handleParentInvite(storedCode)
- uni.removeStorageSync('inviteCode')
- uni.removeStorageSync('inviteType')
- }
- }
- },
- 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/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/index' })
- }, 1500)
- }
- } catch (e) {
- uni.hideLoading()
- uni.showToast({ title: e.message || '加入失败', icon: 'none' })
- }
- }
- }
- })
- }, 500)
- },
- },
- computed: {
- dimList: function() {
- return DIMENSIONS
- },
- energyDotColors: function() {
- return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
- }
- }
- }
- </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(首次进入蒙板) ===== */
- .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;
- }
- .splash-overlay-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- pointer-events: none;
- }
- .splash-overlay-circle {
- position: absolute;
- border-radius: 50%;
- opacity: 0.15;
- }
- .splash-overlay-circle.c1 {
- width: 400rpx; height: 400rpx;
- background: #FF8C42;
- top: -100rpx; right: -100rpx;
- animation: splash-float 6s ease-in-out infinite;
- }
- .splash-overlay-circle.c2 {
- width: 300rpx; height: 300rpx;
- background: #F59E0B;
- bottom: 100rpx; left: -80rpx;
- animation: splash-float 8s ease-in-out infinite reverse;
- }
- .splash-overlay-circle.c3 {
- width: 200rpx; height: 200rpx;
- background: #FF6B9D;
- top: 300rpx; right: 50rpx;
- animation: splash-float 5s ease-in-out infinite 1s;
- }
- @keyframes splash-float {
- 0%, 100% { transform: translateY(0) scale(1); }
- 50% { transform: translateY(-20rpx) scale(1.05); }
- }
- .splash-overlay-body {
- display: flex;
- flex-direction: column;
- align-items: center;
- animation: splash-overlay-fade-in 0.8s ease forwards;
- }
- @keyframes splash-overlay-fade-in {
- from { opacity: 0; transform: translateY(30rpx); }
- to { opacity: 1; transform: translateY(0); }
- }
- .splash-overlay-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: 24rpx;
- box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
- }
- .splash-overlay-logo {
- width: 100rpx; height: 100rpx;
- }
- .splash-overlay-brand {
- font-size: 60rpx; font-weight: 700;
- color: #7C2D12;
- letter-spacing: 8rpx; margin-bottom: 4rpx;
- text-shadow: 0 2rpx 12rpx rgba(0,0,0,0.1);
- }
- .splash-overlay-en {
- font-size: 22rpx;
- color: rgba(124,45,18,0.6);
- letter-spacing: 4rpx; margin-bottom: 20rpx;
- }
- .splash-overlay-dims {
- display: flex; flex-direction: row;
- align-items: center; justify-content: center;
- gap: 20rpx; margin: 24rpx 0;
- }
- .splash-overlay-dim {
- display: flex; flex-direction: column;
- align-items: center; gap: 6rpx;
- }
- .splash-overlay-dim-icon { font-size: 36rpx; line-height: 1; }
- .splash-overlay-dim-label { font-size: 20rpx; color: rgba(124,45,18,0.7); line-height: 1; font-weight: 500; }
- .splash-overlay-tagline {
- font-size: 28rpx;
- color: rgba(124,45,18,0.8);
- letter-spacing: 2rpx; font-weight: 500;
- }
- /* 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; }
- }
- </style>
|