index.vue 57 KB

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