parent-index.vue 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043
  1. <template>
  2. <view class="container">
  3. <!-- 加载状态 -->
  4. <BaseLoading :loading="loading" text="正在加载..." />
  5. <template v-if="!loading">
  6. <!-- ===== a) 顶部 Banner ===== -->
  7. <PageBanner theme="home"
  8. tagline="家庭健康成长俱乐部"
  9. quote="给全家的一站式幸福提案" />
  10. <!-- ===== 家庭成员选择条 ===== -->
  11. <FamilyMemberStrip
  12. v-if="isLoggedIn"
  13. :members="familyMembersVisible"
  14. :selectedMemberId="selectedMemberId"
  15. :isParent="isFamilyAdmin"
  16. @select="onFamilyMemberSelect"
  17. @switch="onFamilyMemberSwitch"
  18. @removed="loadFamilyMembersVisible" />
  19. <!-- ===== 微行动卡片(P0:有效启动) ===== -->
  20. <MicroActionCard
  21. v-if="selectedMemberId && selectedChild && selectedChild.id"
  22. :memberId="selectedChild.id"
  23. @completed="onMicroActionCompleted" />
  24. <!-- ===== 健康预警横幅(P1-2) ===== -->
  25. <HealthAlertBanner
  26. v-if="selectedMemberId && selectedChild && selectedChild.id"
  27. :alerts="healthAlerts"
  28. @dismiss="onAlertDismiss" />
  29. <!-- ===== 家庭健康排行榜(P2-2) ===== -->
  30. <FamilyHealthRanking
  31. v-if="rankingMembers && rankingMembers.length > 0"
  32. :list="rankingMembers"
  33. :totalScore="rankingTotalScore" />
  34. <!-- ===== 家庭挑战区域 ===== -->
  35. <view class="challenge-section">
  36. <view class="challenge-section-header" @click="goToChallengeManage">
  37. <text class="challenge-section-title">家庭挑战</text>
  38. <text class="challenge-section-action">管理 →</text>
  39. </view>
  40. <FamilyChallengeCard
  41. v-for="ch in activeChallenges"
  42. :key="ch.id"
  43. :challenge="ch" />
  44. </view>
  45. <!-- ===== 健康圈入口(P3:社区扩散) ===== -->
  46. <view class="circle-entry-section">
  47. <!-- 有健康圈数据:显示排行榜预览 -->
  48. <PlayfulCard v-if="circleName && circleRankings.length > 0" variant="flat" shadow="sm" :clickable="true" @click="goToHealthCircle" class="circle-card-wide">
  49. <view class="circle-card-content">
  50. <view class="circle-header">
  51. <view class="circle-icon-wrap">
  52. <text class="circle-icon">🏅</text>
  53. </view>
  54. <view class="circle-header-body">
  55. <text class="circle-card-title">健康圈</text>
  56. <text class="circle-card-subtitle">{{ circleName }}</text>
  57. </view>
  58. </view>
  59. <view class="circle-ranking-preview">
  60. <view class="circle-rank-row" v-for="(item, idx) in circleRankings.slice(0, 3)" :key="idx">
  61. <text class="circle-rank-badge">{{ rankIcon(idx) }}</text>
  62. <text class="circle-rank-family">家庭 {{ idx + 1 }}</text>
  63. <text class="circle-rank-score">{{ item.totalScore || 0 }} 分</text>
  64. </view>
  65. </view>
  66. <view class="circle-action">
  67. <text class="circle-action-text">查看详情 →</text>
  68. </view>
  69. </view>
  70. </PlayfulCard>
  71. <!-- 无健康圈数据:邀请加入 -->
  72. <PlayfulCard v-else variant="flat" shadow="sm" :clickable="true" @click="goToHealthCircle" class="circle-card-wide circle-card-invite">
  73. <view class="circle-invite-content">
  74. <view class="circle-invite-icon">🏅</view>
  75. <text class="circle-invite-title">健康圈</text>
  76. <text class="circle-invite-desc">加入健康圈,和更多家庭一起健康打卡</text>
  77. <text class="circle-invite-cta">去看看 →</text>
  78. </view>
  79. </PlayfulCard>
  80. </view>
  81. <!-- ===== 五维家庭自检入口(P0-1/P0-2) ===== -->
  82. <view class="selfcheck-entry-section">
  83. <PlayfulCard variant="flat" shadow="sm" :clickable="true" @click="goToSelfCheck" class="selfcheck-card-wide">
  84. <view class="selfcheck-card-content">
  85. <view class="selfcheck-icon-wrap">
  86. <view class="selfcheck-icon-circle" style="background: #FF8C42;">
  87. <text class="selfcheck-icon-char">身</text>
  88. </view>
  89. <view class="selfcheck-icon-circle" style="background: #6366F1;">
  90. <text class="selfcheck-icon-char">智</text>
  91. </view>
  92. <view class="selfcheck-icon-circle" style="background: #F59E0B;">
  93. <text class="selfcheck-icon-char">富</text>
  94. </view>
  95. <view class="selfcheck-icon-circle" style="background: #10B981;">
  96. <text class="selfcheck-icon-char">行</text>
  97. </view>
  98. <view class="selfcheck-icon-circle" style="background: #FF6B9D;">
  99. <text class="selfcheck-icon-char">心</text>
  100. </view>
  101. </view>
  102. <view class="selfcheck-body">
  103. <text class="selfcheck-title">五维家庭自检</text>
  104. <text class="selfcheck-subtitle">15题 · 5分钟 · 生成五行相生寻源建议</text>
  105. </view>
  106. <text class="selfcheck-arrow">→</text>
  107. </view>
  108. </PlayfulCard>
  109. </view>
  110. <!-- ===== 家庭成员关系图谱 ===== -->
  111. <FamilyRelationGraph
  112. v-if="familyMembersVisible.length > 0"
  113. dimensionCode="home"
  114. :selfId="selfMemberId"
  115. :members="familyMembersVisible"
  116. :energyMap="energyMapForGraph"
  117. :intimacyMap="intimacyMapForGraph"
  118. @memberTap="goMemberDetail" />
  119. <!-- 能量沙盘 -->
  120. <WuxingSandbox
  121. v-if="sandboxData"
  122. mode="live"
  123. :scores="sandboxScores"
  124. :overallScore="sandboxData.overallScore || 0"
  125. :members="sandboxData.members || []"
  126. :dimensions="energyDimensions"
  127. :totalEnergy="totalEnergy"
  128. :totalHealthIndex="totalHealthIndex"
  129. starHeight="400rpx"
  130. showDimensionBar
  131. @point-click="onDomainClick" />
  132. <!-- 能量数据加载失败兜底 -->
  133. <view class="error-state" v-if="errorEnergy && !sandboxData" @click="loadData">
  134. <text class="error-state-text">家庭能量数据加载失败,点击重试</text>
  135. </view>
  136. <!-- ===== c) 成长数据 ===== -->
  137. <view class="stats-section animate-fade-in animate-stagger-5">
  138. <view class="section-title">成长数据</view>
  139. <view class="stats-row">
  140. <!-- 任务完成率:自己的 + 全家平均 -->
  141. <PlayfulCard variant="flat" shadow="sm" :clickable="true" @click="goToCompletionStats" class="stat-card-wide" padding="0">
  142. <view class="stat-card-content">
  143. <view class="stat-header">
  144. <view class="stat-icon-wrap stat-icon-orange">
  145. <text class="stat-icon-symbol">📋</text>
  146. </view>
  147. <view class="stat-body">
  148. <text class="stat-label-header">任务完成</text>
  149. </view>
  150. </view>
  151. <view class="stat-compare">
  152. <view class="stat-compare-row">
  153. <text class="compare-label">自己的</text>
  154. <text class="compare-value accent-color">{{ myCompletionRate }}%</text>
  155. </view>
  156. <view class="progress-bar-sm">
  157. <view class="progress-fill-sm" :style="{ width: myCompletionRate + '%' }"></view>
  158. </view>
  159. <view class="stat-compare-row">
  160. <text class="compare-label">全家平均</text>
  161. <text class="compare-value">{{ familyAvgCompletionRate }}%</text>
  162. </view>
  163. <view class="progress-bar-sm">
  164. <view class="progress-fill-sm muted" :style="{ width: familyAvgCompletionRate + '%' }"></view>
  165. </view>
  166. </view>
  167. <text class="stat-more">查看分析 ›</text>
  168. </view>
  169. </PlayfulCard>
  170. <!-- 成长积分:自己的 + 全家共 -->
  171. <PlayfulCard variant="flat" shadow="sm" :clickable="true" @click="goToRewards" class="stat-card-wide" padding="0">
  172. <view class="stat-card-content">
  173. <view class="stat-header">
  174. <view class="stat-icon-wrap stat-icon-gold">
  175. <text class="stat-icon-symbol">⭐</text>
  176. </view>
  177. <view class="stat-body">
  178. <text class="stat-label-header">成长积分</text>
  179. </view>
  180. </view>
  181. <view class="stat-compare">
  182. <view class="stat-compare-row">
  183. <text class="compare-label">自己的</text>
  184. <text class="compare-value gold-color">{{ myPoints }}</text>
  185. </view>
  186. <view class="stat-compare-row">
  187. <text class="compare-label">全家共</text>
  188. <text class="compare-value">{{ familyTotalPoints }}</text>
  189. </view>
  190. </view>
  191. <text class="stat-encourage" v-if="myPoints > 0">太棒了!</text>
  192. <text class="stat-encourage muted" v-else>开始赚星星吧</text>
  193. </view>
  194. </PlayfulCard>
  195. </view>
  196. </view>
  197. <!-- ===== d) 今日重点 ===== -->
  198. <view class="today-section animate-fade-in animate-stagger-7">
  199. <view class="section-title">今日重点</view>
  200. <PlayfulCard variant="flat" class="today-card">
  201. <template slot="header">
  202. <view class="today-header">
  203. <text class="today-label">今日待完成</text>
  204. <text class="today-count">{{ pendingTasks.length }}项任务</text>
  205. </view>
  206. </template>
  207. <view class="task-list" v-if="pendingTasks.length > 0">
  208. <view class="task-item" v-for="task in pendingTasks.slice(0, 3)" :key="task.id">
  209. <view class="task-dot" :class="'dot-color-' + (task.id % 5)"></view>
  210. <text class="task-title">{{ task.title }}</text>
  211. </view>
  212. </view>
  213. <BaseEmpty v-else icon="🎉" title="今日任务已完成" description="太棒了!" :compact="true" />
  214. <view slot="actions" class="task-view-all" @click="goToTaskList">
  215. <text>查看全部</text>
  216. <text class="arrow">→</text>
  217. </view>
  218. </PlayfulCard>
  219. </view>
  220. <!-- ===== e) 成长里程碑 ===== -->
  221. <view class="milestone-section animate-fade-in animate-stagger-8">
  222. <view class="section-title">成长里程碑</view>
  223. <PlayfulCard variant="flat" class="milestone-card">
  224. <view class="milestone-item" v-if="selectedChild && selectedChild.streakDays >= 7">
  225. <view class="milestone-icon-wrap milestone-star">
  226. <text class="milestone-icon">🌟</text>
  227. </view>
  228. <text class="milestone-text">连续7天打卡</text>
  229. </view>
  230. <view class="milestone-item" v-if="selectedChild && selectedChild.streakDays >= 30">
  231. <view class="milestone-icon-wrap milestone-trophy">
  232. <text class="milestone-icon">🏆</text>
  233. </view>
  234. <text class="milestone-text">坚持一个月啦!</text>
  235. </view>
  236. <view class="milestone-item" v-if="(selectedChild && selectedChild.totalPoints) >= 1000">
  237. <view class="milestone-icon-wrap milestone-sparkle">
  238. <text class="milestone-icon">💫</text>
  239. </view>
  240. <text class="milestone-text">积分突破1000</text>
  241. </view>
  242. <BaseEmpty v-if="!hasMilestones" icon="🌱" title="开始养成好习惯" description="见证成长" :compact="true" />
  243. </PlayfulCard>
  244. </view>
  245. <!-- ===== f) 待处理事项 ===== -->
  246. <view class="pending-section animate-fade-in animate-stagger-9">
  247. <view class="section-title">📋 待处理事项</view>
  248. <view class="pending-grid">
  249. <view class="pending-card" @click="goToReview">
  250. <view class="pending-icon pending-icon--blue">
  251. <text class="pending-emoji">📝</text>
  252. </view>
  253. <view class="pending-info">
  254. <text class="pending-count accent-color">{{ pendingReviewTasks.length }}</text>
  255. <text class="pending-label">待审核任务</text>
  256. </view>
  257. </view>
  258. <view class="pending-card" @click="goToWishApprove">
  259. <view class="pending-icon pending-icon--pink">
  260. <text class="pending-emoji">💝</text>
  261. </view>
  262. <view class="pending-info">
  263. <text class="pending-count pink-color">{{ pendingReviewWishes.length }}</text>
  264. <text class="pending-label">待审批心愿</text>
  265. </view>
  266. </view>
  267. <view class="pending-card" @click="goToAssessmentReport">
  268. <view class="pending-icon pending-icon--green">
  269. <text class="pending-emoji">📊</text>
  270. </view>
  271. <view class="pending-info">
  272. <text class="pending-count teal-color">{{ hasNewReport ? '有新' : '暂无' }}</text>
  273. <text class="pending-label">最新测评报告</text>
  274. </view>
  275. </view>
  276. <view class="pending-card" @click="goToActivities">
  277. <view class="pending-icon pending-icon--orange">
  278. <text class="pending-emoji">🎉</text>
  279. </view>
  280. <view class="pending-info">
  281. <text class="pending-count orange-color">{{ hotActivityCount > 0 ? hotActivityCount : '暂无' }}</text>
  282. <text class="pending-label">活动推荐</text>
  283. </view>
  284. </view>
  285. </view>
  286. </view>
  287. <!-- ===== 重要关系(外部通讯录) ===== -->
  288. <view class="contact-section" v-if="!loading && familyMembersVisible.length > 0">
  289. <view class="contact-header">
  290. <text class="contact-section-title">重要关系</text>
  291. <view class="contact-header-right">
  292. <text class="contact-more" @click="loadContacts">刷新</text>
  293. <text class="contact-import-btn" @click="onShowImport">+ 导入</text>
  294. </view>
  295. </view>
  296. <scroll-view class="contact-scroll" scroll-x enable-flex>
  297. <view class="contact-scroll-inner">
  298. <view class="contact-card-wrap" v-for="item in contactList" :key="item.id" @click="onContactClick(item)">
  299. <ContactCard :contact="item" />
  300. </view>
  301. <view class="contact-card-wrap contact-add-card" @click="onShowImport">
  302. <view class="add-card-inner">
  303. <text class="add-card-icon">+</text>
  304. <text class="add-card-label">导入通讯录</text>
  305. </view>
  306. </view>
  307. </view>
  308. </scroll-view>
  309. <view class="contact-empty" v-if="contactList.length === 0">
  310. <text class="contact-empty-text">暂无重要联系人,点击导入添加</text>
  311. </view>
  312. </view>
  313. <!-- 导入联系人弹窗 -->
  314. <ContactImport
  315. :visible="showImportModal"
  316. @close="onCloseImport"
  317. @success="onImportSuccess" />
  318. <!-- 邀请码二维码弹窗 -->
  319. <view class="qr-code-modal" v-if="showQrCodeModal" @touchmove.stop.prevent @click="onCloseQrCodeModal">
  320. <view class="qr-code-modal-content" @click.stop>
  321. <view class="qr-code-modal-header">
  322. <text class="qr-code-modal-title">邀请二维码</text>
  323. <text class="qr-code-modal-close" @click="onCloseQrCodeModal">×</text>
  324. </view>
  325. <view class="qr-code-modal-body">
  326. <view class="qr-code-image-container">
  327. <image :src="(qrCodeData && qrCodeData.qrCodeBase64) || ''" class="qr-code-image" mode="aspectFit" />
  328. </view>
  329. <view class="qr-code-referral-code">
  330. <text class="qr-code-label">邀请码:</text>
  331. <text class="qr-code-code">{{ (qrCodeData && qrCodeData.referralCode) || '' }}</text>
  332. <text class="qr-code-copy" @click="onCopyReferralCode">复制</text>
  333. </view>
  334. </view>
  335. </view>
  336. </view>
  337. <!-- ===== 推荐商品+活动(混合信息流) ===== -->
  338. <RecommendedFeed
  339. :products="recommendedProducts"
  340. :activities="recommendedActivities"
  341. :loading="loadingProducts || loadingActivities"
  342. @itemClick="onFeedItemClick"
  343. @more="goMoreDiscover" />
  344. <view class="error-state" v-if="errorProducts || errorActivities">
  345. <text class="error-state-text">推荐加载失败</text>
  346. </view>
  347. <!-- ===== 推荐阅读(书册风格) ===== -->
  348. <ArticleBookshelf
  349. :articles="indexArticles"
  350. :loading="articlesLoading"
  351. :isLoggedIn="isLoggedIn"
  352. @articleClick="goArticleDetail"
  353. @moreArticles="goArticles"
  354. />
  355. <!-- ===== h) 待审核任务 ===== -->
  356. <view class="review-section animate-fade-in animate-stagger-11" v-if="pendingReviewTasks.length > 0">
  357. <view class="section-title">待审核任务</view>
  358. <PlayfulCard
  359. variant="flat"
  360. shadow="sm"
  361. class="review-card"
  362. v-for="task in pendingReviewTasks"
  363. :key="task.id"
  364. padding="0"
  365. >
  366. <view class="review-card-content">
  367. <view class="review-info">
  368. <text class="task-name">{{ task.title }}</text>
  369. <text class="task-child" v-if="task.childName">提供者: {{ task.childName }}</text>
  370. </view>
  371. <view class="review-actions">
  372. <PlayfulButton variant="success" size="xs" @click="approveTask(task.id)">通过</PlayfulButton>
  373. <PlayfulButton variant="error" size="xs" @click="rejectTask(task.id)">拒绝</PlayfulButton>
  374. </view>
  375. </view>
  376. </PlayfulCard>
  377. </view>
  378. <!-- ===== g) 快捷操作 ===== -->
  379. <view class="quick-section animate-fade-in animate-stagger-10">
  380. <view class="section-title">快捷操作</view>
  381. <PlayfulCard variant="flat" class="quick-card">
  382. <view class="quick-actions">
  383. <view class="action-item" @click="addTask">
  384. <view class="action-icon act-add">
  385. <text class="action-icon-text">➕</text>
  386. </view>
  387. <text class="action-label">添加任务</text>
  388. </view>
  389. <view class="action-item" @click="goToReview">
  390. <view class="action-icon act-review">
  391. <text class="action-icon-text">📋</text>
  392. </view>
  393. <text class="action-label">审核任务</text>
  394. </view>
  395. <view class="action-item" @click="manageChildren">
  396. <view class="action-icon act-child">
  397. <text class="action-icon-text">👨‍👩‍👧</text>
  398. </view>
  399. <text class="action-label">成员管理</text>
  400. </view>
  401. <view class="action-item" @click="goToRewards">
  402. <view class="action-icon act-reward">
  403. <text class="action-icon-text">🎁</text>
  404. </view>
  405. <text class="action-label">奖励中心</text>
  406. </view>
  407. <!-- Added: QR Code button -->
  408. <view class="action-item" @click="onShowQrCodeModal">
  409. <view class="action-icon act-invite">
  410. <text class="action-icon-text">📱</text>
  411. </view>
  412. <text class="action-label">邀请码</text>
  413. </view>
  414. </view>
  415. </PlayfulCard>
  416. </view>
  417. </template>
  418. <!-- ===== L1 即时反馈:Toast + 庆祝 ===== -->
  419. <FeedbackToast
  420. :visible="toastVisible"
  421. :text="toastText"
  422. :icon="toastIcon"
  423. :animating="toastAnimating" />
  424. <MilestoneCelebration
  425. :visible="celebrationVisible"
  426. :title="celebrationTitle"
  427. :subtitle="celebrationSubtitle"
  428. :particles="celebrationParticles"
  429. @dismiss="celebrationVisible = false" />
  430. <!-- ===== L2 深度反馈:每日健康小语 ===== -->
  431. <DailySummary
  432. v-if="selectedMemberId && selectedChild && selectedChild.id"
  433. :memberId="selectedChild.id"
  434. @dismiss="onDailySummaryDismiss" />
  435. </view>
  436. </template>
  437. <script>
  438. import { getFamilyMembers, getChildren, getPendingReviewTasks, getPendingWishes, approveTask, rejectTask, getChildCompletionStats, getParentDashboard, getFamilyEnergySandbox, getEnergyOverview, getVisibleFamilyMembers, getActivityList, getProductsByDomain, getContactList, getFeaturedArticles, getActiveAlerts, dismissAlert, getFamilyRanking, getChallengeList, getCircleRanking, getInviteQrCode, switchToFamilyMember } from '../../utils/api.js'
  439. import store from '../../store/index.js'
  440. import PageBanner from '../../components/PageBanner.vue'
  441. import PlayfulCard from '../../components/PlayfulCard.vue'
  442. import PlayfulButton from '../../components/PlayfulButton.vue'
  443. import BaseBadge from '../../components/BaseBadge.vue'
  444. import BaseEmpty from '../../components/BaseEmpty.vue'
  445. import BaseLoading from '../../components/BaseLoading.vue'
  446. import FamilyRelationGraph from '../../components/FamilyRelationGraph.vue'
  447. import WuxingSandbox from '../../components/wuxing-sandbox.vue'
  448. import ContactCard from '../../components/ContactCard.vue'
  449. import FamilyHealthRanking from '../../components/FamilyHealthRanking.vue'
  450. import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
  451. import ContactImport from '../../components/ContactImport.vue'
  452. import RecommendedFeed from '../../components/RecommendedFeed.vue'
  453. import FamilyMemberStrip from '../../components/FamilyMemberStrip.vue'
  454. import MicroActionCard from '../../components/MicroActionCard.vue'
  455. import FeedbackToast from '../../components/FeedbackToast.vue'
  456. import MilestoneCelebration from '../../components/MilestoneCelebration.vue'
  457. import DailySummary from '../../components/DailySummary.vue'
  458. import HealthAlertBanner from '../../components/HealthAlertBanner.vue'
  459. import CircleRanking from '../../components/CircleRanking.vue'
  460. import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
  461. import feedbackEngine from '../../utils/feedback-engine.js'
  462. export default {
  463. components: { PageBanner, RecommendedFeed, PlayfulCard, PlayfulButton, BaseBadge, BaseEmpty, BaseLoading, FamilyRelationGraph, WuxingSandbox, ContactCard, ContactImport, FamilyMemberStrip, MicroActionCard, FeedbackToast, MilestoneCelebration, DailySummary, HealthAlertBanner, FamilyHealthRanking, FamilyChallengeCard, CircleRanking, ArticleBookshelf },
  464. data() {
  465. return {
  466. nickname: '',
  467. familyMembers: [],
  468. children: [],
  469. selectedChild: null,
  470. pendingReviewTasks: [],
  471. pendingReviewWishes: [],
  472. pendingWishesCount: 0,
  473. pendingTasks: [],
  474. hotActivityCount: 0,
  475. hasNewReport: false,
  476. myCompletionRate: 0,
  477. familyAvgCompletionRate: 0,
  478. myPoints: 0,
  479. familyTotalPoints: 0,
  480. // membershipText removed (no real function)
  481. loading: true,
  482. currentChildId: '',
  483. _initialLoadDone: false,
  484. _familyId: null,
  485. familyMembersVisible: [],
  486. selfMemberId: null,
  487. energyData: null,
  488. energyDimensions: [],
  489. totalEnergy: 0,
  490. totalHealthIndex: 0,
  491. recommendedActivities: [],
  492. recommendedProducts: [],
  493. sandboxData: null,
  494. errorEnergy: false,
  495. errorTasks: false,
  496. errorActivities: false,
  497. errorProducts: false,
  498. loadingActivities: false,
  499. loadingProducts: false,
  500. contactList: [],
  501. showImportModal: false,
  502. // QR Code modal
  503. showQrCodeModal: false,
  504. qrCodeData: null,
  505. // 推荐阅读
  506. indexArticles: [],
  507. articlesLoading: false,
  508. isLoggedIn: false,
  509. gradientColors: [
  510. 'linear-gradient(135deg, #10B981, #34D399)',
  511. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  512. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  513. 'linear-gradient(135deg, #F97316, #FB923C)',
  514. 'linear-gradient(135deg, #6366F1, #818CF8)'
  515. ],
  516. selectedMemberId: null,
  517. // L1 即时反馈状态
  518. toastVisible: false,
  519. toastText: '',
  520. toastIcon: '✅',
  521. toastAnimating: false,
  522. celebrationVisible: false,
  523. celebrationTitle: '',
  524. celebrationSubtitle: '',
  525. celebrationParticles: [],
  526. // P1-2 健康预警
  527. healthAlerts: [],
  528. // P2-2 家庭互动
  529. rankingMembers: [],
  530. rankingTotalScore: 0,
  531. activeChallenges: [],
  532. // P3 健康圈(社区扩散)
  533. circleRankings: [],
  534. circleName: '',
  535. circleLoading: false
  536. }
  537. },
  538. computed: {
  539. isFamilyAdmin() {
  540. if (!this.familyMembersVisible || this.familyMembersVisible.length === 0) return false
  541. return this.familyMembersVisible[0].isAdmin === true
  542. },
  543. topPendingTasks() {
  544. return this.pendingTasks.slice(0, 3)
  545. },
  546. energyScores() {
  547. var d = this.energyData
  548. if (!d) return { body: 0, mind: 0, wisdom: 0, action: 0, wealth: 0 }
  549. return { body: d.bodyScore, mind: d.mindScore, wisdom: d.wisdomScore, action: d.actionScore, wealth: d.wealthScore }
  550. },
  551. energyOverall() {
  552. return this.energyData ? this.energyData.overallScore : 0
  553. },
  554. energyMembers() {
  555. return this.energyData ? this.energyData.members : []
  556. },
  557. sandboxScores() {
  558. if (!this.sandboxData) return { body: 0, mind: 0, wisdom: 0, action: 0, wealth: 0 }
  559. return {
  560. body: this.sandboxData.bodyScore || 0,
  561. mind: this.sandboxData.mindScore || 0,
  562. wisdom: this.sandboxData.wisdomScore || 0,
  563. action: this.sandboxData.actionScore || 0,
  564. wealth: this.sandboxData.wealthScore || 0
  565. }
  566. },
  567. greetingText() {
  568. const hour = new Date().getHours()
  569. if (hour < 6) return '夜深了'
  570. if (hour < 9) return '早上好'
  571. if (hour < 12) return '上午好'
  572. if (hour < 14) return '中午好'
  573. if (hour < 18) return '下午好'
  574. if (hour < 22) return '晚上好'
  575. return '夜深了'
  576. },
  577. hasMilestones() {
  578. const c = this.selectedChild
  579. if (!c) return false
  580. return (c.streakDays >= 7) || (c.streakDays >= 30) || (c.totalPoints >= 1000)
  581. },
  582. energyMapForGraph() {
  583. var map = {}
  584. if (this.sandboxData && this.sandboxData.members) {
  585. for (var i = 0; i < this.sandboxData.members.length; i++) {
  586. var m = this.sandboxData.members[i]
  587. map[m.memberId || m.id] = {
  588. bodyScore: m.bodyScore || 0,
  589. mindScore: m.mindScore || 0,
  590. actionScore: m.actionScore || 0
  591. }
  592. }
  593. }
  594. return map
  595. },
  596. intimacyMapForGraph() {
  597. return {}
  598. }
  599. },
  600. // 使用 mounted 而非 onLoad,因为本组件作为条件渲染子组件(v-if),
  601. // page 生命周期钩子(onLoad/onShow)可能在组件挂载前已触发完毕
  602. mounted() {
  603. if (uni.getStorageSync('token')) {
  604. this.isLoggedIn = true
  605. this.loadData()
  606. }
  607. },
  608. onShow() {
  609. // 首次 onShow 紧接 mounted 之后,跳过避免双重加载
  610. if (!this._initialLoadDone) {
  611. this._initialLoadDone = true
  612. return
  613. }
  614. const currentRole = uni.getStorageSync('currentRole') || 'parent'
  615. if (currentRole === 'child') {
  616. uni.reLaunch({ url: '/pages/home-pages/child-index' })
  617. return
  618. }
  619. if (uni.getStorageSync('token')) {
  620. this.isLoggedIn = true
  621. this.loadData()
  622. }
  623. },
  624. onPullDownRefresh() {
  625. this.loadData().finally(() => {
  626. uni.stopPullDownRefresh()
  627. })
  628. },
  629. methods: {
  630. rankIcon: function(idx) {
  631. var medals = ['🥇', '🥈', '🥉']
  632. return medals[idx] || '#' + (idx + 1)
  633. },
  634. async loadData() {
  635. this.loading = true
  636. try {
  637. var userInfo = uni.getStorageSync('userInfo')
  638. this.nickname = (userInfo && userInfo.nickname) ? userInfo.nickname : ''
  639. this.selfMemberId = uni.getStorageSync('userId') || null
  640. // 优先使用仪表盘接口(包含孩子列表 + 统计数据)
  641. let dashboardLoaded = false
  642. try {
  643. const dashRes = await getParentDashboard()
  644. const dashData = dashRes.data || {}
  645. const dashChildren = dashData.children || []
  646. // 过滤:仅保留孩子角色成员,排除家长/本人
  647. var currentUserId = uni.getStorageSync('userId')
  648. var filteredChildren = dashChildren.filter(function(c) {
  649. return c && c.id && c.id !== currentUserId && (c.role === 'child' || c.memberType === 'child')
  650. })
  651. if (filteredChildren.length > 0) {
  652. this.children = filteredChildren
  653. this.selectedChild = filteredChildren[0]
  654. this.currentChildId = filteredChildren[0].id
  655. this.familyAvgCompletionRate = dashData.avgCompletionRate || 0
  656. // 家长自身数据(积分 + 任务完成率)
  657. this.myPoints = dashData.parentPoints || 0
  658. this.myCompletionRate = dashData.parentCompletionRate || 0
  659. // 从仪表盘获取 familyId
  660. if (dashData.familyId) {
  661. this._familyId = dashData.familyId
  662. }
  663. dashboardLoaded = true
  664. }
  665. } catch (e) {
  666. console.log('获取仪表盘数据失败,降级到单独接口', e)
  667. }
  668. // 降级:使用原有单独接口
  669. if (!dashboardLoaded) {
  670. try {
  671. const currentUserId = uni.getStorageSync('userId')
  672. const membersRes = await getFamilyMembers()
  673. const data = membersRes.data || {}
  674. const parents = (data.parents || []).filter(function(p) { return p && p.id && p.id !== currentUserId }).map(function(p) { return { ...p, role: 'parent' } })
  675. const children = (data.children || []).filter(function(c) { return c && c.id }).map(function(c) { return { ...c, role: 'child' } })
  676. this.familyMembers = [].concat(parents, children)
  677. if (children.length > 0) {
  678. this.selectedChild = children[0]
  679. this.currentChildId = children[0].id
  680. }
  681. // 保存 familyId 用于后续请求
  682. if (data.familyId) {
  683. this._familyId = data.familyId
  684. }
  685. } catch (e) {
  686. console.log('获取家庭成员失败', e)
  687. }
  688. if (this.children.length === 0) {
  689. try {
  690. const childrenRes = await getChildren()
  691. const rawChildren = childrenRes.data || []
  692. this.children = rawChildren
  693. if (this.children.length > 0 && !this.selectedChild) {
  694. this.selectedChild = this.children[0]
  695. this.currentChildId = this.children[0].id
  696. }
  697. } catch (e) {
  698. console.log('获取孩子列表失败', e)
  699. }
  700. }
  701. }
  702. const reviewRes = await getPendingReviewTasks()
  703. const allReviewTasks = reviewRes.data || []
  704. this.pendingReviewTasks = allReviewTasks.slice(0, 3)
  705. try {
  706. const wishRes = await getPendingWishes()
  707. this.pendingReviewWishes = wishRes.data || []
  708. } catch (e) {
  709. console.log('获取待处理心愿失败', e)
  710. this.pendingReviewWishes = []
  711. }
  712. const reviewMap = {}
  713. const wishMap = {}
  714. for (let i = 0; i < allReviewTasks.length; i++) {
  715. const task = allReviewTasks[i]
  716. const cid = task.memberId || task.assigneeId
  717. if (cid) {
  718. reviewMap[cid] = (reviewMap[cid] || 0) + 1
  719. }
  720. }
  721. for (let j = 0; j < (this.pendingReviewWishes || []).length; j++) {
  722. const wish = this.pendingReviewWishes[j]
  723. const cid = wish.memberId
  724. if (cid) {
  725. wishMap[cid] = (wishMap[cid] || 0) + 1
  726. }
  727. }
  728. this.children = this.children.map(function(c) {
  729. return {
  730. ...c,
  731. pendingReviewCount: reviewMap[c.id] || 0,
  732. pendingWishCount: wishMap[c.id] || 0
  733. }
  734. })
  735. // 计算全家总积分(家长 + 所有孩子)
  736. var totalPts = this.myPoints
  737. for (var pi = 0; pi < this.children.length; pi++) {
  738. totalPts += (this.children[pi].totalPoints || 0)
  739. }
  740. this.familyTotalPoints = totalPts
  741. // 如果仪表盘未加载到数据,降级:从孩子数据取近似值
  742. if (!dashboardLoaded) {
  743. // 降级:家长积分取自己的(从缓存或API),完成率取第一个孩子的
  744. const targetChild = this.selectedChild || (this.children.length > 0 ? this.children[0] : null)
  745. if (targetChild) {
  746. try {
  747. const statsRes = await getChildCompletionStats({ memberId: targetChild.id })
  748. if (statsRes && statsRes.data) {
  749. this.myCompletionRate = statsRes.data.completionRate || 0
  750. }
  751. } catch (e) {
  752. console.log('获取个人完成率失败', e)
  753. }
  754. userInfo = uni.getStorageSync('userInfo')
  755. this.myPoints = (userInfo && userInfo.totalPoints) || 0
  756. this.familyAvgCompletionRate = this.myCompletionRate
  757. }
  758. }
  759. // 待完成任务 - 优先使用后端返回的真实任务列表
  760. this.pendingTasks = []
  761. if (this.children.length > 0) {
  762. const targetChild = this.selectedChild || this.children[0]
  763. try {
  764. const r2 = await getChildCompletionStats({ memberId: targetChild.id })
  765. if (r2 && r2.data && r2.data.pendingTaskList && r2.data.pendingTaskList.length > 0) {
  766. this.pendingTasks = r2.data.pendingTaskList.slice(0, 3)
  767. } else if (r2 && r2.data && r2.data.pendingTasks > 0) {
  768. // 降级:只有数量没有列表时使用占位
  769. for (let k = 0; k < Math.min(r2.data.pendingTasks, 3); k++) {
  770. this.pendingTasks.push({ id: 'pending-' + k, title: '待完成任务' })
  771. }
  772. }
  773. } catch (e) {
  774. this.pendingTasks = []
  775. }
  776. }
  777. // 加载家庭能量沙盘数据(五维 + 所有成员)
  778. try {
  779. const energyRes = await getFamilyEnergySandbox()
  780. this.energyData = energyRes.data || null
  781. this.sandboxData = energyRes.data || null
  782. } catch (e) {
  783. console.log('获取能量沙盘数据失败', e)
  784. this.energyData = null
  785. this.errorEnergy = true
  786. }
  787. // 加载推荐活动
  788. this.loadRecommendedActivities()
  789. // 加载推荐商品
  790. this.loadRecommendedProducts()
  791. // 加载家庭成员可见列表
  792. this.loadFamilyMembersVisible()
  793. // 加载健康预警(P1-2)
  794. this.loadAlerts()
  795. // 加载家庭健康互动(P2-2)
  796. this.loadFamilyInteraction()
  797. // 加载健康圈(P3:社区扩散)
  798. this.loadHealthCircle()
  799. // 加载外部联系人
  800. this.loadContacts()
  801. // 加载推荐阅读
  802. this.loadFeaturedArticles()
  803. // 加载五维能量概览(账本模式)
  804. var overviewChildId = this.currentChildId
  805. if (overviewChildId) {
  806. try {
  807. var overviewRes = await getEnergyOverview(overviewChildId)
  808. if (overviewRes && overviewRes.data) {
  809. this.energyDimensions = overviewRes.data.dimensions || []
  810. this.totalEnergy = overviewRes.data.totalEnergy || 0
  811. this.totalHealthIndex = overviewRes.data.totalHealthIndex || 0
  812. }
  813. } catch (e) {
  814. console.log('获取能量概览失败', e)
  815. }
  816. }
  817. } catch (e) {
  818. console.error('加载数据失败', e)
  819. } finally {
  820. this.loading = false
  821. this.$emit('ready')
  822. }
  823. },
  824. async approveTask(taskId) {
  825. try {
  826. await approveTask(taskId)
  827. uni.showToast({ title: '已通过', icon: 'success' })
  828. this.loadData()
  829. } catch (e) {
  830. uni.showToast({ title: '操作失败', icon: 'none' })
  831. }
  832. },
  833. async rejectTask(taskId) {
  834. try {
  835. await rejectTask(taskId)
  836. uni.showToast({ title: '已拒绝', icon: 'success' })
  837. this.loadData()
  838. } catch (e) {
  839. uni.showToast({ title: '操作失败', icon: 'none' })
  840. }
  841. },
  842. // 加载可见家庭成员
  843. async loadFamilyMembersVisible() {
  844. try {
  845. var res = await getVisibleFamilyMembers()
  846. this.familyMembersVisible = res.data || []
  847. } catch (e) {
  848. console.log('获取可见家庭成员失败', e)
  849. this.familyMembersVisible = []
  850. }
  851. },
  852. // 成员选择
  853. goToCompletionStats() {
  854. if (this.children.length === 1) {
  855. uni.navigateTo({ url: '/pages/stats/completion-rate?memberId=' + this.children[0].id })
  856. } else {
  857. uni.navigateTo({ url: '/pages/stats/completion-rate?familyView=1' })
  858. }
  859. },
  860. onDomainClick(evt) {
  861. this.goToDomain(evt.code)
  862. },
  863. goToDomain(code) {
  864. // 跳转到能量详情页
  865. var memberId = this.currentChildId
  866. if (!memberId || !code) return
  867. uni.navigateTo({
  868. url: '/pages/energy/detail?memberId=' + memberId + '&code=' + code
  869. })
  870. },
  871. onFamilyMemberSelect(member) {
  872. this.selectedMemberId = member.id
  873. },
  874. async onFamilyMemberSwitch(member) {
  875. if (!member || !member.id) return
  876. try {
  877. var res = await switchToFamilyMember(member.id, member.source || 'family_member')
  878. if (res.code === 200 && res.data) {
  879. store.commit('switchToMember', {
  880. memberId: res.data.memberId,
  881. effectiveRole: res.data.effectiveRole
  882. })
  883. uni.showToast({ title: '已切换到' + (member.nickname || '该成员'), icon: 'success' })
  884. setTimeout(function() {
  885. uni.reLaunch({ url: '/pages/index-home/index' })
  886. }, 1000)
  887. } else {
  888. uni.showToast({ title: res.message || '切换失败', icon: 'none' })
  889. }
  890. } catch (e) {
  891. uni.showToast({ title: '切换失败', icon: 'none' })
  892. }
  893. },
  894. onMicroActionCompleted() {
  895. this.loadData()
  896. feedbackEngine.trigger('micro_action')
  897. },
  898. onDailySummaryDismiss() {
  899. // DailySummary 已关闭,无额外操作
  900. },
  901. loadAlerts: function() {
  902. var memberId = this.selectedChild && this.selectedChild.id
  903. if (!memberId) return
  904. var self = this
  905. getActiveAlerts({ memberId: memberId }).then(function(res) {
  906. if (res.code === 200) {
  907. self.healthAlerts = res.data || []
  908. }
  909. }).catch(function() {})
  910. },
  911. handleDismissAlert: function(alertId) {
  912. var self = this
  913. dismissAlert({ id: alertId }).then(function(res) {
  914. if (res.code === 200) {
  915. self.healthAlerts = self.healthAlerts.filter(function(a) { return a.id !== alertId })
  916. }
  917. }).catch(function() {})
  918. },
  919. loadFamilyInteraction: function() {
  920. var familyId = this._familyId
  921. if (!familyId) return
  922. var self = this
  923. getFamilyRanking({}).then(function(res) {
  924. if (res.code === 200 && res.data) {
  925. self.rankingMembers = res.data.members || []
  926. self.rankingTotalScore = res.data.totalScore || 0
  927. }
  928. }).catch(function() {})
  929. getChallengeList({}).then(function(res) {
  930. if (res.code === 200 && Array.isArray(res.data)) {
  931. self.activeChallenges = res.data
  932. }
  933. }).catch(function() {})
  934. },
  935. loadHealthCircle: function() {
  936. var familyId = this._familyId
  937. if (!familyId) return
  938. var self = this
  939. self.circleLoading = true
  940. getCircleRanking({}).then(function(res) {
  941. if (res.code === 200 && res.data) {
  942. self.circleName = res.data.circleName || ''
  943. self.circleRankings = res.data.rankings || []
  944. }
  945. }).catch(function() {
  946. self.circleRankings = []
  947. self.circleName = ''
  948. }).finally(function() {
  949. self.circleLoading = false
  950. })
  951. },
  952. goToHealthCircle: function() {
  953. uni.navigateTo({ url: '/pages/share/index' })
  954. },
  955. goToSelfCheck: function() {
  956. uni.navigateTo({ url: '/pages/family/self-check' })
  957. },
  958. goMemberDetail(member) {
  959. if (!member || !member.memberId) return
  960. uni.navigateTo({
  961. url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&memberType=' + (member.memberType || 'child') + '&entrySource=relation-graph'
  962. })
  963. },
  964. addTask() { uni.navigateTo({ url: '/pages/tasks/create-task' }) },
  965. goToChallengeManage() { uni.navigateTo({ url: '/pages/health/challenge-manage' }) },
  966. goToReview() { uni.navigateTo({ url: '/pages/tasks/review' }) },
  967. goToWishApprove() { uni.navigateTo({ url: '/pages/wishes/approve' }) },
  968. goToAssessmentReport() { uni.navigateTo({ url: '/pages/assessment/report' }) },
  969. goToActivities() { uni.navigateTo({ url: '/pages/activity/index' }) },
  970. goToRewards() { uni.navigateTo({ url: '/pages/rewards/rewards' }) },
  971. onFeedItemClick(item) {
  972. if (item.type === 'product') {
  973. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + item.id })
  974. } else if (item.type === 'activity') {
  975. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + item.id })
  976. }
  977. },
  978. goMoreDiscover() {
  979. uni.navigateTo({ url: '/pages/discover/index' })
  980. },
  981. loadRecommendedActivities() {
  982. var self = this
  983. getActivityList({ page: 1, size: 6 }).then(function(res) {
  984. if (res && res.data) {
  985. self.recommendedActivities = res.data.records || []
  986. }
  987. }).catch(function() {
  988. self.errorActivities = true
  989. })
  990. },
  991. loadRecommendedProducts() {
  992. var self = this
  993. getProductsByDomain('all', 1, 6).then(function(res) {
  994. if (res && res.data) {
  995. self.recommendedProducts = res.data.records || []
  996. }
  997. }).catch(function() {
  998. self.errorProducts = true
  999. })
  1000. },
  1001. goToTaskList() { uni.navigateTo({ url: '/pages/tasks/tasks' }) },
  1002. manageChildren() { uni.navigateTo({ url: '/pages/profile-extra/family-members' }) },
  1003. loadContacts: function() {
  1004. var self = this
  1005. getContactList({}).then(function(res) {
  1006. if (res.code === 200 && res.data) {
  1007. self.contactList = Array.isArray(res.data) ? res.data : []
  1008. }
  1009. }).catch(function(e) {
  1010. console.log('获取联系人失败', e)
  1011. })
  1012. },
  1013. onContactClick: function(item) {
  1014. uni.navigateTo({ url: '/pages/action-detail/contact-detail?id=' + item.id })
  1015. },
  1016. onShowImport: function() {
  1017. this.showImportModal = true
  1018. },
  1019. onCloseImport: function() {
  1020. this.showImportModal = false
  1021. },
  1022. onImportSuccess: function() {
  1023. this.showImportModal = false
  1024. this.loadContacts()
  1025. },
  1026. // QR Code modal methods
  1027. onShowQrCodeModal: async function() {
  1028. this.showQrCodeModal = true
  1029. this.qrCodeData = null
  1030. try {
  1031. const res = await this.getInviteQrCode()
  1032. if (res.code === 200) {
  1033. this.qrCodeData = res.data
  1034. }
  1035. } catch (e) {
  1036. console.error('获取二维码失败', e)
  1037. uni.showToast({ title: '获取二维码失败', icon: 'none' })
  1038. }
  1039. },
  1040. onCloseQrCodeModal: function() {
  1041. this.showQrCodeModal = false
  1042. this.qrCodeData = null
  1043. },
  1044. onCopyReferralCode: function() {
  1045. if (this.qrCodeData && this.qrCodeData.referralCode) {
  1046. uni.setClipboardData({
  1047. data: this.qrCodeData.referralCode,
  1048. success: () => {
  1049. uni.showToast({ title: '复制成功', icon: 'success' })
  1050. }
  1051. })
  1052. }
  1053. },
  1054. // 兼容旧引用
  1055. getInviteQrCode: function() {
  1056. return getInviteQrCode()
  1057. },
  1058. // ===== 推荐阅读 =====
  1059. loadFeaturedArticles: function() {
  1060. var self = this
  1061. this.articlesLoading = true
  1062. getFeaturedArticles({ size: 5 }).then(function(res) {
  1063. self.articlesLoading = false
  1064. if (res && res.code === 200) {
  1065. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  1066. var list = Array.isArray(rawList) ? rawList : []
  1067. self.indexArticles = list.map(function(item, index) {
  1068. return {
  1069. id: item.id,
  1070. category: item.categoryName || item.category || '热门文章',
  1071. categoryColor: self.gradientColors[index % self.gradientColors.length],
  1072. title: item.title || '',
  1073. summary: item.summary || '',
  1074. views: item.viewCount ? String(item.viewCount) : '0',
  1075. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  1076. coverImage: item.coverImage
  1077. }
  1078. })
  1079. }
  1080. }).catch(function() {
  1081. self.articlesLoading = false
  1082. })
  1083. },
  1084. goArticles: function() {
  1085. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  1086. },
  1087. goArticleDetail: function(articleOrId) {
  1088. var id = typeof articleOrId === 'object' ? articleOrId.id : articleOrId
  1089. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1090. }
  1091. }
  1092. }
  1093. </script>
  1094. <style scoped>
  1095. /* ========================================
  1096. Flat Card Design System — 家长端暖橙扁平
  1097. ======================================== */
  1098. .container {
  1099. padding: 32rpx;
  1100. background: var(--bg, #F5F9FC);
  1101. min-height: 100vh;
  1102. }
  1103. /* ========================================
  1104. 区块标题
  1105. ======================================== */
  1106. .section-title {
  1107. font-size: 32rpx;
  1108. font-weight: 700;
  1109. color: var(--text, #1E293B);
  1110. margin-bottom: var(--space-md);
  1111. }
  1112. /* ========================================
  1113. c) 成长数据
  1114. ======================================== */
  1115. .stats-section {
  1116. margin-bottom: 48rpx;
  1117. }
  1118. .stats-row {
  1119. display: flex;
  1120. gap: 16rpx;
  1121. }
  1122. .stat-card-wide {
  1123. flex: 1;
  1124. min-width: 0;
  1125. box-sizing: border-box;
  1126. }
  1127. .stat-card-content {
  1128. padding: 24rpx;
  1129. }
  1130. .stat-header {
  1131. display: flex;
  1132. align-items: center;
  1133. margin-bottom: 16rpx;
  1134. }
  1135. .stat-icon-wrap {
  1136. width: 56rpx;
  1137. height: 56rpx;
  1138. border-radius: var(--radius-sm, 12rpx);
  1139. display: flex;
  1140. align-items: center;
  1141. justify-content: center;
  1142. margin-right: 14rpx;
  1143. flex-shrink: 0;
  1144. }
  1145. .stat-icon-symbol {
  1146. font-size: 28rpx;
  1147. }
  1148. .stat-icon-orange { background: rgba(91, 155, 213, 0.12); }
  1149. .stat-icon-gold { background: rgba(245, 158, 11, 0.15); }
  1150. .stat-body {
  1151. flex: 1;
  1152. min-width: 0;
  1153. }
  1154. .stat-label-header {
  1155. font-size: 26rpx;
  1156. font-weight: 600;
  1157. color: var(--text, #1E293B);
  1158. }
  1159. /* 对比行布局 */
  1160. .stat-compare {
  1161. margin-bottom: 12rpx;
  1162. }
  1163. .stat-compare-row {
  1164. display: flex;
  1165. justify-content: space-between;
  1166. align-items: center;
  1167. margin-bottom: 4rpx;
  1168. }
  1169. .compare-label {
  1170. font-size: 22rpx;
  1171. color: var(--text-secondary, #64748B);
  1172. }
  1173. .compare-value {
  1174. font-size: 30rpx;
  1175. font-weight: 700;
  1176. }
  1177. /* 进度条 - 紧凑版 */
  1178. .progress-bar-sm {
  1179. height: 6rpx;
  1180. background: var(--border-light, #E2E8F0);
  1181. border-radius: 999rpx;
  1182. overflow: hidden;
  1183. margin-bottom: 8rpx;
  1184. }
  1185. .progress-fill-sm {
  1186. height: 100%;
  1187. background: linear-gradient(90deg, var(--color-primary, #5B9BD5), #F59E0B);
  1188. border-radius: 999rpx;
  1189. transition: width 0.3s ease;
  1190. }
  1191. .progress-fill-sm.muted {
  1192. background: linear-gradient(90deg, #94A3B8, #CBD5E1);
  1193. }
  1194. .accent-color { color: var(--color-primary, #5B9BD5); }
  1195. .gold-color { color: #F59E0B; }
  1196. .stat-more {
  1197. font-size: 22rpx;
  1198. color: var(--color-accent, #0EA5E9);
  1199. font-weight: 500;
  1200. display: block;
  1201. }
  1202. .stat-encourage {
  1203. font-size: 22rpx;
  1204. color: #10B981;
  1205. font-weight: 500;
  1206. margin-top: 8rpx;
  1207. display: block;
  1208. }
  1209. .stat-encourage.muted {
  1210. color: var(--muted, #94A3B8);
  1211. }
  1212. /* ========================================
  1213. d) 今日重点
  1214. ======================================== */
  1215. .today-section {
  1216. margin-bottom: 48rpx;
  1217. }
  1218. .today-card .today-header {
  1219. display: flex;
  1220. justify-content: space-between;
  1221. align-items: center;
  1222. }
  1223. .today-label {
  1224. font-size: 28rpx;
  1225. font-weight: 600;
  1226. color: var(--text, #1E293B);
  1227. }
  1228. .today-count {
  1229. font-size: 24rpx;
  1230. color: var(--color-primary, #5B9BD5);
  1231. font-weight: 600;
  1232. }
  1233. .task-list {
  1234. margin-bottom: 8rpx;
  1235. }
  1236. .task-item {
  1237. display: flex;
  1238. align-items: center;
  1239. padding: 18rpx 0;
  1240. border-bottom: 1rpx solid var(--border-light, #E2E8F0);
  1241. }
  1242. .task-item:last-child {
  1243. border-bottom: none;
  1244. }
  1245. .task-dot {
  1246. width: 14rpx;
  1247. height: 14rpx;
  1248. border-radius: 50%;
  1249. margin-right: 16rpx;
  1250. flex-shrink: 0;
  1251. }
  1252. .dot-color-0 { background: var(--color-primary, #5B9BD5); }
  1253. .dot-color-1 { background: #10B981; }
  1254. .dot-color-2 { background: var(--color-accent, #0EA5E9); }
  1255. .dot-color-3 { background: #F59E0B; }
  1256. .dot-color-4 { background: var(--color-error, #EF4444); }
  1257. .task-title {
  1258. font-size: 28rpx;
  1259. color: var(--text, #1E293B);
  1260. }
  1261. .task-view-all {
  1262. display: flex;
  1263. justify-content: flex-end;
  1264. align-items: center;
  1265. color: var(--text-secondary, #64748B);
  1266. font-size: 24rpx;
  1267. padding-top: 16rpx;
  1268. border-top: 1rpx solid var(--border-light, #E2E8F0);
  1269. }
  1270. .task-view-all .arrow {
  1271. margin-left: 8rpx;
  1272. }
  1273. /* ========================================
  1274. e) 成长里程碑
  1275. ======================================== */
  1276. .milestone-section {
  1277. margin-bottom: 48rpx;
  1278. }
  1279. .milestone-card {
  1280. padding: 24rpx !important;
  1281. }
  1282. .milestone-item {
  1283. display: flex;
  1284. align-items: center;
  1285. padding: 16rpx 0;
  1286. border-bottom: 1rpx solid var(--border-light, #E2E8F0);
  1287. }
  1288. .milestone-item:last-child {
  1289. border-bottom: none;
  1290. }
  1291. .milestone-icon-wrap {
  1292. width: 56rpx;
  1293. height: 56rpx;
  1294. border-radius: var(--radius-sm, 12rpx);
  1295. display: flex;
  1296. align-items: center;
  1297. justify-content: center;
  1298. margin-right: 16rpx;
  1299. flex-shrink: 0;
  1300. }
  1301. .milestone-icon {
  1302. font-size: 28rpx;
  1303. }
  1304. .milestone-star { background: rgba(245, 158, 11, 0.15); }
  1305. .milestone-trophy { background: rgba(91, 155, 213, 0.12); }
  1306. .milestone-sparkle { background: rgba(16, 185, 129, 0.12); }
  1307. .milestone-text {
  1308. font-size: 28rpx;
  1309. color: var(--text, #1E293B);
  1310. }
  1311. /* ========================================
  1312. f) 待处理事项
  1313. ======================================== */
  1314. .pending-section { margin-bottom: 48rpx; }
  1315. .pending-grid {
  1316. display: flex;
  1317. flex-wrap: wrap;
  1318. gap: 16rpx;
  1319. }
  1320. .pending-card {
  1321. background: #fff;
  1322. border-radius: 20rpx;
  1323. padding: 24rpx;
  1324. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1325. display: flex;
  1326. align-items: center;
  1327. width: calc(50% - 8rpx);
  1328. box-sizing: border-box;
  1329. }
  1330. .pending-card:active { opacity: 0.8; }
  1331. .pending-icon {
  1332. width: 72rpx; height: 72rpx;
  1333. border-radius: 16rpx;
  1334. display: flex; align-items: center; justify-content: center;
  1335. margin-right: 16rpx; flex-shrink: 0;
  1336. }
  1337. .pending-icon--blue { background: rgba(91,155,213,0.12); }
  1338. .pending-icon--pink { background: rgba(236,72,153,0.12); }
  1339. .pending-icon--green { background: rgba(16,185,129,0.12); }
  1340. .pending-icon--orange { background: rgba(249,115,22,0.12); }
  1341. .pending-emoji { font-size: 32rpx; }
  1342. .pending-info { flex: 1; min-width: 0; }
  1343. .pending-count { font-size: 36rpx; font-weight: 800; display: block; }
  1344. .pending-label { font-size: 22rpx; color: #666; margin-top: 4rpx; display: block; }
  1345. .pink-color { color: #EC4899; }
  1346. .orange-color { color: #F97316; }
  1347. /* ========================================
  1348. g) 成长建议
  1349. ======================================== */
  1350. .advice-section { margin-bottom: 48rpx; }
  1351. .advice-card { margin-bottom: 12rpx; }
  1352. .advice-content {
  1353. display: flex; align-items: center; padding: 24rpx;
  1354. }
  1355. .advice-icon-wrap {
  1356. width: 56rpx; height: 56rpx;
  1357. border-radius: 14rpx;
  1358. background: rgba(91,155,213,0.1);
  1359. display: flex; align-items: center; justify-content: center;
  1360. margin-right: 16rpx; flex-shrink: 0;
  1361. }
  1362. .advice-icon { font-size: 28rpx; }
  1363. .advice-text-wrap { flex: 1; min-width: 0; }
  1364. .advice-title { font-size: 28rpx; font-weight: 600; color: #333; display: block; }
  1365. .advice-desc { font-size: 24rpx; color: #999; margin-top: 4rpx; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  1366. .advice-arrow { font-size: 36rpx; color: #ccc; margin-left: 12rpx; }
  1367. /* ========================================
  1368. h) 待审核任务
  1369. ======================================== */
  1370. .review-section {
  1371. margin-bottom: 48rpx;
  1372. }
  1373. .review-card {
  1374. margin-bottom: 16rpx;
  1375. }
  1376. .review-card:last-child {
  1377. margin-bottom: 0;
  1378. }
  1379. .review-card-content {
  1380. display: flex;
  1381. justify-content: space-between;
  1382. align-items: center;
  1383. padding: 24rpx;
  1384. }
  1385. .review-info {
  1386. flex: 1;
  1387. min-width: 0;
  1388. }
  1389. .review-info .task-name {
  1390. font-size: 28rpx;
  1391. color: var(--text, #1E293B);
  1392. display: block;
  1393. margin-bottom: 4rpx;
  1394. }
  1395. .review-info .task-child {
  1396. font-size: 22rpx;
  1397. color: var(--muted, #94A3B8);
  1398. }
  1399. .review-actions {
  1400. display: flex;
  1401. gap: 12rpx;
  1402. flex-shrink: 0;
  1403. margin-left: 16rpx;
  1404. }
  1405. /* ========================================
  1406. g) 快捷操作
  1407. ======================================== */
  1408. .quick-section {
  1409. margin-bottom: 48rpx;
  1410. }
  1411. .quick-card {
  1412. padding: 16rpx 12rpx !important;
  1413. }
  1414. .quick-actions {
  1415. display: flex;
  1416. flex-wrap: wrap;
  1417. }
  1418. .action-item {
  1419. display: flex;
  1420. flex-direction: column;
  1421. align-items: center;
  1422. width: 20%;
  1423. margin-bottom: 12rpx;
  1424. transition: transform 0.15s ease;
  1425. }
  1426. .action-item:active {
  1427. transform: scale(0.92);
  1428. }
  1429. .action-icon {
  1430. width: 80rpx;
  1431. height: 80rpx;
  1432. border-radius: var(--radius-sm, 12rpx);
  1433. display: flex;
  1434. align-items: center;
  1435. justify-content: center;
  1436. margin-bottom: 10rpx;
  1437. }
  1438. .action-icon-text {
  1439. font-size: 32rpx;
  1440. }
  1441. .act-add { background: rgba(91, 155, 213, 0.12); }
  1442. .act-review { background: rgba(16, 185, 129, 0.12); }
  1443. .act-child { background: rgba(14, 165, 233, 0.12); }
  1444. .act-reward { background: rgba(245, 158, 11, 0.15); }
  1445. .act-invite { background: rgba(139, 92, 246, 0.12); }
  1446. .action-label {
  1447. font-size: 22rpx;
  1448. color: var(--text-secondary, #64748B);
  1449. font-weight: 500;
  1450. text-align: center;
  1451. }
  1452. /* ===== Error State ===== */
  1453. .error-state {
  1454. display: flex;
  1455. align-items: center;
  1456. justify-content: center;
  1457. padding: 32rpx 24rpx;
  1458. margin-bottom: 24rpx;
  1459. background: #FFF;
  1460. border-radius: 16rpx;
  1461. border: 1rpx dashed #E2E8F0;
  1462. }
  1463. .error-state-text {
  1464. font-size: 26rpx;
  1465. color: #94A3B8;
  1466. text-align: center;
  1467. }
  1468. /* ===== 重要关系(通讯录) ===== */
  1469. .contact-section {
  1470. margin: 20rpx 20rpx 0;
  1471. }
  1472. .contact-header {
  1473. display: flex;
  1474. justify-content: space-between;
  1475. align-items: center;
  1476. margin-bottom: 16rpx;
  1477. }
  1478. .contact-section-title {
  1479. font-size: 30rpx;
  1480. font-weight: 600;
  1481. color: #333;
  1482. }
  1483. .contact-header-right {
  1484. display: flex;
  1485. gap: 16rpx;
  1486. align-items: center;
  1487. }
  1488. .contact-more {
  1489. font-size: 24rpx;
  1490. color: #999;
  1491. }
  1492. .contact-import-btn {
  1493. font-size: 24rpx;
  1494. color: #F97316;
  1495. font-weight: 500;
  1496. }
  1497. .contact-scroll {
  1498. white-space: nowrap;
  1499. overflow: hidden;
  1500. }
  1501. .contact-scroll-inner {
  1502. display: flex;
  1503. flex-direction: row;
  1504. gap: 16rpx;
  1505. padding: 8rpx 0 16rpx;
  1506. }
  1507. .contact-card-wrap {
  1508. flex-shrink: 0;
  1509. width: 220rpx;
  1510. }
  1511. .contact-card-wrap:active {
  1512. opacity: 0.8;
  1513. }
  1514. .contact-add-card {
  1515. width: 160rpx;
  1516. }
  1517. .add-card-inner {
  1518. width: 160rpx;
  1519. height: 280rpx;
  1520. background: #fff;
  1521. border-radius: 16rpx;
  1522. border: 2rpx dashed #ddd;
  1523. display: flex;
  1524. flex-direction: column;
  1525. align-items: center;
  1526. justify-content: center;
  1527. gap: 12rpx;
  1528. }
  1529. .add-card-icon {
  1530. font-size: 48rpx;
  1531. color: #ccc;
  1532. }
  1533. .add-card-label {
  1534. font-size: 22rpx;
  1535. color: #999;
  1536. }
  1537. .contact-empty {
  1538. padding: 40rpx 0;
  1539. text-align: center;
  1540. }
  1541. .contact-empty-text {
  1542. font-size: 26rpx;
  1543. color: #ccc;
  1544. }
  1545. /* ===== 推荐阅读 ===== */
  1546. .article-section {
  1547. margin-bottom: 48rpx;
  1548. }
  1549. .article-header {
  1550. display: flex;
  1551. justify-content: space-between;
  1552. align-items: center;
  1553. margin-bottom: var(--space-md);
  1554. }
  1555. .article-more {
  1556. font-size: 26rpx;
  1557. color: var(--color-primary, #F97316);
  1558. }
  1559. .article-list {
  1560. display: flex;
  1561. flex-direction: column;
  1562. gap: 16rpx;
  1563. }
  1564. .article-card {
  1565. background: #fff;
  1566. border-radius: 16rpx;
  1567. padding: 24rpx;
  1568. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1569. }
  1570. .article-card:active {
  1571. opacity: 0.8;
  1572. }
  1573. .article-category {
  1574. display: inline-block;
  1575. padding: 4rpx 14rpx;
  1576. border-radius: 8rpx;
  1577. margin-bottom: 10rpx;
  1578. }
  1579. .article-category-text {
  1580. font-size: 20rpx;
  1581. color: #fff;
  1582. }
  1583. .article-title {
  1584. display: block;
  1585. font-size: 28rpx;
  1586. font-weight: bold;
  1587. color: #333;
  1588. margin-bottom: 8rpx;
  1589. line-height: 1.4;
  1590. }
  1591. .article-summary {
  1592. display: block;
  1593. font-size: 24rpx;
  1594. color: #888;
  1595. line-height: 1.5;
  1596. margin-bottom: 12rpx;
  1597. overflow: hidden;
  1598. text-overflow: ellipsis;
  1599. display: -webkit-box;
  1600. -webkit-line-clamp: 2;
  1601. -webkit-box-orient: vertical;
  1602. }
  1603. .article-meta {
  1604. display: flex;
  1605. align-items: center;
  1606. gap: 16rpx;
  1607. }
  1608. .meta-item {
  1609. display: flex;
  1610. align-items: center;
  1611. gap: 4rpx;
  1612. }
  1613. .meta-icon {
  1614. font-size: 24rpx;
  1615. }
  1616. .meta-text {
  1617. font-size: 22rpx;
  1618. color: #999;
  1619. }
  1620. .article-date {
  1621. font-size: 22rpx;
  1622. color: #bbb;
  1623. }
  1624. /* ===== 家庭挑战区域 ===== */
  1625. .challenge-section {
  1626. margin-bottom: 28rpx;
  1627. }
  1628. .challenge-section-header {
  1629. display: flex;
  1630. justify-content: space-between;
  1631. align-items: center;
  1632. margin: 0 20rpx 12rpx;
  1633. }
  1634. .challenge-section-title {
  1635. font-size: 32rpx;
  1636. font-weight: 700;
  1637. color: #1E293B;
  1638. }
  1639. .challenge-section-action {
  1640. font-size: 24rpx;
  1641. color: #10B981;
  1642. font-weight: 600;
  1643. }
  1644. /* ===== 健康圈入口卡片(P3:社区扩散) ===== */
  1645. .circle-entry-section {
  1646. margin: 0 20rpx 28rpx 20rpx;
  1647. }
  1648. .circle-card-wide {
  1649. width: 100%;
  1650. }
  1651. .circle-card-content {
  1652. padding: 24rpx;
  1653. display: flex;
  1654. flex-direction: column;
  1655. gap: 16rpx;
  1656. }
  1657. .circle-header {
  1658. display: flex;
  1659. align-items: center;
  1660. gap: 12rpx;
  1661. }
  1662. .circle-icon-wrap {
  1663. width: 56rpx;
  1664. height: 56rpx;
  1665. border-radius: 14rpx;
  1666. background: linear-gradient(135deg, #10B981, #34D399);
  1667. display: flex;
  1668. align-items: center;
  1669. justify-content: center;
  1670. }
  1671. .circle-icon {
  1672. font-size: 28rpx;
  1673. }
  1674. .circle-header-body {
  1675. flex: 1;
  1676. }
  1677. .circle-card-title {
  1678. display: block;
  1679. font-size: 28rpx;
  1680. font-weight: 700;
  1681. color: #1E293B;
  1682. line-height: 1.4;
  1683. }
  1684. .circle-card-subtitle {
  1685. display: block;
  1686. font-size: 22rpx;
  1687. color: #6B7280;
  1688. margin-top: 2rpx;
  1689. }
  1690. .circle-ranking-preview {
  1691. background: #F0FDF4;
  1692. border-radius: 12rpx;
  1693. padding: 16rpx;
  1694. display: flex;
  1695. flex-direction: column;
  1696. gap: 10rpx;
  1697. }
  1698. .circle-rank-row {
  1699. display: flex;
  1700. align-items: center;
  1701. gap: 10rpx;
  1702. }
  1703. .circle-rank-badge {
  1704. font-size: 24rpx;
  1705. width: 40rpx;
  1706. text-align: center;
  1707. }
  1708. .circle-rank-family {
  1709. flex: 1;
  1710. font-size: 24rpx;
  1711. color: #374151;
  1712. font-weight: 500;
  1713. }
  1714. .circle-rank-score {
  1715. font-size: 24rpx;
  1716. color: #F97316;
  1717. font-weight: 600;
  1718. }
  1719. .circle-action {
  1720. display: flex;
  1721. justify-content: flex-end;
  1722. }
  1723. .circle-action-text {
  1724. font-size: 24rpx;
  1725. color: #F97316;
  1726. font-weight: 500;
  1727. }
  1728. /* 无数据:邀请加入样式 */
  1729. .circle-card-invite {
  1730. background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  1731. }
  1732. .circle-invite-content {
  1733. padding: 32rpx 24rpx;
  1734. display: flex;
  1735. flex-direction: column;
  1736. align-items: center;
  1737. gap: 12rpx;
  1738. }
  1739. .circle-invite-icon {
  1740. font-size: 48rpx;
  1741. margin-bottom: 4rpx;
  1742. }
  1743. .circle-invite-title {
  1744. font-size: 30rpx;
  1745. font-weight: 700;
  1746. color: #065F46;
  1747. }
  1748. .circle-invite-desc {
  1749. font-size: 24rpx;
  1750. color: #6B7280;
  1751. text-align: center;
  1752. line-height: 1.5;
  1753. }
  1754. .circle-invite-cta {
  1755. font-size: 26rpx;
  1756. color: #F97316;
  1757. font-weight: 600;
  1758. margin-top: 4rpx;
  1759. }
  1760. /* ===== 五维家庭自检入口卡片(P0-1/P0-2) ===== */
  1761. .selfcheck-entry-section {
  1762. margin: 0 20rpx 28rpx 20rpx;
  1763. }
  1764. .selfcheck-card-wide {
  1765. width: 100%;
  1766. }
  1767. .selfcheck-card-content {
  1768. padding: 28rpx 24rpx;
  1769. display: flex;
  1770. align-items: center;
  1771. gap: 20rpx;
  1772. }
  1773. .selfcheck-icon-wrap {
  1774. display: flex;
  1775. flex-direction: row;
  1776. align-items: center;
  1777. flex-shrink: 0;
  1778. }
  1779. .selfcheck-icon-circle {
  1780. width: 52rpx;
  1781. height: 52rpx;
  1782. border-radius: 50%;
  1783. display: flex;
  1784. align-items: center;
  1785. justify-content: center;
  1786. margin-right: -10rpx;
  1787. border: 4rpx solid #fff;
  1788. box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.12);
  1789. }
  1790. .selfcheck-icon-circle:last-child {
  1791. margin-right: 0;
  1792. }
  1793. .selfcheck-icon-char {
  1794. font-size: 24rpx;
  1795. font-weight: 700;
  1796. color: #fff;
  1797. }
  1798. .selfcheck-body {
  1799. flex: 1;
  1800. }
  1801. .selfcheck-title {
  1802. display: block;
  1803. font-size: 30rpx;
  1804. font-weight: 700;
  1805. color: #1E293B;
  1806. line-height: 1.4;
  1807. }
  1808. .selfcheck-subtitle {
  1809. display: block;
  1810. font-size: 22rpx;
  1811. color: #6B7280;
  1812. margin-top: 4rpx;
  1813. }
  1814. .selfcheck-arrow {
  1815. font-size: 30rpx;
  1816. color: #F97316;
  1817. font-weight: 600;
  1818. flex-shrink: 0;
  1819. }
  1820. /* ===== 邀请码二维码弹窗 ===== */
  1821. .qr-code-modal {
  1822. position: fixed;
  1823. top: 0;
  1824. left: 0;
  1825. width: 100%;
  1826. height: 100%;
  1827. background: rgba(0, 0, 0, 0.6);
  1828. display: flex;
  1829. align-items: center;
  1830. justify-content: center;
  1831. z-index: 1000;
  1832. padding: 40rpx 20rpx;
  1833. box-sizing: border-box;
  1834. }
  1835. .qr-code-modal-content {
  1836. background: #fff;
  1837. border-radius: 20rpx;
  1838. padding: 40rpx 32rpx;
  1839. max-width: 600rpx;
  1840. width: 100%;
  1841. box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.2);
  1842. position: relative;
  1843. }
  1844. .qr-code-modal-header {
  1845. display: flex;
  1846. justify-content: space-between;
  1847. align-items: center;
  1848. margin-bottom: 32rpx;
  1849. }
  1850. .qr-code-modal-title {
  1851. font-size: 36rpx;
  1852. font-weight: 700;
  1853. color: #1E293B;
  1854. }
  1855. .qr-code-modal-close {
  1856. font-size: 48rpx;
  1857. color: #94A3B8;
  1858. line-height: 1;
  1859. padding: 8rpx;
  1860. cursor: pointer;
  1861. }
  1862. .qr-code-modal-body {
  1863. display: flex;
  1864. flex-direction: column;
  1865. align-items: center;
  1866. gap: 32rpx;
  1867. }
  1868. .qr-code-image-container {
  1869. width: 280rpx;
  1870. height: 280rpx;
  1871. display: flex;
  1872. align-items: center;
  1873. justify-content: center;
  1874. background: #f9fafb;
  1875. border-radius: 16rpx;
  1876. padding: 20rpx;
  1877. }
  1878. .qr-code-image {
  1879. width: 100%;
  1880. height: 100%;
  1881. object-fit: contain;
  1882. }
  1883. .qr-code-referral-code {
  1884. display: flex;
  1885. align-items: center;
  1886. gap: 16rpx;
  1887. padding: 24rpx;
  1888. background: #f9fafb;
  1889. border-radius: 16rpx;
  1890. width: 100%;
  1891. box-sizing: border-box;
  1892. }
  1893. .qr-code-label {
  1894. font-size: 26rpx;
  1895. color: #64748b;
  1896. font-weight: 500;
  1897. }
  1898. .qr-code-code {
  1899. flex: 1;
  1900. font-size: 32rpx;
  1901. font-weight: 700;
  1902. color: #1E293B;
  1903. word-break: break-all;
  1904. letter-spacing: 2rpx;
  1905. }
  1906. .qr-code-copy {
  1907. font-size: 24rpx;
  1908. color: #F97316;
  1909. font-weight: 500;
  1910. padding: 8rpx 16rpx;
  1911. background: #fff;
  1912. border-radius: 8rpx;
  1913. border: 1px solid #F97316;
  1914. cursor: pointer;
  1915. }
  1916. .qr-code-copy:active {
  1917. opacity: 0.8;
  1918. }
  1919. </style>