| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139 |
- <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" />
- <!-- 发现页/引流内容,登录后也保留 TabBar -->
- <view 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" v-if="!isLoggedIn()" @click="handleLogin">登录 / 注册</button>
- <button class="login-btn home-btn" v-else @click="goHomeDashboard">进入家庭首页</button>
- <text class="login-footer-text" v-if="!isLoggedIn()">登录即表示同意《用户协议》和《隐私政策》</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 { 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: {
- PageBanner,
- WuxingSandbox,
- TabTransition
- },
- 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)'
- ]
- }
- },
- 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)
- },
- onChildReady() {
- // 已废弃:登录用户不再通过此页面渲染子组件
- },
- // 首页 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)
- 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 页,显示推荐内容
- // 不再 redirectTo 到 home 分包(分包页无 TabBar)
- this.loadProducts()
- this.loadDimensionActivities()
- this.loadFeaturedArticles()
- },
- 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') })
- },
- goHomeDashboard() {
- var targetUrl = this.currentRole === 'child'
- ? '/pages/home-pages/child-index'
- : '/pages/home-pages/parent-index'
- uni.navigateTo({ url: targetUrl })
- },
- 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)
- },
- },
- 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(冷启动蒙板,来自 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; }
- }
- </style>
|