index.vue 56 KB

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