index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. <template>
  2. <view>
  3. <!-- 首次进入的 splash loading 蒙板 — 覆盖首页直到数据加载完毕 -->
  4. <view class="splash-overlay" :class="{'fade-out': splashOverlayFading}" v-if="splashOverlay || splashOverlayFading">
  5. <view class="splash-overlay-bg">
  6. <view class="splash-overlay-circle c1"></view>
  7. <view class="splash-overlay-circle c2"></view>
  8. <view class="splash-overlay-circle c3"></view>
  9. </view>
  10. <view class="splash-overlay-body">
  11. <view class="splash-overlay-logo-wrap">
  12. <image class="splash-overlay-logo" src="/static/logo.png" mode="aspectFit" />
  13. </view>
  14. <text class="splash-overlay-brand">浠艾福</text>
  15. <text class="splash-overlay-en">Care Family</text>
  16. <view class="splash-overlay-dims">
  17. <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🌏</text><text class="splash-overlay-dim-label">身</text></view>
  18. <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🔥</text><text class="splash-overlay-dim-label">心</text></view>
  19. <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">⚡</text><text class="splash-overlay-dim-label">智</text></view>
  20. <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">🌿</text><text class="splash-overlay-dim-label">行</text></view>
  21. <view class="splash-overlay-dim"><text class="splash-overlay-dim-icon">💧</text><text class="splash-overlay-dim-label">富</text></view>
  22. </view>
  23. <text class="splash-overlay-tagline">给全家的一站式幸福提案</text>
  24. <view class="splash-overlay-loading">
  25. <view class="splash-overlay-dot"></view>
  26. <view class="splash-overlay-dot"></view>
  27. <view class="splash-overlay-dot"></view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- Tabbar 切换过渡页 -->
  32. <tab-transition v-if="showTabTransition" dimCode="action" />
  33. <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
  34. <view v-if="!currentRole" class="discover-container">
  35. <!-- 品牌头部 -->
  36. <PageBanner theme="home"
  37. tagline="家庭健康成长俱乐部"
  38. quote="给全家的一站式幸福提案" />
  39. <!-- 五行沙盘预览 -->
  40. <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
  41. <!-- 活动/商品推荐 -->
  42. <view class="recommend-section">
  43. <view class="section-header">
  44. <text class="section-title">🔥 热门推荐</text>
  45. <text class="section-more" @click="goShop">查看更多 ›</text>
  46. </view>
  47. <scroll-view scroll-x enable-flex show-scrollbar="false" class="type-filter-scroll">
  48. <view
  49. v-for="item in typeList"
  50. :key="item.value"
  51. :class="['filter-chip', currentType === item.value ? 'active' : '']"
  52. @click="onTypeChange(item.value)"
  53. >
  54. {{ item.label }}
  55. </view>
  56. </scroll-view>
  57. <view v-if="loading" class="loading-state">
  58. <text class="loading-text">加载中...</text>
  59. </view>
  60. <view v-else-if="products.length === 0" class="empty-state">
  61. <text class="empty-text">暂无商品,去商城看看吧</text>
  62. </view>
  63. <view v-else class="product-grid">
  64. <view
  65. v-for="item in products"
  66. :key="item.id"
  67. class="product-card"
  68. @click="handleLogin()"
  69. >
  70. <image class="product-cover" :src="item.coverImage || '/static/default-product.png'" mode="aspectFill" />
  71. <view class="product-info">
  72. <text class="product-name">{{ item.name }}</text>
  73. <view class="product-price-row">
  74. <!-- 游客不显示价格 -->
  75. <text class="product-price-login">登录查看</text>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 热门活动(无条件展示) -->
  82. <view class="section">
  83. <view class="section-header">
  84. <text class="section-title">🔥 热门活动</text>
  85. <text class="section-more" @click="goActivities">查看更多 ›</text>
  86. </view>
  87. <view v-if="dimensionActivities.length === 0" class="empty-state" style="padding: 40rpx 0;">
  88. <text class="empty-text">暂无活动</text>
  89. </view>
  90. <view class="activity-list" v-else>
  91. <view class="activity-card" v-for="act in dimensionActivities" :key="act.id" @click="goActivityDetail(act)">
  92. <image class="activity-cover" :src="act.coverImage || '/static/default-activity.png'" mode="aspectFill" />
  93. <view class="activity-info">
  94. <text class="activity-name line-clamp-1">{{ act.title }}</text>
  95. <view class="activity-meta">
  96. <text class="activity-time">{{ act.startTime }}</text>
  97. </view>
  98. <view class="activity-bottom">
  99. <text class="activity-status" :class="'status-' + (act.status || 'upcoming')">{{ act.status === 'ongoing' ? '进行中' : act.status === 'ended' ? '已结束' : '即将开始' }}</text>
  100. <text class="activity-fee" v-if="act.price && act.price > 0">¥{{ (act.price / 100).toFixed(0) }}</text>
  101. <text class="activity-fee fee-free" v-else>免费</text>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <!-- 推荐阅读(无条件展示) -->
  108. <view class="section">
  109. <view class="section-header">
  110. <text class="section-title">📖 推荐阅读</text>
  111. <text class="section-more" @click="goArticles">更多 ›</text>
  112. </view>
  113. <view v-if="articlesLoading" class="loading-state">
  114. <text class="loading-text">加载中...</text>
  115. </view>
  116. <view v-else-if="indexArticles.length === 0" class="empty-state" style="padding: 40rpx 0;">
  117. <text class="empty-text">暂无文章</text>
  118. </view>
  119. <view class="article-list" v-else>
  120. <view class="article-card" v-for="article in indexArticles" :key="article.id" @click="goArticleDetail(article.id)">
  121. <view class="article-category" :style="{ background: article.categoryColor }">
  122. <text class="article-category-text">{{ article.category }}</text>
  123. </view>
  124. <text class="article-title">{{ article.title }}</text>
  125. <text class="article-summary">{{ article.summary }}</text>
  126. <view class="article-meta">
  127. <view class="meta-item">
  128. <text class="meta-icon">&#x1F4D6;</text>
  129. <text class="meta-text">{{ article.views }}</text>
  130. </view>
  131. <text class="article-date">{{ article.date }}</text>
  132. </view>
  133. </view>
  134. </view>
  135. </view>
  136. <!-- 五维全景幸福矩阵 -->
  137. <view class="why-section">
  138. <view class="section-header">
  139. <text class="section-title">🌏 五维全景幸福矩阵 — 给全家的一站式幸福提案</text>
  140. </view>
  141. <view class="dim-matrix">
  142. <view
  143. v-for="dim in dimList" :key="dim.code"
  144. class="dim-card"
  145. :style="'border-left:6rpx solid ' + dim.color"
  146. @click="handleLogin"
  147. >
  148. <view class="dim-icon-circle" :style="'background:' + dim.bgColor">
  149. <text class="dim-icon">{{ dim.icon }}</text>
  150. </view>
  151. <view class="dim-tag" :style="'color:' + dim.color + ';background:' + dim.bgColor">{{ dim.name }} · {{ dim.title }}</view>
  152. <text class="dim-desc">{{ dim.desc }}</text>
  153. </view>
  154. </view>
  155. <!-- 五维能量环装饰 -->
  156. <view class="dim-energy-row">
  157. <view
  158. v-for="c in energyDotColors" :key="c"
  159. class="energy-dot"
  160. :style="'background:' + c"
  161. ></view>
  162. </view>
  163. </view>
  164. <!-- 底部登录按钮 -->
  165. <view class="login-footer">
  166. <button class="login-btn" @click="handleLogin">登录 / 注册</button>
  167. <text class="login-footer-text">登录即表示同意《用户协议》和《隐私政策》</text>
  168. </view>
  169. <!-- 底部占位 -->
  170. <view style="height: 120rpx;"></view>
  171. </view>
  172. <!-- 登录态 — 按角色渲染(带淡入淡出过渡)-->
  173. <view v-else class="role-switch-wrapper">
  174. <transition name="fade" mode="out-in">
  175. <parent-index v-if="currentRole === 'parent'" key="parent" @ready="onChildReady" />
  176. <child-index v-else-if="currentRole === 'child'" key="child" @ready="onChildReady" />
  177. <!-- teacher-index 已废弃,教师功能折入 parent-index -->
  178. <view v-else class="loading-container" key="loading">
  179. <text>加载中...</text>
  180. </view>
  181. </transition>
  182. <AIFloatingAvatar />
  183. </view>
  184. </view>
  185. </template>
  186. <script>
  187. import ParentIndex from './parent-index.vue'
  188. import ChildIndex from './child-index.vue'
  189. // TeacherIndex 已废弃,教师功能折入 parent-index
  190. import PageBanner from '../../components/PageBanner.vue'
  191. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  192. import TabTransition from '../../components/tab-transition.vue'
  193. import AIFloatingAvatar from '../../components/AIFloatingAvatar.vue'
  194. import { acceptParentInvite, productList, getActivityList, getFeaturedArticles } from '../../utils/api.js'
  195. var DIMENSIONS = [
  196. { code: 'body', name: '身', icon: '🌏', color: '#8D6E63', bgColor: 'rgba(141,110,99,0.15)', title: '主动健康', desc: '用最适合的方法,从根源调理家人体质,畅享高质量长寿生活' },
  197. { code: 'mind', name: '心', icon: '🔥', color: '#FF6B35', bgColor: 'rgba(255,107,53,0.15)', title: '大爱传承', desc: '将长辈陪护升华为家族纽带,让家风温暖代代相传' },
  198. { code: 'wisdom', name: '智', icon: '⚡', color: '#FFD700', bgColor: 'rgba(255,215,0,0.15)', title: '赋能未来', desc: '专业测评与素质培养,开启孩子面向未来的大智慧' },
  199. { code: 'action', name: '行', icon: '🌿', color: '#4CAF50', bgColor: 'rgba(76,175,80,0.15)', title: '知行合一', desc: '在亲子户外与沙龙中,让健康生活方式真正知行合一' },
  200. { code: 'wealth', name: '富', icon: '💧', color: '#42A5F5', bgColor: 'rgba(66,165,245,0.15)', title: '利他创富', desc: '依托创客生态,在利他分享中实现家庭第二收入曲线' }
  201. ]
  202. export default {
  203. components: {
  204. ParentIndex,
  205. ChildIndex,
  206. PageBanner,
  207. WuxingSandbox,
  208. TabTransition,
  209. AIFloatingAvatar
  210. },
  211. data() {
  212. // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
  213. var _token = uni.getStorageSync('token')
  214. var _currentRole = ''
  215. if (_token) {
  216. _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
  217. }
  218. return {
  219. currentRole: _currentRole,
  220. // TabTransition 始终默认 true,确保首次渲染即出现
  221. showTabTransition: true,
  222. // splash loading overlay 已移除,不再展示
  223. splashOverlay: false,
  224. splashOverlayFading: false,
  225. _splashReady: false,
  226. typeList: [
  227. { label: '全部', value: '' },
  228. { label: '活动', value: 'activity' },
  229. { label: '课程', value: 'course' },
  230. { label: '实物', value: 'physical' },
  231. { label: '数字', value: 'digital' },
  232. { label: '服务', value: 'service' }
  233. ],
  234. currentType: '',
  235. products: [],
  236. loading: false,
  237. dimensionActivities: [],
  238. indexArticles: [],
  239. articlesLoading: false
  240. }
  241. },
  242. onLoad(options) {
  243. this._doInit(options)
  244. },
  245. onShow() {
  246. // TabTransition 已在 data() 中为 true,确保首次渲染即出现
  247. // 但组件缓存后再次切回时可能已被 _watchPageReady 置为 false,需要重置
  248. this.showTabTransition = true
  249. this._watchPageReady()
  250. // 始终执行初始化,确保登录态变更后及时切换视图
  251. this._doInit()
  252. },
  253. methods: {
  254. _checkSplashReady() {
  255. this._splashLoadCount++
  256. this._tryHideSplash()
  257. },
  258. _tryHideSplash() {
  259. if (this.splashOverlayFading) return
  260. if (!this._splashMinPassed) return
  261. if (this.isLoggedIn()) {
  262. // 登录用户:等待子组件的 ready 信号
  263. if (this._splashReady) this._hideSplashOverlay()
  264. } else {
  265. // 游客:等待 3 个 API 全部返回
  266. if (this._splashLoadCount >= 3) this._hideSplashOverlay()
  267. }
  268. },
  269. _hideSplashOverlay() {
  270. if (this.splashOverlayFading) return
  271. this.splashOverlayFading = true
  272. // splash 关闭时同时隐藏 TabTransition(防止 splash 结束后闪现过渡页)
  273. this.showTabTransition = false
  274. var self = this
  275. setTimeout(function() {
  276. self.splashOverlay = false
  277. self.splashOverlayFading = false
  278. }, 400)
  279. },
  280. onChildReady() {
  281. this._splashReady = true
  282. this._tryHideSplash()
  283. },
  284. // 首页 TabTransition 动态关闭:检测关键内容是否就绪
  285. _watchPageReady() {
  286. var self = this
  287. var unwatch = this.$watch(function() {
  288. if (!self.isLoggedIn()) {
  289. return !!(self.products && self.products.length > 0) ||
  290. !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  291. !!(self.indexArticles && self.indexArticles.length > 0)
  292. }
  293. // 登录用户:currentRole 存在代表子组件已渲染
  294. return !!self.currentRole
  295. }, function(val) {
  296. if (val) {
  297. if (unwatch) unwatch()
  298. self.showTabTransition = false
  299. }
  300. })
  301. // 5s 超时兜底
  302. setTimeout(function() {
  303. if (unwatch) unwatch()
  304. self.showTabTransition = false
  305. }, 5000)
  306. },
  307. _doInit(options) {
  308. options = options || {}
  309. if (!this.isLoggedIn()) {
  310. this.currentRole = ''
  311. this.loadProducts()
  312. this.loadDimensionActivities()
  313. this.loadFeaturedArticles()
  314. return
  315. }
  316. this.syncRoleAndTabBar()
  317. if (options.inviteCode && options.type === 'parent_invite') {
  318. this.handleParentInvite(options.inviteCode)
  319. } else {
  320. var storedCode = uni.getStorageSync('inviteCode')
  321. var storedType = uni.getStorageSync('inviteType')
  322. if (storedCode && storedType === 'parent_invite') {
  323. this.handleParentInvite(storedCode)
  324. uni.removeStorageSync('inviteCode')
  325. uni.removeStorageSync('inviteType')
  326. }
  327. }
  328. },
  329. isLoggedIn() {
  330. return !!uni.getStorageSync('token')
  331. },
  332. normalizeCurrentRole() {
  333. const role = uni.getStorageSync('role') || 'parent'
  334. const currentRole = uni.getStorageSync('currentRole')
  335. if (!currentRole) {
  336. return role
  337. }
  338. // 非规划师账号不允许落到规划师首页
  339. if (currentRole === 'teacher' && role !== 'teacher') {
  340. return role
  341. }
  342. // 只有家长账号允许切换到孩子视角
  343. if (currentRole === 'child' && role !== 'parent') {
  344. return role
  345. }
  346. return currentRole
  347. },
  348. syncRoleAndTabBar() {
  349. this.currentRole = this.normalizeCurrentRole()
  350. uni.setStorageSync('currentRole', this.currentRole)
  351. },
  352. // ===== 发现页 / 未登录态方法 =====
  353. loadProducts: function() {
  354. this.loading = true
  355. var params = { page: 1, size: 10 }
  356. if (this.currentType) {
  357. params.productType = this.currentType
  358. }
  359. var self = this
  360. productList(params).then(function(res) {
  361. self.loading = false
  362. if (res && res.code === 200) {
  363. // res.data is the response wrapper, products are in res.data.data or res.data.records
  364. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  365. self.products = Array.isArray(rawData) ? rawData : []
  366. }
  367. self._checkSplashReady()
  368. }).catch(function() {
  369. self.loading = false
  370. self._checkSplashReady()
  371. })
  372. },
  373. loadDimensionActivities: function() {
  374. var self = this
  375. getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
  376. if (res && res.code === 200) {
  377. // res.data is the response wrapper, activities are in res.data.data or res.data.records
  378. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  379. self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
  380. }
  381. self._checkSplashReady()
  382. }).catch(function() {
  383. self._checkSplashReady()
  384. })
  385. },
  386. loadFeaturedArticles: function() {
  387. var self = this
  388. this.articlesLoading = true
  389. getFeaturedArticles({ size: 5 }).then(function(res) {
  390. self.articlesLoading = false
  391. if (res && res.code === 200) {
  392. var gradientColors = [
  393. 'linear-gradient(135deg, #10B981, #34D399)',
  394. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  395. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  396. 'linear-gradient(135deg, #F97316, #FB923C)',
  397. 'linear-gradient(135deg, #6366F1, #818CF8)'
  398. ]
  399. // res.data is the response wrapper, articles are in res.data.data
  400. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  401. var list = Array.isArray(rawList) ? rawList : []
  402. self.indexArticles = list.map(function(item, index) {
  403. return {
  404. id: item.id,
  405. category: item.categoryName || item.category || '热门文章',
  406. categoryColor: gradientColors[index % gradientColors.length],
  407. title: item.title || '',
  408. summary: item.summary || '',
  409. views: item.viewCount ? String(item.viewCount) : '0',
  410. date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
  411. }
  412. })
  413. }
  414. self._checkSplashReady()
  415. }).catch(function() {
  416. self.articlesLoading = false
  417. self._checkSplashReady()
  418. })
  419. },
  420. goActivities: function() {
  421. uni.navigateTo({ url: '/pages/discover/index?type=activity' })
  422. },
  423. goActivityDetail: function(act) {
  424. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  425. },
  426. goArticles: function() {
  427. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  428. },
  429. goArticleDetail: function(id) {
  430. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  431. },
  432. onTypeChange(value) {
  433. this.currentType = value
  434. this.loadProducts()
  435. },
  436. goShop() {
  437. uni.navigateTo({ url: '/pages/discover/index' })
  438. },
  439. goDetail(id) {
  440. uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
  441. },
  442. handleLogin() {
  443. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index/index') })
  444. },
  445. async handleParentInvite(code) {
  446. // 延迟显示,等待登录完成
  447. setTimeout(async () => {
  448. const hasToken = uni.getStorageSync('token')
  449. if (!hasToken) {
  450. // 未登录,先去登录
  451. uni.reLaunch({
  452. url: '/pages/login/login?inviteCode=' + code
  453. })
  454. return
  455. }
  456. // 已登录,显示确认框
  457. uni.showModal({
  458. title: '加入家庭',
  459. content: '您已被邀请加入家庭,是否接受?',
  460. success: async (res) => {
  461. if (res.confirm) {
  462. try {
  463. uni.showLoading({ title: '加入中...' })
  464. const result = await acceptParentInvite(code)
  465. uni.hideLoading()
  466. if (result.code === 200) {
  467. const { familyId, role, token } = result.data
  468. uni.setStorageSync('familyId', familyId)
  469. uni.setStorageSync('role', role)
  470. uni.setStorageSync('token', token)
  471. uni.showToast({ title: '加入成功', icon: 'success' })
  472. // 刷新页面
  473. setTimeout(() => {
  474. uni.switchTab({ url: '/pages/index/index' })
  475. }, 1500)
  476. }
  477. } catch (e) {
  478. uni.hideLoading()
  479. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  480. }
  481. }
  482. }
  483. })
  484. }, 500)
  485. },
  486. },
  487. computed: {
  488. dimList: function() {
  489. return DIMENSIONS
  490. },
  491. energyDotColors: function() {
  492. return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
  493. }
  494. }
  495. }
  496. </script>
  497. <style>
  498. .discover-container {
  499. min-height: 100vh;
  500. background: #f5f7fa;
  501. padding-bottom: 100rpx;
  502. }
  503. /* ===== 推荐 ===== */
  504. .recommend-section {
  505. margin: 20rpx 30rpx;
  506. }
  507. .section-header {
  508. display: flex;
  509. justify-content: space-between;
  510. align-items: center;
  511. margin-bottom: 20rpx;
  512. }
  513. .section-title {
  514. font-size: 30rpx;
  515. font-weight: bold;
  516. color: #333;
  517. }
  518. .section-more {
  519. font-size: 24rpx;
  520. color: #5B9BD5;
  521. }
  522. .type-filter-scroll {
  523. white-space: nowrap;
  524. margin-bottom: 20rpx;
  525. }
  526. .filter-chip {
  527. display: inline-block;
  528. padding: 8rpx 24rpx;
  529. font-size: 24rpx;
  530. color: #666;
  531. background: #f0f0f0;
  532. border-radius: 30rpx;
  533. margin-right: 16rpx;
  534. }
  535. .filter-chip.active {
  536. background: #5B9BD5;
  537. color: #fff;
  538. }
  539. .loading-state,
  540. .empty-state {
  541. display: flex;
  542. justify-content: center;
  543. padding: 60rpx 0;
  544. }
  545. .loading-text,
  546. .empty-text {
  547. font-size: 26rpx;
  548. color: #999;
  549. }
  550. .product-grid {
  551. display: flex;
  552. flex-wrap: wrap;
  553. justify-content: space-between;
  554. }
  555. .product-card {
  556. width: 48%;
  557. background: #fff;
  558. border-radius: 16rpx;
  559. overflow: hidden;
  560. margin-bottom: 20rpx;
  561. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  562. }
  563. .product-cover {
  564. width: 100%;
  565. height: 200rpx;
  566. background: #f0f0f0;
  567. }
  568. .product-info {
  569. padding: 14rpx;
  570. }
  571. .product-name {
  572. display: block;
  573. font-size: 26rpx;
  574. color: #333;
  575. margin-bottom: 10rpx;
  576. overflow: hidden;
  577. text-overflow: ellipsis;
  578. white-space: nowrap;
  579. }
  580. .product-price-row {
  581. display: flex;
  582. align-items: baseline;
  583. }
  584. .product-price {
  585. font-size: 28rpx;
  586. color: #5B9BD5;
  587. font-weight: bold;
  588. margin-right: 10rpx;
  589. }
  590. .product-price-login {
  591. font-size: 24rpx;
  592. color: #999;
  593. }
  594. .product-member {
  595. font-size: 20rpx;
  596. color: #999;
  597. }
  598. /* ===== 五维全景幸福矩阵 ===== */
  599. .why-section {
  600. margin: 30rpx;
  601. }
  602. .dim-matrix {
  603. display: flex;
  604. flex-wrap: wrap;
  605. gap: 20rpx;
  606. justify-content: center;
  607. }
  608. .dim-card {
  609. width: calc(33.33% - 14rpx);
  610. box-sizing: border-box;
  611. background: #fff;
  612. border-radius: 20rpx;
  613. padding: 28rpx 16rpx 24rpx;
  614. display: flex;
  615. flex-direction: column;
  616. align-items: center;
  617. text-align: center;
  618. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  619. transition: transform 0.2s ease, box-shadow 0.2s ease;
  620. position: relative;
  621. overflow: hidden;
  622. }
  623. .dim-card:active {
  624. transform: scale(0.96);
  625. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
  626. }
  627. .dim-icon-circle {
  628. width: 72rpx;
  629. height: 72rpx;
  630. border-radius: 50%;
  631. display: flex;
  632. align-items: center;
  633. justify-content: center;
  634. margin-bottom: 14rpx;
  635. flex-shrink: 0;
  636. }
  637. .dim-icon {
  638. font-size: 36rpx;
  639. line-height: 1;
  640. }
  641. .dim-tag {
  642. font-size: 22rpx;
  643. font-weight: 600;
  644. padding: 4rpx 14rpx;
  645. border-radius: 20rpx;
  646. margin-bottom: 10rpx;
  647. max-width: 100%;
  648. overflow: hidden;
  649. text-overflow: ellipsis;
  650. white-space: nowrap;
  651. }
  652. .dim-desc {
  653. font-size: 20rpx;
  654. color: #888;
  655. line-height: 1.5;
  656. display: -webkit-box;
  657. -webkit-line-clamp: 2;
  658. -webkit-box-orient: vertical;
  659. overflow: hidden;
  660. }
  661. /* 五维能量环 */
  662. .dim-energy-row {
  663. display: flex;
  664. justify-content: center;
  665. gap: 12rpx;
  666. margin-top: 24rpx;
  667. opacity: 0.5;
  668. }
  669. .energy-dot {
  670. width: 10rpx;
  671. height: 10rpx;
  672. border-radius: 50%;
  673. }
  674. /* ===== 底部登录 ===== */
  675. .login-footer {
  676. margin: 40rpx 30rpx;
  677. display: flex;
  678. flex-direction: column;
  679. align-items: center;
  680. }
  681. .login-btn {
  682. width: 100%;
  683. height: 88rpx;
  684. line-height: 88rpx;
  685. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  686. color: #fff;
  687. font-size: 32rpx;
  688. font-weight: bold;
  689. border-radius: 44rpx;
  690. text-align: center;
  691. border: none;
  692. }
  693. .login-btn::after {
  694. border: none;
  695. }
  696. .login-footer-text {
  697. font-size: 20rpx;
  698. color: #bbb;
  699. margin-top: 16rpx;
  700. }
  701. /* ===== 加载占位 ===== */
  702. .loading-container {
  703. display: flex;
  704. justify-content: center;
  705. align-items: center;
  706. height: 100vh;
  707. }
  708. /* ===== 角色切换淡入淡出 ===== */
  709. .role-switch-wrapper {
  710. width: 100%;
  711. min-height: 100vh;
  712. }
  713. .fade-enter-active,
  714. .fade-leave-active {
  715. transition: opacity 0.3s ease;
  716. }
  717. .fade-enter,
  718. .fade-leave-to {
  719. opacity: 0;
  720. }
  721. /* ===== 通用区块样式 ===== */
  722. .section {
  723. margin: 20rpx 30rpx;
  724. }
  725. .section-header {
  726. display: flex;
  727. justify-content: space-between;
  728. align-items: center;
  729. margin-bottom: 20rpx;
  730. }
  731. .section-title {
  732. font-size: 30rpx;
  733. font-weight: bold;
  734. color: #333;
  735. }
  736. .section-more {
  737. font-size: 24rpx;
  738. color: #5B9BD5;
  739. }
  740. .empty-state {
  741. display: flex;
  742. justify-content: center;
  743. padding: 60rpx 0;
  744. }
  745. .empty-text {
  746. font-size: 26rpx;
  747. color: #999;
  748. }
  749. /* ===== 活动列表 ===== */
  750. .activity-list {
  751. display: flex;
  752. flex-direction: column;
  753. gap: 16rpx;
  754. }
  755. .activity-card {
  756. background: #fff;
  757. border-radius: 16rpx;
  758. overflow: hidden;
  759. display: flex;
  760. flex-direction: row;
  761. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  762. }
  763. .activity-card:active {
  764. opacity: 0.8;
  765. }
  766. .activity-cover {
  767. width: 200rpx;
  768. height: 160rpx;
  769. flex-shrink: 0;
  770. background: #f0f0f0;
  771. }
  772. .activity-info {
  773. flex: 1;
  774. padding: 16rpx;
  775. display: flex;
  776. flex-direction: column;
  777. justify-content: space-between;
  778. }
  779. .activity-name {
  780. font-size: 28rpx;
  781. font-weight: bold;
  782. color: #333;
  783. margin-bottom: 8rpx;
  784. }
  785. .line-clamp-1 {
  786. overflow: hidden;
  787. text-overflow: ellipsis;
  788. white-space: nowrap;
  789. }
  790. .activity-meta {
  791. display: flex;
  792. align-items: center;
  793. margin-bottom: 8rpx;
  794. }
  795. .activity-time {
  796. font-size: 22rpx;
  797. color: #999;
  798. }
  799. .activity-bottom {
  800. display: flex;
  801. align-items: center;
  802. gap: 12rpx;
  803. }
  804. .activity-status {
  805. font-size: 20rpx;
  806. padding: 2rpx 10rpx;
  807. border-radius: 8rpx;
  808. background: #E8F5E9;
  809. color: #2E7D32;
  810. }
  811. .activity-status.status-upcoming {
  812. background: #E3F2FD;
  813. color: #1565C0;
  814. }
  815. .activity-status.status-ended {
  816. background: #F5F5F5;
  817. color: #999;
  818. }
  819. .activity-fee {
  820. font-size: 24rpx;
  821. color: #F97316;
  822. font-weight: bold;
  823. }
  824. .activity-fee.fee-free {
  825. color: #4CAF50;
  826. }
  827. /* ===== 文章列表 ===== */
  828. .article-list {
  829. display: flex;
  830. flex-direction: column;
  831. gap: 16rpx;
  832. }
  833. .article-card {
  834. background: #fff;
  835. border-radius: 16rpx;
  836. padding: 24rpx;
  837. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  838. }
  839. .article-card:active {
  840. opacity: 0.8;
  841. }
  842. .article-category {
  843. display: inline-block;
  844. padding: 4rpx 14rpx;
  845. border-radius: 8rpx;
  846. margin-bottom: 10rpx;
  847. }
  848. .article-category-text {
  849. font-size: 20rpx;
  850. color: #fff;
  851. }
  852. .article-title {
  853. display: block;
  854. font-size: 28rpx;
  855. font-weight: bold;
  856. color: #333;
  857. margin-bottom: 8rpx;
  858. line-height: 1.4;
  859. }
  860. .article-summary {
  861. display: block;
  862. font-size: 24rpx;
  863. color: #888;
  864. line-height: 1.5;
  865. margin-bottom: 12rpx;
  866. overflow: hidden;
  867. text-overflow: ellipsis;
  868. display: -webkit-box;
  869. -webkit-line-clamp: 2;
  870. -webkit-box-orient: vertical;
  871. }
  872. .article-meta {
  873. display: flex;
  874. align-items: center;
  875. gap: 16rpx;
  876. }
  877. .meta-item {
  878. display: flex;
  879. align-items: center;
  880. gap: 4rpx;
  881. }
  882. .meta-icon {
  883. font-size: 24rpx;
  884. }
  885. .meta-text {
  886. font-size: 22rpx;
  887. color: #999;
  888. }
  889. .article-date {
  890. font-size: 22rpx;
  891. color: #bbb;
  892. }
  893. /* ===== Splash Loading Overlay(首次进入蒙板) ===== */
  894. .splash-overlay {
  895. position: fixed;
  896. top: 0;
  897. left: 0;
  898. right: 0;
  899. bottom: 0;
  900. z-index: 9999;
  901. display: flex;
  902. align-items: center;
  903. justify-content: center;
  904. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  905. overflow: hidden;
  906. opacity: 1;
  907. transition: opacity 0.4s ease;
  908. }
  909. .splash-overlay.fade-out {
  910. opacity: 0;
  911. pointer-events: none;
  912. }
  913. .splash-overlay-bg {
  914. position: absolute;
  915. top: 0;
  916. left: 0;
  917. right: 0;
  918. bottom: 0;
  919. pointer-events: none;
  920. }
  921. .splash-overlay-circle {
  922. position: absolute;
  923. border-radius: 50%;
  924. opacity: 0.15;
  925. }
  926. .splash-overlay-circle.c1 {
  927. width: 400rpx; height: 400rpx;
  928. background: #FF8C42;
  929. top: -100rpx; right: -100rpx;
  930. animation: splash-float 6s ease-in-out infinite;
  931. }
  932. .splash-overlay-circle.c2 {
  933. width: 300rpx; height: 300rpx;
  934. background: #F59E0B;
  935. bottom: 100rpx; left: -80rpx;
  936. animation: splash-float 8s ease-in-out infinite reverse;
  937. }
  938. .splash-overlay-circle.c3 {
  939. width: 200rpx; height: 200rpx;
  940. background: #FF6B9D;
  941. top: 300rpx; right: 50rpx;
  942. animation: splash-float 5s ease-in-out infinite 1s;
  943. }
  944. @keyframes splash-float {
  945. 0%, 100% { transform: translateY(0) scale(1); }
  946. 50% { transform: translateY(-20rpx) scale(1.05); }
  947. }
  948. .splash-overlay-body {
  949. display: flex;
  950. flex-direction: column;
  951. align-items: center;
  952. animation: splash-overlay-fade-in 0.8s ease forwards;
  953. }
  954. @keyframes splash-overlay-fade-in {
  955. from { opacity: 0; transform: translateY(30rpx); }
  956. to { opacity: 1; transform: translateY(0); }
  957. }
  958. .splash-overlay-logo-wrap {
  959. width: 160rpx; height: 160rpx;
  960. border-radius: 40rpx;
  961. background: rgba(255,255,255,0.95);
  962. display: flex; align-items: center; justify-content: center;
  963. margin-bottom: 24rpx;
  964. box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
  965. }
  966. .splash-overlay-logo {
  967. width: 100rpx; height: 100rpx;
  968. }
  969. .splash-overlay-brand {
  970. font-size: 60rpx; font-weight: 700;
  971. color: #7C2D12;
  972. letter-spacing: 8rpx; margin-bottom: 4rpx;
  973. text-shadow: 0 2rpx 12rpx rgba(0,0,0,0.1);
  974. }
  975. .splash-overlay-en {
  976. font-size: 22rpx;
  977. color: rgba(124,45,18,0.6);
  978. letter-spacing: 4rpx; margin-bottom: 20rpx;
  979. }
  980. .splash-overlay-dims {
  981. display: flex; flex-direction: row;
  982. align-items: center; justify-content: center;
  983. gap: 20rpx; margin: 24rpx 0;
  984. }
  985. .splash-overlay-dim {
  986. display: flex; flex-direction: column;
  987. align-items: center; gap: 6rpx;
  988. }
  989. .splash-overlay-dim-icon { font-size: 36rpx; line-height: 1; }
  990. .splash-overlay-dim-label { font-size: 20rpx; color: rgba(124,45,18,0.7); line-height: 1; font-weight: 500; }
  991. .splash-overlay-tagline {
  992. font-size: 28rpx;
  993. color: rgba(124,45,18,0.8);
  994. letter-spacing: 2rpx; font-weight: 500;
  995. }
  996. /* Loading dots */
  997. .splash-overlay-loading {
  998. position: absolute;
  999. bottom: 120rpx;
  1000. left: 0; right: 0;
  1001. display: flex;
  1002. justify-content: center;
  1003. align-items: center;
  1004. gap: 12rpx;
  1005. }
  1006. .splash-overlay-dot {
  1007. width: 14rpx; height: 14rpx;
  1008. border-radius: 50%;
  1009. background: rgba(249,115,22,0.6);
  1010. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  1011. }
  1012. .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
  1013. .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
  1014. .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
  1015. @keyframes splash-dot-bounce {
  1016. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  1017. 40% { transform: scale(1); opacity: 1; }
  1018. }
  1019. </style>