index.vue 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831
  1. <template>
  2. <view>
  3. <!-- 冷启动 splash overlay — 覆盖首页直到数据加载完毕(tab 切回时不显示) -->
  4. <view class="splash-overlay" :class="{'fade-out': splashOverlayFading}" v-if="splashOverlay || splashOverlayFading">
  5. <view class="splash-overlay-bg">
  6. <view class="bg-circle bg-circle-1"></view>
  7. <view class="bg-circle bg-circle-2"></view>
  8. <view class="bg-circle bg-circle-3"></view>
  9. </view>
  10. <view class="splash-overlay-body">
  11. <view class="splash-logo-wrap">
  12. <image class="splash-logo-img" src="/static/logo.png" mode="aspectFit" />
  13. </view>
  14. <text class="splash-brand-name">浠艾福</text>
  15. <text class="splash-brand-en">Care Family</text>
  16. <view class="splash-dims-row">
  17. <view class="splash-dim-item">
  18. <view class="splash-dim-circle" style="background:rgba(255,140,66,0.3);"><text class="splash-dim-icon">🌏</text></view>
  19. <text class="splash-dim-label">身</text>
  20. </view>
  21. <view class="splash-dim-item">
  22. <view class="splash-dim-circle" style="background:rgba(255,107,157,0.3);"><text class="splash-dim-icon">🔥</text></view>
  23. <text class="splash-dim-label">心</text>
  24. </view>
  25. <view class="splash-dim-item">
  26. <view class="splash-dim-circle" style="background:rgba(99,102,241,0.3);"><text class="splash-dim-icon">⚡</text></view>
  27. <text class="splash-dim-label">智</text>
  28. </view>
  29. <view class="splash-dim-item">
  30. <view class="splash-dim-circle" style="background:rgba(16,185,129,0.3);"><text class="splash-dim-icon">🌿</text></view>
  31. <text class="splash-dim-label">行</text>
  32. </view>
  33. <view class="splash-dim-item">
  34. <view class="splash-dim-circle" style="background:rgba(245,158,11,0.3);"><text class="splash-dim-icon">💧</text></view>
  35. <text class="splash-dim-label">富</text>
  36. </view>
  37. </view>
  38. <text class="splash-tagline">给全家的一站式幸福提案</text>
  39. <view class="splash-overlay-loading">
  40. <view class="splash-overlay-dot"></view>
  41. <view class="splash-overlay-dot"></view>
  42. <view class="splash-overlay-dot"></view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- Tabbar 切换过渡页 -->
  47. <tab-transition v-if="showTabTransition" dimCode="action" ref="tabTransition" @close="showTabTransition = false" />
  48. <!-- 登录态 — 直接内嵌,保持底签可见 -->
  49. <view v-if="currentRole" class="logged-in-container">
  50. <!-- 品牌头部 -->
  51. <PageBanner theme="action"
  52. tagline="知行合一 · 快乐成长"
  53. quote="千里之行,始于足下" />
  54. <!-- 能量沙盘 — Canvas 五行星图 -->
  55. <view v-if="hasFamily">
  56. <WuxingSandbox
  57. v-if="sandboxData"
  58. mode="live"
  59. :scores="sandboxScores"
  60. :overallScore="sandboxData.overallScore || 0"
  61. :members="sandboxData.members || []"
  62. showDimensionBar
  63. starHeight="480rpx" />
  64. </view>
  65. <view v-else>
  66. <FamilyEmptyState type="card" />
  67. </view>
  68. <!-- 会员入口:非会员显示开通 / 快到期显示续费 -->
  69. <view v-if="showMemberEntry" class="member-entry" @click="goMembership">
  70. <view class="member-entry-icon-wrap">
  71. <text class="member-entry-icon">👑</text>
  72. </view>
  73. <view class="member-entry-texts">
  74. <text class="member-entry-title">{{ memberEntryTitle }}</text>
  75. <text class="member-entry-desc">{{ memberEntryDesc }}</text>
  76. </view>
  77. <view class="member-entry-btn">
  78. <text class="member-entry-btn-text">{{ memberEntryBtn }}</text>
  79. </view>
  80. </view>
  81. <!-- 家庭成员选择条 -->
  82. <FamilyMemberStrip
  83. :members="familyMembersVisible"
  84. :selectedMemberId="selectedMemberId"
  85. :isParent="isFamilyAdmin"
  86. @select="onFamilyMemberSelect"
  87. @switch="onFamilyMemberSwitch"
  88. @removed="loadFamilyMembers" />
  89. <!-- 五维能量条 -->
  90. <FamilyEnergyBar
  91. v-if="sandboxData"
  92. dimensionCode="action"
  93. :sandboxData="sandboxData"
  94. :dualDimension="dualDimension" />
  95. <!-- 家庭挑战任务 -->
  96. <view v-if="hasFamily" class="section challenge-section">
  97. <view class="section-header">
  98. <text class="section-title">🔥 家庭挑战</text>
  99. </view>
  100. <FamilyChallengeCard
  101. v-for="ch in activeChallenges"
  102. :key="ch.id"
  103. :challenge="ch"
  104. :showCheckin="showCheckinBtn"
  105. @checkin="onChallengeCheckin" />
  106. </view>
  107. <view v-else>
  108. <FamilyEmptyState type="card" />
  109. </view>
  110. <!-- 今日行动任务 -->
  111. <DimensionTasks
  112. dimensionCode="action"
  113. :tasks="dimensionTasks"
  114. @taskClick="onTaskClick"
  115. @moreTasks="goTasks" />
  116. <DimensionActivities
  117. dimensionCode="action"
  118. :activities="dimensionActivities"
  119. :isLoggedIn="true"
  120. @activityClick="goActivityDetail"
  121. @moreActivities="goMoreActivities" />
  122. <ArticleBookshelf
  123. :articles="actionArticles"
  124. :isLoggedIn="true"
  125. @articleClick="goArticleDetail"
  126. @moreArticles="goMoreArticles" />
  127. <DimensionProducts
  128. dimensionCode="action"
  129. :products="dimensionProducts"
  130. :isLoggedIn="true"
  131. @productClick="goProductDetail"
  132. @moreProducts="goMoreProducts" />
  133. <!-- ===== 我的圈子 ===== -->
  134. <view class="circle-section" v-if="isLoggedIn()">
  135. <view class="circle-header">
  136. <text class="circle-section-title">🤝 我的圈子</text>
  137. <text class="circle-header-link" @click="goDiscoverCircles">发现更多 ›</text>
  138. </view>
  139. <scroll-view class="circle-scroll" scroll-x enable-flex v-if="myCircles.length > 0">
  140. <view class="circle-scroll-inner">
  141. <view class="circle-card-wrap" v-for="item in myCircles" :key="getCircleKey(item)" @click="onCircleClick(item)">
  142. <CircleCard :circle="item" compact />
  143. </view>
  144. </view>
  145. </scroll-view>
  146. <view class="circle-empty" v-else>
  147. <text class="circle-empty-text">暂未加入圈子,去发现看看</text>
  148. </view>
  149. <!-- ===== 发现推荐 ===== -->
  150. <view class="circle-discover" v-if="discoverCirclesList.length > 0">
  151. <view class="circle-header">
  152. <text class="circle-section-title">🔍 发现推荐</text>
  153. <text class="circle-header-link" @click="goDiscoverCircles">查看更多 ›</text>
  154. </view>
  155. <view class="discover-list">
  156. <view class="discover-item" v-for="item in discoverCirclesList" :key="getCircleKey(item)" @click="onCircleClick(item)">
  157. <CircleCard :circle="item" />
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. <!-- 圈子详情弹窗 -->
  163. <CircleDetail
  164. :visible="circleDetailVisible"
  165. :circle="detailCircle"
  166. :isMember="selectedCircleIsMember"
  167. @close="circleDetailVisible = false"
  168. @join="onCircleJoin"
  169. @leave="onCircleLeave" />
  170. <!-- 功能入口 -->
  171. <view class="func-section">
  172. <view class="func-grid">
  173. <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
  174. <view class="func-icon-wrap">
  175. <text class="func-icon">{{ item.icon }}</text>
  176. </view>
  177. <text class="func-label">{{ item.label }}</text>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 底部占位 -->
  182. <view class="bottom-spacer" style="height: 40rpx;"></view>
  183. </view>
  184. <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
  185. <view v-else class="discover-container">
  186. <!-- 品牌头部 -->
  187. <PageBanner theme="home"
  188. tagline="家庭健康成长俱乐部"
  189. quote="给全家的一站式幸福提案" />
  190. <!-- 五行沙盘预览 -->
  191. <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
  192. <!-- 活动/商品推荐 -->
  193. <view class="recommend-section">
  194. <view class="section-header">
  195. <text class="section-title">🔥 热门推荐</text>
  196. <text class="section-more" @click="goShop">查看更多 ›</text>
  197. </view>
  198. <scroll-view scroll-x enable-flex show-scrollbar="false" class="type-filter-scroll">
  199. <view
  200. v-for="item in typeList"
  201. :key="item.value"
  202. :class="['filter-chip', currentType === item.value ? 'active' : '']"
  203. @click="onTypeChange(item.value)"
  204. >
  205. {{ item.label }}
  206. </view>
  207. </scroll-view>
  208. <view v-if="loading" class="loading-state">
  209. <text class="loading-text">加载中...</text>
  210. </view>
  211. <view v-else-if="products.length === 0" class="empty-state">
  212. <text class="empty-text">暂无商品,去商城看看吧</text>
  213. </view>
  214. <view v-else class="product-grid">
  215. <view
  216. v-for="item in products"
  217. :key="item.id"
  218. class="product-card"
  219. @click="goDetail(item.id)"
  220. >
  221. <image class="product-cover" :src="getImageUrl(item.coverImage) || '/static/default-product.png'" mode="aspectFill" />
  222. <view class="product-info">
  223. <text class="product-name">{{ item.name }}</text>
  224. <view class="product-price-row">
  225. <text class="product-price" v-if="item.price && item.price > 0">¥{{ (item.price / 100).toFixed(0) }}</text>
  226. <text class="product-price-free" v-else>免费</text>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. <!-- 热门活动(无条件展示) -->
  233. <view class="section">
  234. <view class="section-header">
  235. <text class="section-title">🔥 热门活动</text>
  236. <text class="section-more" @click="goActivities">查看更多 ›</text>
  237. </view>
  238. <view v-if="dimensionActivities.length === 0" class="empty-state" style="padding: 40rpx 0;">
  239. <text class="empty-text">暂无活动</text>
  240. </view>
  241. <view class="activity-list" v-else>
  242. <view class="activity-card" v-for="act in dimensionActivities" :key="act.id" @click="goActivityDetail(act)">
  243. <image class="activity-cover" :src="getImageUrl(act.coverImage) || '/static/default-activity.png'" mode="aspectFill" />
  244. <view class="activity-info">
  245. <text class="activity-name line-clamp-1">{{ act.title }}</text>
  246. <view class="activity-meta">
  247. <text class="activity-time">{{ act.startTime }}</text>
  248. </view>
  249. <view class="activity-bottom">
  250. <text class="activity-status" :class="'status-' + (act.status || 'upcoming')">{{ act.status === 'ongoing' ? '进行中' : act.status === 'ended' ? '已结束' : '即将开始' }}</text>
  251. <text class="activity-fee" v-if="act.price && act.price > 0">¥{{ (act.price / 100).toFixed(0) }}</text>
  252. <text class="activity-fee fee-free" v-else>免费</text>
  253. </view>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <!-- 推荐阅读(无条件展示) -->
  259. <view class="section">
  260. <view class="section-header">
  261. <text class="section-title">📖 推荐阅读</text>
  262. <text class="section-more" @click="goArticles">更多 ›</text>
  263. </view>
  264. <view class="article-list">
  265. <view v-if="articlesLoading" class="loading-state" style="padding: 40rpx 0;">
  266. <text class="loading-text">加载中...</text>
  267. </view>
  268. <!-- 无数据时显示占位卡片 -->
  269. <template v-else-if="indexArticles.length === 0">
  270. <view class="article-card" v-for="(item, i) in [1,2,3]" :key="i">
  271. <view class="article-category" :style="{ background: gradientColors[(i-1) % gradientColors.length] }">
  272. <text class="article-category-text">推荐文章</text>
  273. </view>
  274. <text class="article-title">暂无推荐文章</text>
  275. <text class="article-summary">精彩内容即将上线,敬请期待</text>
  276. <view class="article-meta">
  277. <view class="meta-item">
  278. <text class="meta-icon">&#x1F4D6;</text>
  279. <text class="meta-text">0</text>
  280. </view>
  281. <text class="article-date">--</text>
  282. </view>
  283. </view>
  284. </template>
  285. <!-- 有数据时显示文章卡片 -->
  286. <template v-else>
  287. <view class="article-card" v-for="article in indexArticles" :key="article.id" @click="goArticleDetail(article.id)">
  288. <view class="article-category" :style="{ background: article.categoryColor }">
  289. <text class="article-category-text">{{ article.category }}</text>
  290. </view>
  291. <text class="article-title">{{ article.title }}</text>
  292. <text class="article-summary">{{ article.summary }}</text>
  293. <view class="article-meta">
  294. <view class="meta-item">
  295. <text class="meta-icon">&#x1F4D6;</text>
  296. <text class="meta-text">{{ article.views }}</text>
  297. </view>
  298. <text class="article-date">{{ article.date }}</text>
  299. </view>
  300. </view>
  301. </template>
  302. </view>
  303. </view>
  304. <!-- 五维全景幸福矩阵 -->
  305. <view class="why-section">
  306. <view class="section-header">
  307. <text class="section-title">🌏 五维全景幸福矩阵 — 给全家的一站式幸福提案</text>
  308. </view>
  309. <view class="dim-matrix">
  310. <view
  311. v-for="dim in dimList" :key="dim.code"
  312. class="dim-card"
  313. :style="'border-left:6rpx solid ' + dim.color"
  314. >
  315. <view class="dim-icon-circle" :style="'background:' + dim.bgColor">
  316. <text class="dim-icon">{{ dim.icon }}</text>
  317. </view>
  318. <view class="dim-tag" :style="'color:' + dim.color + ';background:' + dim.bgColor">{{ dim.name }} · {{ dim.title }}</view>
  319. <text class="dim-desc">{{ dim.desc }}</text>
  320. </view>
  321. </view>
  322. <!-- 五维能量环装饰 -->
  323. <view class="dim-energy-row">
  324. <view
  325. v-for="c in energyDotColors" :key="c"
  326. class="energy-dot"
  327. :style="'background:' + c"
  328. ></view>
  329. </view>
  330. </view>
  331. <!-- 底部登录按钮 -->
  332. <view class="login-footer">
  333. <button class="login-btn" @click="handleLogin">登录 / 注册</button>
  334. <text class="login-footer-text">登录即表示同意《用户协议》和《隐私政策》</text>
  335. </view>
  336. <!-- 底部占位 -->
  337. <view style="height: 120rpx;"></view>
  338. </view>
  339. </view>
  340. </template>
  341. <script>
  342. import PageBanner from '../../components/PageBanner.vue'
  343. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  344. import TabTransition from '../../components/tab-transition.vue'
  345. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  346. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  347. import DimensionTasks from '../../components/DimensionTasks.vue'
  348. import DimensionActivities from '../../components/DimensionActivities.vue'
  349. import DimensionProducts from '../../components/DimensionProducts.vue'
  350. import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
  351. import CircleCard from '../../components/CircleCard.vue'
  352. import CircleDetail from '../../components/CircleDetail.vue'
  353. import LoginGuideCard from '../../components/LoginGuideCard.vue'
  354. import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
  355. import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getTodayTasksByCategory, getChildren, getEnergyOverview, getProductsByDomain, getChallengeList, getMyCircles, discoverCircles, joinGeneralCircle, leaveGeneralCircle, switchToFamilyMember, getMyMembership, updateChallengeProgress } from '../../utils/api.js'
  356. import store from '../../store/index.js'
  357. import config from '@/config.js'
  358. var DIMENSIONS = [
  359. { code: 'body', name: '身', icon: '🌏', color: '#8D6E63', bgColor: 'rgba(141,110,99,0.15)', title: '主动健康', desc: '用最适合的方法,从根源调理家人体质,畅享高质量长寿生活' },
  360. { code: 'mind', name: '心', icon: '🔥', color: '#FF6B35', bgColor: 'rgba(255,107,53,0.15)', title: '大爱传承', desc: '将长辈陪护升华为家族纽带,让家风温暖代代相传' },
  361. { code: 'wisdom', name: '智', icon: '⚡', color: '#FFD700', bgColor: 'rgba(255,215,0,0.15)', title: '赋能未来', desc: '专业测评与素质培养,开启孩子面向未来的大智慧' },
  362. { code: 'action', name: '行', icon: '🌿', color: '#4CAF50', bgColor: 'rgba(76,175,80,0.15)', title: '知行合一', desc: '在亲子户外与沙龙中,让健康生活方式真正知行合一' },
  363. { code: 'wealth', name: '富', icon: '💧', color: '#42A5F5', bgColor: 'rgba(66,165,245,0.15)', title: '利他创富', desc: '依托创客生态,在利他分享中实现家庭第二收入曲线' }
  364. ]
  365. export default {
  366. components: {
  367. PageBanner,
  368. WuxingSandbox,
  369. TabTransition,
  370. FamilyMemberStrip,
  371. FamilyEnergyBar,
  372. DimensionTasks,
  373. DimensionActivities,
  374. DimensionProducts,
  375. ArticleBookshelf,
  376. CircleCard,
  377. CircleDetail,
  378. LoginGuideCard,
  379. FamilyChallengeCard
  380. },
  381. data() {
  382. // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
  383. var _token = uni.getStorageSync('token')
  384. var _currentRole = ''
  385. if (_token) {
  386. _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
  387. }
  388. // 冷启动标记(由 App.vue onLaunch 设置,仅在冷启动时存在)
  389. var _isFirstLaunch = (uni.getStorageSync('_showSplashOverlay') === '1')
  390. return {
  391. currentRole: _currentRole,
  392. // TabTransition 始终默认 true,确保首次渲染即出现;冷启动时被 splash overlay 覆盖不可见
  393. showTabTransition: true,
  394. // splash loading overlay(冷启动时展示,数据加载完关闭)
  395. splashOverlay: _isFirstLaunch,
  396. splashOverlayFading: false,
  397. _splashReady: false,
  398. typeList: [
  399. { label: '全部', value: '' },
  400. { label: '活动', value: 'activity' },
  401. { label: '课程', value: 'course' },
  402. { label: '实物', value: 'physical' },
  403. { label: '数字', value: 'digital' },
  404. { label: '服务', value: 'service' }
  405. ],
  406. currentType: '',
  407. products: [],
  408. loading: false,
  409. dimensionActivities: [],
  410. indexArticles: [],
  411. articlesLoading: false,
  412. gradientColors: [
  413. 'linear-gradient(135deg, #10B981, #34D399)',
  414. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  415. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  416. 'linear-gradient(135deg, #F97316, #FB923C)',
  417. 'linear-gradient(135deg, #6366F1, #818CF8)'
  418. ],
  419. // 登录态数据
  420. familyMembersVisible: [],
  421. // 接口数据是否已检查(用于 hasFamily 判断,替代已失效的 store.familyId)
  422. childrenChecked: false,
  423. membersChecked: false,
  424. selectedMemberId: null,
  425. sandboxData: null,
  426. dualDimension: null,
  427. dimensionTasks: [],
  428. dimensionActivities: [],
  429. dimensionProducts: [],
  430. articles: [],
  431. children: [],
  432. currentChildId: null,
  433. activeChallenges: [],
  434. myCircles: [],
  435. discoverCirclesList: [],
  436. circleDetailVisible: false,
  437. detailCircle: null,
  438. selectedCircleIsMember: false,
  439. funcList: [
  440. { icon: '\u{1F3CB}', label: '任务', needLogin: true, page: '/pages/tasks/tasks' },
  441. { icon: '\u{1F4AC}', label: '记录互动', needLogin: true, page: '/pages/action-detail/interaction-log' },
  442. { icon: '\u{1F3E0}', label: '家庭天盘', needLogin: true, page: '/pages/mind-detail/family-dashboard' },
  443. { icon: '\u{1F468}\u200D\u{1F469}\u200D\u{1F467}', label: '成员管理', needLogin: true, page: '/pages/profile-extra/family-members' }
  444. ],
  445. loggedInInitDone: false,
  446. // 会员状态(沙盘下方会员入口使用)
  447. isMember: false,
  448. membershipDays: 0
  449. }
  450. },
  451. computed: {
  452. hasFamily: function() {
  453. if (!this.isLoggedIn()) return false
  454. // 接口未返回前乐观显示内容区,避免"暂无数据"闪烁
  455. if (!this.childrenChecked || !this.membersChecked) return true
  456. // 有孩子成员或可见家庭成员即认为有家庭
  457. if (this.sandboxData) return true
  458. if (this.children && this.children.length > 0) return true
  459. if (this.familyMembersVisible && this.familyMembersVisible.length > 0) return true
  460. return this.$store.getters.hasFamily
  461. },
  462. isFamilyAdmin: function() {
  463. if (!this.familyMembersVisible || this.familyMembersVisible.length === 0) return false
  464. return this.familyMembersVisible[0].isAdmin === true
  465. },
  466. sandboxScores: function() {
  467. var d = this.sandboxData || {}
  468. return {
  469. body: d.bodyScore || 0,
  470. mind: d.mindScore || 0,
  471. wisdom: d.wisdomScore || 0,
  472. action: d.actionScore || 0,
  473. wealth: d.wealthScore || 0
  474. }
  475. },
  476. actionArticles: function() {
  477. if (!this.articles || this.articles.length === 0) return []
  478. var result = []
  479. for (var i = 0; i < this.articles.length; i++) {
  480. var a = this.articles[i]
  481. if (a.relatedDimensions && a.relatedDimensions.indexOf('action') !== -1) {
  482. result.push(a)
  483. }
  484. }
  485. if (result.length === 0) return this.articles.slice(0, 5)
  486. return result.slice(0, 5)
  487. },
  488. dimList: function() {
  489. return DIMENSIONS
  490. },
  491. energyDotColors: function() {
  492. return ['#8D6E63', '#FF6B35', '#FFD700', '#4CAF50', '#42A5F5']
  493. },
  494. // 会员入口显示:非会员显示开通;会员剩余≤30天显示续费
  495. showMemberEntry: function() {
  496. if (!this.isLoggedIn()) return false
  497. if (!this.isMember) return true
  498. return this.membershipDays > 0 && this.membershipDays <= 30
  499. },
  500. showCheckinBtn: function() {
  501. return (uni.getStorageSync('role') || 'parent') === 'child'
  502. },
  503. memberEntryTitle: function() {
  504. if (!this.isMember) return '开通会员,解锁全部特权'
  505. return '会员即将到期,续费恢复权益'
  506. },
  507. memberEntryDesc: function() {
  508. if (!this.isMember) return '享专属折扣 · 成长服务 · 规划指导'
  509. return '剩余 ' + this.membershipDays + ' 天,续费保持权益不中断'
  510. },
  511. memberEntryBtn: function() {
  512. return this.isMember ? '立即续费' : '立即开通'
  513. }
  514. },
  515. onLoad(options) {
  516. this._doInit(options)
  517. },
  518. onShow() {
  519. // splash overlay 已在 data() 中根据 storage 标记初始化,此处只需配置关闭条件
  520. if (this.splashOverlay) {
  521. uni.removeStorageSync('_showSplashOverlay')
  522. this._splashLoadCount = 0
  523. this._splashMinPassed = false
  524. var self = this
  525. // 最低展示 800ms
  526. setTimeout(function() {
  527. self._splashMinPassed = true
  528. self._tryHideSplash()
  529. }, 800)
  530. // 最多展示 5s
  531. setTimeout(function() {
  532. if (self.splashOverlay) self._hideSplashOverlay()
  533. }, 5000)
  534. } else {
  535. // tab 切回:TabTransition 已在 data() 中为 true,确保首次渲染即出现
  536. // 但组件缓存后再次切回时可能已被 _watchPageReady 置为 false,需要重置
  537. this.showTabTransition = true
  538. this._watchPageReady()
  539. }
  540. // 始终执行初始化,确保登录态变更后及时切换视图
  541. this._doInit()
  542. },
  543. methods: {
  544. _checkSplashReady() {
  545. this._splashLoadCount++
  546. this._tryHideSplash()
  547. },
  548. _tryHideSplash() {
  549. if (this.splashOverlayFading) return
  550. if (!this._splashMinPassed) return
  551. if (this.isLoggedIn()) {
  552. // 登录用户:等待子组件的 ready 信号
  553. if (this._splashReady) this._hideSplashOverlay()
  554. } else {
  555. // 游客:等待 3 个 API 全部返回
  556. if (this._splashLoadCount >= 3) this._hideSplashOverlay()
  557. }
  558. },
  559. _hideSplashOverlay() {
  560. if (this.splashOverlayFading) return
  561. this.splashOverlayFading = true
  562. // splash 关闭时同时隐藏 TabTransition(防止 splash 结束后闪现过渡页)
  563. this.showTabTransition = false
  564. var self = this
  565. setTimeout(function() {
  566. self.splashOverlay = false
  567. self.splashOverlayFading = false
  568. }, 400)
  569. },
  570. // ===== 登录态数据加载 =====
  571. loadLoggedInData: function() {
  572. this.loadFamilyMembers()
  573. this.loadChildren()
  574. },
  575. loadChildren: function() {
  576. var self = this
  577. getChildren().then(function(res) {
  578. if (res.code === 200 && res.data) {
  579. self.children = res.data
  580. var savedChildId = uni.getStorageSync('currentChildId')
  581. if (savedChildId) {
  582. self.currentChildId = savedChildId
  583. }
  584. self.loadDimensionData()
  585. }
  586. self.childrenChecked = true
  587. }).catch(function(e) {
  588. console.log('获取孩子列表失败', e)
  589. self.childrenChecked = true
  590. })
  591. },
  592. loadDimensionData: function() {
  593. this.loadEnergyData()
  594. this.loadSandboxData()
  595. this.loadDimensionTasks()
  596. this.loadActionActivities()
  597. this.loadActionProducts()
  598. this.loadActionArticles()
  599. this.loadChallenges()
  600. this.loadMyCircles()
  601. this.loadDiscoverCircles()
  602. },
  603. loadEnergyData: function() {
  604. var self = this
  605. if (!this.currentChildId) return
  606. getEnergyOverview(this.currentChildId).then(function(res) {
  607. if (res && res.data) {
  608. var dims = res.data.dimensions
  609. if (dims && dims.length > 0) {
  610. for (var i = 0; i < dims.length; i++) {
  611. if (dims[i].code === 'action') {
  612. self.dualDimension = dims[i]
  613. break
  614. }
  615. }
  616. }
  617. }
  618. }).catch(function() {})
  619. },
  620. loadSandboxData: function() {
  621. var self = this
  622. getFamilyEnergySandbox().then(function(res) {
  623. if (res && res.data) {
  624. self.sandboxData = res.data
  625. self._splashReady = true
  626. self._tryHideSplash()
  627. }
  628. }).catch(function() {})
  629. },
  630. loadDimensionTasks: function() {
  631. var self = this
  632. if (!this.currentChildId) return
  633. getTodayTasksByCategory(this.currentChildId, 'action').then(function(res) {
  634. if (res && res.data) {
  635. self.dimensionTasks = Array.isArray(res.data) ? res.data.slice(0, 5) : []
  636. }
  637. }).catch(function() { self.dimensionTasks = [] })
  638. },
  639. loadActionActivities: function() {
  640. var self = this
  641. getActivityList({ dimensionCode: 'action', page: 1, size: 3 }).then(function(res) {
  642. if (res && res.data) {
  643. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  644. self.dimensionActivities = list.slice(0, 3)
  645. }
  646. }).catch(function() { self.dimensionActivities = [] })
  647. },
  648. loadActionProducts: function() {
  649. var self = this
  650. getProductsByDomain('action', 1, 4).then(function(res) {
  651. if (res && res.data) {
  652. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  653. self.dimensionProducts = list.slice(0, 4)
  654. }
  655. }).catch(function() { self.dimensionProducts = [] })
  656. },
  657. loadActionArticles: function() {
  658. var self = this
  659. getFeaturedArticles({ size: 5, dimensionCode: 'action' }).then(function(res) {
  660. if (res.code === 200 && res.data) {
  661. var gradientColors = [
  662. 'linear-gradient(135deg, #10B981, #34D399)',
  663. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  664. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  665. 'linear-gradient(135deg, #F97316, #FB923C)',
  666. 'linear-gradient(135deg, #6366F1, #818CF8)'
  667. ]
  668. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  669. self.articles = list.map(function(item, index) {
  670. return {
  671. id: item.id,
  672. category: item.categoryName || '行动社交',
  673. categoryColor: gradientColors[index % gradientColors.length],
  674. title: item.title || '',
  675. summary: item.summary || '',
  676. dimensionWeights: item.dimensionWeights || null,
  677. views: item.viewCount ? String(item.viewCount) : '0',
  678. likes: '0',
  679. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  680. relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions),
  681. coverImage: item.coverImage
  682. }
  683. })
  684. }
  685. }).catch(function() {})
  686. },
  687. loadChallenges: function() {
  688. var self = this
  689. getChallengeList({}).then(function(res) {
  690. if (res.code === 200 && Array.isArray(res.data)) {
  691. self.activeChallenges = res.data
  692. }
  693. }).catch(function() {
  694. self.activeChallenges = []
  695. })
  696. },
  697. onChallengeCheckin: function(payload) {
  698. var self = this
  699. updateChallengeProgress({ challengeId: payload.challengeId, delta: 1 }).then(function(res) {
  700. if (res && res.code === 200) {
  701. uni.showToast({ title: '打卡成功', icon: 'success' })
  702. self.loadChallenges()
  703. } else {
  704. uni.showToast({ title: (res && res.message) || '打卡失败', icon: 'none' })
  705. }
  706. }).catch(function() {
  707. uni.showToast({ title: '打卡失败,请重试', icon: 'none' })
  708. })
  709. },
  710. loadMyCircles: function() {
  711. var self = this
  712. if (!this.currentChildId) return
  713. getMyCircles(this.currentChildId, 'child').then(function(res) {
  714. if (res.code === 200 && res.data) {
  715. self.myCircles = Array.isArray(res.data) ? res.data : (res.data.list || [])
  716. }
  717. }).catch(function() { self.myCircles = [] })
  718. },
  719. loadDiscoverCircles: function() {
  720. var self = this
  721. if (!this.currentChildId) return
  722. discoverCircles(this.currentChildId).then(function(res) {
  723. if (res.code === 200 && res.data) {
  724. self.discoverCirclesList = Array.isArray(res.data) ? res.data.slice(0, 3) : []
  725. }
  726. }).catch(function() { self.discoverCirclesList = [] })
  727. },
  728. getCircleKey: function(item) {
  729. return item.id || item.circleId || Math.random()
  730. },
  731. onCircleClick: function(item) {
  732. this.detailCircle = item
  733. this.selectedCircleIsMember = item.isMember || false
  734. this.circleDetailVisible = true
  735. },
  736. onCircleJoin: function(circle) {
  737. var self = this
  738. joinGeneralCircle({ circleId: circle.id }).then(function(res) {
  739. if (res.code === 200) {
  740. self.circleDetailVisible = false
  741. self.loadMyCircles()
  742. self.loadDiscoverCircles()
  743. uni.showToast({ title: '加入成功', icon: 'success' })
  744. }
  745. }).catch(function() {})
  746. },
  747. onCircleLeave: function(circle) {
  748. var self = this
  749. leaveGeneralCircle({ circleId: circle.id }).then(function(res) {
  750. if (res.code === 200) {
  751. self.circleDetailVisible = false
  752. self.loadMyCircles()
  753. self.loadDiscoverCircles()
  754. uni.showToast({ title: '已退出', icon: 'none' })
  755. }
  756. }).catch(function() {})
  757. },
  758. goDiscoverCircles: function() {
  759. uni.navigateTo({ url: '/pages/discover/circles' })
  760. },
  761. loadFamilyMembers: function() {
  762. var self = this
  763. getVisibleFamilyMembers().then(function(res) {
  764. if (res.code === 200 && res.data) {
  765. self.familyMembersVisible = Array.isArray(res.data) ? res.data : (res.data.list || [])
  766. }
  767. self.membersChecked = true
  768. }).catch(function(e) {
  769. console.log('获取可见家庭成员失败', e)
  770. self.familyMembersVisible = []
  771. self.membersChecked = true
  772. })
  773. },
  774. parseRelatedDimensions: function(val) {
  775. if (!val) return []
  776. if (Array.isArray(val)) return val
  777. if (typeof val === 'string') {
  778. try {
  779. var parsed = JSON.parse(val)
  780. return Array.isArray(parsed) ? parsed : []
  781. } catch (e) {
  782. return val.split(',').map(function(s) { return s.trim() }).filter(function(s) { return s })
  783. }
  784. }
  785. return []
  786. },
  787. onFamilyMemberSelect: function(member) {
  788. this.selectedMemberId = member.id
  789. },
  790. onFamilyMemberSwitch: function(member) {
  791. var self = this
  792. if (!member || !member.id) return
  793. switchToFamilyMember(member.id, member.source || 'family_member').then(function(res) {
  794. if (res.code === 200 && res.data) {
  795. store.commit('switchToMember', {
  796. memberId: res.data.memberId,
  797. effectiveRole: res.data.effectiveRole
  798. })
  799. uni.showToast({ title: '已切换到' + (member.nickname || '该成员'), icon: 'success' })
  800. setTimeout(function() {
  801. uni.reLaunch({ url: '/pages/index-home/index' })
  802. }, 1000)
  803. } else {
  804. uni.showToast({ title: res.message || '切换失败', icon: 'none' })
  805. }
  806. }).catch(function() {
  807. uni.showToast({ title: '切换失败', icon: 'none' })
  808. })
  809. },
  810. onTaskClick: function(task) {
  811. uni.navigateTo({ url: '/pages/tasks/tasks' })
  812. },
  813. goTasks: function() {
  814. uni.navigateTo({ url: '/pages/tasks/tasks' })
  815. },
  816. goActivityDetail: function(act) {
  817. if (!act || !act.id) return
  818. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
  819. },
  820. goMoreActivities: function() {
  821. uni.navigateTo({ url: '/pages/activity/index' })
  822. },
  823. goProductDetail: function(prod) {
  824. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  825. },
  826. goMoreProducts: function() {
  827. uni.navigateTo({ url: '/pages/shop/index/index' })
  828. },
  829. goArticleDetail: function(article) {
  830. var id = article.id || article
  831. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  832. },
  833. goMoreArticles: function() {
  834. uni.navigateTo({ url: '/pages/article-center/index?dimension=action' })
  835. },
  836. onFuncClick: function(item) {
  837. var nativeTabs = ['/pages/index-home/index', '/pages/body/index', '/pages/mind/index', '/pages/wisdom/index', '/pages/wealth/index']
  838. if (nativeTabs.indexOf(item.page) !== -1) {
  839. uni.switchTab({ url: item.page })
  840. } else {
  841. uni.navigateTo({ url: item.page })
  842. }
  843. },
  844. // 首页 TabTransition 动态关闭:检测关键内容是否就绪
  845. _watchPageReady() {
  846. var self = this
  847. var unwatch = this.$watch(function() {
  848. if (!self.isLoggedIn()) {
  849. return !!(self.products && self.products.length > 0) ||
  850. !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  851. !!(self.indexArticles && self.indexArticles.length > 0)
  852. }
  853. // 登录用户:等待关键数据加载完成
  854. return !!(self.currentRole && self.sandboxData)
  855. }, function(val) {
  856. if (val) {
  857. if (unwatch) unwatch()
  858. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  859. }
  860. })
  861. },
  862. _doInit(options) {
  863. options = options || {}
  864. if (!this.isLoggedIn()) {
  865. this.currentRole = ''
  866. this.loadProducts()
  867. this.loadDimensionActivities()
  868. this.loadFeaturedArticles()
  869. return
  870. }
  871. this.syncRoleAndTabBar()
  872. if (options.inviteCode && options.type === 'parent_invite') {
  873. this.handleParentInvite(options.inviteCode)
  874. return
  875. }
  876. var storedCode = uni.getStorageSync('inviteCode')
  877. var storedType = uni.getStorageSync('inviteType')
  878. if (storedCode && storedType === 'parent_invite') {
  879. this.handleParentInvite(storedCode)
  880. uni.removeStorageSync('inviteCode')
  881. uni.removeStorageSync('inviteType')
  882. return
  883. }
  884. // 登录用户:直接在 TabBar 页面内联渲染,保持底签可见
  885. if (!this.loggedInInitDone) {
  886. this.loggedInInitDone = true
  887. this.loadLoggedInData()
  888. }
  889. this.checkMemberStatus()
  890. this._watchPageReady()
  891. },
  892. isLoggedIn() {
  893. return !!uni.getStorageSync('token')
  894. },
  895. // ===== 会员状态(沙盘下方会员入口) =====
  896. checkMemberStatus: function() {
  897. var that = this
  898. getMyMembership().then(function(res) {
  899. var m = res.data || {}
  900. that.isMember = !!(m.memberLevel && m.memberLevel !== 'FREE') || !!(m.levelCode && m.levelCode !== 'FREE')
  901. var mem = m.membership || m
  902. if (mem.daysRemaining != null) {
  903. that.membershipDays = mem.daysRemaining
  904. }
  905. }).catch(function() {})
  906. },
  907. goMembership: function() {
  908. uni.navigateTo({ url: '/pages/membership/upgrade' })
  909. },
  910. normalizeCurrentRole() {
  911. const role = uni.getStorageSync('role') || 'parent'
  912. const currentRole = uni.getStorageSync('currentRole')
  913. if (!currentRole) {
  914. return role
  915. }
  916. // 非规划师账号不允许落到规划师首页
  917. if (currentRole === 'teacher' && role !== 'teacher') {
  918. return role
  919. }
  920. // 只有家长账号允许切换到孩子视角
  921. if (currentRole === 'child' && role !== 'parent') {
  922. return role
  923. }
  924. return currentRole
  925. },
  926. syncRoleAndTabBar() {
  927. this.currentRole = this.normalizeCurrentRole()
  928. uni.setStorageSync('currentRole', this.currentRole)
  929. },
  930. // ===== 发现页 / 未登录态方法 =====
  931. loadProducts: function() {
  932. this.loading = true
  933. var params = { page: 1, size: 10 }
  934. if (this.currentType) {
  935. params.productType = this.currentType
  936. }
  937. var self = this
  938. productList(params).then(function(res) {
  939. self.loading = false
  940. if (res && res.code === 200) {
  941. // res.data is the response wrapper, products are in res.data.data or res.data.records
  942. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  943. self.products = Array.isArray(rawData) ? rawData : []
  944. }
  945. self._checkSplashReady()
  946. }).catch(function() {
  947. self.loading = false
  948. self._checkSplashReady()
  949. })
  950. },
  951. loadDimensionActivities: function() {
  952. var self = this
  953. getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
  954. if (res && res.code === 200) {
  955. // res.data is the response wrapper, activities are in res.data.data or res.data.records
  956. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  957. self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
  958. }
  959. self._checkSplashReady()
  960. }).catch(function() {
  961. self._checkSplashReady()
  962. })
  963. },
  964. loadFeaturedArticles: function() {
  965. var self = this
  966. this.articlesLoading = true
  967. getFeaturedArticles({ size: 5 }).then(function(res) {
  968. self.articlesLoading = false
  969. if (res && res.code === 200) {
  970. var gradientColors = [
  971. 'linear-gradient(135deg, #10B981, #34D399)',
  972. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  973. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  974. 'linear-gradient(135deg, #F97316, #FB923C)',
  975. 'linear-gradient(135deg, #6366F1, #818CF8)'
  976. ]
  977. // res.data is the response wrapper, articles are in res.data.data
  978. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  979. var list = Array.isArray(rawList) ? rawList : []
  980. self.indexArticles = list.map(function(item, index) {
  981. return {
  982. id: item.id,
  983. category: item.categoryName || item.category || '热门文章',
  984. categoryColor: gradientColors[index % gradientColors.length],
  985. title: item.title || '',
  986. summary: item.summary || '',
  987. views: item.viewCount ? String(item.viewCount) : '0',
  988. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  989. coverImage: item.coverImage
  990. }
  991. })
  992. }
  993. self._checkSplashReady()
  994. }).catch(function() {
  995. self.articlesLoading = false
  996. self._checkSplashReady()
  997. })
  998. },
  999. goActivities: function() {
  1000. uni.navigateTo({ url: '/pages/activity/index' })
  1001. },
  1002. goActivityDetail: function(act) {
  1003. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
  1004. },
  1005. goArticles: function() {
  1006. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  1007. },
  1008. goArticleDetail: function(article) {
  1009. var id = article && article.id ? article.id : article
  1010. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1011. },
  1012. onTypeChange(value) {
  1013. this.currentType = value
  1014. this.loadProducts()
  1015. },
  1016. goShop() {
  1017. uni.navigateTo({ url: '/pages/shop/index/index' })
  1018. },
  1019. goDetail(id) {
  1020. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + id })
  1021. },
  1022. handleLogin() {
  1023. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index-home/index') })
  1024. },
  1025. async handleParentInvite(code) {
  1026. // 延迟显示,等待登录完成
  1027. setTimeout(async () => {
  1028. const hasToken = uni.getStorageSync('token')
  1029. if (!hasToken) {
  1030. // 未登录,先去登录
  1031. uni.reLaunch({
  1032. url: '/pages/login/login?inviteCode=' + code
  1033. })
  1034. return
  1035. }
  1036. // 已登录,显示确认框
  1037. uni.showModal({
  1038. title: '加入家庭',
  1039. content: '您已被邀请加入家庭,是否接受?',
  1040. success: async (res) => {
  1041. if (res.confirm) {
  1042. try {
  1043. uni.showLoading({ title: '加入中...' })
  1044. const result = await acceptParentInvite(code)
  1045. uni.hideLoading()
  1046. if (result.code === 200) {
  1047. const { role, token } = result.data
  1048. uni.setStorageSync('role', role)
  1049. uni.setStorageSync('token', token)
  1050. uni.showToast({ title: '加入成功', icon: 'success' })
  1051. // 刷新页面
  1052. setTimeout(() => {
  1053. uni.switchTab({ url: '/pages/index-home/index' })
  1054. }, 1500)
  1055. }
  1056. } catch (e) {
  1057. uni.hideLoading()
  1058. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  1059. }
  1060. }
  1061. }
  1062. })
  1063. }, 500)
  1064. },
  1065. getImageUrl: function(path) {
  1066. return config.API_BASE_URL + path
  1067. }
  1068. }
  1069. }
  1070. </script>
  1071. <style>
  1072. .discover-container {
  1073. min-height: 100vh;
  1074. background: #f5f7fa;
  1075. padding-bottom: 100rpx;
  1076. }
  1077. /* ===== 会员入口卡(能量沙盘下方) ===== */
  1078. .member-entry {
  1079. display: flex;
  1080. align-items: center;
  1081. margin: 20rpx 30rpx 0;
  1082. background: linear-gradient(135deg, #F97316, #FB923C);
  1083. border-radius: 20rpx;
  1084. padding: 24rpx 30rpx;
  1085. }
  1086. .member-entry-icon-wrap {
  1087. width: 64rpx;
  1088. height: 64rpx;
  1089. border-radius: 50%;
  1090. background: rgba(255,255,255,0.2);
  1091. display: flex;
  1092. align-items: center;
  1093. justify-content: center;
  1094. margin-right: 16rpx;
  1095. flex-shrink: 0;
  1096. }
  1097. .member-entry-icon {
  1098. font-size: 36rpx;
  1099. }
  1100. .member-entry-texts {
  1101. flex: 1;
  1102. display: flex;
  1103. flex-direction: column;
  1104. min-width: 0;
  1105. }
  1106. .member-entry-title {
  1107. font-size: 30rpx;
  1108. font-weight: bold;
  1109. color: #fff;
  1110. }
  1111. .member-entry-desc {
  1112. font-size: 22rpx;
  1113. color: rgba(255,255,255,0.85);
  1114. margin-top: 4rpx;
  1115. overflow: hidden;
  1116. text-overflow: ellipsis;
  1117. white-space: nowrap;
  1118. }
  1119. .member-entry-btn {
  1120. margin-left: 16rpx;
  1121. padding: 10rpx 24rpx;
  1122. background: #fff;
  1123. border-radius: 30rpx;
  1124. flex-shrink: 0;
  1125. }
  1126. .member-entry-btn-text {
  1127. font-size: 24rpx;
  1128. color: #F97316;
  1129. font-weight: bold;
  1130. }
  1131. /* ===== 推荐 ===== */
  1132. .recommend-section {
  1133. margin: 20rpx 30rpx;
  1134. }
  1135. .section-header {
  1136. display: flex;
  1137. justify-content: space-between;
  1138. align-items: center;
  1139. margin-bottom: 20rpx;
  1140. }
  1141. .section-title {
  1142. font-size: 30rpx;
  1143. font-weight: bold;
  1144. color: #333;
  1145. }
  1146. .section-more {
  1147. font-size: 24rpx;
  1148. color: #5B9BD5;
  1149. }
  1150. .type-filter-scroll {
  1151. white-space: nowrap;
  1152. margin-bottom: 20rpx;
  1153. }
  1154. .filter-chip {
  1155. display: inline-block;
  1156. padding: 8rpx 24rpx;
  1157. font-size: 24rpx;
  1158. color: #666;
  1159. background: #f0f0f0;
  1160. border-radius: 30rpx;
  1161. margin-right: 16rpx;
  1162. }
  1163. .filter-chip.active {
  1164. background: #5B9BD5;
  1165. color: #fff;
  1166. }
  1167. .loading-state,
  1168. .empty-state {
  1169. display: flex;
  1170. justify-content: center;
  1171. padding: 60rpx 0;
  1172. }
  1173. .loading-text,
  1174. .empty-text {
  1175. font-size: 26rpx;
  1176. color: #999;
  1177. }
  1178. .product-grid {
  1179. display: flex;
  1180. flex-wrap: wrap;
  1181. justify-content: space-between;
  1182. }
  1183. .product-card {
  1184. width: 48%;
  1185. background: #fff;
  1186. border-radius: 16rpx;
  1187. overflow: hidden;
  1188. margin-bottom: 20rpx;
  1189. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  1190. }
  1191. .product-cover {
  1192. width: 100%;
  1193. height: 200rpx;
  1194. background: #f0f0f0;
  1195. }
  1196. .product-info {
  1197. padding: 14rpx;
  1198. }
  1199. .product-name {
  1200. display: block;
  1201. font-size: 26rpx;
  1202. color: #333;
  1203. margin-bottom: 10rpx;
  1204. overflow: hidden;
  1205. text-overflow: ellipsis;
  1206. white-space: nowrap;
  1207. }
  1208. .product-price-row {
  1209. display: flex;
  1210. align-items: baseline;
  1211. }
  1212. .product-price {
  1213. font-size: 28rpx;
  1214. color: #5B9BD5;
  1215. font-weight: bold;
  1216. margin-right: 10rpx;
  1217. }
  1218. .product-price-login {
  1219. font-size: 24rpx;
  1220. color: #999;
  1221. }
  1222. .product-member {
  1223. font-size: 20rpx;
  1224. color: #999;
  1225. }
  1226. /* ===== 五维全景幸福矩阵 ===== */
  1227. .why-section {
  1228. margin: 30rpx;
  1229. }
  1230. .dim-matrix {
  1231. display: flex;
  1232. flex-wrap: wrap;
  1233. gap: 20rpx;
  1234. justify-content: center;
  1235. }
  1236. .dim-card {
  1237. width: calc(33.33% - 14rpx);
  1238. box-sizing: border-box;
  1239. background: #fff;
  1240. border-radius: 20rpx;
  1241. padding: 28rpx 16rpx 24rpx;
  1242. display: flex;
  1243. flex-direction: column;
  1244. align-items: center;
  1245. text-align: center;
  1246. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1247. transition: transform 0.2s ease, box-shadow 0.2s ease;
  1248. position: relative;
  1249. overflow: hidden;
  1250. }
  1251. .dim-card:active {
  1252. transform: scale(0.96);
  1253. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
  1254. }
  1255. .dim-icon-circle {
  1256. width: 72rpx;
  1257. height: 72rpx;
  1258. border-radius: 50%;
  1259. display: flex;
  1260. align-items: center;
  1261. justify-content: center;
  1262. margin-bottom: 14rpx;
  1263. flex-shrink: 0;
  1264. }
  1265. .dim-icon {
  1266. font-size: 36rpx;
  1267. line-height: 1;
  1268. }
  1269. .dim-tag {
  1270. font-size: 22rpx;
  1271. font-weight: 600;
  1272. padding: 4rpx 14rpx;
  1273. border-radius: 20rpx;
  1274. margin-bottom: 10rpx;
  1275. max-width: 100%;
  1276. overflow: hidden;
  1277. text-overflow: ellipsis;
  1278. white-space: nowrap;
  1279. }
  1280. .dim-desc {
  1281. font-size: 20rpx;
  1282. color: #888;
  1283. line-height: 1.5;
  1284. display: -webkit-box;
  1285. -webkit-line-clamp: 2;
  1286. -webkit-box-orient: vertical;
  1287. overflow: hidden;
  1288. }
  1289. /* 五维能量环 */
  1290. .dim-energy-row {
  1291. display: flex;
  1292. justify-content: center;
  1293. gap: 12rpx;
  1294. margin-top: 24rpx;
  1295. opacity: 0.5;
  1296. }
  1297. .energy-dot {
  1298. width: 10rpx;
  1299. height: 10rpx;
  1300. border-radius: 50%;
  1301. }
  1302. /* ===== 底部登录 ===== */
  1303. .login-footer {
  1304. margin: 40rpx 30rpx;
  1305. display: flex;
  1306. flex-direction: column;
  1307. align-items: center;
  1308. }
  1309. .login-btn {
  1310. width: 100%;
  1311. height: 88rpx;
  1312. line-height: 88rpx;
  1313. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  1314. color: #fff;
  1315. font-size: 32rpx;
  1316. font-weight: bold;
  1317. border-radius: 44rpx;
  1318. text-align: center;
  1319. border: none;
  1320. }
  1321. .login-btn::after {
  1322. border: none;
  1323. }
  1324. .login-footer-text {
  1325. font-size: 20rpx;
  1326. color: #bbb;
  1327. margin-top: 16rpx;
  1328. }
  1329. /* ===== 加载占位 ===== */
  1330. .loading-container {
  1331. display: flex;
  1332. justify-content: center;
  1333. align-items: center;
  1334. height: 100vh;
  1335. }
  1336. /* ===== 角色切换淡入淡出 ===== */
  1337. .role-switch-wrapper {
  1338. width: 100%;
  1339. min-height: 100vh;
  1340. }
  1341. .fade-enter-active,
  1342. .fade-leave-active {
  1343. transition: opacity 0.3s ease;
  1344. }
  1345. .fade-enter,
  1346. .fade-leave-to {
  1347. opacity: 0;
  1348. }
  1349. /* ===== 通用区块样式 ===== */
  1350. .section {
  1351. margin: 20rpx 30rpx;
  1352. }
  1353. .section-header {
  1354. display: flex;
  1355. justify-content: space-between;
  1356. align-items: center;
  1357. margin-bottom: 20rpx;
  1358. }
  1359. .section-title {
  1360. font-size: 30rpx;
  1361. font-weight: bold;
  1362. color: #333;
  1363. }
  1364. .section-more {
  1365. font-size: 24rpx;
  1366. color: #5B9BD5;
  1367. }
  1368. .empty-state {
  1369. display: flex;
  1370. justify-content: center;
  1371. padding: 60rpx 0;
  1372. }
  1373. .empty-text {
  1374. font-size: 26rpx;
  1375. color: #999;
  1376. }
  1377. /* ===== 活动列表 ===== */
  1378. .activity-list {
  1379. display: flex;
  1380. flex-direction: column;
  1381. gap: 16rpx;
  1382. }
  1383. .activity-card {
  1384. background: #fff;
  1385. border-radius: 16rpx;
  1386. overflow: hidden;
  1387. display: flex;
  1388. flex-direction: row;
  1389. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1390. }
  1391. .activity-card:active {
  1392. opacity: 0.8;
  1393. }
  1394. .activity-cover {
  1395. width: 200rpx;
  1396. height: 160rpx;
  1397. flex-shrink: 0;
  1398. background: #f0f0f0;
  1399. }
  1400. .activity-info {
  1401. flex: 1;
  1402. padding: 16rpx;
  1403. display: flex;
  1404. flex-direction: column;
  1405. justify-content: space-between;
  1406. }
  1407. .activity-name {
  1408. font-size: 28rpx;
  1409. font-weight: bold;
  1410. color: #333;
  1411. margin-bottom: 8rpx;
  1412. }
  1413. .line-clamp-1 {
  1414. overflow: hidden;
  1415. text-overflow: ellipsis;
  1416. white-space: nowrap;
  1417. }
  1418. .activity-meta {
  1419. display: flex;
  1420. align-items: center;
  1421. margin-bottom: 8rpx;
  1422. }
  1423. .activity-time {
  1424. font-size: 22rpx;
  1425. color: #999;
  1426. }
  1427. .activity-bottom {
  1428. display: flex;
  1429. align-items: center;
  1430. gap: 12rpx;
  1431. }
  1432. .activity-status {
  1433. font-size: 20rpx;
  1434. padding: 2rpx 10rpx;
  1435. border-radius: 8rpx;
  1436. background: #E8F5E9;
  1437. color: #2E7D32;
  1438. }
  1439. .activity-status.status-upcoming {
  1440. background: #E3F2FD;
  1441. color: #1565C0;
  1442. }
  1443. .activity-status.status-ended {
  1444. background: #F5F5F5;
  1445. color: #999;
  1446. }
  1447. .activity-fee {
  1448. font-size: 24rpx;
  1449. color: #F97316;
  1450. font-weight: bold;
  1451. }
  1452. .activity-fee.fee-free {
  1453. color: #4CAF50;
  1454. }
  1455. /* ===== 文章列表 ===== */
  1456. .article-list {
  1457. display: flex;
  1458. flex-direction: column;
  1459. gap: 16rpx;
  1460. }
  1461. .article-card {
  1462. background: #fff;
  1463. border-radius: 16rpx;
  1464. padding: 24rpx;
  1465. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1466. }
  1467. .article-card:active {
  1468. opacity: 0.8;
  1469. }
  1470. .article-category {
  1471. display: inline-block;
  1472. padding: 4rpx 14rpx;
  1473. border-radius: 8rpx;
  1474. margin-bottom: 10rpx;
  1475. }
  1476. .article-category-text {
  1477. font-size: 20rpx;
  1478. color: #fff;
  1479. }
  1480. .article-title {
  1481. display: block;
  1482. font-size: 28rpx;
  1483. font-weight: bold;
  1484. color: #333;
  1485. margin-bottom: 8rpx;
  1486. line-height: 1.4;
  1487. }
  1488. .article-summary {
  1489. display: block;
  1490. font-size: 24rpx;
  1491. color: #888;
  1492. line-height: 1.5;
  1493. margin-bottom: 12rpx;
  1494. overflow: hidden;
  1495. text-overflow: ellipsis;
  1496. display: -webkit-box;
  1497. -webkit-line-clamp: 2;
  1498. -webkit-box-orient: vertical;
  1499. }
  1500. .article-meta {
  1501. display: flex;
  1502. align-items: center;
  1503. gap: 16rpx;
  1504. }
  1505. .meta-item {
  1506. display: flex;
  1507. align-items: center;
  1508. gap: 4rpx;
  1509. }
  1510. .meta-icon {
  1511. font-size: 24rpx;
  1512. }
  1513. .meta-text {
  1514. font-size: 22rpx;
  1515. color: #999;
  1516. }
  1517. .article-date {
  1518. font-size: 22rpx;
  1519. color: #bbb;
  1520. }
  1521. /* ===== Splash Loading Overlay(冷启动蒙板,来自 merge splash.vue) ===== */
  1522. .splash-overlay {
  1523. position: fixed;
  1524. top: 0; left: 0; right: 0; bottom: 0;
  1525. z-index: 9999;
  1526. display: flex;
  1527. align-items: center;
  1528. justify-content: center;
  1529. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  1530. overflow: hidden;
  1531. opacity: 1;
  1532. transition: opacity 0.4s ease;
  1533. }
  1534. .splash-overlay.fade-out {
  1535. opacity: 0;
  1536. pointer-events: none;
  1537. }
  1538. /* ---- bg circles from splash.vue ---- */
  1539. .splash-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
  1540. .bg-circle {
  1541. position: absolute;
  1542. border-radius: 50%;
  1543. opacity: 0.12;
  1544. }
  1545. .bg-circle-1 {
  1546. width: 400rpx; height: 400rpx;
  1547. background: #FF8C42;
  1548. top: -100rpx; right: -80rpx;
  1549. animation: splash-float-1 4s ease-in-out infinite;
  1550. }
  1551. .bg-circle-2 {
  1552. width: 280rpx; height: 280rpx;
  1553. background: #FF6B9D;
  1554. bottom: 80rpx; left: -60rpx;
  1555. animation: splash-float-2 5s ease-in-out infinite;
  1556. }
  1557. .bg-circle-3 {
  1558. width: 180rpx; height: 180rpx;
  1559. background: #6366F1;
  1560. top: 50%; right: -40rpx;
  1561. animation: splash-float-3 6s ease-in-out infinite;
  1562. }
  1563. @keyframes splash-float-1 {
  1564. 0%, 100% { transform: translateY(0) scale(1); }
  1565. 50% { transform: translateY(-30rpx) scale(1.05); }
  1566. }
  1567. @keyframes splash-float-2 {
  1568. 0%, 100% { transform: translateY(0) scale(1); }
  1569. 50% { transform: translateY(20rpx) scale(1.08); }
  1570. }
  1571. @keyframes splash-float-3 {
  1572. 0%, 100% { transform: translateY(0) rotate(0deg); }
  1573. 50% { transform: translateY(-20rpx) rotate(10deg); }
  1574. }
  1575. /* ---- body fade-in ---- */
  1576. .splash-overlay-body {
  1577. display: flex;
  1578. flex-direction: column;
  1579. align-items: center;
  1580. animation: splash-body-in 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  1581. }
  1582. @keyframes splash-body-in {
  1583. from { opacity: 0; transform: translateY(40rpx) scale(0.96); }
  1584. to { opacity: 1; transform: translateY(0) scale(1); }
  1585. }
  1586. /* ---- logo ---- */
  1587. .splash-logo-wrap {
  1588. width: 160rpx; height: 160rpx;
  1589. border-radius: 40rpx;
  1590. background: rgba(255,255,255,0.95);
  1591. display: flex; align-items: center; justify-content: center;
  1592. margin-bottom: 16rpx;
  1593. box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
  1594. animation: splash-logo-pulse 2.5s ease-in-out infinite;
  1595. }
  1596. @keyframes splash-logo-pulse {
  1597. 0%, 100% { box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25); }
  1598. 50% { box-shadow: 0 8rpx 48rpx rgba(249,115,22,0.45); }
  1599. }
  1600. .splash-logo-img { width: 100rpx; height: 100rpx; }
  1601. /* ---- brand ---- */
  1602. .splash-brand-name {
  1603. font-size: 64rpx; font-weight: 800;
  1604. color: #7C2D12;
  1605. letter-spacing: 10rpx;
  1606. margin-bottom: 2rpx;
  1607. }
  1608. .splash-brand-en {
  1609. font-size: 20rpx;
  1610. color: rgba(124,45,18,0.5);
  1611. letter-spacing: 6rpx;
  1612. margin-bottom: 30rpx;
  1613. }
  1614. .splash-tagline {
  1615. font-size: 26rpx;
  1616. color: rgba(124,45,18,0.7);
  1617. letter-spacing: 4rpx;
  1618. margin-top: 24rpx;
  1619. }
  1620. /* ---- dims row from splash.vue (rounded circles) ---- */
  1621. .splash-dims-row {
  1622. display: flex; flex-direction: row;
  1623. align-items: center; justify-content: center;
  1624. gap: 28rpx;
  1625. }
  1626. .splash-dim-item {
  1627. display: flex; flex-direction: column;
  1628. align-items: center; gap: 8rpx;
  1629. }
  1630. .splash-dim-circle {
  1631. width: 80rpx; height: 80rpx;
  1632. border-radius: 50%;
  1633. display: flex; align-items: center; justify-content: center;
  1634. }
  1635. .splash-dim-icon { font-size: 36rpx; line-height: 1; }
  1636. .splash-dim-label {
  1637. font-size: 22rpx; font-weight: 500;
  1638. color: rgba(124,45,18,0.75);
  1639. line-height: 1;
  1640. }
  1641. /* ---- staggered dim entry from splash.vue ---- */
  1642. .splash-dim-item:nth-child(1) { animation: splash-dim-in 0.5s ease 0.1s both; }
  1643. .splash-dim-item:nth-child(2) { animation: splash-dim-in 0.5s ease 0.2s both; }
  1644. .splash-dim-item:nth-child(3) { animation: splash-dim-in 0.5s ease 0.3s both; }
  1645. .splash-dim-item:nth-child(4) { animation: splash-dim-in 0.5s ease 0.4s both; }
  1646. .splash-dim-item:nth-child(5) { animation: splash-dim-in 0.5s ease 0.5s both; }
  1647. @keyframes splash-dim-in {
  1648. from { opacity: 0; transform: translateY(16rpx) scale(0.8); }
  1649. to { opacity: 1; transform: translateY(0) scale(1); }
  1650. }
  1651. /* ---- loading dots ---- */
  1652. .splash-overlay-loading {
  1653. position: absolute;
  1654. bottom: 120rpx;
  1655. left: 0; right: 0;
  1656. display: flex;
  1657. justify-content: center;
  1658. align-items: center;
  1659. gap: 12rpx;
  1660. }
  1661. .splash-overlay-dot {
  1662. width: 14rpx; height: 14rpx;
  1663. border-radius: 50%;
  1664. background: rgba(249,115,22,0.6);
  1665. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  1666. }
  1667. .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
  1668. .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
  1669. .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
  1670. @keyframes splash-dot-bounce {
  1671. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  1672. 40% { transform: scale(1); opacity: 1; }
  1673. }
  1674. /* ---- 登录态内容布局 ---- */
  1675. .logged-in-container {
  1676. padding-bottom: 40rpx;
  1677. }
  1678. /* ===== 功能入口(原action页样式) ===== */
  1679. .func-section {
  1680. margin: -40rpx 20rpx 0;
  1681. position: relative;
  1682. z-index: 2;
  1683. }
  1684. .func-grid {
  1685. background: #fff;
  1686. border-radius: 24rpx;
  1687. padding: 30rpx 16rpx;
  1688. display: flex;
  1689. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1690. }
  1691. .func-item {
  1692. flex: 1;
  1693. display: flex;
  1694. flex-direction: column;
  1695. align-items: center;
  1696. }
  1697. .func-item:active {
  1698. opacity: 0.7;
  1699. }
  1700. .func-icon-wrap {
  1701. width: 88rpx;
  1702. height: 88rpx;
  1703. border-radius: 50%;
  1704. background: #FFF7ED;
  1705. display: flex;
  1706. align-items: center;
  1707. justify-content: center;
  1708. margin-bottom: 10rpx;
  1709. }
  1710. .func-icon {
  1711. font-size: 40rpx;
  1712. }
  1713. .func-label {
  1714. font-size: 24rpx;
  1715. color: #333;
  1716. font-weight: 500;
  1717. }
  1718. /* ===== 圈子卡片 ===== */
  1719. .circle-section {
  1720. margin: 20rpx 30rpx;
  1721. }
  1722. .circle-header {
  1723. display: flex;
  1724. justify-content: space-between;
  1725. align-items: center;
  1726. margin-bottom: 20rpx;
  1727. }
  1728. .circle-section-title {
  1729. font-size: 30rpx;
  1730. font-weight: bold;
  1731. color: #333;
  1732. }
  1733. .circle-header-link {
  1734. font-size: 24rpx;
  1735. color: #5B9BD5;
  1736. }
  1737. .circle-scroll {
  1738. white-space: nowrap;
  1739. }
  1740. .circle-scroll-inner {
  1741. display: inline-flex;
  1742. gap: 16rpx;
  1743. }
  1744. .circle-card-wrap {
  1745. display: inline-block;
  1746. }
  1747. .circle-empty {
  1748. padding: 40rpx 0;
  1749. text-align: center;
  1750. }
  1751. .circle-empty-text {
  1752. font-size: 26rpx;
  1753. color: #999;
  1754. }
  1755. .circle-discover {
  1756. margin-top: 30rpx;
  1757. }
  1758. .discover-list {
  1759. display: flex;
  1760. flex-direction: column;
  1761. gap: 16rpx;
  1762. }
  1763. .discover-item {
  1764. background: #fff;
  1765. border-radius: 16rpx;
  1766. overflow: hidden;
  1767. }
  1768. </style>