parent-index.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045
  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. hasFamilyData: false,
  494. sandboxData: null,
  495. errorEnergy: false,
  496. errorTasks: false,
  497. errorActivities: false,
  498. errorProducts: false,
  499. loadingActivities: false,
  500. loadingProducts: false,
  501. contactList: [],
  502. showImportModal: false,
  503. // QR Code modal
  504. showQrCodeModal: false,
  505. qrCodeData: null,
  506. // 推荐阅读
  507. indexArticles: [],
  508. articlesLoading: false,
  509. isLoggedIn: false,
  510. gradientColors: [
  511. 'linear-gradient(135deg, #10B981, #34D399)',
  512. 'linear-gradient(135deg, #5B9BD5, #8FC5E8)',
  513. 'linear-gradient(135deg, #8B5CF6, #C084FC)',
  514. 'linear-gradient(135deg, #F97316, #FB923C)',
  515. 'linear-gradient(135deg, #6366F1, #818CF8)'
  516. ],
  517. selectedMemberId: null,
  518. // L1 即时反馈状态
  519. toastVisible: false,
  520. toastText: '',
  521. toastIcon: '✅',
  522. toastAnimating: false,
  523. celebrationVisible: false,
  524. celebrationTitle: '',
  525. celebrationSubtitle: '',
  526. celebrationParticles: [],
  527. // P1-2 健康预警
  528. healthAlerts: [],
  529. // P2-2 家庭互动
  530. rankingMembers: [],
  531. rankingTotalScore: 0,
  532. activeChallenges: [],
  533. // P3 健康圈(社区扩散)
  534. circleRankings: [],
  535. circleName: '',
  536. circleLoading: false
  537. }
  538. },
  539. computed: {
  540. isFamilyAdmin() {
  541. if (!this.familyMembersVisible || this.familyMembersVisible.length === 0) return false
  542. return this.familyMembersVisible[0].isAdmin === true
  543. },
  544. topPendingTasks() {
  545. return this.pendingTasks.slice(0, 3)
  546. },
  547. energyScores() {
  548. var d = this.energyData
  549. if (!d) return { body: 0, mind: 0, wisdom: 0, action: 0, wealth: 0 }
  550. return { body: d.bodyScore, mind: d.mindScore, wisdom: d.wisdomScore, action: d.actionScore, wealth: d.wealthScore }
  551. },
  552. energyOverall() {
  553. return this.energyData ? this.energyData.overallScore : 0
  554. },
  555. energyMembers() {
  556. return this.energyData ? this.energyData.members : []
  557. },
  558. sandboxScores() {
  559. if (!this.sandboxData) return { body: 0, mind: 0, wisdom: 0, action: 0, wealth: 0 }
  560. return {
  561. body: this.sandboxData.bodyScore || 0,
  562. mind: this.sandboxData.mindScore || 0,
  563. wisdom: this.sandboxData.wisdomScore || 0,
  564. action: this.sandboxData.actionScore || 0,
  565. wealth: this.sandboxData.wealthScore || 0
  566. }
  567. },
  568. greetingText() {
  569. const hour = new Date().getHours()
  570. if (hour < 6) return '夜深了'
  571. if (hour < 9) return '早上好'
  572. if (hour < 12) return '上午好'
  573. if (hour < 14) return '中午好'
  574. if (hour < 18) return '下午好'
  575. if (hour < 22) return '晚上好'
  576. return '夜深了'
  577. },
  578. hasMilestones() {
  579. const c = this.selectedChild
  580. if (!c) return false
  581. return (c.streakDays >= 7) || (c.streakDays >= 30) || (c.totalPoints >= 1000)
  582. },
  583. energyMapForGraph() {
  584. var map = {}
  585. if (this.sandboxData && this.sandboxData.members) {
  586. for (var i = 0; i < this.sandboxData.members.length; i++) {
  587. var m = this.sandboxData.members[i]
  588. map[m.memberId || m.id] = {
  589. bodyScore: m.bodyScore || 0,
  590. mindScore: m.mindScore || 0,
  591. actionScore: m.actionScore || 0
  592. }
  593. }
  594. }
  595. return map
  596. },
  597. intimacyMapForGraph() {
  598. return {}
  599. }
  600. },
  601. // 使用 mounted 而非 onLoad,因为本组件作为条件渲染子组件(v-if),
  602. // page 生命周期钩子(onLoad/onShow)可能在组件挂载前已触发完毕
  603. mounted() {
  604. if (uni.getStorageSync('token')) {
  605. this.isLoggedIn = true
  606. this.loadData()
  607. }
  608. },
  609. onShow() {
  610. // 首次 onShow 紧接 mounted 之后,跳过避免双重加载
  611. if (!this._initialLoadDone) {
  612. this._initialLoadDone = true
  613. return
  614. }
  615. const currentRole = uni.getStorageSync('currentRole') || 'parent'
  616. if (currentRole === 'child') {
  617. uni.reLaunch({ url: '/pages/home-pages/child-index' })
  618. return
  619. }
  620. if (uni.getStorageSync('token')) {
  621. this.isLoggedIn = true
  622. this.loadData()
  623. }
  624. },
  625. onPullDownRefresh() {
  626. this.loadData().finally(() => {
  627. uni.stopPullDownRefresh()
  628. })
  629. },
  630. methods: {
  631. rankIcon: function(idx) {
  632. var medals = ['🥇', '🥈', '🥉']
  633. return medals[idx] || '#' + (idx + 1)
  634. },
  635. async loadData() {
  636. this.loading = true
  637. try {
  638. var userInfo = uni.getStorageSync('userInfo')
  639. this.nickname = (userInfo && userInfo.nickname) ? userInfo.nickname : ''
  640. this.selfMemberId = uni.getStorageSync('userId') || null
  641. // 优先使用仪表盘接口(包含孩子列表 + 统计数据)
  642. let dashboardLoaded = false
  643. try {
  644. const dashRes = await getParentDashboard()
  645. const dashData = dashRes.data || {}
  646. const dashChildren = dashData.children || []
  647. // 过滤:仅保留孩子角色成员,排除家长/本人
  648. var currentUserId = uni.getStorageSync('userId')
  649. var filteredChildren = dashChildren.filter(function(c) {
  650. return c && c.id && c.id !== currentUserId && (c.role === 'child' || c.memberType === 'child')
  651. })
  652. if (filteredChildren.length > 0) {
  653. this.children = filteredChildren
  654. this.selectedChild = filteredChildren[0]
  655. this.currentChildId = filteredChildren[0].id
  656. this.familyAvgCompletionRate = dashData.avgCompletionRate || 0
  657. // 家长自身数据(积分 + 任务完成率)
  658. this.myPoints = dashData.parentPoints || 0
  659. this.myCompletionRate = dashData.parentCompletionRate || 0
  660. // 从仪表盘获取 familyId
  661. if (dashData.familyId) {
  662. this._familyId = dashData.familyId
  663. }
  664. dashboardLoaded = true
  665. }
  666. } catch (e) {
  667. console.log('获取仪表盘数据失败,降级到单独接口', e)
  668. }
  669. // 降级:使用原有单独接口
  670. if (!dashboardLoaded) {
  671. try {
  672. const currentUserId = uni.getStorageSync('userId')
  673. const membersRes = await getFamilyMembers()
  674. const data = membersRes.data || {}
  675. const parents = (data.parents || []).filter(function(p) { return p && p.id && p.id !== currentUserId }).map(function(p) { return { ...p, role: 'parent' } })
  676. const children = (data.children || []).filter(function(c) { return c && c.id }).map(function(c) { return { ...c, role: 'child' } })
  677. this.familyMembers = [].concat(parents, children)
  678. if (children.length > 0) {
  679. this.selectedChild = children[0]
  680. this.currentChildId = children[0].id
  681. }
  682. // 保存 familyId 用于后续请求
  683. if (data.familyId) {
  684. this._familyId = data.familyId
  685. }
  686. } catch (e) {
  687. console.log('获取家庭成员失败', e)
  688. }
  689. if (this.children.length === 0) {
  690. try {
  691. const childrenRes = await getChildren()
  692. const rawChildren = childrenRes.data || []
  693. this.children = rawChildren
  694. if (this.children.length > 0 && !this.selectedChild) {
  695. this.selectedChild = this.children[0]
  696. this.currentChildId = this.children[0].id
  697. }
  698. } catch (e) {
  699. console.log('获取孩子列表失败', e)
  700. }
  701. }
  702. }
  703. const reviewRes = await getPendingReviewTasks()
  704. const allReviewTasks = reviewRes.data || []
  705. this.pendingReviewTasks = allReviewTasks.slice(0, 3)
  706. try {
  707. const wishRes = await getPendingWishes(this._familyId)
  708. this.pendingReviewWishes = wishRes.data || []
  709. } catch (e) {
  710. console.log('获取待处理心愿失败', e)
  711. this.pendingReviewWishes = []
  712. }
  713. const reviewMap = {}
  714. const wishMap = {}
  715. for (let i = 0; i < allReviewTasks.length; i++) {
  716. const task = allReviewTasks[i]
  717. const cid = task.memberId || task.assigneeId
  718. if (cid) {
  719. reviewMap[cid] = (reviewMap[cid] || 0) + 1
  720. }
  721. }
  722. for (let j = 0; j < (this.pendingReviewWishes || []).length; j++) {
  723. const wish = this.pendingReviewWishes[j]
  724. const cid = wish.memberId
  725. if (cid) {
  726. wishMap[cid] = (wishMap[cid] || 0) + 1
  727. }
  728. }
  729. this.children = this.children.map(function(c) {
  730. return {
  731. ...c,
  732. pendingReviewCount: reviewMap[c.id] || 0,
  733. pendingWishCount: wishMap[c.id] || 0
  734. }
  735. })
  736. // 计算全家总积分(家长 + 所有孩子)
  737. var totalPts = this.myPoints
  738. for (var pi = 0; pi < this.children.length; pi++) {
  739. totalPts += (this.children[pi].totalPoints || 0)
  740. }
  741. this.familyTotalPoints = totalPts
  742. // 如果仪表盘未加载到数据,降级:从孩子数据取近似值
  743. if (!dashboardLoaded) {
  744. // 降级:家长积分取自己的(从缓存或API),完成率取第一个孩子的
  745. const targetChild = this.selectedChild || (this.children.length > 0 ? this.children[0] : null)
  746. if (targetChild) {
  747. try {
  748. const statsRes = await getChildCompletionStats({ memberId: targetChild.id })
  749. if (statsRes && statsRes.data) {
  750. this.myCompletionRate = statsRes.data.completionRate || 0
  751. }
  752. } catch (e) {
  753. console.log('获取个人完成率失败', e)
  754. }
  755. userInfo = uni.getStorageSync('userInfo')
  756. this.myPoints = (userInfo && userInfo.totalPoints) || 0
  757. this.familyAvgCompletionRate = this.myCompletionRate
  758. }
  759. }
  760. // 待完成任务 - 优先使用后端返回的真实任务列表
  761. this.pendingTasks = []
  762. if (this.children.length > 0) {
  763. const targetChild = this.selectedChild || this.children[0]
  764. try {
  765. const r2 = await getChildCompletionStats({ memberId: targetChild.id })
  766. if (r2 && r2.data && r2.data.pendingTaskList && r2.data.pendingTaskList.length > 0) {
  767. this.pendingTasks = r2.data.pendingTaskList.slice(0, 3)
  768. } else if (r2 && r2.data && r2.data.pendingTasks > 0) {
  769. // 降级:只有数量没有列表时使用占位
  770. for (let k = 0; k < Math.min(r2.data.pendingTasks, 3); k++) {
  771. this.pendingTasks.push({ id: 'pending-' + k, title: '待完成任务' })
  772. }
  773. }
  774. } catch (e) {
  775. this.pendingTasks = []
  776. }
  777. }
  778. // 加载家庭能量沙盘数据(五维 + 所有成员)
  779. try {
  780. const energyRes = await getFamilyEnergySandbox()
  781. this.energyData = energyRes.data || null
  782. this.sandboxData = energyRes.data || null
  783. this.hasFamilyData = !!(energyRes.data && energyRes.data.members && energyRes.data.members.length > 0)
  784. } catch (e) {
  785. console.log('获取能量沙盘数据失败', e)
  786. this.energyData = null
  787. this.errorEnergy = true
  788. }
  789. // 加载推荐活动
  790. this.loadRecommendedActivities()
  791. // 加载推荐商品
  792. this.loadRecommendedProducts()
  793. // 加载家庭成员可见列表
  794. this.loadFamilyMembersVisible()
  795. // 加载健康预警(P1-2)
  796. this.loadAlerts()
  797. // 加载家庭健康互动(P2-2)
  798. this.loadFamilyInteraction()
  799. // 加载健康圈(P3:社区扩散)
  800. this.loadHealthCircle()
  801. // 加载外部联系人
  802. this.loadContacts()
  803. // 加载推荐阅读
  804. this.loadFeaturedArticles()
  805. // 加载五维能量概览(账本模式)
  806. var overviewChildId = this.currentChildId
  807. if (overviewChildId) {
  808. try {
  809. var overviewRes = await getEnergyOverview(overviewChildId)
  810. if (overviewRes && overviewRes.data) {
  811. this.energyDimensions = overviewRes.data.dimensions || []
  812. this.totalEnergy = overviewRes.data.totalEnergy || 0
  813. this.totalHealthIndex = overviewRes.data.totalHealthIndex || 0
  814. }
  815. } catch (e) {
  816. console.log('获取能量概览失败', e)
  817. }
  818. }
  819. } catch (e) {
  820. console.error('加载数据失败', e)
  821. } finally {
  822. this.loading = false
  823. this.$emit('ready')
  824. }
  825. },
  826. async approveTask(taskId) {
  827. try {
  828. await approveTask(taskId)
  829. uni.showToast({ title: '已通过', icon: 'success' })
  830. this.loadData()
  831. } catch (e) {
  832. uni.showToast({ title: '操作失败', icon: 'none' })
  833. }
  834. },
  835. async rejectTask(taskId) {
  836. try {
  837. await rejectTask(taskId)
  838. uni.showToast({ title: '已拒绝', icon: 'success' })
  839. this.loadData()
  840. } catch (e) {
  841. uni.showToast({ title: '操作失败', icon: 'none' })
  842. }
  843. },
  844. // 加载可见家庭成员
  845. async loadFamilyMembersVisible() {
  846. try {
  847. var res = await getVisibleFamilyMembers()
  848. this.familyMembersVisible = res.data || []
  849. } catch (e) {
  850. console.log('获取可见家庭成员失败', e)
  851. this.familyMembersVisible = []
  852. }
  853. },
  854. // 成员选择
  855. goToCompletionStats() {
  856. if (this.children.length === 1) {
  857. uni.navigateTo({ url: '/pages/stats/completion-rate?memberId=' + this.children[0].id })
  858. } else {
  859. uni.navigateTo({ url: '/pages/stats/completion-rate?familyView=1' })
  860. }
  861. },
  862. onDomainClick(evt) {
  863. this.goToDomain(evt.code)
  864. },
  865. goToDomain(code) {
  866. // 跳转到能量详情页
  867. var memberId = this.currentChildId
  868. if (!memberId || !code) return
  869. uni.navigateTo({
  870. url: '/pages/energy/detail?memberId=' + memberId + '&code=' + code
  871. })
  872. },
  873. onFamilyMemberSelect(member) {
  874. this.selectedMemberId = member.id
  875. },
  876. async onFamilyMemberSwitch(member) {
  877. if (!member || !member.id) return
  878. try {
  879. var res = await switchToFamilyMember(member.id, member.source || 'family_member')
  880. if (res.code === 200 && res.data) {
  881. store.commit('switchToMember', {
  882. memberId: res.data.memberId,
  883. effectiveRole: res.data.effectiveRole
  884. })
  885. uni.showToast({ title: '已切换到' + (member.nickname || '该成员'), icon: 'success' })
  886. setTimeout(function() {
  887. uni.reLaunch({ url: '/pages/index-home/index' })
  888. }, 1000)
  889. } else {
  890. uni.showToast({ title: res.message || '切换失败', icon: 'none' })
  891. }
  892. } catch (e) {
  893. uni.showToast({ title: '切换失败', icon: 'none' })
  894. }
  895. },
  896. onMicroActionCompleted() {
  897. this.loadData()
  898. feedbackEngine.trigger('micro_action')
  899. },
  900. onDailySummaryDismiss() {
  901. // DailySummary 已关闭,无额外操作
  902. },
  903. loadAlerts: function() {
  904. var memberId = this.selectedChild && this.selectedChild.id
  905. if (!memberId) return
  906. var self = this
  907. getActiveAlerts({ memberId: memberId }).then(function(res) {
  908. if (res.code === 200) {
  909. self.healthAlerts = res.data || []
  910. }
  911. }).catch(function() {})
  912. },
  913. handleDismissAlert: function(alertId) {
  914. var self = this
  915. dismissAlert({ id: alertId }).then(function(res) {
  916. if (res.code === 200) {
  917. self.healthAlerts = self.healthAlerts.filter(function(a) { return a.id !== alertId })
  918. }
  919. }).catch(function() {})
  920. },
  921. loadFamilyInteraction: function() {
  922. var familyId = this._familyId
  923. if (!familyId) return
  924. var self = this
  925. getFamilyRanking({}).then(function(res) {
  926. if (res.code === 200 && res.data) {
  927. self.rankingMembers = res.data.members || []
  928. self.rankingTotalScore = res.data.totalScore || 0
  929. }
  930. }).catch(function() {})
  931. getChallengeList({}).then(function(res) {
  932. if (res.code === 200 && Array.isArray(res.data)) {
  933. self.activeChallenges = res.data
  934. }
  935. }).catch(function() {})
  936. },
  937. loadHealthCircle: function() {
  938. var familyId = this._familyId
  939. if (!familyId) return
  940. var self = this
  941. self.circleLoading = true
  942. getCircleRanking({}).then(function(res) {
  943. if (res.code === 200 && res.data) {
  944. self.circleName = res.data.circleName || ''
  945. self.circleRankings = res.data.rankings || []
  946. }
  947. }).catch(function() {
  948. self.circleRankings = []
  949. self.circleName = ''
  950. }).finally(function() {
  951. self.circleLoading = false
  952. })
  953. },
  954. goToHealthCircle: function() {
  955. uni.navigateTo({ url: '/pages/share/index' })
  956. },
  957. goToSelfCheck: function() {
  958. uni.navigateTo({ url: '/pages/family/self-check' })
  959. },
  960. goMemberDetail(member) {
  961. if (!member || !member.memberId) return
  962. uni.navigateTo({
  963. url: '/pages/member-detail/member-detail?memberId=' + member.memberId + '&memberType=' + (member.memberType || 'child') + '&entrySource=relation-graph'
  964. })
  965. },
  966. addTask() { uni.navigateTo({ url: '/pages/tasks/create-task' }) },
  967. goToChallengeManage() { uni.navigateTo({ url: '/pages/health/challenge-manage' }) },
  968. goToReview() { uni.navigateTo({ url: '/pages/tasks/review' }) },
  969. goToWishApprove() { uni.navigateTo({ url: '/pages/wishes/approve' }) },
  970. goToAssessmentReport() { uni.navigateTo({ url: '/pages/assessment/report' }) },
  971. goToActivities() { uni.navigateTo({ url: '/pages/activity/index' }) },
  972. goToRewards() { uni.navigateTo({ url: '/pages/rewards/rewards' }) },
  973. onFeedItemClick(item) {
  974. if (item.type === 'product') {
  975. uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + item.id })
  976. } else if (item.type === 'activity') {
  977. uni.navigateTo({ url: '/pages/activity/activity-detail/activity-detail?id=' + item.id })
  978. }
  979. },
  980. goMoreDiscover() {
  981. uni.navigateTo({ url: '/pages/discover/index' })
  982. },
  983. loadRecommendedActivities() {
  984. var self = this
  985. getActivityList({ page: 1, size: 6 }).then(function(res) {
  986. if (res && res.data) {
  987. self.recommendedActivities = res.data.records || []
  988. }
  989. }).catch(function() {
  990. self.errorActivities = true
  991. })
  992. },
  993. loadRecommendedProducts() {
  994. var self = this
  995. getProductsByDomain('all', 1, 6).then(function(res) {
  996. if (res && res.data) {
  997. self.recommendedProducts = res.data.records || []
  998. }
  999. }).catch(function() {
  1000. self.errorProducts = true
  1001. })
  1002. },
  1003. goToTaskList() { uni.navigateTo({ url: '/pages/tasks/tasks' }) },
  1004. manageChildren() { uni.navigateTo({ url: '/pages/profile-extra/family-members' }) },
  1005. loadContacts: function() {
  1006. var self = this
  1007. getContactList({}).then(function(res) {
  1008. if (res.code === 200 && res.data) {
  1009. self.contactList = Array.isArray(res.data) ? res.data : []
  1010. }
  1011. }).catch(function(e) {
  1012. console.log('获取联系人失败', e)
  1013. })
  1014. },
  1015. onContactClick: function(item) {
  1016. uni.navigateTo({ url: '/pages/action-detail/contact-detail?id=' + item.id })
  1017. },
  1018. onShowImport: function() {
  1019. this.showImportModal = true
  1020. },
  1021. onCloseImport: function() {
  1022. this.showImportModal = false
  1023. },
  1024. onImportSuccess: function() {
  1025. this.showImportModal = false
  1026. this.loadContacts()
  1027. },
  1028. // QR Code modal methods
  1029. onShowQrCodeModal: async function() {
  1030. this.showQrCodeModal = true
  1031. this.qrCodeData = null
  1032. try {
  1033. const res = await this.getInviteQrCode()
  1034. if (res.code === 200) {
  1035. this.qrCodeData = res.data
  1036. }
  1037. } catch (e) {
  1038. console.error('获取二维码失败', e)
  1039. uni.showToast({ title: '获取二维码失败', icon: 'none' })
  1040. }
  1041. },
  1042. onCloseQrCodeModal: function() {
  1043. this.showQrCodeModal = false
  1044. this.qrCodeData = null
  1045. },
  1046. onCopyReferralCode: function() {
  1047. if (this.qrCodeData && this.qrCodeData.referralCode) {
  1048. uni.setClipboardData({
  1049. data: this.qrCodeData.referralCode,
  1050. success: () => {
  1051. uni.showToast({ title: '复制成功', icon: 'success' })
  1052. }
  1053. })
  1054. }
  1055. },
  1056. // 兼容旧引用
  1057. getInviteQrCode: function() {
  1058. return getInviteQrCode()
  1059. },
  1060. // ===== 推荐阅读 =====
  1061. loadFeaturedArticles: function() {
  1062. var self = this
  1063. this.articlesLoading = true
  1064. getFeaturedArticles({ size: 5 }).then(function(res) {
  1065. self.articlesLoading = false
  1066. if (res && res.code === 200) {
  1067. var rawList = res.data && (Array.isArray(res.data) ? res.data : (res.data.data || res.data.records || []))
  1068. var list = Array.isArray(rawList) ? rawList : []
  1069. self.indexArticles = list.map(function(item, index) {
  1070. return {
  1071. id: item.id,
  1072. category: item.categoryName || item.category || '热门文章',
  1073. categoryColor: self.gradientColors[index % self.gradientColors.length],
  1074. title: item.title || '',
  1075. summary: item.summary || '',
  1076. views: item.viewCount ? String(item.viewCount) : '0',
  1077. date: item.publishedAt ? item.publishedAt.slice(0, 10) : '',
  1078. coverImage: item.coverImage
  1079. }
  1080. })
  1081. }
  1082. }).catch(function() {
  1083. self.articlesLoading = false
  1084. })
  1085. },
  1086. goArticles: function() {
  1087. uni.navigateTo({ url: '/pages/mind-detail/articles' })
  1088. },
  1089. goArticleDetail: function(articleOrId) {
  1090. var id = typeof articleOrId === 'object' ? articleOrId.id : articleOrId
  1091. uni.navigateTo({ url: '/pages/article-center/article-detail?id=' + id })
  1092. }
  1093. }
  1094. }
  1095. </script>
  1096. <style scoped>
  1097. /* ========================================
  1098. Flat Card Design System — 家长端暖橙扁平
  1099. ======================================== */
  1100. .container {
  1101. padding: 32rpx;
  1102. background: var(--bg, #F5F9FC);
  1103. min-height: 100vh;
  1104. }
  1105. /* ========================================
  1106. 区块标题
  1107. ======================================== */
  1108. .section-title {
  1109. font-size: 32rpx;
  1110. font-weight: 700;
  1111. color: var(--text, #1E293B);
  1112. margin-bottom: var(--space-md);
  1113. }
  1114. /* ========================================
  1115. c) 成长数据
  1116. ======================================== */
  1117. .stats-section {
  1118. margin-bottom: 48rpx;
  1119. }
  1120. .stats-row {
  1121. display: flex;
  1122. gap: 16rpx;
  1123. }
  1124. .stat-card-wide {
  1125. flex: 1;
  1126. min-width: 0;
  1127. box-sizing: border-box;
  1128. }
  1129. .stat-card-content {
  1130. padding: 24rpx;
  1131. }
  1132. .stat-header {
  1133. display: flex;
  1134. align-items: center;
  1135. margin-bottom: 16rpx;
  1136. }
  1137. .stat-icon-wrap {
  1138. width: 56rpx;
  1139. height: 56rpx;
  1140. border-radius: var(--radius-sm, 12rpx);
  1141. display: flex;
  1142. align-items: center;
  1143. justify-content: center;
  1144. margin-right: 14rpx;
  1145. flex-shrink: 0;
  1146. }
  1147. .stat-icon-symbol {
  1148. font-size: 28rpx;
  1149. }
  1150. .stat-icon-orange { background: rgba(91, 155, 213, 0.12); }
  1151. .stat-icon-gold { background: rgba(245, 158, 11, 0.15); }
  1152. .stat-body {
  1153. flex: 1;
  1154. min-width: 0;
  1155. }
  1156. .stat-label-header {
  1157. font-size: 26rpx;
  1158. font-weight: 600;
  1159. color: var(--text, #1E293B);
  1160. }
  1161. /* 对比行布局 */
  1162. .stat-compare {
  1163. margin-bottom: 12rpx;
  1164. }
  1165. .stat-compare-row {
  1166. display: flex;
  1167. justify-content: space-between;
  1168. align-items: center;
  1169. margin-bottom: 4rpx;
  1170. }
  1171. .compare-label {
  1172. font-size: 22rpx;
  1173. color: var(--text-secondary, #64748B);
  1174. }
  1175. .compare-value {
  1176. font-size: 30rpx;
  1177. font-weight: 700;
  1178. }
  1179. /* 进度条 - 紧凑版 */
  1180. .progress-bar-sm {
  1181. height: 6rpx;
  1182. background: var(--border-light, #E2E8F0);
  1183. border-radius: 999rpx;
  1184. overflow: hidden;
  1185. margin-bottom: 8rpx;
  1186. }
  1187. .progress-fill-sm {
  1188. height: 100%;
  1189. background: linear-gradient(90deg, var(--color-primary, #5B9BD5), #F59E0B);
  1190. border-radius: 999rpx;
  1191. transition: width 0.3s ease;
  1192. }
  1193. .progress-fill-sm.muted {
  1194. background: linear-gradient(90deg, #94A3B8, #CBD5E1);
  1195. }
  1196. .accent-color { color: var(--color-primary, #5B9BD5); }
  1197. .gold-color { color: #F59E0B; }
  1198. .stat-more {
  1199. font-size: 22rpx;
  1200. color: var(--color-accent, #0EA5E9);
  1201. font-weight: 500;
  1202. display: block;
  1203. }
  1204. .stat-encourage {
  1205. font-size: 22rpx;
  1206. color: #10B981;
  1207. font-weight: 500;
  1208. margin-top: 8rpx;
  1209. display: block;
  1210. }
  1211. .stat-encourage.muted {
  1212. color: var(--muted, #94A3B8);
  1213. }
  1214. /* ========================================
  1215. d) 今日重点
  1216. ======================================== */
  1217. .today-section {
  1218. margin-bottom: 48rpx;
  1219. }
  1220. .today-card .today-header {
  1221. display: flex;
  1222. justify-content: space-between;
  1223. align-items: center;
  1224. }
  1225. .today-label {
  1226. font-size: 28rpx;
  1227. font-weight: 600;
  1228. color: var(--text, #1E293B);
  1229. }
  1230. .today-count {
  1231. font-size: 24rpx;
  1232. color: var(--color-primary, #5B9BD5);
  1233. font-weight: 600;
  1234. }
  1235. .task-list {
  1236. margin-bottom: 8rpx;
  1237. }
  1238. .task-item {
  1239. display: flex;
  1240. align-items: center;
  1241. padding: 18rpx 0;
  1242. border-bottom: 1rpx solid var(--border-light, #E2E8F0);
  1243. }
  1244. .task-item:last-child {
  1245. border-bottom: none;
  1246. }
  1247. .task-dot {
  1248. width: 14rpx;
  1249. height: 14rpx;
  1250. border-radius: 50%;
  1251. margin-right: 16rpx;
  1252. flex-shrink: 0;
  1253. }
  1254. .dot-color-0 { background: var(--color-primary, #5B9BD5); }
  1255. .dot-color-1 { background: #10B981; }
  1256. .dot-color-2 { background: var(--color-accent, #0EA5E9); }
  1257. .dot-color-3 { background: #F59E0B; }
  1258. .dot-color-4 { background: var(--color-error, #EF4444); }
  1259. .task-title {
  1260. font-size: 28rpx;
  1261. color: var(--text, #1E293B);
  1262. }
  1263. .task-view-all {
  1264. display: flex;
  1265. justify-content: flex-end;
  1266. align-items: center;
  1267. color: var(--text-secondary, #64748B);
  1268. font-size: 24rpx;
  1269. padding-top: 16rpx;
  1270. border-top: 1rpx solid var(--border-light, #E2E8F0);
  1271. }
  1272. .task-view-all .arrow {
  1273. margin-left: 8rpx;
  1274. }
  1275. /* ========================================
  1276. e) 成长里程碑
  1277. ======================================== */
  1278. .milestone-section {
  1279. margin-bottom: 48rpx;
  1280. }
  1281. .milestone-card {
  1282. padding: 24rpx !important;
  1283. }
  1284. .milestone-item {
  1285. display: flex;
  1286. align-items: center;
  1287. padding: 16rpx 0;
  1288. border-bottom: 1rpx solid var(--border-light, #E2E8F0);
  1289. }
  1290. .milestone-item:last-child {
  1291. border-bottom: none;
  1292. }
  1293. .milestone-icon-wrap {
  1294. width: 56rpx;
  1295. height: 56rpx;
  1296. border-radius: var(--radius-sm, 12rpx);
  1297. display: flex;
  1298. align-items: center;
  1299. justify-content: center;
  1300. margin-right: 16rpx;
  1301. flex-shrink: 0;
  1302. }
  1303. .milestone-icon {
  1304. font-size: 28rpx;
  1305. }
  1306. .milestone-star { background: rgba(245, 158, 11, 0.15); }
  1307. .milestone-trophy { background: rgba(91, 155, 213, 0.12); }
  1308. .milestone-sparkle { background: rgba(16, 185, 129, 0.12); }
  1309. .milestone-text {
  1310. font-size: 28rpx;
  1311. color: var(--text, #1E293B);
  1312. }
  1313. /* ========================================
  1314. f) 待处理事项
  1315. ======================================== */
  1316. .pending-section { margin-bottom: 48rpx; }
  1317. .pending-grid {
  1318. display: flex;
  1319. flex-wrap: wrap;
  1320. gap: 16rpx;
  1321. }
  1322. .pending-card {
  1323. background: #fff;
  1324. border-radius: 20rpx;
  1325. padding: 24rpx;
  1326. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1327. display: flex;
  1328. align-items: center;
  1329. width: calc(50% - 8rpx);
  1330. box-sizing: border-box;
  1331. }
  1332. .pending-card:active { opacity: 0.8; }
  1333. .pending-icon {
  1334. width: 72rpx; height: 72rpx;
  1335. border-radius: 16rpx;
  1336. display: flex; align-items: center; justify-content: center;
  1337. margin-right: 16rpx; flex-shrink: 0;
  1338. }
  1339. .pending-icon--blue { background: rgba(91,155,213,0.12); }
  1340. .pending-icon--pink { background: rgba(236,72,153,0.12); }
  1341. .pending-icon--green { background: rgba(16,185,129,0.12); }
  1342. .pending-icon--orange { background: rgba(249,115,22,0.12); }
  1343. .pending-emoji { font-size: 32rpx; }
  1344. .pending-info { flex: 1; min-width: 0; }
  1345. .pending-count { font-size: 36rpx; font-weight: 800; display: block; }
  1346. .pending-label { font-size: 22rpx; color: #666; margin-top: 4rpx; display: block; }
  1347. .pink-color { color: #EC4899; }
  1348. .orange-color { color: #F97316; }
  1349. /* ========================================
  1350. g) 成长建议
  1351. ======================================== */
  1352. .advice-section { margin-bottom: 48rpx; }
  1353. .advice-card { margin-bottom: 12rpx; }
  1354. .advice-content {
  1355. display: flex; align-items: center; padding: 24rpx;
  1356. }
  1357. .advice-icon-wrap {
  1358. width: 56rpx; height: 56rpx;
  1359. border-radius: 14rpx;
  1360. background: rgba(91,155,213,0.1);
  1361. display: flex; align-items: center; justify-content: center;
  1362. margin-right: 16rpx; flex-shrink: 0;
  1363. }
  1364. .advice-icon { font-size: 28rpx; }
  1365. .advice-text-wrap { flex: 1; min-width: 0; }
  1366. .advice-title { font-size: 28rpx; font-weight: 600; color: #333; display: block; }
  1367. .advice-desc { font-size: 24rpx; color: #999; margin-top: 4rpx; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  1368. .advice-arrow { font-size: 36rpx; color: #ccc; margin-left: 12rpx; }
  1369. /* ========================================
  1370. h) 待审核任务
  1371. ======================================== */
  1372. .review-section {
  1373. margin-bottom: 48rpx;
  1374. }
  1375. .review-card {
  1376. margin-bottom: 16rpx;
  1377. }
  1378. .review-card:last-child {
  1379. margin-bottom: 0;
  1380. }
  1381. .review-card-content {
  1382. display: flex;
  1383. justify-content: space-between;
  1384. align-items: center;
  1385. padding: 24rpx;
  1386. }
  1387. .review-info {
  1388. flex: 1;
  1389. min-width: 0;
  1390. }
  1391. .review-info .task-name {
  1392. font-size: 28rpx;
  1393. color: var(--text, #1E293B);
  1394. display: block;
  1395. margin-bottom: 4rpx;
  1396. }
  1397. .review-info .task-child {
  1398. font-size: 22rpx;
  1399. color: var(--muted, #94A3B8);
  1400. }
  1401. .review-actions {
  1402. display: flex;
  1403. gap: 12rpx;
  1404. flex-shrink: 0;
  1405. margin-left: 16rpx;
  1406. }
  1407. /* ========================================
  1408. g) 快捷操作
  1409. ======================================== */
  1410. .quick-section {
  1411. margin-bottom: 48rpx;
  1412. }
  1413. .quick-card {
  1414. padding: 16rpx 12rpx !important;
  1415. }
  1416. .quick-actions {
  1417. display: flex;
  1418. flex-wrap: wrap;
  1419. }
  1420. .action-item {
  1421. display: flex;
  1422. flex-direction: column;
  1423. align-items: center;
  1424. width: 20%;
  1425. margin-bottom: 12rpx;
  1426. transition: transform 0.15s ease;
  1427. }
  1428. .action-item:active {
  1429. transform: scale(0.92);
  1430. }
  1431. .action-icon {
  1432. width: 80rpx;
  1433. height: 80rpx;
  1434. border-radius: var(--radius-sm, 12rpx);
  1435. display: flex;
  1436. align-items: center;
  1437. justify-content: center;
  1438. margin-bottom: 10rpx;
  1439. }
  1440. .action-icon-text {
  1441. font-size: 32rpx;
  1442. }
  1443. .act-add { background: rgba(91, 155, 213, 0.12); }
  1444. .act-review { background: rgba(16, 185, 129, 0.12); }
  1445. .act-child { background: rgba(14, 165, 233, 0.12); }
  1446. .act-reward { background: rgba(245, 158, 11, 0.15); }
  1447. .act-invite { background: rgba(139, 92, 246, 0.12); }
  1448. .action-label {
  1449. font-size: 22rpx;
  1450. color: var(--text-secondary, #64748B);
  1451. font-weight: 500;
  1452. text-align: center;
  1453. }
  1454. /* ===== Error State ===== */
  1455. .error-state {
  1456. display: flex;
  1457. align-items: center;
  1458. justify-content: center;
  1459. padding: 32rpx 24rpx;
  1460. margin-bottom: 24rpx;
  1461. background: #FFF;
  1462. border-radius: 16rpx;
  1463. border: 1rpx dashed #E2E8F0;
  1464. }
  1465. .error-state-text {
  1466. font-size: 26rpx;
  1467. color: #94A3B8;
  1468. text-align: center;
  1469. }
  1470. /* ===== 重要关系(通讯录) ===== */
  1471. .contact-section {
  1472. margin: 20rpx 20rpx 0;
  1473. }
  1474. .contact-header {
  1475. display: flex;
  1476. justify-content: space-between;
  1477. align-items: center;
  1478. margin-bottom: 16rpx;
  1479. }
  1480. .contact-section-title {
  1481. font-size: 30rpx;
  1482. font-weight: 600;
  1483. color: #333;
  1484. }
  1485. .contact-header-right {
  1486. display: flex;
  1487. gap: 16rpx;
  1488. align-items: center;
  1489. }
  1490. .contact-more {
  1491. font-size: 24rpx;
  1492. color: #999;
  1493. }
  1494. .contact-import-btn {
  1495. font-size: 24rpx;
  1496. color: #F97316;
  1497. font-weight: 500;
  1498. }
  1499. .contact-scroll {
  1500. white-space: nowrap;
  1501. overflow: hidden;
  1502. }
  1503. .contact-scroll-inner {
  1504. display: flex;
  1505. flex-direction: row;
  1506. gap: 16rpx;
  1507. padding: 8rpx 0 16rpx;
  1508. }
  1509. .contact-card-wrap {
  1510. flex-shrink: 0;
  1511. width: 220rpx;
  1512. }
  1513. .contact-card-wrap:active {
  1514. opacity: 0.8;
  1515. }
  1516. .contact-add-card {
  1517. width: 160rpx;
  1518. }
  1519. .add-card-inner {
  1520. width: 160rpx;
  1521. height: 280rpx;
  1522. background: #fff;
  1523. border-radius: 16rpx;
  1524. border: 2rpx dashed #ddd;
  1525. display: flex;
  1526. flex-direction: column;
  1527. align-items: center;
  1528. justify-content: center;
  1529. gap: 12rpx;
  1530. }
  1531. .add-card-icon {
  1532. font-size: 48rpx;
  1533. color: #ccc;
  1534. }
  1535. .add-card-label {
  1536. font-size: 22rpx;
  1537. color: #999;
  1538. }
  1539. .contact-empty {
  1540. padding: 40rpx 0;
  1541. text-align: center;
  1542. }
  1543. .contact-empty-text {
  1544. font-size: 26rpx;
  1545. color: #ccc;
  1546. }
  1547. /* ===== 推荐阅读 ===== */
  1548. .article-section {
  1549. margin-bottom: 48rpx;
  1550. }
  1551. .article-header {
  1552. display: flex;
  1553. justify-content: space-between;
  1554. align-items: center;
  1555. margin-bottom: var(--space-md);
  1556. }
  1557. .article-more {
  1558. font-size: 26rpx;
  1559. color: var(--color-primary, #F97316);
  1560. }
  1561. .article-list {
  1562. display: flex;
  1563. flex-direction: column;
  1564. gap: 16rpx;
  1565. }
  1566. .article-card {
  1567. background: #fff;
  1568. border-radius: 16rpx;
  1569. padding: 24rpx;
  1570. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1571. }
  1572. .article-card:active {
  1573. opacity: 0.8;
  1574. }
  1575. .article-category {
  1576. display: inline-block;
  1577. padding: 4rpx 14rpx;
  1578. border-radius: 8rpx;
  1579. margin-bottom: 10rpx;
  1580. }
  1581. .article-category-text {
  1582. font-size: 20rpx;
  1583. color: #fff;
  1584. }
  1585. .article-title {
  1586. display: block;
  1587. font-size: 28rpx;
  1588. font-weight: bold;
  1589. color: #333;
  1590. margin-bottom: 8rpx;
  1591. line-height: 1.4;
  1592. }
  1593. .article-summary {
  1594. display: block;
  1595. font-size: 24rpx;
  1596. color: #888;
  1597. line-height: 1.5;
  1598. margin-bottom: 12rpx;
  1599. overflow: hidden;
  1600. text-overflow: ellipsis;
  1601. display: -webkit-box;
  1602. -webkit-line-clamp: 2;
  1603. -webkit-box-orient: vertical;
  1604. }
  1605. .article-meta {
  1606. display: flex;
  1607. align-items: center;
  1608. gap: 16rpx;
  1609. }
  1610. .meta-item {
  1611. display: flex;
  1612. align-items: center;
  1613. gap: 4rpx;
  1614. }
  1615. .meta-icon {
  1616. font-size: 24rpx;
  1617. }
  1618. .meta-text {
  1619. font-size: 22rpx;
  1620. color: #999;
  1621. }
  1622. .article-date {
  1623. font-size: 22rpx;
  1624. color: #bbb;
  1625. }
  1626. /* ===== 家庭挑战区域 ===== */
  1627. .challenge-section {
  1628. margin-bottom: 28rpx;
  1629. }
  1630. .challenge-section-header {
  1631. display: flex;
  1632. justify-content: space-between;
  1633. align-items: center;
  1634. margin: 0 20rpx 12rpx;
  1635. }
  1636. .challenge-section-title {
  1637. font-size: 32rpx;
  1638. font-weight: 700;
  1639. color: #1E293B;
  1640. }
  1641. .challenge-section-action {
  1642. font-size: 24rpx;
  1643. color: #10B981;
  1644. font-weight: 600;
  1645. }
  1646. /* ===== 健康圈入口卡片(P3:社区扩散) ===== */
  1647. .circle-entry-section {
  1648. margin: 0 20rpx 28rpx 20rpx;
  1649. }
  1650. .circle-card-wide {
  1651. width: 100%;
  1652. }
  1653. .circle-card-content {
  1654. padding: 24rpx;
  1655. display: flex;
  1656. flex-direction: column;
  1657. gap: 16rpx;
  1658. }
  1659. .circle-header {
  1660. display: flex;
  1661. align-items: center;
  1662. gap: 12rpx;
  1663. }
  1664. .circle-icon-wrap {
  1665. width: 56rpx;
  1666. height: 56rpx;
  1667. border-radius: 14rpx;
  1668. background: linear-gradient(135deg, #10B981, #34D399);
  1669. display: flex;
  1670. align-items: center;
  1671. justify-content: center;
  1672. }
  1673. .circle-icon {
  1674. font-size: 28rpx;
  1675. }
  1676. .circle-header-body {
  1677. flex: 1;
  1678. }
  1679. .circle-card-title {
  1680. display: block;
  1681. font-size: 28rpx;
  1682. font-weight: 700;
  1683. color: #1E293B;
  1684. line-height: 1.4;
  1685. }
  1686. .circle-card-subtitle {
  1687. display: block;
  1688. font-size: 22rpx;
  1689. color: #6B7280;
  1690. margin-top: 2rpx;
  1691. }
  1692. .circle-ranking-preview {
  1693. background: #F0FDF4;
  1694. border-radius: 12rpx;
  1695. padding: 16rpx;
  1696. display: flex;
  1697. flex-direction: column;
  1698. gap: 10rpx;
  1699. }
  1700. .circle-rank-row {
  1701. display: flex;
  1702. align-items: center;
  1703. gap: 10rpx;
  1704. }
  1705. .circle-rank-badge {
  1706. font-size: 24rpx;
  1707. width: 40rpx;
  1708. text-align: center;
  1709. }
  1710. .circle-rank-family {
  1711. flex: 1;
  1712. font-size: 24rpx;
  1713. color: #374151;
  1714. font-weight: 500;
  1715. }
  1716. .circle-rank-score {
  1717. font-size: 24rpx;
  1718. color: #F97316;
  1719. font-weight: 600;
  1720. }
  1721. .circle-action {
  1722. display: flex;
  1723. justify-content: flex-end;
  1724. }
  1725. .circle-action-text {
  1726. font-size: 24rpx;
  1727. color: #F97316;
  1728. font-weight: 500;
  1729. }
  1730. /* 无数据:邀请加入样式 */
  1731. .circle-card-invite {
  1732. background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  1733. }
  1734. .circle-invite-content {
  1735. padding: 32rpx 24rpx;
  1736. display: flex;
  1737. flex-direction: column;
  1738. align-items: center;
  1739. gap: 12rpx;
  1740. }
  1741. .circle-invite-icon {
  1742. font-size: 48rpx;
  1743. margin-bottom: 4rpx;
  1744. }
  1745. .circle-invite-title {
  1746. font-size: 30rpx;
  1747. font-weight: 700;
  1748. color: #065F46;
  1749. }
  1750. .circle-invite-desc {
  1751. font-size: 24rpx;
  1752. color: #6B7280;
  1753. text-align: center;
  1754. line-height: 1.5;
  1755. }
  1756. .circle-invite-cta {
  1757. font-size: 26rpx;
  1758. color: #F97316;
  1759. font-weight: 600;
  1760. margin-top: 4rpx;
  1761. }
  1762. /* ===== 五维家庭自检入口卡片(P0-1/P0-2) ===== */
  1763. .selfcheck-entry-section {
  1764. margin: 0 20rpx 28rpx 20rpx;
  1765. }
  1766. .selfcheck-card-wide {
  1767. width: 100%;
  1768. }
  1769. .selfcheck-card-content {
  1770. padding: 28rpx 24rpx;
  1771. display: flex;
  1772. align-items: center;
  1773. gap: 20rpx;
  1774. }
  1775. .selfcheck-icon-wrap {
  1776. display: flex;
  1777. flex-direction: row;
  1778. align-items: center;
  1779. flex-shrink: 0;
  1780. }
  1781. .selfcheck-icon-circle {
  1782. width: 52rpx;
  1783. height: 52rpx;
  1784. border-radius: 50%;
  1785. display: flex;
  1786. align-items: center;
  1787. justify-content: center;
  1788. margin-right: -10rpx;
  1789. border: 4rpx solid #fff;
  1790. box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.12);
  1791. }
  1792. .selfcheck-icon-circle:last-child {
  1793. margin-right: 0;
  1794. }
  1795. .selfcheck-icon-char {
  1796. font-size: 24rpx;
  1797. font-weight: 700;
  1798. color: #fff;
  1799. }
  1800. .selfcheck-body {
  1801. flex: 1;
  1802. }
  1803. .selfcheck-title {
  1804. display: block;
  1805. font-size: 30rpx;
  1806. font-weight: 700;
  1807. color: #1E293B;
  1808. line-height: 1.4;
  1809. }
  1810. .selfcheck-subtitle {
  1811. display: block;
  1812. font-size: 22rpx;
  1813. color: #6B7280;
  1814. margin-top: 4rpx;
  1815. }
  1816. .selfcheck-arrow {
  1817. font-size: 30rpx;
  1818. color: #F97316;
  1819. font-weight: 600;
  1820. flex-shrink: 0;
  1821. }
  1822. /* ===== 邀请码二维码弹窗 ===== */
  1823. .qr-code-modal {
  1824. position: fixed;
  1825. top: 0;
  1826. left: 0;
  1827. width: 100%;
  1828. height: 100%;
  1829. background: rgba(0, 0, 0, 0.6);
  1830. display: flex;
  1831. align-items: center;
  1832. justify-content: center;
  1833. z-index: 1000;
  1834. padding: 40rpx 20rpx;
  1835. box-sizing: border-box;
  1836. }
  1837. .qr-code-modal-content {
  1838. background: #fff;
  1839. border-radius: 20rpx;
  1840. padding: 40rpx 32rpx;
  1841. max-width: 600rpx;
  1842. width: 100%;
  1843. box-shadow: 0 10rpx 40rpx rgba(0, 0, 0, 0.2);
  1844. position: relative;
  1845. }
  1846. .qr-code-modal-header {
  1847. display: flex;
  1848. justify-content: space-between;
  1849. align-items: center;
  1850. margin-bottom: 32rpx;
  1851. }
  1852. .qr-code-modal-title {
  1853. font-size: 36rpx;
  1854. font-weight: 700;
  1855. color: #1E293B;
  1856. }
  1857. .qr-code-modal-close {
  1858. font-size: 48rpx;
  1859. color: #94A3B8;
  1860. line-height: 1;
  1861. padding: 8rpx;
  1862. cursor: pointer;
  1863. }
  1864. .qr-code-modal-body {
  1865. display: flex;
  1866. flex-direction: column;
  1867. align-items: center;
  1868. gap: 32rpx;
  1869. }
  1870. .qr-code-image-container {
  1871. width: 280rpx;
  1872. height: 280rpx;
  1873. display: flex;
  1874. align-items: center;
  1875. justify-content: center;
  1876. background: #f9fafb;
  1877. border-radius: 16rpx;
  1878. padding: 20rpx;
  1879. }
  1880. .qr-code-image {
  1881. width: 100%;
  1882. height: 100%;
  1883. object-fit: contain;
  1884. }
  1885. .qr-code-referral-code {
  1886. display: flex;
  1887. align-items: center;
  1888. gap: 16rpx;
  1889. padding: 24rpx;
  1890. background: #f9fafb;
  1891. border-radius: 16rpx;
  1892. width: 100%;
  1893. box-sizing: border-box;
  1894. }
  1895. .qr-code-label {
  1896. font-size: 26rpx;
  1897. color: #64748b;
  1898. font-weight: 500;
  1899. }
  1900. .qr-code-code {
  1901. flex: 1;
  1902. font-size: 32rpx;
  1903. font-weight: 700;
  1904. color: #1E293B;
  1905. word-break: break-all;
  1906. letter-spacing: 2rpx;
  1907. }
  1908. .qr-code-copy {
  1909. font-size: 24rpx;
  1910. color: #F97316;
  1911. font-weight: 500;
  1912. padding: 8rpx 16rpx;
  1913. background: #fff;
  1914. border-radius: 8rpx;
  1915. border: 1px solid #F97316;
  1916. cursor: pointer;
  1917. }
  1918. .qr-code-copy:active {
  1919. opacity: 0.8;
  1920. }
  1921. </style>