index.vue 96 KB

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