index.vue 75 KB

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