index.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835
  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. </view>
  108. <view v-else>
  109. <FamilyEmptyState type="card" />
  110. </view>
  111. <!-- 今日行动任务 -->
  112. <DimensionTasks
  113. dimensionCode="action"
  114. :tasks="dimensionTasks"
  115. @taskClick="onTaskClick"
  116. @moreTasks="goTasks" />
  117. <DimensionActivities
  118. dimensionCode="action"
  119. :activities="dimensionActivities"
  120. :isLoggedIn="true"
  121. @activityClick="goActivityDetail"
  122. @moreActivities="goMoreActivities" />
  123. <ArticleBookshelf
  124. :articles="actionArticles"
  125. :isLoggedIn="true"
  126. @articleClick="goArticleDetail"
  127. @moreArticles="goMoreArticles" />
  128. <DimensionProducts
  129. dimensionCode="action"
  130. :products="dimensionProducts"
  131. :isLoggedIn="true"
  132. @productClick="goProductDetail"
  133. @moreProducts="goMoreProducts" />
  134. <!-- ===== 我的圈子 ===== -->
  135. <view class="circle-section" v-if="isLoggedIn()">
  136. <view class="circle-header">
  137. <text class="circle-section-title">🤝 我的圈子</text>
  138. <text class="circle-header-link" @click="goDiscoverCircles">发现更多 ›</text>
  139. </view>
  140. <scroll-view class="circle-scroll" scroll-x enable-flex v-if="myCircles.length > 0">
  141. <view class="circle-scroll-inner">
  142. <view class="circle-card-wrap" v-for="item in myCircles" :key="getCircleKey(item)" @click="onCircleClick(item)">
  143. <CircleCard :circle="item" compact />
  144. </view>
  145. </view>
  146. </scroll-view>
  147. <view class="circle-empty" v-else>
  148. <text class="circle-empty-text">暂未加入圈子,去发现看看</text>
  149. </view>
  150. <!-- ===== 发现推荐 ===== -->
  151. <view class="circle-discover" v-if="discoverCirclesList.length > 0">
  152. <view class="circle-header">
  153. <text class="circle-section-title">🔍 发现推荐</text>
  154. <text class="circle-header-link" @click="goDiscoverCircles">查看更多 ›</text>
  155. </view>
  156. <view class="discover-list">
  157. <view class="discover-item" v-for="item in discoverCirclesList" :key="getCircleKey(item)" @click="onCircleClick(item)">
  158. <CircleCard :circle="item" />
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <!-- 圈子详情弹窗 -->
  164. <CircleDetail
  165. :visible="circleDetailVisible"
  166. :circle="detailCircle"
  167. :isMember="selectedCircleIsMember"
  168. @close="circleDetailVisible = false"
  169. @join="onCircleJoin"
  170. @leave="onCircleLeave" />
  171. <!-- 功能入口 -->
  172. <view class="func-section">
  173. <view class="func-grid">
  174. <view class="func-item" v-for="item in funcList" :key="item.label" @click="onFuncClick(item)">
  175. <view class="func-icon-wrap">
  176. <text class="func-icon">{{ item.icon }}</text>
  177. </view>
  178. <text class="func-label">{{ item.label }}</text>
  179. </view>
  180. </view>
  181. </view>
  182. <!-- 底部占位 -->
  183. <view class="bottom-spacer" style="height: 40rpx;"></view>
  184. </view>
  185. <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
  186. <view v-else class="discover-container">
  187. <!-- 品牌头部 -->
  188. <PageBanner theme="home"
  189. tagline="家庭健康成长俱乐部"
  190. quote="给全家的一站式幸福提案" />
  191. <!-- 五行沙盘预览 -->
  192. <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
  193. <!-- 活动/商品推荐 -->
  194. <view class="recommend-section">
  195. <view class="section-header">
  196. <text class="section-title">🔥 热门推荐</text>
  197. <text class="section-more" @click="goShop">查看更多 ›</text>
  198. </view>
  199. <scroll-view scroll-x enable-flex show-scrollbar="false" class="type-filter-scroll">
  200. <view
  201. v-for="item in typeList"
  202. :key="item.value"
  203. :class="['filter-chip', currentType === item.value ? 'active' : '']"
  204. @click="onTypeChange(item.value)"
  205. >
  206. {{ item.label }}
  207. </view>
  208. </scroll-view>
  209. <view v-if="loading" class="loading-state">
  210. <text class="loading-text">加载中...</text>
  211. </view>
  212. <view v-else-if="products.length === 0" class="empty-state">
  213. <text class="empty-text">暂无商品,去商城看看吧</text>
  214. </view>
  215. <view v-else class="product-grid">
  216. <view
  217. v-for="item in products"
  218. :key="item.id"
  219. class="product-card"
  220. @click="goDetail(item.id)"
  221. >
  222. <image class="product-cover" :src="getImageUrl(item.coverImage) || '/static/default-product.png'" mode="aspectFill" />
  223. <view class="product-info">
  224. <text class="product-name">{{ item.name }}</text>
  225. <view class="product-price-row">
  226. <text class="product-price" v-if="item.price && item.price > 0">¥{{ (item.price / 100).toFixed(0) }}</text>
  227. <text class="product-price-free" v-else>免费</text>
  228. </view>
  229. </view>
  230. </view>
  231. </view>
  232. </view>
  233. <!-- 热门活动(无条件展示) -->
  234. <view class="section">
  235. <view class="section-header">
  236. <text class="section-title">🔥 热门活动</text>
  237. <text class="section-more" @click="goActivities">查看更多 ›</text>
  238. </view>
  239. <view v-if="dimensionActivities.length === 0" class="empty-state" style="padding: 40rpx 0;">
  240. <text class="empty-text">暂无活动</text>
  241. </view>
  242. <view class="activity-list" v-else>
  243. <view class="activity-card" v-for="act in dimensionActivities" :key="act.id" @click="goActivityDetail(act)">
  244. <image class="activity-cover" :src="getImageUrl(act.coverImage) || '/static/default-activity.png'" mode="aspectFill" />
  245. <view class="activity-info">
  246. <text class="activity-name line-clamp-1">{{ act.title }}</text>
  247. <view class="activity-meta">
  248. <text class="activity-time">{{ act.startTime }}</text>
  249. </view>
  250. <view class="activity-bottom">
  251. <text class="activity-status" :class="'status-' + (act.status || 'upcoming')">{{ act.status === 'ongoing' ? '进行中' : act.status === 'ended' ? '已结束' : '即将开始' }}</text>
  252. <text class="activity-fee" v-if="act.price && act.price > 0">¥{{ (act.price / 100).toFixed(0) }}</text>
  253. <text class="activity-fee fee-free" v-else>免费</text>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. </view>
  259. <!-- 推荐阅读(无条件展示) -->
  260. <view class="section">
  261. <view class="section-header">
  262. <text class="section-title">📖 推荐阅读</text>
  263. <text class="section-more" @click="goArticles">更多 ›</text>
  264. </view>
  265. <view class="article-list">
  266. <view v-if="articlesLoading" class="loading-state" style="padding: 40rpx 0;">
  267. <text class="loading-text">加载中...</text>
  268. </view>
  269. <!-- 无数据时显示占位卡片 -->
  270. <template v-else-if="indexArticles.length === 0">
  271. <view class="article-card" v-for="(item, i) in [1,2,3]" :key="i">
  272. <view class="article-category" :style="{ background: gradientColors[(i-1) % gradientColors.length] }">
  273. <text class="article-category-text">推荐文章</text>
  274. </view>
  275. <text class="article-title">暂无推荐文章</text>
  276. <text class="article-summary">精彩内容即将上线,敬请期待</text>
  277. <view class="article-meta">
  278. <view class="meta-item">
  279. <text class="meta-icon">&#x1F4D6;</text>
  280. <text class="meta-text">0</text>
  281. </view>
  282. <text class="article-date">--</text>
  283. </view>
  284. </view>
  285. </template>
  286. <!-- 有数据时显示文章卡片 -->
  287. <template v-else>
  288. <view class="article-card" v-for="article in indexArticles" :key="article.id" @click="goArticleDetail(article.id)">
  289. <view class="article-category" :style="{ background: article.categoryColor }">
  290. <text class="article-category-text">{{ article.category }}</text>
  291. </view>
  292. <text class="article-title">{{ article.title }}</text>
  293. <text class="article-summary">{{ article.summary }}</text>
  294. <view class="article-meta">
  295. <view class="meta-item">
  296. <text class="meta-icon">&#x1F4D6;</text>
  297. <text class="meta-text">{{ article.views }}</text>
  298. </view>
  299. <text class="article-date">{{ article.date }}</text>
  300. </view>
  301. </view>
  302. </template>
  303. </view>
  304. </view>
  305. <!-- 五维全景幸福矩阵 -->
  306. <view class="why-section">
  307. <view class="section-header">
  308. <text class="section-title">🌏 五维全景幸福矩阵 — 给全家的一站式幸福提案</text>
  309. </view>
  310. <view class="dim-matrix">
  311. <view
  312. v-for="dim in dimList" :key="dim.code"
  313. class="dim-card"
  314. :style="'border-left:6rpx solid ' + dim.color"
  315. >
  316. <view class="dim-icon-circle" :style="'background:' + dim.bgColor">
  317. <text class="dim-icon">{{ dim.icon }}</text>
  318. </view>
  319. <view class="dim-tag" :style="'color:' + dim.color + ';background:' + dim.bgColor">{{ dim.name }} · {{ dim.title }}</view>
  320. <text class="dim-desc">{{ dim.desc }}</text>
  321. </view>
  322. </view>
  323. <!-- 五维能量环装饰 -->
  324. <view class="dim-energy-row">
  325. <view
  326. v-for="c in energyDotColors" :key="c"
  327. class="energy-dot"
  328. :style="'background:' + c"
  329. ></view>
  330. </view>
  331. </view>
  332. <!-- 底部登录按钮 -->
  333. <view class="login-footer">
  334. <button class="login-btn" @click="handleLogin">登录 / 注册</button>
  335. <text class="login-footer-text">登录即表示同意《用户协议》和《隐私政策》</text>
  336. </view>
  337. <!-- 底部占位 -->
  338. <view style="height: 120rpx;"></view>
  339. </view>
  340. </view>
  341. </template>
  342. <script>
  343. import PageBanner from '../../components/PageBanner.vue'
  344. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  345. import TabTransition from '../../components/tab-transition.vue'
  346. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  347. import FamilyEnergyBar from '../../components/FamilyEnergyBar.vue'
  348. import DimensionTasks from '../../components/DimensionTasks.vue'
  349. import DimensionActivities from '../../components/DimensionActivities.vue'
  350. import DimensionProducts from '../../components/DimensionProducts.vue'
  351. import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
  352. import CircleCard from '../../components/CircleCard.vue'
  353. import CircleDetail from '../../components/CircleDetail.vue'
  354. import LoginGuideCard from '../../components/LoginGuideCard.vue'
  355. import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
  356. import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getVisibleFamilyMembers, getTodayTasksByCategory, getChildren, getEnergyOverview, getProductsByDomain, getChallengeList, getMyCircles, discoverCircles, joinGeneralCircle, leaveGeneralCircle, switchToFamilyMember, getMyMembership, updateChallengeProgress } from '../../utils/api.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. var nativeTabs = ['/pages/index-home/index', '/pages/body/index', '/pages/mind/index', '/pages/wisdom/index', '/pages/wealth/index']
  839. if (nativeTabs.indexOf(item.page) !== -1) {
  840. uni.switchTab({ url: item.page })
  841. } else {
  842. uni.navigateTo({ url: item.page })
  843. }
  844. },
  845. // 首页 TabTransition 动态关闭:检测关键内容是否就绪
  846. _watchPageReady() {
  847. var self = this
  848. var unwatch = this.$watch(function() {
  849. if (!self.isLoggedIn()) {
  850. return !!(self.products && self.products.length > 0) ||
  851. !!(self.dimensionActivities && self.dimensionActivities.length > 0) ||
  852. !!(self.indexArticles && self.indexArticles.length > 0)
  853. }
  854. // 登录用户:等待关键数据加载完成
  855. return !!(self.currentRole && self.sandboxData)
  856. }, function(val) {
  857. if (val) {
  858. if (unwatch) unwatch()
  859. if (self.$refs.tabTransition) self.$refs.tabTransition.markReady()
  860. }
  861. })
  862. },
  863. _doInit(options) {
  864. options = options || {}
  865. if (!this.isLoggedIn()) {
  866. this.currentRole = ''
  867. this.loadProducts()
  868. this.loadDimensionActivities()
  869. this.loadFeaturedArticles()
  870. return
  871. }
  872. this.syncRoleAndTabBar()
  873. if (options.inviteCode && options.type === 'parent_invite') {
  874. this.handleParentInvite(options.inviteCode)
  875. return
  876. }
  877. var storedCode = uni.getStorageSync('inviteCode')
  878. var storedType = uni.getStorageSync('inviteType')
  879. if (storedCode && storedType === 'parent_invite') {
  880. this.handleParentInvite(storedCode)
  881. uni.removeStorageSync('inviteCode')
  882. uni.removeStorageSync('inviteType')
  883. return
  884. }
  885. // 登录用户:直接在 TabBar 页面内联渲染,保持底签可见
  886. if (!this.loggedInInitDone) {
  887. this.loggedInInitDone = true
  888. this.loadLoggedInData()
  889. }
  890. this.checkMemberStatus()
  891. this._watchPageReady()
  892. },
  893. isLoggedIn() {
  894. return !!uni.getStorageSync('token')
  895. },
  896. // ===== 会员状态(沙盘下方会员入口) =====
  897. checkMemberStatus: function() {
  898. var that = this
  899. getMyMembership().then(function(res) {
  900. var m = res.data || {}
  901. that.isMember = !!(m.memberLevel && m.memberLevel !== 'FREE') || !!(m.levelCode && m.levelCode !== 'FREE')
  902. var mem = m.membership || m
  903. if (mem.daysRemaining != null) {
  904. that.membershipDays = mem.daysRemaining
  905. }
  906. }).catch(function() {})
  907. },
  908. goMembership: function() {
  909. uni.navigateTo({ url: '/pages/membership/upgrade' })
  910. },
  911. normalizeCurrentRole() {
  912. const role = uni.getStorageSync('role') || 'parent'
  913. const currentRole = uni.getStorageSync('currentRole')
  914. if (!currentRole) {
  915. return role
  916. }
  917. // 非规划师账号不允许落到规划师首页
  918. if (currentRole === 'teacher' && role !== 'teacher') {
  919. return role
  920. }
  921. // 只有家长账号允许切换到孩子视角
  922. if (currentRole === 'child' && role !== 'parent') {
  923. return role
  924. }
  925. return currentRole
  926. },
  927. syncRoleAndTabBar() {
  928. this.currentRole = this.normalizeCurrentRole()
  929. uni.setStorageSync('currentRole', this.currentRole)
  930. },
  931. // ===== 发现页 / 未登录态方法 =====
  932. loadProducts: function() {
  933. this.loading = true
  934. var params = { page: 1, size: 10 }
  935. if (this.currentType) {
  936. params.productType = this.currentType
  937. }
  938. var self = this
  939. productList(params).then(function(res) {
  940. self.loading = false
  941. if (res && res.code === 200) {
  942. // res.data is the response wrapper, products are in res.data.data or res.data.records
  943. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  944. self.products = Array.isArray(rawData) ? rawData : []
  945. }
  946. self._checkSplashReady()
  947. }).catch(function() {
  948. self.loading = false
  949. self._checkSplashReady()
  950. })
  951. },
  952. loadDimensionActivities: function() {
  953. var self = this
  954. getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
  955. if (res && res.code === 200) {
  956. // res.data is the response wrapper, activities are in res.data.data or res.data.records
  957. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  958. self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
  959. }
  960. self._checkSplashReady()
  961. }).catch(function() {
  962. self._checkSplashReady()
  963. })
  964. },
  965. loadFeaturedArticles: function() {
  966. var self = this
  967. this.articlesLoading = true
  968. getFeaturedArticles({ size: 5 }).then(function(res) {
  969. self.articlesLoading = false
  970. if (res && res.code === 200) {
  971. var gradientColors = [
  972. 'linear-gradient(135deg, #10B981, #34D399)',
  973. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  974. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  975. 'linear-gradient(135deg, #F97316, #FB923C)',
  976. 'linear-gradient(135deg, #6366F1, #818CF8)'
  977. ]
  978. // res.data is the response wrapper, articles are in res.data.data
  979. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  980. var list = Array.isArray(rawList) ? rawList : []
  981. self.indexArticles = list.map(function(item, index) {
  982. return {
  983. id: item.id,
  984. category: item.categoryName || item.category || '热门文章',
  985. categoryColor: gradientColors[index % gradientColors.length],
  986. title: item.title || '',
  987. summary: item.summary || '',
  988. views: item.viewCount ? String(item.viewCount) : '0',
  989. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  990. coverImage: item.coverImage
  991. }
  992. })
  993. }
  994. self._checkSplashReady()
  995. }).catch(function() {
  996. self.articlesLoading = false
  997. self._checkSplashReady()
  998. })
  999. },
  1000. goActivities: function() {
  1001. uni.navigateTo({ url: '/pages/activity/index' })
  1002. },
  1003. goChallengeManage: function() {
  1004. uni.navigateTo({ url: '/pages/health/challenge-manage' })
  1005. },
  1006. goActivityDetail: function(act) {
  1007. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
  1008. },
  1009. goArticles: function() {
  1010. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  1011. },
  1012. goArticleDetail: function(article) {
  1013. var id = article && article.id ? article.id : article
  1014. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1015. },
  1016. onTypeChange(value) {
  1017. this.currentType = value
  1018. this.loadProducts()
  1019. },
  1020. goShop() {
  1021. uni.navigateTo({ url: '/pages/shop/index/index' })
  1022. },
  1023. goDetail(id) {
  1024. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + id })
  1025. },
  1026. handleLogin() {
  1027. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index-home/index') })
  1028. },
  1029. async handleParentInvite(code) {
  1030. // 延迟显示,等待登录完成
  1031. setTimeout(async () => {
  1032. const hasToken = uni.getStorageSync('token')
  1033. if (!hasToken) {
  1034. // 未登录,先去登录
  1035. uni.reLaunch({
  1036. url: '/pages/login/login?inviteCode=' + code
  1037. })
  1038. return
  1039. }
  1040. // 已登录,显示确认框
  1041. uni.showModal({
  1042. title: '加入家庭',
  1043. content: '您已被邀请加入家庭,是否接受?',
  1044. success: async (res) => {
  1045. if (res.confirm) {
  1046. try {
  1047. uni.showLoading({ title: '加入中...' })
  1048. const result = await acceptParentInvite(code)
  1049. uni.hideLoading()
  1050. if (result.code === 200) {
  1051. const { role, token } = result.data
  1052. uni.setStorageSync('role', role)
  1053. uni.setStorageSync('token', token)
  1054. uni.showToast({ title: '加入成功', icon: 'success' })
  1055. // 刷新页面
  1056. setTimeout(() => {
  1057. uni.switchTab({ url: '/pages/index-home/index' })
  1058. }, 1500)
  1059. }
  1060. } catch (e) {
  1061. uni.hideLoading()
  1062. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  1063. }
  1064. }
  1065. }
  1066. })
  1067. }, 500)
  1068. },
  1069. getImageUrl: function(path) {
  1070. return config.API_BASE_URL + path
  1071. }
  1072. }
  1073. }
  1074. </script>
  1075. <style>
  1076. .discover-container {
  1077. min-height: 100vh;
  1078. background: #f5f7fa;
  1079. padding-bottom: 100rpx;
  1080. }
  1081. /* ===== 会员入口卡(能量沙盘下方) ===== */
  1082. .member-entry {
  1083. display: flex;
  1084. align-items: center;
  1085. margin: 20rpx 30rpx 0;
  1086. background: linear-gradient(135deg, #F97316, #FB923C);
  1087. border-radius: 20rpx;
  1088. padding: 24rpx 30rpx;
  1089. }
  1090. .member-entry-icon-wrap {
  1091. width: 64rpx;
  1092. height: 64rpx;
  1093. border-radius: 50%;
  1094. background: rgba(255,255,255,0.2);
  1095. display: flex;
  1096. align-items: center;
  1097. justify-content: center;
  1098. margin-right: 16rpx;
  1099. flex-shrink: 0;
  1100. }
  1101. .member-entry-icon {
  1102. font-size: 36rpx;
  1103. }
  1104. .member-entry-texts {
  1105. flex: 1;
  1106. display: flex;
  1107. flex-direction: column;
  1108. min-width: 0;
  1109. }
  1110. .member-entry-title {
  1111. font-size: 30rpx;
  1112. font-weight: bold;
  1113. color: #fff;
  1114. }
  1115. .member-entry-desc {
  1116. font-size: 22rpx;
  1117. color: rgba(255,255,255,0.85);
  1118. margin-top: 4rpx;
  1119. overflow: hidden;
  1120. text-overflow: ellipsis;
  1121. white-space: nowrap;
  1122. }
  1123. .member-entry-btn {
  1124. margin-left: 16rpx;
  1125. padding: 10rpx 24rpx;
  1126. background: #fff;
  1127. border-radius: 30rpx;
  1128. flex-shrink: 0;
  1129. }
  1130. .member-entry-btn-text {
  1131. font-size: 24rpx;
  1132. color: #F97316;
  1133. font-weight: bold;
  1134. }
  1135. /* ===== 推荐 ===== */
  1136. .recommend-section {
  1137. margin: 20rpx 30rpx;
  1138. }
  1139. .section-header {
  1140. display: flex;
  1141. justify-content: space-between;
  1142. align-items: center;
  1143. margin-bottom: 20rpx;
  1144. }
  1145. .section-title {
  1146. font-size: 30rpx;
  1147. font-weight: bold;
  1148. color: #333;
  1149. }
  1150. .section-more {
  1151. font-size: 24rpx;
  1152. color: #5B9BD5;
  1153. }
  1154. .type-filter-scroll {
  1155. white-space: nowrap;
  1156. margin-bottom: 20rpx;
  1157. }
  1158. .filter-chip {
  1159. display: inline-block;
  1160. padding: 8rpx 24rpx;
  1161. font-size: 24rpx;
  1162. color: #666;
  1163. background: #f0f0f0;
  1164. border-radius: 30rpx;
  1165. margin-right: 16rpx;
  1166. }
  1167. .filter-chip.active {
  1168. background: #5B9BD5;
  1169. color: #fff;
  1170. }
  1171. .loading-state,
  1172. .empty-state {
  1173. display: flex;
  1174. justify-content: center;
  1175. padding: 60rpx 0;
  1176. }
  1177. .loading-text,
  1178. .empty-text {
  1179. font-size: 26rpx;
  1180. color: #999;
  1181. }
  1182. .product-grid {
  1183. display: flex;
  1184. flex-wrap: wrap;
  1185. justify-content: space-between;
  1186. }
  1187. .product-card {
  1188. width: 48%;
  1189. background: #fff;
  1190. border-radius: 16rpx;
  1191. overflow: hidden;
  1192. margin-bottom: 20rpx;
  1193. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
  1194. }
  1195. .product-cover {
  1196. width: 100%;
  1197. height: 200rpx;
  1198. background: #f0f0f0;
  1199. }
  1200. .product-info {
  1201. padding: 14rpx;
  1202. }
  1203. .product-name {
  1204. display: block;
  1205. font-size: 26rpx;
  1206. color: #333;
  1207. margin-bottom: 10rpx;
  1208. overflow: hidden;
  1209. text-overflow: ellipsis;
  1210. white-space: nowrap;
  1211. }
  1212. .product-price-row {
  1213. display: flex;
  1214. align-items: baseline;
  1215. }
  1216. .product-price {
  1217. font-size: 28rpx;
  1218. color: #5B9BD5;
  1219. font-weight: bold;
  1220. margin-right: 10rpx;
  1221. }
  1222. .product-price-login {
  1223. font-size: 24rpx;
  1224. color: #999;
  1225. }
  1226. .product-member {
  1227. font-size: 20rpx;
  1228. color: #999;
  1229. }
  1230. /* ===== 五维全景幸福矩阵 ===== */
  1231. .why-section {
  1232. margin: 30rpx;
  1233. }
  1234. .dim-matrix {
  1235. display: flex;
  1236. flex-wrap: wrap;
  1237. gap: 20rpx;
  1238. justify-content: center;
  1239. }
  1240. .dim-card {
  1241. width: calc(33.33% - 14rpx);
  1242. box-sizing: border-box;
  1243. background: #fff;
  1244. border-radius: 20rpx;
  1245. padding: 28rpx 16rpx 24rpx;
  1246. display: flex;
  1247. flex-direction: column;
  1248. align-items: center;
  1249. text-align: center;
  1250. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1251. transition: transform 0.2s ease, box-shadow 0.2s ease;
  1252. position: relative;
  1253. overflow: hidden;
  1254. }
  1255. .dim-card:active {
  1256. transform: scale(0.96);
  1257. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.1);
  1258. }
  1259. .dim-icon-circle {
  1260. width: 72rpx;
  1261. height: 72rpx;
  1262. border-radius: 50%;
  1263. display: flex;
  1264. align-items: center;
  1265. justify-content: center;
  1266. margin-bottom: 14rpx;
  1267. flex-shrink: 0;
  1268. }
  1269. .dim-icon {
  1270. font-size: 36rpx;
  1271. line-height: 1;
  1272. }
  1273. .dim-tag {
  1274. font-size: 22rpx;
  1275. font-weight: 600;
  1276. padding: 4rpx 14rpx;
  1277. border-radius: 20rpx;
  1278. margin-bottom: 10rpx;
  1279. max-width: 100%;
  1280. overflow: hidden;
  1281. text-overflow: ellipsis;
  1282. white-space: nowrap;
  1283. }
  1284. .dim-desc {
  1285. font-size: 20rpx;
  1286. color: #888;
  1287. line-height: 1.5;
  1288. display: -webkit-box;
  1289. -webkit-line-clamp: 2;
  1290. -webkit-box-orient: vertical;
  1291. overflow: hidden;
  1292. }
  1293. /* 五维能量环 */
  1294. .dim-energy-row {
  1295. display: flex;
  1296. justify-content: center;
  1297. gap: 12rpx;
  1298. margin-top: 24rpx;
  1299. opacity: 0.5;
  1300. }
  1301. .energy-dot {
  1302. width: 10rpx;
  1303. height: 10rpx;
  1304. border-radius: 50%;
  1305. }
  1306. /* ===== 底部登录 ===== */
  1307. .login-footer {
  1308. margin: 40rpx 30rpx;
  1309. display: flex;
  1310. flex-direction: column;
  1311. align-items: center;
  1312. }
  1313. .login-btn {
  1314. width: 100%;
  1315. height: 88rpx;
  1316. line-height: 88rpx;
  1317. background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
  1318. color: #fff;
  1319. font-size: 32rpx;
  1320. font-weight: bold;
  1321. border-radius: 44rpx;
  1322. text-align: center;
  1323. border: none;
  1324. }
  1325. .login-btn::after {
  1326. border: none;
  1327. }
  1328. .login-footer-text {
  1329. font-size: 20rpx;
  1330. color: #bbb;
  1331. margin-top: 16rpx;
  1332. }
  1333. /* ===== 加载占位 ===== */
  1334. .loading-container {
  1335. display: flex;
  1336. justify-content: center;
  1337. align-items: center;
  1338. height: 100vh;
  1339. }
  1340. /* ===== 角色切换淡入淡出 ===== */
  1341. .role-switch-wrapper {
  1342. width: 100%;
  1343. min-height: 100vh;
  1344. }
  1345. .fade-enter-active,
  1346. .fade-leave-active {
  1347. transition: opacity 0.3s ease;
  1348. }
  1349. .fade-enter,
  1350. .fade-leave-to {
  1351. opacity: 0;
  1352. }
  1353. /* ===== 通用区块样式 ===== */
  1354. .section {
  1355. margin: 20rpx 30rpx;
  1356. }
  1357. .section-header {
  1358. display: flex;
  1359. justify-content: space-between;
  1360. align-items: center;
  1361. margin-bottom: 20rpx;
  1362. }
  1363. .section-title {
  1364. font-size: 30rpx;
  1365. font-weight: bold;
  1366. color: #333;
  1367. }
  1368. .section-more {
  1369. font-size: 24rpx;
  1370. color: #5B9BD5;
  1371. }
  1372. .empty-state {
  1373. display: flex;
  1374. justify-content: center;
  1375. padding: 60rpx 0;
  1376. }
  1377. .empty-text {
  1378. font-size: 26rpx;
  1379. color: #999;
  1380. }
  1381. /* ===== 活动列表 ===== */
  1382. .activity-list {
  1383. display: flex;
  1384. flex-direction: column;
  1385. gap: 16rpx;
  1386. }
  1387. .activity-card {
  1388. background: #fff;
  1389. border-radius: 16rpx;
  1390. overflow: hidden;
  1391. display: flex;
  1392. flex-direction: row;
  1393. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1394. }
  1395. .activity-card:active {
  1396. opacity: 0.8;
  1397. }
  1398. .activity-cover {
  1399. width: 200rpx;
  1400. height: 160rpx;
  1401. flex-shrink: 0;
  1402. background: #f0f0f0;
  1403. }
  1404. .activity-info {
  1405. flex: 1;
  1406. padding: 16rpx;
  1407. display: flex;
  1408. flex-direction: column;
  1409. justify-content: space-between;
  1410. }
  1411. .activity-name {
  1412. font-size: 28rpx;
  1413. font-weight: bold;
  1414. color: #333;
  1415. margin-bottom: 8rpx;
  1416. }
  1417. .line-clamp-1 {
  1418. overflow: hidden;
  1419. text-overflow: ellipsis;
  1420. white-space: nowrap;
  1421. }
  1422. .activity-meta {
  1423. display: flex;
  1424. align-items: center;
  1425. margin-bottom: 8rpx;
  1426. }
  1427. .activity-time {
  1428. font-size: 22rpx;
  1429. color: #999;
  1430. }
  1431. .activity-bottom {
  1432. display: flex;
  1433. align-items: center;
  1434. gap: 12rpx;
  1435. }
  1436. .activity-status {
  1437. font-size: 20rpx;
  1438. padding: 2rpx 10rpx;
  1439. border-radius: 8rpx;
  1440. background: #E8F5E9;
  1441. color: #2E7D32;
  1442. }
  1443. .activity-status.status-upcoming {
  1444. background: #E3F2FD;
  1445. color: #1565C0;
  1446. }
  1447. .activity-status.status-ended {
  1448. background: #F5F5F5;
  1449. color: #999;
  1450. }
  1451. .activity-fee {
  1452. font-size: 24rpx;
  1453. color: #F97316;
  1454. font-weight: bold;
  1455. }
  1456. .activity-fee.fee-free {
  1457. color: #4CAF50;
  1458. }
  1459. /* ===== 文章列表 ===== */
  1460. .article-list {
  1461. display: flex;
  1462. flex-direction: column;
  1463. gap: 16rpx;
  1464. }
  1465. .article-card {
  1466. background: #fff;
  1467. border-radius: 16rpx;
  1468. padding: 24rpx;
  1469. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1470. }
  1471. .article-card:active {
  1472. opacity: 0.8;
  1473. }
  1474. .article-category {
  1475. display: inline-block;
  1476. padding: 4rpx 14rpx;
  1477. border-radius: 8rpx;
  1478. margin-bottom: 10rpx;
  1479. }
  1480. .article-category-text {
  1481. font-size: 20rpx;
  1482. color: #fff;
  1483. }
  1484. .article-title {
  1485. display: block;
  1486. font-size: 28rpx;
  1487. font-weight: bold;
  1488. color: #333;
  1489. margin-bottom: 8rpx;
  1490. line-height: 1.4;
  1491. }
  1492. .article-summary {
  1493. display: block;
  1494. font-size: 24rpx;
  1495. color: #888;
  1496. line-height: 1.5;
  1497. margin-bottom: 12rpx;
  1498. overflow: hidden;
  1499. text-overflow: ellipsis;
  1500. display: -webkit-box;
  1501. -webkit-line-clamp: 2;
  1502. -webkit-box-orient: vertical;
  1503. }
  1504. .article-meta {
  1505. display: flex;
  1506. align-items: center;
  1507. gap: 16rpx;
  1508. }
  1509. .meta-item {
  1510. display: flex;
  1511. align-items: center;
  1512. gap: 4rpx;
  1513. }
  1514. .meta-icon {
  1515. font-size: 24rpx;
  1516. }
  1517. .meta-text {
  1518. font-size: 22rpx;
  1519. color: #999;
  1520. }
  1521. .article-date {
  1522. font-size: 22rpx;
  1523. color: #bbb;
  1524. }
  1525. /* ===== Splash Loading Overlay(冷启动蒙板,来自 merge splash.vue) ===== */
  1526. .splash-overlay {
  1527. position: fixed;
  1528. top: 0; left: 0; right: 0; bottom: 0;
  1529. z-index: 9999;
  1530. display: flex;
  1531. align-items: center;
  1532. justify-content: center;
  1533. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  1534. overflow: hidden;
  1535. opacity: 1;
  1536. transition: opacity 0.4s ease;
  1537. }
  1538. .splash-overlay.fade-out {
  1539. opacity: 0;
  1540. pointer-events: none;
  1541. }
  1542. /* ---- bg circles from splash.vue ---- */
  1543. .splash-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
  1544. .bg-circle {
  1545. position: absolute;
  1546. border-radius: 50%;
  1547. opacity: 0.12;
  1548. }
  1549. .bg-circle-1 {
  1550. width: 400rpx; height: 400rpx;
  1551. background: #FF8C42;
  1552. top: -100rpx; right: -80rpx;
  1553. animation: splash-float-1 4s ease-in-out infinite;
  1554. }
  1555. .bg-circle-2 {
  1556. width: 280rpx; height: 280rpx;
  1557. background: #FF6B9D;
  1558. bottom: 80rpx; left: -60rpx;
  1559. animation: splash-float-2 5s ease-in-out infinite;
  1560. }
  1561. .bg-circle-3 {
  1562. width: 180rpx; height: 180rpx;
  1563. background: #6366F1;
  1564. top: 50%; right: -40rpx;
  1565. animation: splash-float-3 6s ease-in-out infinite;
  1566. }
  1567. @keyframes splash-float-1 {
  1568. 0%, 100% { transform: translateY(0) scale(1); }
  1569. 50% { transform: translateY(-30rpx) scale(1.05); }
  1570. }
  1571. @keyframes splash-float-2 {
  1572. 0%, 100% { transform: translateY(0) scale(1); }
  1573. 50% { transform: translateY(20rpx) scale(1.08); }
  1574. }
  1575. @keyframes splash-float-3 {
  1576. 0%, 100% { transform: translateY(0) rotate(0deg); }
  1577. 50% { transform: translateY(-20rpx) rotate(10deg); }
  1578. }
  1579. /* ---- body fade-in ---- */
  1580. .splash-overlay-body {
  1581. display: flex;
  1582. flex-direction: column;
  1583. align-items: center;
  1584. animation: splash-body-in 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  1585. }
  1586. @keyframes splash-body-in {
  1587. from { opacity: 0; transform: translateY(40rpx) scale(0.96); }
  1588. to { opacity: 1; transform: translateY(0) scale(1); }
  1589. }
  1590. /* ---- logo ---- */
  1591. .splash-logo-wrap {
  1592. width: 160rpx; height: 160rpx;
  1593. border-radius: 40rpx;
  1594. background: rgba(255,255,255,0.95);
  1595. display: flex; align-items: center; justify-content: center;
  1596. margin-bottom: 16rpx;
  1597. box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
  1598. animation: splash-logo-pulse 2.5s ease-in-out infinite;
  1599. }
  1600. @keyframes splash-logo-pulse {
  1601. 0%, 100% { box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25); }
  1602. 50% { box-shadow: 0 8rpx 48rpx rgba(249,115,22,0.45); }
  1603. }
  1604. .splash-logo-img { width: 100rpx; height: 100rpx; }
  1605. /* ---- brand ---- */
  1606. .splash-brand-name {
  1607. font-size: 64rpx; font-weight: 800;
  1608. color: #7C2D12;
  1609. letter-spacing: 10rpx;
  1610. margin-bottom: 2rpx;
  1611. }
  1612. .splash-brand-en {
  1613. font-size: 20rpx;
  1614. color: rgba(124,45,18,0.5);
  1615. letter-spacing: 6rpx;
  1616. margin-bottom: 30rpx;
  1617. }
  1618. .splash-tagline {
  1619. font-size: 26rpx;
  1620. color: rgba(124,45,18,0.7);
  1621. letter-spacing: 4rpx;
  1622. margin-top: 24rpx;
  1623. }
  1624. /* ---- dims row from splash.vue (rounded circles) ---- */
  1625. .splash-dims-row {
  1626. display: flex; flex-direction: row;
  1627. align-items: center; justify-content: center;
  1628. gap: 28rpx;
  1629. }
  1630. .splash-dim-item {
  1631. display: flex; flex-direction: column;
  1632. align-items: center; gap: 8rpx;
  1633. }
  1634. .splash-dim-circle {
  1635. width: 80rpx; height: 80rpx;
  1636. border-radius: 50%;
  1637. display: flex; align-items: center; justify-content: center;
  1638. }
  1639. .splash-dim-icon { font-size: 36rpx; line-height: 1; }
  1640. .splash-dim-label {
  1641. font-size: 22rpx; font-weight: 500;
  1642. color: rgba(124,45,18,0.75);
  1643. line-height: 1;
  1644. }
  1645. /* ---- staggered dim entry from splash.vue ---- */
  1646. .splash-dim-item:nth-child(1) { animation: splash-dim-in 0.5s ease 0.1s both; }
  1647. .splash-dim-item:nth-child(2) { animation: splash-dim-in 0.5s ease 0.2s both; }
  1648. .splash-dim-item:nth-child(3) { animation: splash-dim-in 0.5s ease 0.3s both; }
  1649. .splash-dim-item:nth-child(4) { animation: splash-dim-in 0.5s ease 0.4s both; }
  1650. .splash-dim-item:nth-child(5) { animation: splash-dim-in 0.5s ease 0.5s both; }
  1651. @keyframes splash-dim-in {
  1652. from { opacity: 0; transform: translateY(16rpx) scale(0.8); }
  1653. to { opacity: 1; transform: translateY(0) scale(1); }
  1654. }
  1655. /* ---- loading dots ---- */
  1656. .splash-overlay-loading {
  1657. position: absolute;
  1658. bottom: 120rpx;
  1659. left: 0; right: 0;
  1660. display: flex;
  1661. justify-content: center;
  1662. align-items: center;
  1663. gap: 12rpx;
  1664. }
  1665. .splash-overlay-dot {
  1666. width: 14rpx; height: 14rpx;
  1667. border-radius: 50%;
  1668. background: rgba(249,115,22,0.6);
  1669. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  1670. }
  1671. .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
  1672. .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
  1673. .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
  1674. @keyframes splash-dot-bounce {
  1675. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  1676. 40% { transform: scale(1); opacity: 1; }
  1677. }
  1678. /* ---- 登录态内容布局 ---- */
  1679. .logged-in-container {
  1680. padding-bottom: 40rpx;
  1681. }
  1682. /* ===== 功能入口(原action页样式) ===== */
  1683. .func-section {
  1684. margin: -40rpx 20rpx 0;
  1685. position: relative;
  1686. z-index: 2;
  1687. }
  1688. .func-grid {
  1689. background: #fff;
  1690. border-radius: 24rpx;
  1691. padding: 30rpx 16rpx;
  1692. display: flex;
  1693. box-shadow: 0 4rpx 20rpx rgba(0,0,0,0.06);
  1694. }
  1695. .func-item {
  1696. flex: 1;
  1697. display: flex;
  1698. flex-direction: column;
  1699. align-items: center;
  1700. }
  1701. .func-item:active {
  1702. opacity: 0.7;
  1703. }
  1704. .func-icon-wrap {
  1705. width: 88rpx;
  1706. height: 88rpx;
  1707. border-radius: 50%;
  1708. background: #FFF7ED;
  1709. display: flex;
  1710. align-items: center;
  1711. justify-content: center;
  1712. margin-bottom: 10rpx;
  1713. }
  1714. .func-icon {
  1715. font-size: 40rpx;
  1716. }
  1717. .func-label {
  1718. font-size: 24rpx;
  1719. color: #333;
  1720. font-weight: 500;
  1721. }
  1722. /* ===== 圈子卡片 ===== */
  1723. .circle-section {
  1724. margin: 20rpx 30rpx;
  1725. }
  1726. .circle-header {
  1727. display: flex;
  1728. justify-content: space-between;
  1729. align-items: center;
  1730. margin-bottom: 20rpx;
  1731. }
  1732. .circle-section-title {
  1733. font-size: 30rpx;
  1734. font-weight: bold;
  1735. color: #333;
  1736. }
  1737. .circle-header-link {
  1738. font-size: 24rpx;
  1739. color: #5B9BD5;
  1740. }
  1741. .circle-scroll {
  1742. white-space: nowrap;
  1743. }
  1744. .circle-scroll-inner {
  1745. display: inline-flex;
  1746. gap: 16rpx;
  1747. }
  1748. .circle-card-wrap {
  1749. display: inline-block;
  1750. }
  1751. .circle-empty {
  1752. padding: 40rpx 0;
  1753. text-align: center;
  1754. }
  1755. .circle-empty-text {
  1756. font-size: 26rpx;
  1757. color: #999;
  1758. }
  1759. .circle-discover {
  1760. margin-top: 30rpx;
  1761. }
  1762. .discover-list {
  1763. display: flex;
  1764. flex-direction: column;
  1765. gap: 16rpx;
  1766. }
  1767. .discover-item {
  1768. background: #fff;
  1769. border-radius: 16rpx;
  1770. overflow: hidden;
  1771. }
  1772. </style>