index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  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" />
  176. <child-index v-else-if="currentRole === 'child'" key="child" />
  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. showTabTransition: true,
  221. // splash loading ovarlay(首次进入时展示,数据加载完关闭)
  222. splashOverlay: false,
  223. splashOverlayFading: false,
  224. typeList: [
  225. { label: '全部', value: '' },
  226. { label: '活动', value: 'activity' },
  227. { label: '课程', value: 'course' },
  228. { label: '实物', value: 'physical' },
  229. { label: '数字', value: 'digital' },
  230. { label: '服务', value: 'service' }
  231. ],
  232. currentType: '',
  233. products: [],
  234. loading: false,
  235. dimensionActivities: [],
  236. indexArticles: [],
  237. articlesLoading: false
  238. }
  239. },
  240. onLoad(options) {
  241. this._doInit(options)
  242. },
  243. onShow() {
  244. // 从 splash 首次进入:展示 splash overlay,数据加载完后自动关闭
  245. var showOverlay = uni.getStorageSync('_showSplashOverlay')
  246. if (showOverlay === '1') {
  247. uni.removeStorageSync('_showSplashOverlay')
  248. this._showSplashOverlayMask()
  249. }
  250. // Tabbar 切换过渡动画
  251. this.showTabTransition = true
  252. var self = this
  253. setTimeout(function() {
  254. self.showTabTransition = false
  255. }, 1800)
  256. // 始终执行初始化,确保登录态变更后及时切换视图
  257. this._doInit()
  258. },
  259. methods: {
  260. // ===== Splash overlay (首次进入蒙板) =====
  261. _showSplashOverlayMask() {
  262. this.splashOverlay = true
  263. this._splashLoadCount = 0
  264. this._splashMinPassed = false
  265. // 最小展示 800ms,让 overlay 有足够时间呈现
  266. var self = this
  267. setTimeout(function() {
  268. self._splashMinPassed = true
  269. self._tryHideSplash()
  270. }, 800)
  271. // 最长 6 秒强制关闭,防止 API 卡死导致蒙板不消失
  272. setTimeout(function() {
  273. if (self.splashOverlay) {
  274. self._hideSplashOverlay()
  275. }
  276. }, 6000)
  277. },
  278. _checkSplashReady() {
  279. this._splashLoadCount++
  280. this._tryHideSplash()
  281. },
  282. _tryHideSplash() {
  283. if (this.splashOverlayFading) return
  284. // 最小展示时间未到 → 等待
  285. if (!this._splashMinPassed) return
  286. // 已登录用户只需最小时间;游客需要等待 3 个 API 全部返回
  287. if (this.isLoggedIn() || this._splashLoadCount >= 3) {
  288. this._hideSplashOverlay()
  289. }
  290. },
  291. _hideSplashOverlay() {
  292. if (this.splashOverlayFading) return
  293. this.splashOverlayFading = true
  294. var self = this
  295. setTimeout(function() {
  296. self.splashOverlay = false
  297. self.splashOverlayFading = false
  298. }, 400)
  299. },
  300. _doInit(options) {
  301. options = options || {}
  302. if (!this.isLoggedIn()) {
  303. this.currentRole = ''
  304. this.loadProducts()
  305. this.loadDimensionActivities()
  306. this.loadFeaturedArticles()
  307. return
  308. }
  309. this.syncRoleAndTabBar()
  310. if (options.inviteCode && options.type === 'parent_invite') {
  311. this.handleParentInvite(options.inviteCode)
  312. } else {
  313. var storedCode = uni.getStorageSync('inviteCode')
  314. var storedType = uni.getStorageSync('inviteType')
  315. if (storedCode && storedType === 'parent_invite') {
  316. this.handleParentInvite(storedCode)
  317. uni.removeStorageSync('inviteCode')
  318. uni.removeStorageSync('inviteType')
  319. }
  320. }
  321. },
  322. isLoggedIn() {
  323. return !!uni.getStorageSync('token')
  324. },
  325. normalizeCurrentRole() {
  326. const role = uni.getStorageSync('role') || 'parent'
  327. const currentRole = uni.getStorageSync('currentRole')
  328. if (!currentRole) {
  329. return role
  330. }
  331. // 非规划师账号不允许落到规划师首页
  332. if (currentRole === 'teacher' && role !== 'teacher') {
  333. return role
  334. }
  335. // 只有家长账号允许切换到孩子视角
  336. if (currentRole === 'child' && role !== 'parent') {
  337. return role
  338. }
  339. return currentRole
  340. },
  341. syncRoleAndTabBar() {
  342. this.currentRole = this.normalizeCurrentRole()
  343. uni.setStorageSync('currentRole', this.currentRole)
  344. },
  345. // ===== 发现页 / 未登录态方法 =====
  346. loadProducts: function() {
  347. this.loading = true
  348. var params = { page: 1, size: 10 }
  349. if (this.currentType) {
  350. params.productType = this.currentType
  351. }
  352. var self = this
  353. productList(params).then(function(res) {
  354. self.loading = false
  355. if (res && res.code === 200) {
  356. // res.data is the response wrapper, products are in res.data.data or res.data.records
  357. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  358. self.products = Array.isArray(rawData) ? rawData : []
  359. }
  360. self._checkSplashReady()
  361. }).catch(function() {
  362. self.loading = false
  363. self._checkSplashReady()
  364. })
  365. },
  366. loadDimensionActivities: function() {
  367. var self = this
  368. getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
  369. if (res && res.code === 200) {
  370. // res.data is the response wrapper, activities are in res.data.data or res.data.records
  371. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  372. self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
  373. }
  374. self._checkSplashReady()
  375. }).catch(function() {
  376. self._checkSplashReady()
  377. })
  378. },
  379. loadFeaturedArticles: function() {
  380. var self = this
  381. this.articlesLoading = true
  382. getFeaturedArticles({ size: 5 }).then(function(res) {
  383. self.articlesLoading = false
  384. if (res && res.code === 200) {
  385. var gradientColors = [
  386. 'linear-gradient(135deg, #10B981, #34D399)',
  387. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  388. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  389. 'linear-gradient(135deg, #F97316, #FB923C)',
  390. 'linear-gradient(135deg, #6366F1, #818CF8)'
  391. ]
  392. // res.data is the response wrapper, articles are in res.data.data
  393. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  394. var list = Array.isArray(rawList) ? rawList : []
  395. self.indexArticles = list.map(function(item, index) {
  396. return {
  397. id: item.id,
  398. category: item.categoryName || item.category || '热门文章',
  399. categoryColor: gradientColors[index % gradientColors.length],
  400. title: item.title || '',
  401. summary: item.summary || '',
  402. views: item.viewCount ? String(item.viewCount) : '0',
  403. date: item.publishedAt ? item.publishedAt.slice(0, 10) : ''
  404. }
  405. })
  406. }
  407. self._checkSplashReady()
  408. }).catch(function() {
  409. self.articlesLoading = false
  410. self._checkSplashReady()
  411. })
  412. },
  413. goActivities: function() {
  414. uni.navigateTo({ url: '/pages/discover/index?type=activity' })
  415. },
  416. goActivityDetail: function(act) {
  417. uni.navigateTo({ url: '/pages/discover-detail/activity-detail/activity-detail?id=' + act.id })
  418. },
  419. goArticles: function() {
  420. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  421. },
  422. goArticleDetail: function(id) {
  423. uni.navigateTo({ url: '/pages/mind-detail/article-detail?id=' + id })
  424. },
  425. onTypeChange(value) {
  426. this.currentType = value
  427. this.loadProducts()
  428. },
  429. goShop() {
  430. uni.navigateTo({ url: '/pages/discover/index' })
  431. },
  432. goDetail(id) {
  433. uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + id })
  434. },
  435. handleLogin() {
  436. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index/index') })
  437. },
  438. async handleParentInvite(code) {
  439. // 延迟显示,等待登录完成
  440. setTimeout(async () => {
  441. const hasToken = uni.getStorageSync('token')
  442. if (!hasToken) {
  443. // 未登录,先去登录
  444. uni.reLaunch({
  445. url: '/pages/login/login?inviteCode=' + code
  446. })
  447. return
  448. }
  449. // 已登录,显示确认框
  450. uni.showModal({
  451. title: '加入家庭',
  452. content: '您已被邀请加入家庭,是否接受?',
  453. success: async (res) => {
  454. if (res.confirm) {
  455. try {
  456. uni.showLoading({ title: '加入中...' })
  457. const result = await acceptParentInvite(code)
  458. uni.hideLoading()
  459. if (result.code === 200) {
  460. const { familyId, role, token } = result.data
  461. uni.setStorageSync('familyId', familyId)
  462. uni.setStorageSync('role', role)
  463. uni.setStorageSync('token', token)
  464. uni.showToast({ title: '加入成功', icon: 'success' })
  465. // 刷新页面
  466. setTimeout(() => {
  467. uni.switchTab({ url: '/pages/index/index' })
  468. }, 1500)
  469. }
  470. } catch (e) {
  471. uni.hideLoading()
  472. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  473. }
  474. }
  475. }
  476. })
  477. }, 500)
  478. },
  479. },
  480. computed: {
  481. dimList: function() {
  482. return DIMENSIONS
  483. },
  484. energyDotColors: function() {
  485. return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
  486. }
  487. }
  488. }
  489. </script>
  490. <style>
  491. .discover-container {
  492. min-height: 100vh;
  493. background: #f5f7fa;
  494. padding-bottom: 100rpx;
  495. }
  496. /* ===== 推荐 ===== */
  497. .recommend-section {
  498. margin: 20rpx 30rpx;
  499. }
  500. .section-header {
  501. display: flex;
  502. justify-content: space-between;
  503. align-items: center;
  504. margin-bottom: 20rpx;
  505. }
  506. .section-title {
  507. font-size: 30rpx;
  508. font-weight: bold;
  509. color: #333;
  510. }
  511. .section-more {
  512. font-size: 24rpx;
  513. color: #5B9BD5;
  514. }
  515. .type-filter-scroll {
  516. white-space: nowrap;
  517. margin-bottom: 20rpx;
  518. }
  519. .filter-chip {
  520. display: inline-block;
  521. padding: 8rpx 24rpx;
  522. font-size: 24rpx;
  523. color: #666;
  524. background: #f0f0f0;
  525. border-radius: 30rpx;
  526. margin-right: 16rpx;
  527. }
  528. .filter-chip.active {
  529. background: #5B9BD5;
  530. color: #fff;
  531. }
  532. .loading-state,
  533. .empty-state {
  534. display: flex;
  535. justify-content: center;
  536. padding: 60rpx 0;
  537. }
  538. .loading-text,
  539. .empty-text {
  540. font-size: 26rpx;
  541. color: #999;
  542. }
  543. .product-grid {
  544. display: flex;
  545. flex-wrap: wrap;
  546. justify-content: space-between;
  547. }
  548. .product-card {
  549. width: 48%;
  550. background: #fff;
  551. border-radius: 16rpx;
  552. overflow: hidden;
  553. margin-bottom: 20rpx;
  554. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  555. }
  556. .product-cover {
  557. width: 100%;
  558. height: 200rpx;
  559. background: #f0f0f0;
  560. }
  561. .product-info {
  562. padding: 14rpx;
  563. }
  564. .product-name {
  565. display: block;
  566. font-size: 26rpx;
  567. color: #333;
  568. margin-bottom: 10rpx;
  569. overflow: hidden;
  570. text-overflow: ellipsis;
  571. white-space: nowrap;
  572. }
  573. .product-price-row {
  574. display: flex;
  575. align-items: baseline;
  576. }
  577. .product-price {
  578. font-size: 28rpx;
  579. color: #5B9BD5;
  580. font-weight: bold;
  581. margin-right: 10rpx;
  582. }
  583. .product-price-login {
  584. font-size: 24rpx;
  585. color: #999;
  586. }
  587. .product-member {
  588. font-size: 20rpx;
  589. color: #999;
  590. }
  591. /* ===== 五维全景幸福矩阵 ===== */
  592. .why-section {
  593. margin: 30rpx;
  594. }
  595. .dim-matrix {
  596. display: flex;
  597. flex-wrap: wrap;
  598. gap: 20rpx;
  599. justify-content: center;
  600. }
  601. .dim-card {
  602. width: calc(33.33% - 14rpx);
  603. box-sizing: border-box;
  604. background: #fff;
  605. border-radius: 20rpx;
  606. padding: 28rpx 16rpx 24rpx;
  607. display: flex;
  608. flex-direction: column;
  609. align-items: center;
  610. text-align: center;
  611. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  612. transition: transform 0.2s ease, box-shadow 0.2s ease;
  613. position: relative;
  614. overflow: hidden;
  615. }
  616. .dim-card:active {
  617. transform: scale(0.96);
  618. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
  619. }
  620. .dim-icon-circle {
  621. width: 72rpx;
  622. height: 72rpx;
  623. border-radius: 50%;
  624. display: flex;
  625. align-items: center;
  626. justify-content: center;
  627. margin-bottom: 14rpx;
  628. flex-shrink: 0;
  629. }
  630. .dim-icon {
  631. font-size: 36rpx;
  632. line-height: 1;
  633. }
  634. .dim-tag {
  635. font-size: 22rpx;
  636. font-weight: 600;
  637. padding: 4rpx 14rpx;
  638. border-radius: 20rpx;
  639. margin-bottom: 10rpx;
  640. max-width: 100%;
  641. overflow: hidden;
  642. text-overflow: ellipsis;
  643. white-space: nowrap;
  644. }
  645. .dim-desc {
  646. font-size: 20rpx;
  647. color: #888;
  648. line-height: 1.5;
  649. display: -webkit-box;
  650. -webkit-line-clamp: 2;
  651. -webkit-box-orient: vertical;
  652. overflow: hidden;
  653. }
  654. /* 五维能量环 */
  655. .dim-energy-row {
  656. display: flex;
  657. justify-content: center;
  658. gap: 12rpx;
  659. margin-top: 24rpx;
  660. opacity: 0.5;
  661. }
  662. .energy-dot {
  663. width: 10rpx;
  664. height: 10rpx;
  665. border-radius: 50%;
  666. }
  667. /* ===== 底部登录 ===== */
  668. .login-footer {
  669. margin: 40rpx 30rpx;
  670. display: flex;
  671. flex-direction: column;
  672. align-items: center;
  673. }
  674. .login-btn {
  675. width: 100%;
  676. height: 88rpx;
  677. line-height: 88rpx;
  678. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  679. color: #fff;
  680. font-size: 32rpx;
  681. font-weight: bold;
  682. border-radius: 44rpx;
  683. text-align: center;
  684. border: none;
  685. }
  686. .login-btn::after {
  687. border: none;
  688. }
  689. .login-footer-text {
  690. font-size: 20rpx;
  691. color: #bbb;
  692. margin-top: 16rpx;
  693. }
  694. /* ===== 加载占位 ===== */
  695. .loading-container {
  696. display: flex;
  697. justify-content: center;
  698. align-items: center;
  699. height: 100vh;
  700. }
  701. /* ===== 角色切换淡入淡出 ===== */
  702. .role-switch-wrapper {
  703. width: 100%;
  704. min-height: 100vh;
  705. }
  706. .fade-enter-active,
  707. .fade-leave-active {
  708. transition: opacity 0.3s ease;
  709. }
  710. .fade-enter,
  711. .fade-leave-to {
  712. opacity: 0;
  713. }
  714. /* ===== 通用区块样式 ===== */
  715. .section {
  716. margin: 20rpx 30rpx;
  717. }
  718. .section-header {
  719. display: flex;
  720. justify-content: space-between;
  721. align-items: center;
  722. margin-bottom: 20rpx;
  723. }
  724. .section-title {
  725. font-size: 30rpx;
  726. font-weight: bold;
  727. color: #333;
  728. }
  729. .section-more {
  730. font-size: 24rpx;
  731. color: #5B9BD5;
  732. }
  733. .empty-state {
  734. display: flex;
  735. justify-content: center;
  736. padding: 60rpx 0;
  737. }
  738. .empty-text {
  739. font-size: 26rpx;
  740. color: #999;
  741. }
  742. /* ===== 活动列表 ===== */
  743. .activity-list {
  744. display: flex;
  745. flex-direction: column;
  746. gap: 16rpx;
  747. }
  748. .activity-card {
  749. background: #fff;
  750. border-radius: 16rpx;
  751. overflow: hidden;
  752. display: flex;
  753. flex-direction: row;
  754. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  755. }
  756. .activity-card:active {
  757. opacity: 0.8;
  758. }
  759. .activity-cover {
  760. width: 200rpx;
  761. height: 160rpx;
  762. flex-shrink: 0;
  763. background: #f0f0f0;
  764. }
  765. .activity-info {
  766. flex: 1;
  767. padding: 16rpx;
  768. display: flex;
  769. flex-direction: column;
  770. justify-content: space-between;
  771. }
  772. .activity-name {
  773. font-size: 28rpx;
  774. font-weight: bold;
  775. color: #333;
  776. margin-bottom: 8rpx;
  777. }
  778. .line-clamp-1 {
  779. overflow: hidden;
  780. text-overflow: ellipsis;
  781. white-space: nowrap;
  782. }
  783. .activity-meta {
  784. display: flex;
  785. align-items: center;
  786. margin-bottom: 8rpx;
  787. }
  788. .activity-time {
  789. font-size: 22rpx;
  790. color: #999;
  791. }
  792. .activity-bottom {
  793. display: flex;
  794. align-items: center;
  795. gap: 12rpx;
  796. }
  797. .activity-status {
  798. font-size: 20rpx;
  799. padding: 2rpx 10rpx;
  800. border-radius: 8rpx;
  801. background: #E8F5E9;
  802. color: #2E7D32;
  803. }
  804. .activity-status.status-upcoming {
  805. background: #E3F2FD;
  806. color: #1565C0;
  807. }
  808. .activity-status.status-ended {
  809. background: #F5F5F5;
  810. color: #999;
  811. }
  812. .activity-fee {
  813. font-size: 24rpx;
  814. color: #F97316;
  815. font-weight: bold;
  816. }
  817. .activity-fee.fee-free {
  818. color: #4CAF50;
  819. }
  820. /* ===== 文章列表 ===== */
  821. .article-list {
  822. display: flex;
  823. flex-direction: column;
  824. gap: 16rpx;
  825. }
  826. .article-card {
  827. background: #fff;
  828. border-radius: 16rpx;
  829. padding: 24rpx;
  830. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  831. }
  832. .article-card:active {
  833. opacity: 0.8;
  834. }
  835. .article-category {
  836. display: inline-block;
  837. padding: 4rpx 14rpx;
  838. border-radius: 8rpx;
  839. margin-bottom: 10rpx;
  840. }
  841. .article-category-text {
  842. font-size: 20rpx;
  843. color: #fff;
  844. }
  845. .article-title {
  846. display: block;
  847. font-size: 28rpx;
  848. font-weight: bold;
  849. color: #333;
  850. margin-bottom: 8rpx;
  851. line-height: 1.4;
  852. }
  853. .article-summary {
  854. display: block;
  855. font-size: 24rpx;
  856. color: #888;
  857. line-height: 1.5;
  858. margin-bottom: 12rpx;
  859. overflow: hidden;
  860. text-overflow: ellipsis;
  861. display: -webkit-box;
  862. -webkit-line-clamp: 2;
  863. -webkit-box-orient: vertical;
  864. }
  865. .article-meta {
  866. display: flex;
  867. align-items: center;
  868. gap: 16rpx;
  869. }
  870. .meta-item {
  871. display: flex;
  872. align-items: center;
  873. gap: 4rpx;
  874. }
  875. .meta-icon {
  876. font-size: 24rpx;
  877. }
  878. .meta-text {
  879. font-size: 22rpx;
  880. color: #999;
  881. }
  882. .article-date {
  883. font-size: 22rpx;
  884. color: #bbb;
  885. }
  886. /* ===== Splash Loading Overlay(首次进入蒙板) ===== */
  887. .splash-overlay {
  888. position: fixed;
  889. top: 0;
  890. left: 0;
  891. right: 0;
  892. bottom: 0;
  893. z-index: 9999;
  894. display: flex;
  895. align-items: center;
  896. justify-content: center;
  897. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  898. overflow: hidden;
  899. opacity: 1;
  900. transition: opacity 0.4s ease;
  901. }
  902. .splash-overlay.fade-out {
  903. opacity: 0;
  904. pointer-events: none;
  905. }
  906. .splash-overlay-bg {
  907. position: absolute;
  908. top: 0;
  909. left: 0;
  910. right: 0;
  911. bottom: 0;
  912. pointer-events: none;
  913. }
  914. .splash-overlay-circle {
  915. position: absolute;
  916. border-radius: 50%;
  917. opacity: 0.15;
  918. }
  919. .splash-overlay-circle.c1 {
  920. width: 400rpx; height: 400rpx;
  921. background: #FF8C42;
  922. top: -100rpx; right: -100rpx;
  923. animation: splash-float 6s ease-in-out infinite;
  924. }
  925. .splash-overlay-circle.c2 {
  926. width: 300rpx; height: 300rpx;
  927. background: #F59E0B;
  928. bottom: 100rpx; left: -80rpx;
  929. animation: splash-float 8s ease-in-out infinite reverse;
  930. }
  931. .splash-overlay-circle.c3 {
  932. width: 200rpx; height: 200rpx;
  933. background: #FF6B9D;
  934. top: 300rpx; right: 50rpx;
  935. animation: splash-float 5s ease-in-out infinite 1s;
  936. }
  937. @keyframes splash-float {
  938. 0%, 100% { transform: translateY(0) scale(1); }
  939. 50% { transform: translateY(-20rpx) scale(1.05); }
  940. }
  941. .splash-overlay-body {
  942. display: flex;
  943. flex-direction: column;
  944. align-items: center;
  945. animation: splash-overlay-fade-in 0.8s ease forwards;
  946. }
  947. @keyframes splash-overlay-fade-in {
  948. from { opacity: 0; transform: translateY(30rpx); }
  949. to { opacity: 1; transform: translateY(0); }
  950. }
  951. .splash-overlay-logo-wrap {
  952. width: 160rpx; height: 160rpx;
  953. border-radius: 40rpx;
  954. background: rgba(255,255,255,0.95);
  955. display: flex; align-items: center; justify-content: center;
  956. margin-bottom: 24rpx;
  957. box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
  958. }
  959. .splash-overlay-logo {
  960. width: 100rpx; height: 100rpx;
  961. }
  962. .splash-overlay-brand {
  963. font-size: 60rpx; font-weight: 700;
  964. color: #7C2D12;
  965. letter-spacing: 8rpx; margin-bottom: 4rpx;
  966. text-shadow: 0 2rpx 12rpx rgba(0,0,0,0.1);
  967. }
  968. .splash-overlay-en {
  969. font-size: 22rpx;
  970. color: rgba(124,45,18,0.6);
  971. letter-spacing: 4rpx; margin-bottom: 20rpx;
  972. }
  973. .splash-overlay-dims {
  974. display: flex; flex-direction: row;
  975. align-items: center; justify-content: center;
  976. gap: 20rpx; margin: 24rpx 0;
  977. }
  978. .splash-overlay-dim {
  979. display: flex; flex-direction: column;
  980. align-items: center; gap: 6rpx;
  981. }
  982. .splash-overlay-dim-icon { font-size: 36rpx; line-height: 1; }
  983. .splash-overlay-dim-label { font-size: 20rpx; color: rgba(124,45,18,0.7); line-height: 1; font-weight: 500; }
  984. .splash-overlay-tagline {
  985. font-size: 28rpx;
  986. color: rgba(124,45,18,0.8);
  987. letter-spacing: 2rpx; font-weight: 500;
  988. }
  989. /* Loading dots */
  990. .splash-overlay-loading {
  991. position: absolute;
  992. bottom: 120rpx;
  993. left: 0; right: 0;
  994. display: flex;
  995. justify-content: center;
  996. align-items: center;
  997. gap: 12rpx;
  998. }
  999. .splash-overlay-dot {
  1000. width: 14rpx; height: 14rpx;
  1001. border-radius: 50%;
  1002. background: rgba(249,115,22,0.6);
  1003. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  1004. }
  1005. .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
  1006. .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
  1007. .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
  1008. @keyframes splash-dot-bounce {
  1009. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  1010. 40% { transform: scale(1); opacity: 1; }
  1011. }
  1012. </style>