index.vue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333
  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. <!-- 登录态 — 直接内嵌,保持底签可见 -->
  47. <view v-if="currentRole" class="logged-in-container">
  48. <!-- ⓪ 新手成长礼包进度条(新用户引导,全部领取后自动隐藏) -->
  49. <OnboardingProgressBar ref="onboardingProgress" />
  50. <!-- ① 了解区 — 自测大卡(首屏,引导"从了解开始") -->
  51. <view class="self-test-card" @click="goSelfTest">
  52. <view class="self-test-head">
  53. <text class="self-test-icon">⚡</text>
  54. <view class="self-test-info">
  55. <text class="self-test-title">{{ selfTestTitle }}</text>
  56. <text class="self-test-sub">{{ selfTestSub }}</text>
  57. <text v-if="pendingSurveys.length > 0" class="self-test-badge">有 {{ pendingSurveys.length }} 项调研待填</text>
  58. </view>
  59. <text class="self-test-arrow">›</text>
  60. </view>
  61. </view>
  62. <!-- ①.b 行动引导条 — Next Best Action(仅登录态展示,定位"现在该做的一件事") -->
  63. <view v-if="nextBestAction" class="guide-bar" :class="'guide-bar-' + nextBestAction.color" @click="onGuideTap(nextBestAction)">
  64. <view class="guide-bar-icon-wrap">
  65. <text class="guide-bar-icon">{{ nextBestAction.icon }}</text>
  66. </view>
  67. <view class="guide-bar-info">
  68. <text class="guide-bar-title">{{ nextBestAction.title }}</text>
  69. <text class="guide-bar-sub">{{ nextBestAction.sub }}</text>
  70. </view>
  71. <view class="guide-bar-btn">
  72. <text class="guide-bar-btn-text">{{ nextBestAction.btn }} ›</text>
  73. </view>
  74. </view>
  75. <!-- ② 发现区 — 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
  76. <GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
  77. <WuxingSandbox
  78. v-else-if="sandboxData"
  79. mode="live"
  80. :scores="familySandboxScores"
  81. :overallScore="familySandboxOverall"
  82. :members="familySandboxMembers"
  83. :personalData="sandboxPersonalData"
  84. :dimensions="energyDimensions"
  85. :totalEnergy="totalEnergy"
  86. :totalHealthIndex="totalHealthIndex"
  87. :currentView="currentSandboxView"
  88. :familyUnlocked="familyUnlocked"
  89. :memberCount="familyMembersVisible.length"
  90. @view-change="onSandboxViewChange"
  91. showDimensionBar
  92. starHeight="480rpx" />
  93. <!-- ② 发现区 — 上传报告 -->
  94. <FamilyFeed
  95. :items="familyFeed"
  96. :notices="notices"
  97. :showHeader="true" />
  98. <!-- ④ 内容区 — 推荐文章 -->
  99. <view v-if="showMemberEntry" class="member-entry" @click="goMembership">
  100. <view class="member-entry-icon-wrap">
  101. <text class="member-entry-icon">👑</text>
  102. </view>
  103. <view class="member-entry-texts">
  104. <text class="member-entry-title">{{ memberEntryTitle }}</text>
  105. <text class="member-entry-desc">{{ memberEntryDesc }}</text>
  106. </view>
  107. <view class="member-entry-btn">
  108. <text class="member-entry-btn-text">{{ memberEntryBtn }}</text>
  109. </view>
  110. </view>
  111. <!-- ④ 内容区 — 快捷功能入口(单排) -->
  112. <view class="section">
  113. <view class="quick-bar">
  114. <view class="quick-item" @click="navTo('/pages/tasks/tasks')">
  115. <view class="quick-icon" style="background:rgba(99,102,241,0.15)"><text>📋</text></view>
  116. <text class="quick-label">任务</text>
  117. </view>
  118. <view class="quick-item" @click="navTo('/pages/action-detail/interaction-log')">
  119. <view class="quick-icon" style="background:rgba(16,185,129,0.15)"><text>💬</text></view>
  120. <text class="quick-label">互动</text>
  121. </view>
  122. <view class="quick-item" @click="navTo('/pages/mind-detail/family-dashboard')">
  123. <view class="quick-icon" style="background:rgba(139,92,246,0.15)"><text>🏠</text></view>
  124. <text class="quick-label">天盘</text>
  125. </view>
  126. <view class="quick-item" @click="navTo('/pages/profile-extra/family-members')">
  127. <view class="quick-icon" style="background:rgba(245,158,11,0.15)"><text>👨‍👩‍👧‍👦</text></view>
  128. <text class="quick-label">成员</text>
  129. </view>
  130. <view class="quick-item" @click="navTo('/pages/discover/circles')">
  131. <view class="quick-icon" style="background:rgba(255,107,157,0.15)"><text>🤝</text></view>
  132. <text class="quick-label">圈子</text>
  133. </view>
  134. <view class="quick-item" @click="navTo('/pages/shop/index/index')">
  135. <view class="quick-icon" style="background:rgba(249,115,22,0.15)"><text>🛒</text></view>
  136. <text class="quick-label">商城</text>
  137. </view>
  138. </view>
  139. </view>
  140. <!-- ④ 内容区 — 家庭动态 -->
  141. <view v-if="hasPendingTasks" class="section">
  142. <view class="section-header">
  143. <text class="section-title">📝 我的任务</text>
  144. <text class="section-more" @click="navTo('/pages/tasks/tasks')">全部 ›</text>
  145. </view>
  146. <view class="task-quick-list">
  147. <view
  148. v-for="task in pendingTasks"
  149. :key="task.id"
  150. class="task-quick-item"
  151. >
  152. <view class="task-quick-info">
  153. <text class="task-quick-title line-clamp-1">{{ task.title }}</text>
  154. <text class="task-quick-meta">+{{ task.points }}分</text>
  155. </view>
  156. <button class="btn-quick-complete" @click="quickCompleteTask(task)">完成</button>
  157. </view>
  158. </view>
  159. </view>
  160. <!-- ③ 行动区 — 家庭挑战任务 -->
  161. <view class="section">
  162. <view class="section-header">
  163. <text class="section-title">🔥 家庭挑战</text>
  164. <text class="section-more" @click="goChallengeManage">管理 ›</text>
  165. </view>
  166. <FamilyChallengeCard
  167. v-for="ch in activeChallenges"
  168. :key="ch.id"
  169. :challenge="ch"
  170. :showCheckin="showCheckinBtn"
  171. @checkin="onChallengeCheckin"
  172. @respond="onChallengeRespond" />
  173. <view v-if="activeChallenges.length === 0" class="challenge-empty">
  174. <text class="challenge-empty-icon">🏆</text>
  175. <text class="challenge-empty-text">您还没有挑战,去添加吧</text>
  176. <button class="challenge-add-btn" @click="goChallengeManage">去添加</button>
  177. </view>
  178. </view>
  179. <!-- ③ 行动区 — 会员入口:非会员显示开通 / 快到期显示续费 -->
  180. <DailyTaskCard />
  181. <!-- ③ 行动区 — 我的任务(仅当有待完成时显示) -->
  182. <view class="section">
  183. <ReportUploadCard
  184. title="上传报告"
  185. desc="体检报告 · 菌群检测 · 认知测评 · 心理测评 · 情绪打卡"
  186. :tags="['体检报告', '菌群检测', '认知测评', '心理测评', '情绪打卡']"
  187. @click="goToUploadReport" />
  188. </view>
  189. <!-- ③ 行动区 — 今日任务 -->
  190. <view class="section">
  191. <view class="section-header">
  192. <text class="section-title">📖 推荐阅读</text>
  193. <text class="section-more" @click="goMoreArticles">更多 ›</text>
  194. </view>
  195. <ArticleBookshelf
  196. :articles="actionArticles"
  197. :isLoggedIn="true"
  198. @articleClick="goArticleDetail" />
  199. </view>
  200. <!-- ④ 内容区 — 推荐商品 -->
  201. <view class="section">
  202. <view class="section-header">
  203. <text class="section-title">🛍️ 推荐商品</text>
  204. <text class="section-more" @click="goMoreProducts">更多 ›</text>
  205. </view>
  206. <DimensionProducts
  207. :isLoggedIn="true"
  208. :showMore="false"
  209. @productClick="goProductDetail" />
  210. </view>
  211. <!-- 底部占位 -->
  212. <view class="bottom-spacer" style="height: 40rpx;"></view>
  213. <!-- 首次登录引导浮层(3 步产品介绍,看过一次后不再弹) -->
  214. <OnboardingGuide
  215. :role="currentRole"
  216. :show="showOnboardingGuide"
  217. @close="closeOnboardingGuide" />
  218. </view>
  219. <!-- 未登录态 — 发现页/引流内容,直接内嵌,不跳转 -->
  220. <view v-else class="discover-container">
  221. <!-- 品牌 Hero 区 -->
  222. <view class="hero-section">
  223. <image class="hero-logo" src="/static/logo.png" mode="aspectFit" />
  224. <text class="hero-name">浠艾福</text>
  225. <text class="hero-identity">您的专属家庭主动健康管理师</text>
  226. <text class="hero-slogan">孩子的情绪、习惯、能力,你真的看见了吗?</text>
  227. <text class="hero-powered">亿图腾科技出品</text>
  228. <view class="hero-dims">
  229. <view class="hero-dim"><text class="hero-dim-emoji">🌏</text><text class="hero-dim-label">身·根基</text></view>
  230. <view class="hero-dim"><text class="hero-dim-emoji">⚡</text><text class="hero-dim-label">智·赋能</text></view>
  231. <view class="hero-dim"><text class="hero-dim-emoji">💧</text><text class="hero-dim-label">富·创富</text></view>
  232. <view class="hero-dim"><text class="hero-dim-emoji">🌿</text><text class="hero-dim-label">行·和谐</text></view>
  233. <view class="hero-dim"><text class="hero-dim-emoji">🔥</text><text class="hero-dim-label">心·大爱</text></view>
  234. </view>
  235. <text class="hero-sub-slogan">情绪低落没察觉、习惯变化没注意、能力短板没发现——问题爆发才着急。先看见,先了解,不等问题发生。</text>
  236. <button class="hero-cta-btn" @click="handleLogin">免费体验 · 登录 / 注册</button>
  237. </view>
  238. <!-- ② 平台作用·价值主张 -->
  239. <view class="value-prop-section">
  240. <text class="value-prop-title">为什么选择浠艾福?</text>
  241. <view class="value-prop-grid">
  242. <view class="value-prop-card">
  243. <text class="value-prop-icon">🧪</text>
  244. <view class="value-prop-texts">
  245. <text class="value-prop-name">免费五维测评</text>
  246. <text class="value-prop-desc">从身体到心智,20 分钟看清全家健康状况</text>
  247. </view>
  248. </view>
  249. <view class="value-prop-card">
  250. <text class="value-prop-icon">🎯</text>
  251. <view class="value-prop-texts">
  252. <text class="value-prop-name">个性化成长方案</text>
  253. <text class="value-prop-desc">基于测评数据,AI+专家定制专属行动计划</text>
  254. </view>
  255. </view>
  256. <view class="value-prop-card">
  257. <text class="value-prop-icon">👨‍👩‍👧</text>
  258. <view class="value-prop-texts">
  259. <text class="value-prop-name">全家共管</text>
  260. <text class="value-prop-desc">一个家庭一张网,夫妻协同、孩子参与,成长看得见</text>
  261. </view>
  262. </view>
  263. <view class="value-prop-card">
  264. <text class="value-prop-icon">📈</text>
  265. <view class="value-prop-texts">
  266. <text class="value-prop-name">任务与积分激励</text>
  267. <text class="value-prop-desc">把健康管理变成每天的小行动,习惯自然养成</text>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <!-- ③ 三步上手 -->
  273. <view class="how-it-works">
  274. <text class="how-it-works-title">三步开启全家健康之旅</text>
  275. <view class="step-row">
  276. <view class="step-item">
  277. <view class="step-num">1</view>
  278. <text class="step-name">登录/注册</text>
  279. <text class="step-sub">(30 秒)</text>
  280. </view>
  281. <view class="step-arrow">›</view>
  282. <view class="step-item">
  283. <view class="step-num">2</view>
  284. <text class="step-name">完成五维测评</text>
  285. <text class="step-sub">(全家各一份)</text>
  286. </view>
  287. <view class="step-arrow">›</view>
  288. <view class="step-item">
  289. <view class="step-num">3</view>
  290. <text class="step-name">获得专属方案</text>
  291. <text class="step-sub">(照着做,持续优化)</text>
  292. </view>
  293. </view>
  294. </view>
  295. <!-- 五行沙盘预览 -->
  296. <wuxing-sandbox mode="preview" badgeText="登录查看完整报告" @point-click="handleLogin" />
  297. <!-- 热门活动(无条件展示) -->
  298. <view class="section">
  299. <view class="section-header">
  300. <text class="section-title">🔥 热门活动</text>
  301. <text class="section-more" @click="goActivities">查看更多 ›</text>
  302. </view>
  303. <view v-if="dimensionActivities.length === 0" class="empty-state" style="padding: 40rpx 0;">
  304. <text class="empty-text">暂无活动</text>
  305. </view>
  306. <view class="activity-list" v-else>
  307. <view class="activity-card" v-for="act in dimensionActivities" :key="act.id" @click="goActivityDetail(act)">
  308. <image class="activity-cover" :src="getImageUrl(act.coverImage) || '/static/default-activity.png'" mode="aspectFill" />
  309. <view class="activity-info">
  310. <text class="activity-name line-clamp-1">{{ act.title }}</text>
  311. <view class="activity-meta">
  312. <text class="activity-time">{{ act.startTime }}</text>
  313. </view>
  314. <view class="activity-bottom">
  315. <text class="activity-status" :class="'status-' + (act.status || 'upcoming')">{{ act.status === 'ongoing' ? '进行中' : act.status === 'ended' ? '已结束' : '即将开始' }}</text>
  316. <text class="activity-fee" v-if="act.price && act.price > 0">¥{{ (act.price / 100).toFixed(0) }}</text>
  317. <text class="activity-fee fee-free" v-else>免费</text>
  318. </view>
  319. </view>
  320. </view>
  321. </view>
  322. </view>
  323. <!-- 推荐阅读(无条件展示) -->
  324. <view class="section">
  325. <view class="section-header">
  326. <text class="section-title">📖 推荐阅读</text>
  327. <text class="section-more" @click="goArticles">更多 ›</text>
  328. </view>
  329. <view class="article-list">
  330. <view v-if="articlesLoading" class="loading-state" style="padding: 40rpx 0;">
  331. <text class="loading-text">加载中...</text>
  332. </view>
  333. <!-- 无数据时显示占位卡片 -->
  334. <template v-else-if="indexArticles.length === 0">
  335. <view class="article-card" v-for="(item, i) in [1,2,3]" :key="i">
  336. <view class="article-category" :style="{ background: gradientColors[(i-1) % gradientColors.length] }">
  337. <text class="article-category-text">推荐文章</text>
  338. </view>
  339. <text class="article-title">暂无推荐文章</text>
  340. <text class="article-summary">精彩内容即将上线,敬请期待</text>
  341. <view class="article-meta">
  342. <view class="meta-item">
  343. <text class="meta-icon">&#x1F4D6;</text>
  344. <text class="meta-text">0</text>
  345. </view>
  346. <text class="article-date">--</text>
  347. </view>
  348. </view>
  349. </template>
  350. <!-- 有数据时显示文章卡片 -->
  351. <template v-else>
  352. <view class="article-card" v-for="article in indexArticles" :key="article.id" @click="goArticleDetail(article.id)">
  353. <view class="article-category" :style="{ background: article.categoryColor }">
  354. <text class="article-category-text">{{ article.category }}</text>
  355. </view>
  356. <text class="article-title">{{ article.title }}</text>
  357. <text class="article-summary">{{ article.summary }}</text>
  358. <view class="article-meta">
  359. <view class="meta-item">
  360. <text class="meta-icon">&#x1F4D6;</text>
  361. <text class="meta-text">{{ article.views }}</text>
  362. </view>
  363. <text class="article-date">{{ article.date }}</text>
  364. </view>
  365. </view>
  366. </template>
  367. </view>
  368. </view>
  369. <!-- 底部登录按钮 -->
  370. <view class="login-footer">
  371. <button class="login-btn" @click="handleLogin">登录 / 注册</button>
  372. </view>
  373. <!-- 底部占位 -->
  374. <view style="height: 120rpx;"></view>
  375. </view>
  376. </view>
  377. </template>
  378. <script>
  379. import store from '../../store/index.js'
  380. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  381. import GateLock from '../../components/gate-lock.vue'
  382. import FamilyFeed from '../../components/FamilyFeed.vue'
  383. import DimensionProducts from '../../components/DimensionProducts.vue'
  384. import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
  385. import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
  386. import DailyTaskCard from '../../components/daily-task-card.vue'
  387. import ReportUploadCard from '../../components/report-upload-card.vue'
  388. import OnboardingProgressBar from '../../components/OnboardingProgressBar.vue'
  389. import OnboardingGuide from '../../components/OnboardingGuide.vue'
  390. import { acceptParentInvite, getActivityList, getFeaturedArticles, getEnergySandbox, getEnergyOverview, getFamilyMemberList, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList, getSurveyStatus, getSelfCheckStatus, getReferralCode, extractReferralCode } from '../../utils/api.js'
  391. import nav from '../../utils/nav.js'
  392. import config from '@/config.js'
  393. import { parseDate } from '../../utils/format.js'
  394. export default {
  395. components: {
  396. WuxingSandbox,
  397. GateLock,
  398. FamilyFeed,
  399. DimensionProducts,
  400. ArticleBookshelf,
  401. FamilyChallengeCard,
  402. DailyTaskCard,
  403. ReportUploadCard,
  404. OnboardingProgressBar,
  405. OnboardingGuide,
  406. },
  407. data() {
  408. // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
  409. var _token = uni.getStorageSync('token')
  410. var _currentRole = ''
  411. if (_token) {
  412. _currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
  413. }
  414. // 冷启动标记(由 App.vue onLaunch 设置,仅在冷启动时存在)
  415. var _isFirstLaunch = (uni.getStorageSync('_showSplashOverlay') === '1')
  416. return {
  417. currentRole: _currentRole,
  418. // splash loading overlay(冷启动时展示,数据加载完关闭)
  419. splashOverlay: _isFirstLaunch,
  420. splashOverlayFading: false,
  421. _splashReady: false,
  422. _watchPageReadyDone: false,
  423. pendingSurveys: [],
  424. selfCheckScore: null,
  425. selfCheckLoading: false,
  426. showOnboardingGuide: false,
  427. dimensionActivities: [],
  428. indexArticles: [],
  429. articlesLoading: false,
  430. gradientColors: [
  431. 'linear-gradient(135deg, #10B981, #34D399)',
  432. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  433. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  434. 'linear-gradient(135deg, #F97316, #FB923C)',
  435. 'linear-gradient(135deg, #6366F1, #818CF8)'
  436. ],
  437. // 登录态数据
  438. familyMembersVisible: [],
  439. // 接口数据是否已检查(避免"暂无数据"闪烁)
  440. childrenChecked: false,
  441. membersChecked: false,
  442. selectedMemberId: null,
  443. sandboxData: null,
  444. sandboxPersonalData: null,
  445. sandboxFamilyData: null,
  446. sandboxLocked: false,
  447. sandboxLockGate: null,
  448. currentSandboxView: 'personal',
  449. familyUnlocked: false,
  450. energyDimensions: [],
  451. totalEnergy: 0,
  452. totalHealthIndex: 0,
  453. articles: [],
  454. children: [],
  455. currentChildId: null,
  456. activeChallenges: [],
  457. pendingTasks: [],
  458. familyFeed: [],
  459. notices: [],
  460. loggedInInitDone: false,
  461. // 会员状态(沙盘下方会员入口使用)
  462. isMember: false,
  463. isLifetime: false,
  464. membershipDays: 0,
  465. // 分享邀请码
  466. referralCode: '',
  467. referralCodeLoaded: false
  468. }
  469. },
  470. computed: {
  471. isFamilyAdmin: function() {
  472. if (!this.familyMembersVisible || this.familyMembersVisible.length === 0) return false
  473. // isAdmin 语义为"成员本人是否为家庭创建者";自己(isSelf)是创建者即管理员
  474. var me = this.familyMembersVisible.filter(function(m) { return m.isSelf })[0]
  475. return !!(me && me.isAdmin === true)
  476. },
  477. sandboxScores: function() {
  478. var d = this.sandboxData || {}
  479. return {
  480. body: d.bodyScore || 0,
  481. mind: d.mindScore || 0,
  482. wisdom: d.wisdomScore || 0,
  483. action: d.actionScore || 0,
  484. wealth: d.wealthScore || 0
  485. }
  486. },
  487. familySandboxScores: function() {
  488. var d = this.sandboxFamilyData || {}
  489. return {
  490. body: d.bodyScore || 0,
  491. mind: d.mindScore || 0,
  492. wisdom: d.wisdomScore || 0,
  493. action: d.actionScore || 0,
  494. wealth: d.wealthScore || 0
  495. }
  496. },
  497. familySandboxOverall: function() {
  498. return this.sandboxFamilyData ? (this.sandboxFamilyData.overallScore || 0) : 0
  499. },
  500. familySandboxMembers: function() {
  501. return this.sandboxFamilyData ? (this.sandboxFamilyData.members || []) : []
  502. },
  503. hasPendingTasks: function() {
  504. return (this.pendingTasks && this.pendingTasks.length > 0)
  505. },
  506. actionArticles: function() {
  507. if (!this.articles || this.articles.length === 0) return []
  508. return this.articles.slice(0, 5)
  509. },
  510. // 会员入口显示:非会员显示开通;会员剩余≤30天显示续费
  511. showMemberEntry: function() {
  512. if (!this.isLoggedIn()) return false
  513. if (this.isLifetime) return false
  514. if (!this.isMember) return true
  515. return this.membershipDays > 0 && this.membershipDays <= 30
  516. },
  517. showCheckinBtn: function() {
  518. return (uni.getStorageSync('role') || 'parent') === 'child'
  519. },
  520. memberEntryTitle: function() {
  521. if (this.isLifetime) return '终身会员 · 永久有效'
  522. if (!this.isMember) return '开通会员,解锁全部特权'
  523. return '会员即将到期,续费恢复权益'
  524. },
  525. memberEntryDesc: function() {
  526. if (this.isLifetime) return '享全平台权益,无需续费'
  527. if (!this.isMember) return '享专属折扣 · 成长服务 · 规划指导'
  528. return '剩余 ' + this.membershipDays + ' 天,续费保持权益不中断'
  529. },
  530. memberEntryBtn: function() {
  531. if (this.isLifetime) return '已拥有'
  532. return this.isMember ? '立即续费' : '立即开通'
  533. },
  534. // 自测大卡:已有数据(沙盘解锁)显示"再次了解",否则显示引导文案
  535. selfTestTitle: function() {
  536. return this.sandboxData ? '再次了解 · 看看变化' : '先花 1 分钟,了解全家健康状况'
  537. },
  538. selfTestSub: function() {
  539. if (this.sandboxData) {
  540. if (this.selfCheckScore != null) {
  541. return '最近自检得分 ' + this.selfCheckScore + '/45 分 · 点击查看'
  542. }
  543. return '最近综合得分 ' + (this.sandboxData.overallScore || 0) + ' 分 · 点击查看'
  544. }
  545. return '15 题五维自检 · 约 20 秒'
  546. },
  547. // ===== Next Best Action 引导条(C 方案)=====
  548. // 优先级:沙盘未解锁 > 待填调研 > 待办任务 > 未读通知 > 默认引导
  549. // 只展示当前最该做的一件事,未登录态不展示
  550. nextBestAction: function() {
  551. if (!this.currentRole) return null
  552. // 1) 沙盘未解锁 — 最高优先级,引导完成自检
  553. if (this.sandboxLocked) {
  554. return {
  555. type: 'self-check',
  556. icon: '⚡',
  557. title: '先完成五维自检',
  558. sub: '15 题,约 20 秒,解锁全家能量报告',
  559. btn: '去自检',
  560. color: 'orange'
  561. }
  562. }
  563. // 2) 家庭成员为空 — 新用户关键动作,引导添加孩子/家人
  564. if (this.membersChecked && this.familyMembersVisible && this.familyMembersVisible.length <= 1) {
  565. return {
  566. type: 'add-member',
  567. icon: '👨‍👩‍👧',
  568. title: '添加家庭成员',
  569. sub: '邀请孩子和家人,开启全家成长管理',
  570. btn: '去添加',
  571. color: 'blue'
  572. }
  573. }
  574. // 3) 待填调研 — 定期调研是用户的实际行动邀请
  575. if (this.pendingSurveys && this.pendingSurveys.length > 0) {
  576. return {
  577. type: 'survey',
  578. icon: '📝',
  579. title: '有 ' + this.pendingSurveys.length + ' 项调研待填',
  580. sub: '填完解锁下一阶段内容',
  581. btn: '去填写',
  582. color: 'blue'
  583. }
  584. }
  585. // 4) 待办任务 — 用户已完成自检后的执行路径
  586. if (this.pendingTasks && this.pendingTasks.length > 0) {
  587. return {
  588. type: 'task',
  589. icon: '🎯',
  590. title: '今日有 ' + this.pendingTasks.length + ' 项待办',
  591. sub: '完成可累积成长分',
  592. btn: '去完成',
  593. color: 'green'
  594. }
  595. }
  596. // 5) 未读通知 — 私域触达优先
  597. var unreadCount = 0
  598. if (this.notices && this.notices.length) {
  599. for (var i = 0; i < this.notices.length; i++) {
  600. if (this.notices[i] && this.notices[i].unread) unreadCount++
  601. }
  602. }
  603. if (unreadCount > 0) {
  604. return {
  605. type: 'notice',
  606. icon: '📬',
  607. title: '有 ' + unreadCount + ' 条新消息',
  608. sub: '家庭动态、通知、待办提醒',
  609. btn: '查看',
  610. color: 'purple'
  611. }
  612. }
  613. // 6) 默认引导 — 已完成所有任务,指向任务中心
  614. return {
  615. type: 'default',
  616. icon: '✨',
  617. title: '今日任务已清空',
  618. sub: '去任务中心看看,保持成长节奏',
  619. btn: '逛一逛',
  620. color: 'gray'
  621. }
  622. }
  623. },
  624. onLoad(options) {
  625. this._onLoadFired = true
  626. // 兜底:分享卡直达首页(热启动直通等 App 级捕获未覆盖到的路径)时,
  627. // 新用户把推荐码写入 storage,登录注册后由 login / user-edit 消费绑定推荐人
  628. // 注意:type=parent_invite 的家庭邀请码不存推荐码 storage,避免后续误绑
  629. if (options && !uni.getStorageSync('token')) {
  630. var refCode = options.refCode
  631. if (!refCode && options.inviteCode && options.type !== 'parent_invite') {
  632. refCode = options.inviteCode // 兼容老推荐码链接
  633. }
  634. if (refCode) {
  635. uni.setStorageSync('refCode', refCode)
  636. }
  637. }
  638. this._doInit(options)
  639. },
  640. onShow() {
  641. // splash overlay 已在 data() 中根据 storage 标记初始化,此处只需配置关闭条件
  642. if (this.splashOverlay) {
  643. uni.removeStorageSync('_showSplashOverlay')
  644. this._splashLoadCount = 0
  645. this._splashMinPassed = false
  646. var self = this
  647. // 最低展示 800ms
  648. setTimeout(function() {
  649. self._splashMinPassed = true
  650. self._tryHideSplash()
  651. }, 800)
  652. // 最多展示 5s
  653. setTimeout(function() {
  654. if (self.splashOverlay) self._hideSplashOverlay()
  655. }, 5000)
  656. }
  657. // 首次加载:onLoad 已触发 _doInit,此处跳过避免重复调用
  658. // 后续 onShow(切 Tab 返回):刷新易变数据(会员状态、今日任务、挑战列表)
  659. if (this._onLoadFired) {
  660. this._onLoadFired = false // 清标记,后续 onShow 走刷新路径
  661. } else {
  662. this._refreshOnShow()
  663. }
  664. // 定期调研待办角标(内部自检登录态,未登录静默清空)
  665. this._loadSurveyBadge()
  666. },
  667. methods: {
  668. _checkSplashReady() {
  669. this._splashLoadCount++
  670. this._tryHideSplash()
  671. },
  672. _tryHideSplash() {
  673. if (this.splashOverlayFading) return
  674. if (!this._splashMinPassed) return
  675. if (this.isLoggedIn()) {
  676. // 登录用户:等待子组件的 ready 信号
  677. if (this._splashReady) this._hideSplashOverlay()
  678. } else {
  679. // 游客:等待 3 个 API 全部返回
  680. if (this._splashLoadCount >= 3) this._hideSplashOverlay()
  681. }
  682. },
  683. _hideSplashOverlay() {
  684. if (this.splashOverlayFading) return
  685. this.splashOverlayFading = true
  686. var self = this
  687. setTimeout(function() {
  688. self.splashOverlay = false
  689. self.splashOverlayFading = false
  690. }, 400)
  691. },
  692. // ===== 登录态数据加载 =====
  693. loadLoggedInData: function() {
  694. this.loadFamilyData()
  695. this.loadReferralCode()
  696. },
  697. // 合并原 loadFamilyMembers + loadChildren:仅调用一次 getFamilyMemberList
  698. loadFamilyData: function() {
  699. var self = this
  700. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  701. if (res.code === 200 && res.data) {
  702. var arr = Array.isArray(res.data) ? res.data : (res.data.list || [])
  703. self.familyMembersVisible = arr
  704. // 过滤出孩子成员(effectiveRole 为 'child' 的成员)
  705. self.children = arr.filter(function(m) { return m.effectiveRole === 'child' })
  706. var savedChildId = uni.getStorageSync('currentChildId')
  707. if (savedChildId) {
  708. self.currentChildId = savedChildId
  709. }
  710. self.loadDimensionData()
  711. }
  712. self.childrenChecked = true
  713. self.membersChecked = true
  714. self.loadTodayTasks()
  715. self.loadFamilyFeed()
  716. self.loadNotices()
  717. self.loadNotifications()
  718. }).catch(function(e) {
  719. console.log('获取家庭成员失败', e)
  720. self.familyMembersVisible = []
  721. self.children = []
  722. self.childrenChecked = true
  723. self.membersChecked = true
  724. })
  725. },
  726. // loadChildren 已废弃:loadFamilyData 统一调用 getFamilyMemberList 一次,
  727. // 从响应中过滤出 effectiveRole==='child' 的成员赋给 this.children。
  728. // 删除了原 loadChildren 方法(调用 getChildren 会重复打 /api/family/member/list)。
  729. loadDimensionData: function() {
  730. this.loadSandboxData()
  731. this.loadEnergyOverview()
  732. this.loadActionArticles()
  733. this.loadChallenges()
  734. this.loadSelfCheckStatus()
  735. },
  736. loadEnergyOverview: function() {
  737. var memberId = this.currentChildId || uni.getStorageSync('currentMemberId')
  738. if (!memberId) return
  739. var self = this
  740. getEnergyOverview(memberId).then(function(res) {
  741. if (res && res.data) {
  742. self.energyDimensions = res.data.dimensions || []
  743. self.totalEnergy = res.data.totalEnergy || 0
  744. self.totalHealthIndex = res.data.totalHealthIndex || 0
  745. }
  746. }).catch(function(e) {
  747. console.log('获取能量概览失败', e)
  748. })
  749. },
  750. loadSandboxData: function() {
  751. var self = this
  752. var memberId = uni.getStorageSync('currentMemberId') || uni.getStorageSync('currentChildId') || null
  753. getEnergySandbox(this.currentSandboxView, memberId).then(function(res) {
  754. if (res && res.data) {
  755. var d = res.data
  756. if (d.locked) {
  757. // 未解锁:显示引导卡(GateLock 渲染自检引导按钮)
  758. self.sandboxLocked = true
  759. self.sandboxLockGate = d.gate || null
  760. self.sandboxData = null
  761. self.sandboxPersonalData = null
  762. self.sandboxFamilyData = null
  763. } else {
  764. self.sandboxLocked = false
  765. self.sandboxLockGate = null
  766. self.sandboxPersonalData = d.personalData || null
  767. self.sandboxFamilyData = d.familyData || null
  768. self.sandboxData = self.currentSandboxView === 'family' ? (d.familyData || null) : (d.personalData || null)
  769. self.familyUnlocked = d.familyUnlocked || false
  770. }
  771. self._splashReady = true
  772. self._tryHideSplash()
  773. }
  774. }).catch(function() {})
  775. },
  776. /** 切换沙盘个人/全家视角(本地切换,不重新请求) */
  777. onSandboxViewChange: function(view) {
  778. if (view === this.currentSandboxView) return
  779. this.currentSandboxView = view
  780. this.sandboxData = view === 'family' ? (this.sandboxFamilyData || null) : (this.sandboxPersonalData || null)
  781. },
  782. loadActionArticles: function() {
  783. var self = this
  784. getFeaturedArticles({ size: 5 }).then(function(res) {
  785. if (res.code === 200 && res.data) {
  786. var gradientColors = [
  787. 'linear-gradient(135deg, #10B981, #34D399)',
  788. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  789. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  790. 'linear-gradient(135deg, #F97316, #FB923C)',
  791. 'linear-gradient(135deg, #6366F1, #818CF8)'
  792. ]
  793. var list = Array.isArray(res.data) ? res.data : (res.data.records || [])
  794. self.articles = list.map(function(item, index) {
  795. return {
  796. id: item.id,
  797. category: item.categoryName || '行动社交',
  798. categoryColor: gradientColors[index % gradientColors.length],
  799. title: item.title || '',
  800. summary: item.summary || '',
  801. dimensionWeights: item.dimensionWeights || null,
  802. views: item.viewCount ? String(item.viewCount) : '0',
  803. likes: '0',
  804. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  805. relatedDimensions: self.parseRelatedDimensions(item.relatedDimensions),
  806. coverImage: item.coverImage
  807. }
  808. })
  809. }
  810. }).catch(function() {})
  811. },
  812. loadChallenges: function() {
  813. var self = this
  814. getChallengeList({}).then(function(res) {
  815. if (res.code === 200 && Array.isArray(res.data)) {
  816. self.activeChallenges = res.data
  817. }
  818. }).catch(function() {
  819. self.activeChallenges = []
  820. })
  821. },
  822. loadTodayTasks: function() {
  823. var self = this
  824. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
  825. // 家长:家庭维度拉取(方案任务可能挂在任意成员,不只是当前孩子)
  826. if (role === 'parent') {
  827. getTodayTasks(null, { familyWide: true }).then(function(res) {
  828. if (res.code === 200 && Array.isArray(res.data)) {
  829. self.pendingTasks = res.data.filter(function(t) {
  830. return t.status === 'pending'
  831. })
  832. }
  833. }).catch(function() {
  834. self.pendingTasks = []
  835. })
  836. return
  837. }
  838. if (!self.currentChildId) {
  839. self.pendingTasks = []
  840. return
  841. }
  842. getTodayTasks(self.currentChildId).then(function(res) {
  843. if (res.code === 200 && Array.isArray(res.data)) {
  844. self.pendingTasks = res.data.filter(function(t) {
  845. return t.status === 'pending'
  846. })
  847. }
  848. }).catch(function() {
  849. self.pendingTasks = []
  850. })
  851. },
  852. loadFamilyFeed: function() {
  853. var self = this
  854. // 仅对第一个孩子拉取任务历史(避免 N 个孩子 N 次 /api/tasks/history 请求)
  855. var children = (self.children || []).filter(function(m) { return m.effectiveRole === 'child' })
  856. if (children.length === 0) {
  857. self.familyFeed = []
  858. return
  859. }
  860. var child = children[0]
  861. getTaskHistory(child.id, 1, 3).then(function(res) {
  862. var tasks = []
  863. if (res.code === 200) {
  864. var data = res.data
  865. tasks = (data && data.records) ? data.records : (Array.isArray(data) ? data : [])
  866. }
  867. var feed = tasks.filter(function(t) { return t.status === 'completed' }).map(function(t) {
  868. var points = t.pointsEarned || t.points || 0
  869. var timeStr = ''
  870. if (t.completedAt && typeof t.completedAt === 'string') {
  871. timeStr = t.completedAt.substring(11, 16)
  872. }
  873. return {
  874. text: '✅ ' + (child.nickname || '小名') + ' 完成「' + (t.title || '任务') + '」 +' + points + '分',
  875. time: timeStr,
  876. type: 'task'
  877. }
  878. })
  879. self.familyFeed = feed.slice(0, 10)
  880. }).catch(function() {
  881. self.familyFeed = []
  882. })
  883. },
  884. loadNotices: function() {
  885. var self = this
  886. getNotices().then(function(res) {
  887. if (res.code === 200 && res.data) {
  888. var notices = res.data.map(function(n) {
  889. var timeStr = ''
  890. if (n.createdAt) {
  891. var d = parseDate(n.createdAt)
  892. if (d) {
  893. timeStr = (d.getMonth() + 1) + '月' + d.getDate() + '日'
  894. }
  895. }
  896. return {
  897. text: '📢 ' + n.title,
  898. time: timeStr,
  899. type: 'notice',
  900. notice: n
  901. }
  902. })
  903. self.notices = notices
  904. // 合并 notices 到 familyFeed(优先显示)
  905. self.familyFeed = notices.concat(self.familyFeed).slice(0, 10)
  906. }
  907. }).catch(function() {})
  908. },
  909. // W3: 用户通知入动态(未读优先显示在 familyFeed 顶部)
  910. loadNotifications: function() {
  911. var self = this
  912. getNotificationList().then(function(res) {
  913. if (res.code === 200 && res.data) {
  914. var notifications = res.data.map(function(n) {
  915. var timeStr = ''
  916. if (n.createdAt) {
  917. var d = parseDate(n.createdAt)
  918. if (d) {
  919. timeStr = (d.getMonth() + 1) + '月' + d.getDate() + '日'
  920. }
  921. }
  922. return {
  923. text: '📬 ' + n.title,
  924. time: timeStr,
  925. type: 'notification',
  926. unread: (n.isRead === 0),
  927. notice: n
  928. }
  929. })
  930. var unread = notifications.filter(function(n) { return n.unread })
  931. var read = notifications.filter(function(n) { return !n.unread })
  932. // 未读在前,已读在后,合并到 familyFeed 顶部
  933. self.familyFeed = unread.concat(read, self.familyFeed).slice(0, 10)
  934. }
  935. }).catch(function() {})
  936. },
  937. quickCompleteTask: function(task) {
  938. var self = this
  939. var memberId = (task && task.familyMemberId) || self.currentChildId || uni.getStorageSync('currentMemberId')
  940. completeTaskApi(task.id, memberId, '').then(function(res) {
  941. if (res.code === 200) {
  942. uni.showToast({ title: '获得 ' + (res.data && res.data.pointsEarned || 0) + ' 积分', icon: 'success' })
  943. self.loadTodayTasks()
  944. } else {
  945. uni.showToast({ title: (res && res.message) || '完成失败', icon: 'none' })
  946. }
  947. }).catch(function() {
  948. uni.showToast({ title: '完成失败,请重试', icon: 'none' })
  949. })
  950. },
  951. onChallengeCheckin: function(payload) {
  952. var self = this
  953. updateChallengeProgress({ challengeId: payload.challengeId, delta: 1 }).then(function(res) {
  954. if (res && res.code === 200) {
  955. uni.showToast({ title: '打卡成功', icon: 'success' })
  956. self.loadChallenges()
  957. } else {
  958. uni.showToast({ title: (res && res.message) || '打卡失败', icon: 'none' })
  959. }
  960. }).catch(function() {
  961. uni.showToast({ title: '打卡失败,请重试', icon: 'none' })
  962. })
  963. },
  964. onChallengeRespond: function(payload) {
  965. var self = this
  966. respondChallenge({ challengeId: payload.challengeId, action: payload.action }).then(function(res) {
  967. if (res && res.code === 200) {
  968. uni.showToast({ title: payload.action === 'agree' ? '已同意' : '已拒绝', icon: 'success' })
  969. self.loadChallenges()
  970. } else {
  971. uni.showToast({ title: (res && res.message) || '操作失败', icon: 'none' })
  972. self.loadChallenges()
  973. }
  974. }).catch(function() {
  975. uni.showToast({ title: '操作失败,请重试', icon: 'none' })
  976. })
  977. },
  978. // loadFamilyMembers 已合并到 loadFamilyData(避免重复调用 /api/family/member/list)
  979. parseRelatedDimensions: function(val) {
  980. if (!val) return []
  981. if (Array.isArray(val)) return val
  982. if (typeof val === 'string') {
  983. try {
  984. var parsed = JSON.parse(val)
  985. return Array.isArray(parsed) ? parsed : []
  986. } catch (e) {
  987. return val.split(',').map(function(s) { return s.trim() }).filter(function(s) { return s })
  988. }
  989. }
  990. return []
  991. },
  992. onFamilyMemberSelect: function(member) {
  993. this.selectedMemberId = member.id
  994. },
  995. onFamilyMemberSwitch: function(member) {
  996. var self = this
  997. if (!member || !member.id) return
  998. switchToFamilyMember(member.id, member.source || 'family_member').then(function(res) {
  999. if (res.code === 200 && res.data) {
  1000. store.commit('switchToMember', {
  1001. memberId: res.data.memberId,
  1002. effectiveRole: res.data.effectiveRole
  1003. })
  1004. uni.showToast({ title: '已切换到' + (member.nickname || '该成员'), icon: 'success' })
  1005. setTimeout(function() {
  1006. uni.reLaunch({ url: '/pages/index-home/index' })
  1007. }, 1000)
  1008. } else {
  1009. uni.showToast({ title: res.message || '切换失败', icon: 'none' })
  1010. }
  1011. }).catch(function() {
  1012. uni.showToast({ title: '切换失败', icon: 'none' })
  1013. })
  1014. },
  1015. navTo: function(url) {
  1016. nav.goPage(url)
  1017. },
  1018. goActivityDetail: function(act) {
  1019. if (!act || !act.id) return
  1020. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + act.id })
  1021. },
  1022. goMoreActivities: function() {
  1023. uni.navigateTo({ url: '/pages/activity/index' })
  1024. },
  1025. goProductDetail: function(prod) {
  1026. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + prod.id })
  1027. },
  1028. goMoreProducts: function() {
  1029. uni.navigateTo({ url: '/pages/shop/index/index' })
  1030. },
  1031. goArticleDetail: function(article) {
  1032. var id = article.id || article
  1033. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1034. },
  1035. goMoreArticles: function() {
  1036. uni.navigateTo({ url: '/pages/article-center/index' })
  1037. },
  1038. goToUploadReport: function() {
  1039. var id = this.currentChildId || ''
  1040. uni.navigateTo({ url: '/pages/health/report-upload?memberId=' + id + '&from=index' })
  1041. },
  1042. // 定期调研待办角标(内部自检登录态,未登录静默清空)
  1043. _loadSurveyBadge: function() {
  1044. var self = this
  1045. if (!this.isLoggedIn()) { self.pendingSurveys = []; return }
  1046. getSurveyStatus({}).then(function(res) {
  1047. var list = (res && res.code === 200 && res.data && res.data instanceof Array) ? res.data : []
  1048. var pending = []
  1049. for (var i = 0; i < list.length; i++) {
  1050. if (list[i] && list[i].status === 'pending') pending.push(list[i])
  1051. }
  1052. self.pendingSurveys = pending
  1053. }).catch(function() { self.pendingSurveys = [] })
  1054. },
  1055. goSelfTest: function() {
  1056. var firstPending = null
  1057. for (var i = 0; i < this.pendingSurveys.length; i++) {
  1058. var s = this.pendingSurveys[i]
  1059. if (s && s.templateId) { firstPending = s; break }
  1060. }
  1061. if (firstPending) {
  1062. var url = '/pages/health/survey-questionnaire?templateId=' + firstPending.templateId +
  1063. '&templateTitle=' + encodeURIComponent(firstPending.title || '定期调研') +
  1064. '&templateDimension=' + encodeURIComponent(firstPending.dimension || '') +
  1065. '&periodStart=' + (firstPending.periodStart || '') +
  1066. '&periodEnd=' + (firstPending.periodEnd || '')
  1067. uni.navigateTo({ url: url })
  1068. } else {
  1069. // 无待填调研 → 进入五维自检中间页
  1070. uni.navigateTo({ url: '/pages/family/self-check-entry' })
  1071. }
  1072. },
  1073. // ===== Next Best Action 引导条点击 =====
  1074. onGuideTap: function(action) {
  1075. if (!action) return
  1076. switch (action.type) {
  1077. case 'self-check':
  1078. this.goSelfTest()
  1079. break
  1080. case 'survey':
  1081. // 跳转到第一个待填调研
  1082. if (this.pendingSurveys && this.pendingSurveys.length > 0) {
  1083. var s = this.pendingSurveys[0]
  1084. uni.navigateTo({
  1085. url: '/pages/health/survey-questionnaire?templateId=' + s.templateId +
  1086. '&templateTitle=' + encodeURIComponent(s.title || '定期调研') +
  1087. '&templateDimension=' + encodeURIComponent(s.dimension || '') +
  1088. '&periodStart=' + (s.periodStart || '') +
  1089. '&periodEnd=' + (s.periodEnd || '')
  1090. })
  1091. }
  1092. break
  1093. case 'add-member':
  1094. this.navTo('/pages/profile-extra/family-members')
  1095. break
  1096. case 'task':
  1097. this.navTo('/pages/tasks/tasks')
  1098. break
  1099. case 'notice':
  1100. this.navTo('/pages/profile/profile')
  1101. break
  1102. case 'default':
  1103. this.navTo('/pages/tasks/tasks')
  1104. break
  1105. }
  1106. },
  1107. loadSelfCheckStatus: function() {
  1108. var self = this
  1109. getSelfCheckStatus().then(function(res) {
  1110. if (res.code === 200 && res.data && res.data.lastResult) {
  1111. self.selfCheckScore = res.data.lastResult.totalScore
  1112. }
  1113. }).catch(function() {})
  1114. },
  1115. _doInit(options) {
  1116. options = options || {}
  1117. if (!this.isLoggedIn()) {
  1118. this.currentRole = ''
  1119. this.loadDimensionActivities()
  1120. this.loadFeaturedArticles()
  1121. return
  1122. }
  1123. this.syncRoleAndTabBar()
  1124. if (options.inviteCode && options.type === 'parent_invite') {
  1125. this.handleParentInvite(options.inviteCode)
  1126. return
  1127. }
  1128. var storedCode = uni.getStorageSync('inviteCode')
  1129. var storedType = uni.getStorageSync('inviteType')
  1130. if (storedCode && storedType === 'parent_invite') {
  1131. this.handleParentInvite(storedCode)
  1132. uni.removeStorageSync('inviteCode')
  1133. uni.removeStorageSync('inviteType')
  1134. return
  1135. }
  1136. // 登录用户:直接在 TabBar 页面内联渲染,保持底签可见
  1137. if (!this.loggedInInitDone) {
  1138. // 首次加载:全量初始化(数据 + 会员状态),onShow 不再重复
  1139. this.loggedInInitDone = true
  1140. this.loadLoggedInData()
  1141. this.checkMemberStatus()
  1142. }
  1143. this._watchPageReady()
  1144. this._maybeShowOnboardingGuide()
  1145. },
  1146. _refreshOnShow() {
  1147. // 切 Tab 返回:刷新家庭成员 + 沙盘 + 会员状态(loadFamilyData 内含任务/挑战刷新)
  1148. if (!this.isLoggedIn()) {
  1149. this.currentRole = ''
  1150. return
  1151. }
  1152. // 登录态可能在后台发生变化(如从登录页 switchTab 返回),
  1153. // 必须在此重新同步 currentRole,否则 v-if="currentRole" 无法切换到登录视图
  1154. this.syncRoleAndTabBar()
  1155. this.checkMemberStatus()
  1156. this.loadFamilyData()
  1157. },
  1158. _watchPageReady() {
  1159. if (this._watchPageReadyDone) return
  1160. this._watchPageReadyDone = true
  1161. var that = this
  1162. that.$watch('_splashReady', function(newVal) {
  1163. if (newVal) that._tryHideSplash()
  1164. })
  1165. },
  1166. // 首次登录引导浮层:仅当从未看过(无 _onboardingDone 标记)时展示一次
  1167. _maybeShowOnboardingGuide() {
  1168. if (this.showOnboardingGuide) return
  1169. if (uni.getStorageSync('_onboardingDone')) return
  1170. // 延迟到 splash 蒙板关闭后再弹,避免层级冲突
  1171. var self = this
  1172. setTimeout(function() {
  1173. if (!self.isLoggedIn()) return
  1174. self.showOnboardingGuide = true
  1175. }, 600)
  1176. },
  1177. closeOnboardingGuide() {
  1178. this.showOnboardingGuide = false
  1179. },
  1180. isLoggedIn() {
  1181. return !!uni.getStorageSync('token')
  1182. },
  1183. // ===== 会员状态(沙盘下方会员入口) =====
  1184. checkMemberStatus: function() {
  1185. var that = this
  1186. getMyMembership().then(function(res) {
  1187. var m = res.data || {}
  1188. var level = m.memberLevel || m.levelCode || ''
  1189. that.isLifetime = (level === 'LIFETIME')
  1190. that.isMember = that.isLifetime || !!(level && level !== 'FREE')
  1191. var mem = m.membership || m
  1192. if (mem.daysRemaining != null) {
  1193. that.membershipDays = mem.daysRemaining
  1194. } else if (that.isLifetime) {
  1195. // 终身会员:永久有效,不显示剩余天数
  1196. that.membershipDays = 0
  1197. }
  1198. }).catch(function() {})
  1199. },
  1200. goMembership: function() {
  1201. uni.navigateTo({ url: '/pages/membership/upgrade' })
  1202. },
  1203. normalizeCurrentRole() {
  1204. const role = uni.getStorageSync('role') || 'parent'
  1205. const currentRole = uni.getStorageSync('currentRole')
  1206. if (!currentRole) {
  1207. return role
  1208. }
  1209. // 非规划师账号不允许落到规划师首页
  1210. if (currentRole === 'teacher' && role !== 'teacher') {
  1211. return role
  1212. }
  1213. // 只有家长账号允许切换到孩子视角
  1214. if (currentRole === 'child' && role !== 'parent') {
  1215. return role
  1216. }
  1217. return currentRole
  1218. },
  1219. syncRoleAndTabBar() {
  1220. this.currentRole = this.normalizeCurrentRole()
  1221. uni.setStorageSync('currentRole', this.currentRole)
  1222. },
  1223. // ===== 发现页 / 未登录态方法 =====
  1224. loadDimensionActivities: function() {
  1225. var self = this
  1226. getActivityList({ dimensionCode: '', page: 1, size: 3 }).then(function(res) {
  1227. if (res && res.code === 200) {
  1228. // res.data is the response wrapper, activities are in res.data.data or res.data.records
  1229. var rawData = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  1230. self.dimensionActivities = Array.isArray(rawData) ? rawData.slice(0, 3) : []
  1231. }
  1232. self._checkSplashReady()
  1233. }).catch(function() {
  1234. self._checkSplashReady()
  1235. })
  1236. },
  1237. loadFeaturedArticles: function() {
  1238. var self = this
  1239. this.articlesLoading = true
  1240. getFeaturedArticles({ size: 5 }).then(function(res) {
  1241. self.articlesLoading = false
  1242. if (res && res.code === 200) {
  1243. var gradientColors = [
  1244. 'linear-gradient(135deg, #10B981, #34D399)',
  1245. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  1246. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  1247. 'linear-gradient(135deg, #F97316, #FB923C)',
  1248. 'linear-gradient(135deg, #6366F1, #818CF8)'
  1249. ]
  1250. // res.data is the response wrapper, articles are in res.data.data
  1251. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  1252. var list = Array.isArray(rawList) ? rawList : []
  1253. self.indexArticles = list.map(function(item, index) {
  1254. return {
  1255. id: item.id,
  1256. category: item.categoryName || item.category || '热门文章',
  1257. categoryColor: gradientColors[index % gradientColors.length],
  1258. title: item.title || '',
  1259. summary: item.summary || '',
  1260. views: item.viewCount ? String(item.viewCount) : '0',
  1261. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  1262. coverImage: item.coverImage
  1263. }
  1264. })
  1265. }
  1266. self._checkSplashReady()
  1267. }).catch(function() {
  1268. self.articlesLoading = false
  1269. self._checkSplashReady()
  1270. })
  1271. },
  1272. goActivities: function() {
  1273. uni.navigateTo({ url: '/pages/activity/index' })
  1274. },
  1275. goChallengeManage: function() {
  1276. uni.navigateTo({ url: '/pages/health/challenge-manage' })
  1277. },
  1278. goArticles: function() {
  1279. uni.navigateTo({ url: '/pages/article-center/index' })
  1280. },
  1281. goArticleDetail: function(article) {
  1282. var id = article && article.id ? article.id : article
  1283. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1284. },
  1285. handleLogin() {
  1286. uni.navigateTo({ url: '/pages/login/login?redirect=' + encodeURIComponent('/pages/index-home/index') })
  1287. },
  1288. async handleParentInvite(code) {
  1289. // 延迟显示,等待登录完成
  1290. setTimeout(async () => {
  1291. const hasToken = uni.getStorageSync('token')
  1292. if (!hasToken) {
  1293. // 未登录,先去登录
  1294. uni.reLaunch({
  1295. url: '/pages/login/login?inviteCode=' + code
  1296. })
  1297. return
  1298. }
  1299. // 已登录,显示确认框
  1300. uni.showModal({
  1301. title: '加入家庭',
  1302. content: '您已被邀请加入家庭,是否接受?',
  1303. success: async (res) => {
  1304. if (res.confirm) {
  1305. try {
  1306. uni.showLoading({ title: '加入中...' })
  1307. const result = await acceptParentInvite(code)
  1308. uni.hideLoading()
  1309. if (result.code === 200) {
  1310. const { role, token } = result.data
  1311. uni.setStorageSync('role', role)
  1312. uni.setStorageSync('token', token)
  1313. uni.showToast({ title: '加入成功', icon: 'success' })
  1314. // 刷新页面
  1315. setTimeout(() => {
  1316. uni.switchTab({ url: '/pages/index-home/index' })
  1317. }, 1500)
  1318. }
  1319. } catch (e) {
  1320. uni.hideLoading()
  1321. uni.showToast({ title: e.message || '加入失败', icon: 'none' })
  1322. }
  1323. }
  1324. }
  1325. })
  1326. }, 500)
  1327. },
  1328. /** 获取自己的邀请码用于分享 */
  1329. loadReferralCode: function() {
  1330. if (this.referralCodeLoaded || !this.isLoggedIn()) return
  1331. var self = this
  1332. getReferralCode().then(function(res) {
  1333. self.referralCode = extractReferralCode(res)
  1334. }).catch(function() {})
  1335. self.referralCodeLoaded = true
  1336. },
  1337. getImageUrl: function(path) {
  1338. return config.API_BASE_URL + path
  1339. },
  1340. /** 转发给朋友/群(不指定 imageUrl,微信自动截取当前页面截图作缩略图;static/share-cover.png 不存在会导致卡片空白) */
  1341. onShareAppMessage: function() {
  1342. var path = '/pages/index-home/index'
  1343. if (this.referralCode) {
  1344. path = path + '?refCode=' + this.referralCode
  1345. }
  1346. return {
  1347. title: '浠艾福 · 家庭五维幸福成长',
  1348. path: path
  1349. }
  1350. },
  1351. /** 分享到朋友圈 */
  1352. onShareTimeline: function() {
  1353. var query = ''
  1354. if (this.referralCode) {
  1355. query = 'refCode=' + this.referralCode
  1356. }
  1357. return {
  1358. title: '浠艾福 · 家庭五维幸福成长',
  1359. query: query
  1360. }
  1361. }
  1362. }
  1363. }
  1364. </script>
  1365. <style>
  1366. .discover-container {
  1367. min-height: 100vh;
  1368. background: #f5f7fa;
  1369. padding-bottom: 100rpx;
  1370. }
  1371. /* ===== 品牌 Hero 区 ===== */
  1372. .hero-section {
  1373. margin: 24rpx 30rpx 0;
  1374. padding: 40rpx 32rpx;
  1375. background: linear-gradient(160deg, #FFF7ED 0%, #FED7AA 60%, rgba(249,115,22,0.15) 100%);
  1376. border-radius: 24rpx;
  1377. text-align: center;
  1378. border: 1rpx solid rgba(249,115,22,0.12);
  1379. }
  1380. .hero-logo {
  1381. width: 100rpx;
  1382. height: 100rpx;
  1383. border-radius: 50rpx;
  1384. background: #fff;
  1385. box-shadow: 0 8rpx 24rpx rgba(249,115,22,0.18);
  1386. }
  1387. .hero-name {
  1388. display: block;
  1389. font-size: 48rpx;
  1390. font-weight: bold;
  1391. color: #7C2D12;
  1392. margin-top: 16rpx;
  1393. letter-spacing: 6rpx;
  1394. }
  1395. .hero-identity {
  1396. display: block;
  1397. font-size: 28rpx;
  1398. font-weight: 600;
  1399. color: #C2410C;
  1400. margin-top: 12rpx;
  1401. letter-spacing: 2rpx;
  1402. }
  1403. .hero-slogan {
  1404. display: block;
  1405. font-size: 26rpx;
  1406. color: #9A3412;
  1407. margin-top: 8rpx;
  1408. font-weight: 500;
  1409. }
  1410. .hero-powered {
  1411. display: block;
  1412. font-size: 20rpx;
  1413. color: rgba(124,45,18,0.45);
  1414. margin-top: 10rpx;
  1415. }
  1416. .hero-dims {
  1417. display: flex;
  1418. justify-content: center;
  1419. gap: 16rpx;
  1420. margin-top: 28rpx;
  1421. flex-wrap: wrap;
  1422. }
  1423. .hero-dim {
  1424. display: flex;
  1425. flex-direction: column;
  1426. align-items: center;
  1427. gap: 6rpx;
  1428. padding: 12rpx 16rpx;
  1429. background: rgba(255,255,255,0.7);
  1430. border-radius: 16rpx;
  1431. }
  1432. .hero-dim-emoji {
  1433. font-size: 32rpx;
  1434. }
  1435. .hero-dim-label {
  1436. font-size: 20rpx;
  1437. color: #7C2D12;
  1438. font-weight: 500;
  1439. white-space: nowrap;
  1440. }
  1441. /* ===== 未登录态 Hero 副标语 / CTA ===== */
  1442. .hero-sub-slogan {
  1443. display: block;
  1444. font-size: 22rpx;
  1445. color: #EA580C;
  1446. margin-top: 18rpx;
  1447. font-weight: 500;
  1448. }
  1449. .hero-cta-btn {
  1450. margin: 28rpx auto 0;
  1451. display: block;
  1452. width: 420rpx;
  1453. height: 80rpx;
  1454. line-height: 80rpx;
  1455. background: linear-gradient(135deg, #F97316, #FB923C);
  1456. color: #fff;
  1457. font-size: 28rpx;
  1458. font-weight: bold;
  1459. border-radius: 40rpx;
  1460. text-align: center;
  1461. border: none;
  1462. box-shadow: 0 8rpx 20rpx rgba(249,115,22,0.3);
  1463. }
  1464. .hero-cta-btn::after {
  1465. border: none;
  1466. }
  1467. /* ===== 价值主张(为什么选择浠艾福) ===== */
  1468. .value-prop-section {
  1469. margin: 24rpx 30rpx 0;
  1470. }
  1471. .value-prop-title {
  1472. display: block;
  1473. font-size: 32rpx;
  1474. font-weight: bold;
  1475. color: #333;
  1476. text-align: center;
  1477. margin-bottom: 20rpx;
  1478. }
  1479. .value-prop-grid {
  1480. display: flex;
  1481. flex-wrap: wrap;
  1482. justify-content: space-between;
  1483. }
  1484. .value-prop-card {
  1485. width: 48.5%;
  1486. box-sizing: border-box;
  1487. background: #fff;
  1488. border-radius: 20rpx;
  1489. padding: 22rpx;
  1490. margin-bottom: 16rpx;
  1491. box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.05);
  1492. display: flex;
  1493. flex-direction: row;
  1494. align-items: flex-start;
  1495. }
  1496. .value-prop-icon {
  1497. font-size: 40rpx;
  1498. line-height: 1.3;
  1499. margin-right: 12rpx;
  1500. flex-shrink: 0;
  1501. }
  1502. .value-prop-texts {
  1503. display: flex;
  1504. flex-direction: column;
  1505. flex: 1;
  1506. min-width: 0;
  1507. }
  1508. .value-prop-name {
  1509. font-size: 28rpx;
  1510. font-weight: bold;
  1511. color: #333;
  1512. }
  1513. .value-prop-desc {
  1514. font-size: 22rpx;
  1515. color: #999;
  1516. margin-top: 8rpx;
  1517. line-height: 1.5;
  1518. }
  1519. /* ===== 三步上手 ===== */
  1520. .how-it-works {
  1521. margin: 32rpx 30rpx 0;
  1522. padding: 32rpx 24rpx;
  1523. background: #fff;
  1524. border-radius: 24rpx;
  1525. box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.04);
  1526. }
  1527. .how-it-works-title {
  1528. display: block;
  1529. font-size: 32rpx;
  1530. font-weight: bold;
  1531. color: #333;
  1532. text-align: center;
  1533. margin-bottom: 28rpx;
  1534. }
  1535. .step-row {
  1536. display: flex;
  1537. align-items: flex-start;
  1538. justify-content: space-between;
  1539. }
  1540. .step-item {
  1541. display: flex;
  1542. flex-direction: column;
  1543. align-items: center;
  1544. flex: 1;
  1545. min-width: 0;
  1546. }
  1547. .step-num {
  1548. width: 48rpx;
  1549. height: 48rpx;
  1550. line-height: 48rpx;
  1551. border-radius: 50%;
  1552. background: linear-gradient(135deg, #F97316, #FB923C);
  1553. color: #fff;
  1554. font-size: 26rpx;
  1555. font-weight: bold;
  1556. text-align: center;
  1557. box-shadow: 0 4rpx 12rpx rgba(249,115,22,0.3);
  1558. }
  1559. .step-name {
  1560. font-size: 24rpx;
  1561. color: #333;
  1562. font-weight: 500;
  1563. margin-top: 12rpx;
  1564. text-align: center;
  1565. }
  1566. .step-sub {
  1567. font-size: 20rpx;
  1568. color: #999;
  1569. margin-top: 4rpx;
  1570. text-align: center;
  1571. }
  1572. .step-arrow {
  1573. font-size: 28rpx;
  1574. color: #F97316;
  1575. line-height: 1;
  1576. align-self: center;
  1577. padding: 0 6rpx;
  1578. }
  1579. /* ===== 品牌定位语(保留旧样式,不再使用) ===== */
  1580. .brand-strap {
  1581. margin: 16rpx 30rpx 0;
  1582. padding: 20rpx 28rpx;
  1583. background: linear-gradient(135deg, #FFF7ED, rgba(249,115,22,0.10));
  1584. border-radius: 16rpx;
  1585. border-left: 4rpx solid #F97316;
  1586. }
  1587. .brand-strap-text {
  1588. font-size: 26rpx;
  1589. color: #9A3412;
  1590. font-weight: 500;
  1591. }
  1592. /* ===== 会员入口卡(能量沙盘下方) ===== */
  1593. .member-entry {
  1594. display: flex;
  1595. align-items: center;
  1596. margin: 20rpx 30rpx 0;
  1597. background: linear-gradient(135deg, #F97316, #FB923C);
  1598. border-radius: 20rpx;
  1599. padding: 24rpx 30rpx;
  1600. }
  1601. .member-entry-icon-wrap {
  1602. width: 64rpx;
  1603. height: 64rpx;
  1604. border-radius: 50%;
  1605. background: rgba(255,255,255,0.2);
  1606. display: flex;
  1607. align-items: center;
  1608. justify-content: center;
  1609. margin-right: 16rpx;
  1610. flex-shrink: 0;
  1611. }
  1612. .member-entry-icon {
  1613. font-size: 36rpx;
  1614. }
  1615. .member-entry-texts {
  1616. flex: 1;
  1617. display: flex;
  1618. flex-direction: column;
  1619. min-width: 0;
  1620. }
  1621. .member-entry-title {
  1622. font-size: 30rpx;
  1623. font-weight: bold;
  1624. color: #fff;
  1625. }
  1626. .member-entry-desc {
  1627. font-size: 22rpx;
  1628. color: rgba(255,255,255,0.85);
  1629. margin-top: 4rpx;
  1630. overflow: hidden;
  1631. text-overflow: ellipsis;
  1632. white-space: nowrap;
  1633. }
  1634. .member-entry-btn {
  1635. margin-left: 16rpx;
  1636. padding: 10rpx 24rpx;
  1637. background: #fff;
  1638. border-radius: 30rpx;
  1639. flex-shrink: 0;
  1640. }
  1641. .member-entry-btn-text {
  1642. font-size: 24rpx;
  1643. color: #F97316;
  1644. font-weight: bold;
  1645. }
  1646. /* ===== 活动/阅读共用状态样式 ===== */
  1647. .loading-state,
  1648. .empty-state {
  1649. display: flex;
  1650. justify-content: center;
  1651. padding: 60rpx 0;
  1652. }
  1653. .loading-text,
  1654. .empty-text {
  1655. font-size: 26rpx;
  1656. color: #999;
  1657. }
  1658. /* ===== 五维全景幸福矩阵 ===== */
  1659. /* ===== 底部登录 ===== */
  1660. .login-footer {
  1661. margin: 40rpx 30rpx;
  1662. display: flex;
  1663. flex-direction: column;
  1664. align-items: center;
  1665. }
  1666. .login-btn {
  1667. width: 100%;
  1668. height: 88rpx;
  1669. line-height: 88rpx;
  1670. background: linear-gradient(135deg, #F97316, #FB923C);
  1671. color: #fff;
  1672. font-size: 32rpx;
  1673. font-weight: bold;
  1674. border-radius: 44rpx;
  1675. text-align: center;
  1676. border: none;
  1677. box-shadow: 0 8rpx 24rpx rgba(249,115,22,0.3);
  1678. }
  1679. .login-btn::after {
  1680. border: none;
  1681. }
  1682. .login-footer-text {
  1683. font-size: 22rpx;
  1684. color: #F97316;
  1685. margin-top: 16rpx;
  1686. font-weight: 500;
  1687. }
  1688. /* ===== 加载占位 ===== */
  1689. .loading-container {
  1690. display: flex;
  1691. justify-content: center;
  1692. align-items: center;
  1693. height: 100vh;
  1694. }
  1695. /* ===== 角色切换淡入淡出 ===== */
  1696. .role-switch-wrapper {
  1697. width: 100%;
  1698. min-height: 100vh;
  1699. }
  1700. .fade-enter-active,
  1701. .fade-leave-active {
  1702. transition: opacity 0.3s ease;
  1703. }
  1704. .fade-enter,
  1705. .fade-leave-to {
  1706. opacity: 0;
  1707. }
  1708. /* ===== 通用区块样式 ===== */
  1709. .section {
  1710. margin: 20rpx 30rpx;
  1711. }
  1712. .section-header {
  1713. display: flex;
  1714. justify-content: space-between;
  1715. align-items: center;
  1716. margin-bottom: 20rpx;
  1717. }
  1718. .section-title {
  1719. font-size: 30rpx;
  1720. font-weight: bold;
  1721. color: #333;
  1722. }
  1723. .section-more {
  1724. font-size: 24rpx;
  1725. color: #5B9BD5;
  1726. }
  1727. .empty-state {
  1728. display: flex;
  1729. justify-content: center;
  1730. padding: 60rpx 0;
  1731. }
  1732. .empty-text {
  1733. font-size: 26rpx;
  1734. color: #999;
  1735. }
  1736. /* ===== 活动列表 ===== */
  1737. .activity-list {
  1738. display: flex;
  1739. flex-direction: column;
  1740. gap: 16rpx;
  1741. }
  1742. .activity-card {
  1743. background: #fff;
  1744. border-radius: 16rpx;
  1745. overflow: hidden;
  1746. display: flex;
  1747. flex-direction: row;
  1748. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1749. }
  1750. .activity-card:active {
  1751. opacity: 0.8;
  1752. }
  1753. .activity-cover {
  1754. width: 200rpx;
  1755. height: 160rpx;
  1756. flex-shrink: 0;
  1757. background: #f0f0f0;
  1758. }
  1759. .activity-info {
  1760. flex: 1;
  1761. padding: 16rpx;
  1762. display: flex;
  1763. flex-direction: column;
  1764. justify-content: space-between;
  1765. }
  1766. .activity-name {
  1767. font-size: 28rpx;
  1768. font-weight: bold;
  1769. color: #333;
  1770. margin-bottom: 8rpx;
  1771. }
  1772. .line-clamp-1 {
  1773. overflow: hidden;
  1774. text-overflow: ellipsis;
  1775. white-space: nowrap;
  1776. }
  1777. .activity-meta {
  1778. display: flex;
  1779. align-items: center;
  1780. margin-bottom: 8rpx;
  1781. }
  1782. .activity-time {
  1783. font-size: 22rpx;
  1784. color: #999;
  1785. }
  1786. .activity-bottom {
  1787. display: flex;
  1788. align-items: center;
  1789. gap: 12rpx;
  1790. }
  1791. .activity-status {
  1792. font-size: 20rpx;
  1793. padding: 2rpx 10rpx;
  1794. border-radius: 8rpx;
  1795. background: #E8F5E9;
  1796. color: #2E7D32;
  1797. }
  1798. .activity-status.status-upcoming {
  1799. background: #E3F2FD;
  1800. color: #1565C0;
  1801. }
  1802. .activity-status.status-ended {
  1803. background: #F5F5F5;
  1804. color: #999;
  1805. }
  1806. .activity-fee {
  1807. font-size: 24rpx;
  1808. color: #F97316;
  1809. font-weight: bold;
  1810. }
  1811. .activity-fee.fee-free {
  1812. color: #4CAF50;
  1813. }
  1814. /* ===== 文章列表 ===== */
  1815. .article-list {
  1816. display: flex;
  1817. flex-direction: column;
  1818. gap: 16rpx;
  1819. }
  1820. .article-card {
  1821. background: #fff;
  1822. border-radius: 16rpx;
  1823. padding: 24rpx;
  1824. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1825. }
  1826. .article-card:active {
  1827. opacity: 0.8;
  1828. }
  1829. .article-category {
  1830. display: inline-block;
  1831. padding: 4rpx 14rpx;
  1832. border-radius: 8rpx;
  1833. margin-bottom: 10rpx;
  1834. }
  1835. .article-category-text {
  1836. font-size: 20rpx;
  1837. color: #fff;
  1838. }
  1839. .article-title {
  1840. display: block;
  1841. font-size: 28rpx;
  1842. font-weight: bold;
  1843. color: #333;
  1844. margin-bottom: 8rpx;
  1845. line-height: 1.4;
  1846. }
  1847. .article-summary {
  1848. display: block;
  1849. font-size: 24rpx;
  1850. color: #888;
  1851. line-height: 1.5;
  1852. margin-bottom: 12rpx;
  1853. overflow: hidden;
  1854. text-overflow: ellipsis;
  1855. display: -webkit-box;
  1856. -webkit-line-clamp: 2;
  1857. -webkit-box-orient: vertical;
  1858. }
  1859. .article-meta {
  1860. display: flex;
  1861. align-items: center;
  1862. gap: 16rpx;
  1863. }
  1864. .meta-item {
  1865. display: flex;
  1866. align-items: center;
  1867. gap: 4rpx;
  1868. }
  1869. .meta-icon {
  1870. font-size: 24rpx;
  1871. }
  1872. .meta-text {
  1873. font-size: 22rpx;
  1874. color: #999;
  1875. }
  1876. .article-date {
  1877. font-size: 22rpx;
  1878. color: #bbb;
  1879. }
  1880. /* ===== Splash Loading Overlay(冷启动蒙板,来自 merge splash.vue) ===== */
  1881. .splash-overlay {
  1882. position: fixed;
  1883. top: 0; left: 0; right: 0; bottom: 0;
  1884. z-index: 9999;
  1885. display: flex;
  1886. align-items: center;
  1887. justify-content: center;
  1888. background: linear-gradient(160deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  1889. overflow: hidden;
  1890. opacity: 1;
  1891. transition: opacity 0.4s ease;
  1892. }
  1893. .splash-overlay.fade-out {
  1894. opacity: 0;
  1895. pointer-events: none;
  1896. }
  1897. /* ---- bg circles from splash.vue ---- */
  1898. .splash-overlay-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
  1899. .bg-circle {
  1900. position: absolute;
  1901. border-radius: 50%;
  1902. opacity: 0.12;
  1903. }
  1904. .bg-circle-1 {
  1905. width: 400rpx; height: 400rpx;
  1906. background: #FF8C42;
  1907. top: -100rpx; right: -80rpx;
  1908. animation: splash-float-1 4s ease-in-out infinite;
  1909. }
  1910. .bg-circle-2 {
  1911. width: 280rpx; height: 280rpx;
  1912. background: #FF6B9D;
  1913. bottom: 80rpx; left: -60rpx;
  1914. animation: splash-float-2 5s ease-in-out infinite;
  1915. }
  1916. .bg-circle-3 {
  1917. width: 180rpx; height: 180rpx;
  1918. background: #6366F1;
  1919. top: 50%; right: -40rpx;
  1920. animation: splash-float-3 6s ease-in-out infinite;
  1921. }
  1922. @keyframes splash-float-1 {
  1923. 0%, 100% { transform: translateY(0) scale(1); }
  1924. 50% { transform: translateY(-30rpx) scale(1.05); }
  1925. }
  1926. @keyframes splash-float-2 {
  1927. 0%, 100% { transform: translateY(0) scale(1); }
  1928. 50% { transform: translateY(20rpx) scale(1.08); }
  1929. }
  1930. @keyframes splash-float-3 {
  1931. 0%, 100% { transform: translateY(0) rotate(0deg); }
  1932. 50% { transform: translateY(-20rpx) rotate(10deg); }
  1933. }
  1934. /* ---- body fade-in ---- */
  1935. .splash-overlay-body {
  1936. display: flex;
  1937. flex-direction: column;
  1938. align-items: center;
  1939. animation: splash-body-in 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
  1940. }
  1941. @keyframes splash-body-in {
  1942. from { opacity: 0; transform: translateY(40rpx) scale(0.96); }
  1943. to { opacity: 1; transform: translateY(0) scale(1); }
  1944. }
  1945. /* ---- logo ---- */
  1946. .splash-logo-wrap {
  1947. width: 160rpx; height: 160rpx;
  1948. border-radius: 40rpx;
  1949. background: rgba(255,255,255,0.95);
  1950. display: flex; align-items: center; justify-content: center;
  1951. margin-bottom: 16rpx;
  1952. box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25);
  1953. animation: splash-logo-pulse 2.5s ease-in-out infinite;
  1954. }
  1955. @keyframes splash-logo-pulse {
  1956. 0%, 100% { box-shadow: 0 8rpx 32rpx rgba(249,115,22,0.25); }
  1957. 50% { box-shadow: 0 8rpx 48rpx rgba(249,115,22,0.45); }
  1958. }
  1959. .splash-logo-img { width: 100rpx; height: 100rpx; }
  1960. /* ---- brand ---- */
  1961. .splash-brand-name {
  1962. font-size: 64rpx; font-weight: 800;
  1963. color: #7C2D12;
  1964. letter-spacing: 10rpx;
  1965. margin-bottom: 2rpx;
  1966. }
  1967. .splash-brand-en {
  1968. font-size: 20rpx;
  1969. color: rgba(124,45,18,0.5);
  1970. letter-spacing: 6rpx;
  1971. margin-bottom: 30rpx;
  1972. }
  1973. .splash-tagline {
  1974. font-size: 26rpx;
  1975. color: rgba(124,45,18,0.7);
  1976. letter-spacing: 4rpx;
  1977. margin-top: 24rpx;
  1978. }
  1979. /* ---- dims row from splash.vue (rounded circles) ---- */
  1980. .splash-dims-row {
  1981. display: flex; flex-direction: row;
  1982. align-items: center; justify-content: center;
  1983. gap: 28rpx;
  1984. }
  1985. .splash-dim-item {
  1986. display: flex; flex-direction: column;
  1987. align-items: center; gap: 8rpx;
  1988. }
  1989. .splash-dim-circle {
  1990. width: 80rpx; height: 80rpx;
  1991. border-radius: 50%;
  1992. display: flex; align-items: center; justify-content: center;
  1993. }
  1994. .splash-dim-icon { font-size: 36rpx; line-height: 1; }
  1995. .splash-dim-label {
  1996. font-size: 22rpx; font-weight: 500;
  1997. color: rgba(124,45,18,0.75);
  1998. line-height: 1;
  1999. }
  2000. /* ---- staggered dim entry from splash.vue ---- */
  2001. .splash-dim-item:nth-child(1) { animation: splash-dim-in 0.5s ease 0.1s both; }
  2002. .splash-dim-item:nth-child(2) { animation: splash-dim-in 0.5s ease 0.2s both; }
  2003. .splash-dim-item:nth-child(3) { animation: splash-dim-in 0.5s ease 0.3s both; }
  2004. .splash-dim-item:nth-child(4) { animation: splash-dim-in 0.5s ease 0.4s both; }
  2005. .splash-dim-item:nth-child(5) { animation: splash-dim-in 0.5s ease 0.5s both; }
  2006. @keyframes splash-dim-in {
  2007. from { opacity: 0; transform: translateY(16rpx) scale(0.8); }
  2008. to { opacity: 1; transform: translateY(0) scale(1); }
  2009. }
  2010. /* ---- loading dots ---- */
  2011. .splash-overlay-loading {
  2012. position: absolute;
  2013. bottom: 120rpx;
  2014. left: 0; right: 0;
  2015. display: flex;
  2016. justify-content: center;
  2017. align-items: center;
  2018. gap: 12rpx;
  2019. }
  2020. .splash-overlay-dot {
  2021. width: 14rpx; height: 14rpx;
  2022. border-radius: 50%;
  2023. background: rgba(249,115,22,0.6);
  2024. animation: splash-dot-bounce 1.4s ease-in-out infinite both;
  2025. }
  2026. .splash-overlay-dot:nth-child(1) { animation-delay: -0.32s; }
  2027. .splash-overlay-dot:nth-child(2) { animation-delay: -0.16s; }
  2028. .splash-overlay-dot:nth-child(3) { animation-delay: 0s; }
  2029. @keyframes splash-dot-bounce {
  2030. 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  2031. 40% { transform: scale(1); opacity: 1; }
  2032. }
  2033. /* ---- 登录态内容布局 ---- */
  2034. .logged-in-container {
  2035. padding-bottom: 120rpx;
  2036. }
  2037. /* ===== ① 了解区 — 自测大卡(引导"从了解开始") ===== */
  2038. .self-test-card {
  2039. margin: 20rpx 30rpx 16rpx;
  2040. background: linear-gradient(135deg, #667eea, #764ba2);
  2041. border-radius: 20rpx;
  2042. padding: 24rpx 28rpx;
  2043. }
  2044. .self-test-head { display: flex; align-items: center; }
  2045. .self-test-icon { font-size: 40rpx; margin-right: 16rpx; }
  2046. .self-test-info { flex: 1; }
  2047. .self-test-title { font-size: 28rpx; font-weight: bold; color: #fff; display: block; }
  2048. .self-test-sub { font-size: 22rpx; color: rgba(255,255,255,0.8); display: block; margin-top: 4rpx; }
  2049. .self-test-arrow { font-size: 36rpx; color: rgba(255,255,255,0.7); }
  2050. /* ===== ①.b 行动引导条 — Next Best Action ===== */
  2051. .guide-bar {
  2052. margin: 0 30rpx 16rpx;
  2053. border-radius: 20rpx;
  2054. padding: 18rpx 24rpx;
  2055. display: flex;
  2056. flex-direction: row;
  2057. align-items: center;
  2058. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  2059. }
  2060. .guide-bar-icon-wrap {
  2061. width: 72rpx;
  2062. height: 72rpx;
  2063. border-radius: 18rpx;
  2064. display: flex;
  2065. align-items: center;
  2066. justify-content: center;
  2067. margin-right: 16rpx;
  2068. flex-shrink: 0;
  2069. }
  2070. .guide-bar-icon { font-size: 34rpx; }
  2071. .guide-bar-info { flex: 1; min-width: 0; }
  2072. .guide-bar-title { font-size: 27rpx; font-weight: bold; display: block; }
  2073. .guide-bar-sub { font-size: 21rpx; margin-top: 3rpx; display: block; }
  2074. .guide-bar-btn {
  2075. flex-shrink: 0;
  2076. margin-left: 12rpx;
  2077. padding: 8rpx 20rpx;
  2078. border-radius: 999rpx;
  2079. font-size: 22rpx;
  2080. font-weight: bold;
  2081. }
  2082. .guide-bar-btn-text { }
  2083. /* 颜色主题 — 低饱和背景 + 深色文字,不抢自测卡风头 */
  2084. .guide-bar-orange { background: #FFF3E7; border: 1rpx solid rgba(249,115,22,0.18); }
  2085. .guide-bar-orange .guide-bar-icon-wrap { background: rgba(249,115,22,0.14); }
  2086. .guide-bar-orange .guide-bar-title { color: #9A3412; }
  2087. .guide-bar-orange .guide-bar-sub { color: #B45309; }
  2088. .guide-bar-orange .guide-bar-btn { background: linear-gradient(135deg, #F97316, #FB923C); color: #fff; }
  2089. .guide-bar-blue { background: #EFF4FF; border: 1rpx solid rgba(99,102,241,0.18); }
  2090. .guide-bar-blue .guide-bar-icon-wrap { background: rgba(99,102,241,0.12); }
  2091. .guide-bar-blue .guide-bar-title { color: #312E81; }
  2092. .guide-bar-blue .guide-bar-sub { color: #4338CA; }
  2093. .guide-bar-blue .guide-bar-btn { background: linear-gradient(135deg, #6366F1, #818CF8); color: #fff; }
  2094. .guide-bar-green { background: #ECFDF5; border: 1rpx solid rgba(16,185,129,0.18); }
  2095. .guide-bar-green .guide-bar-icon-wrap { background: rgba(16,185,129,0.12); }
  2096. .guide-bar-green .guide-bar-title { color: #064E3B; }
  2097. .guide-bar-green .guide-bar-sub { color: #047857; }
  2098. .guide-bar-green .guide-bar-btn { background: linear-gradient(135deg, #10B981, #34D399); color: #fff; }
  2099. .guide-bar-purple { background: #F5F3FF; border: 1rpx solid rgba(139,92,246,0.18); }
  2100. .guide-bar-purple .guide-bar-icon-wrap { background: rgba(139,92,246,0.12); }
  2101. .guide-bar-purple .guide-bar-title { color: #4C1D95; }
  2102. .guide-bar-purple .guide-bar-sub { color: #6D28D9; }
  2103. .guide-bar-purple .guide-bar-btn { background: linear-gradient(135deg, #8B5CF6, #A78BFA); color: #fff; }
  2104. .guide-bar-gray { background: #F8FAFC; border: 1rpx solid rgba(100,116,139,0.15); }
  2105. .guide-bar-gray .guide-bar-icon-wrap { background: rgba(100,116,139,0.10); }
  2106. .guide-bar-gray .guide-bar-title { color: #334155; }
  2107. .guide-bar-gray .guide-bar-sub { color: #64748B; }
  2108. .guide-bar-gray .guide-bar-btn { background: linear-gradient(135deg, #94A3B8, #CBD5E1); color: #fff; }
  2109. /* ===== 快捷功能入口(单排,6个横向排列) ===== */
  2110. .quick-bar {
  2111. display: flex;
  2112. flex-direction: row;
  2113. justify-content: space-between;
  2114. align-items: center;
  2115. background: #fff;
  2116. border-radius: 20rpx;
  2117. padding: 20rpx 10rpx;
  2118. }
  2119. .quick-item {
  2120. flex: 1;
  2121. display: flex;
  2122. flex-direction: column;
  2123. align-items: center;
  2124. gap: 8rpx;
  2125. }
  2126. .quick-icon {
  2127. width: 80rpx;
  2128. height: 80rpx;
  2129. border-radius: 20rpx;
  2130. display: flex;
  2131. align-items: center;
  2132. justify-content: center;
  2133. }
  2134. .quick-icon text {
  2135. font-size: 36rpx;
  2136. }
  2137. .quick-item .quick-label {
  2138. font-size: 26rpx;
  2139. color: #666;
  2140. }
  2141. /* ===== 我的任务快捷列表 ===== */
  2142. .task-quick-list {
  2143. display: flex;
  2144. flex-direction: column;
  2145. gap: 12rpx;
  2146. }
  2147. .task-quick-item {
  2148. display: flex;
  2149. flex-direction: row;
  2150. align-items: center;
  2151. justify-content: space-between;
  2152. background: #fff;
  2153. border-radius: 16rpx;
  2154. padding: 18rpx 24rpx;
  2155. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  2156. }
  2157. .task-quick-info {
  2158. display: flex;
  2159. flex-direction: column;
  2160. min-width: 0;
  2161. flex: 1;
  2162. }
  2163. .task-quick-title {
  2164. font-size: 26rpx;
  2165. color: #333;
  2166. font-weight: 500;
  2167. line-height: 1.4;
  2168. }
  2169. .task-quick-meta {
  2170. font-size: 22rpx;
  2171. color: #F97316;
  2172. margin-top: 4rpx;
  2173. font-weight: bold;
  2174. }
  2175. .btn-quick-complete {
  2176. margin-left: 16rpx;
  2177. padding: 8rpx 24rpx;
  2178. background: linear-gradient(135deg, #F97316, #FB923C);
  2179. color: #fff;
  2180. font-size: 24rpx;
  2181. font-weight: bold;
  2182. border-radius: 20rpx;
  2183. border: none;
  2184. line-height: 1;
  2185. height: 44rpx;
  2186. flex-shrink: 0;
  2187. }
  2188. .btn-quick-complete::after {
  2189. border: none;
  2190. }
  2191. /* ===== 家庭挑战空态 ===== */
  2192. .challenge-empty {
  2193. display: flex;
  2194. flex-direction: column;
  2195. align-items: center;
  2196. padding: 40rpx 0 20rpx;
  2197. }
  2198. .challenge-empty-icon {
  2199. font-size: 64rpx;
  2200. margin-bottom: 12rpx;
  2201. line-height: 1;
  2202. }
  2203. .challenge-empty-text {
  2204. font-size: 26rpx;
  2205. color: #999;
  2206. margin-bottom: 20rpx;
  2207. }
  2208. .challenge-add-btn {
  2209. padding: 10rpx 32rpx;
  2210. background: linear-gradient(135deg, #F97316, #FB923C);
  2211. color: #fff;
  2212. font-size: 24rpx;
  2213. font-weight: bold;
  2214. border-radius: 24rpx;
  2215. border: none;
  2216. line-height: 1;
  2217. height: 48rpx;
  2218. }
  2219. .challenge-add-btn::after {
  2220. border: none;
  2221. }
  2222. .self-test-badge { display: inline-block; align-self: flex-start; margin-top: 8rpx; font-size: 20rpx; color: #F97316; background: rgba(249,115,22,0.1); padding: 4rpx 14rpx; border-radius: 999rpx; }
  2223. </style>