profile.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675
  1. <template>
  2. <view class="container" :style="{ '--font-scale': fontScale }">
  3. <!-- 登录浮层(全局组件,页面内弹出底部登录) -->
  4. <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />
  5. <!-- 未登录 -->
  6. <view v-if="!isLoggedIn">
  7. <view class="gp-page">
  8. <!-- 登录大卡 -->
  9. <view class="gp-login">
  10. <view class="gp-logo"><view class="gp-logo-heart"></view></view>
  11. <text class="gp-login-title">登录浠艾福</text>
  12. <text class="gp-login-desc">登录后查看个人资料、管理积分与家庭。</text>
  13. <view class="gp-login-btn" @click="goLogin">
  14. <view class="gp-login-btn-ic"></view>
  15. <text class="gp-login-btn-text">登录 / 注册</text>
  16. </view>
  17. <text class="gp-skip" @click="goSkip">暂不登录,先逛逛 ›</text>
  18. </view>
  19. <!-- 登录后开启 -->
  20. <view class="gp-block">
  21. <text class="gp-tag">登录后开启</text>
  22. <view class="gp-rows">
  23. <view class="gp-row">
  24. <view class="gp-ic gp-ic-wisdom"><text class="gp-glyph">智</text></view>
  25. <view class="gp-row-info">
  26. <text class="gp-row-name">个人身份档案</text>
  27. <text class="gp-row-sub">资料、角色标签与会员状态</text>
  28. </view>
  29. <view class="gp-lock"></view>
  30. </view>
  31. <view class="gp-row">
  32. <view class="gp-ic gp-ic-action"><text class="gp-glyph">行</text></view>
  33. <view class="gp-row-info">
  34. <text class="gp-row-name">我的家庭</text>
  35. <text class="gp-row-sub">成员档案、家庭报告与关系管理</text>
  36. </view>
  37. <view class="gp-lock"></view>
  38. </view>
  39. <view class="gp-row">
  40. <view class="gp-ic gp-ic-wealth"><text class="gp-glyph">富</text></view>
  41. <view class="gp-row-info">
  42. <text class="gp-row-name">积分与能量</text>
  43. <text class="gp-row-sub">积分记录、能量数据与健康资产</text>
  44. </view>
  45. <view class="gp-lock"></view>
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 理念卡 -->
  50. <view class="gp-philosophy">
  51. <text class="gp-philosophy-title">照顾家庭,从照顾好自己开始</text>
  52. <text class="gp-philosophy-desc">你的状态,就是家的状态。先安顿好自己,才有余力温暖家人。</text>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 已登录 -->
  57. <template v-else>
  58. <!-- 退出切换 -->
  59. <view class="exit-switch" v-if="isSwitchedChild" @click="onExitSwitch">
  60. <text>🔄 退出切换</text>
  61. </view>
  62. <!-- 身份卡 -->
  63. <view class="user-card">
  64. <view class="user-card-left">
  65. <view class="avatar-wrap" @click="goToEditInfo">
  66. <image v-if="userInfo.avatar" class="avatar-img" :src="userInfo.avatar" mode="aspectFill" />
  67. <text v-else class="avatar-text">{{ nickname.charAt(0) || '👤' }}</text>
  68. </view>
  69. <view class="user-meta">
  70. <view class="user-name-row">
  71. <text class="nickname">{{ nickname || '未设置昵称' }}</text>
  72. <text v-if="roleLabel" class="role-tag">{{ roleLabel }}</text>
  73. </view>
  74. <view class="user-sub" v-if="memberLevel">
  75. <view class="level-badge" :class="'level-' + memberLevel">{{ memberLevelText }}</view>
  76. <text v-if="isLifetime" class="days-left">永久有效</text>
  77. <text v-else-if="membershipDays > 0 && membershipDays <= 30" class="days-left">剩余 {{ membershipDays }} 天</text>
  78. <view v-if="hasUpgradeSpace" class="upgrade-btn" @click="goUpgrade">
  79. <text class="upgrade-btn-text">{{ upgradeBtnText }}</text>
  80. </view>
  81. </view>
  82. <view class="user-sub" v-else>
  83. <text class="days-left">开通会员解锁更多权益</text>
  84. <view class="upgrade-btn" @click="goUpgrade">
  85. <text class="upgrade-btn-text">立即开通</text>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="user-card-right" @click="goToPoints">
  91. <text class="points-num">{{ totalPoints }}</text>
  92. <text class="points-label">积分</text>
  93. </view>
  94. </view>
  95. <!-- 团队邀请浮动按钮(纯 CSS 二维码图标):点按直接调起微信转发,不再生成海报。
  96. 用透明 <button open-type="share"> 覆盖原入口,保留既有视觉与布局,仅由原生按钮接管点击。
  97. 分享 path 由页面 onShareAppMessage 返回,直达服务角色申请表并携带本人 refCode。 -->
  98. <view class="share-qr-float">
  99. <view class="qr-glyph">
  100. <view class="qr-eye qr-eye-tl"></view>
  101. <view class="qr-eye qr-eye-tr"></view>
  102. <view class="qr-eye qr-eye-bl"></view>
  103. <view class="qr-mid"></view>
  104. <view class="qr-cluster">
  105. <view class="qr-pip"></view>
  106. <view class="qr-pip"></view>
  107. <view class="qr-pip"></view>
  108. <view class="qr-pip"></view>
  109. </view>
  110. </view>
  111. <button class="share-overlay-btn" open-type="share" @tap="ensureShareCode"></button>
  112. </view>
  113. <!-- 家族成员速览 -->
  114. <view class="family-strip" v-if="familyMembers.length > 0">
  115. <view class="family-strip-header">
  116. <text class="family-strip-title">我的家庭</text>
  117. <text class="family-strip-count">{{ familyMembers.length }} 位成员</text>
  118. </view>
  119. <view class="family-avatars">
  120. <view
  121. v-for="member in familyMembers"
  122. :key="member.id"
  123. class="family-avatar-item"
  124. @click="goMemberDetail(member)"
  125. >
  126. <view class="family-avatar-wrap">
  127. <image v-if="member.avatar" class="family-avatar-img" :src="member.avatar" mode="aspectFill" />
  128. <text v-else class="family-avatar-text">{{ member.nickname ? member.nickname.charAt(0) : '?' }}</text>
  129. <view class="family-avatar-tag" :class="'tag-' + (member.effectiveRole || member.source || 'member')">{{ member.roleLabel || memberRoleLabel(member.effectiveRole) }}</view>
  130. </view>
  131. <text class="family-avatar-name">{{ member.nickname || member.realName || '成员' }}</text>
  132. </view>
  133. <view class="family-avatar-item" @click="goToFamily">
  134. <view class="family-avatar-wrap family-avatar-add">
  135. <text class="family-avatar-plus">+</text>
  136. </view>
  137. <text class="family-avatar-name">添加</text>
  138. </view>
  139. </view>
  140. </view>
  141. <!-- 我的成就(纯成就指标) -->
  142. <view class="achievement-section">
  143. <view class="section-header-row">
  144. <text class="section-title">🏆 我的成就</text>
  145. <text class="section-sub">持续成长,看见改变</text>
  146. </view>
  147. <view class="achievement-grid cols-5">
  148. <view class="ach-item" @click="goToStreak">
  149. <view class="ach-icon-wrap" style="background:rgba(255,140,66,0.12)">
  150. <text class="ach-icon">🔥</text>
  151. </view>
  152. <text class="ach-num">{{ streakDays }}</text>
  153. <text class="ach-label">连续打卡</text>
  154. </view>
  155. <view class="ach-item" @click="goToTaskHistory">
  156. <view class="ach-icon-wrap" style="background:rgba(99,102,241,0.12)">
  157. <text class="ach-icon">✅</text>
  158. </view>
  159. <text class="ach-num">{{ completedTasks }}</text>
  160. <text class="ach-label">完成任务</text>
  161. </view>
  162. <view class="ach-item" @click="goToBadges">
  163. <view class="ach-icon-wrap" style="background:rgba(236,72,153,0.12)">
  164. <text class="ach-icon">🏅</text>
  165. </view>
  166. <text class="ach-num">{{ badgesCollected }}</text>
  167. <text class="ach-label">收集勋章</text>
  168. </view>
  169. <view class="ach-item" @click="goToGrowth">
  170. <view class="ach-icon-wrap" style="background:rgba(16,185,129,0.12)">
  171. <text class="ach-icon">📈</text>
  172. </view>
  173. <text class="ach-num">{{ growthRecords }}</text>
  174. <text class="ach-label">成长记录</text>
  175. </view>
  176. <view class="ach-item" @click="goToChallenges">
  177. <view class="ach-icon-wrap" style="background:rgba(255,107,157,0.12)">
  178. <text class="ach-icon">🎯</text>
  179. </view>
  180. <text class="ach-num">{{ challengesJoined }}</text>
  181. <text class="ach-label">参加挑战</text>
  182. </view>
  183. </view>
  184. </view>
  185. <!-- 我的团队(团队管理 + 推广收益 + 邀请成员) -->
  186. <view class="achievement-section">
  187. <view class="section-header-row">
  188. <text class="section-title">👥 我的团队</text>
  189. <text class="section-sub">团队网络与推广收益</text>
  190. </view>
  191. <view class="achievement-grid team-grid">
  192. <view class="ach-item" @click="goTeamTree">
  193. <view class="ach-icon-wrap" style="background:rgba(16,185,129,0.12)">
  194. <text class="ach-icon">🌳</text>
  195. </view>
  196. <text class="ach-num">{{ teamMembers }}</text>
  197. <text class="ach-label">我的团队</text>
  198. </view>
  199. <view class="ach-item" @click="goToWealthCenter">
  200. <view class="ach-icon-wrap" style="background:rgba(245,158,11,0.12)">
  201. <text class="ach-icon">💰</text>
  202. </view>
  203. <text class="ach-num">{{ referralEarnings }}</text>
  204. <text class="ach-label">推广收益</text>
  205. </view>
  206. <view class="ach-item ach-item-share">
  207. <view class="ach-icon-wrap" style="background:rgba(99,102,241,0.12)">
  208. <text class="ach-icon">🤝</text>
  209. </view>
  210. <text class="ach-num">+</text>
  211. <text class="ach-label">邀请成员</text>
  212. <!-- 团队邀请:透明原生分享按钮覆盖网格项,点按直接调起微信转发(不再生成海报) -->
  213. <button class="share-overlay-btn" open-type="share" @tap="ensureShareCode"></button>
  214. </view>
  215. </view>
  216. </view>
  217. <!-- 我的订单(电商风格) -->
  218. <view class="order-section">
  219. <view class="order-section-header">
  220. <text class="section-title">🛒 我的订单</text>
  221. <text class="order-all-link" @click="goToOrders">全部订单 ›</text>
  222. </view>
  223. <view class="order-card">
  224. <view class="order-grid">
  225. <view class="order-grid-item" @click="goToOrderStatus('pending')">
  226. <view class="order-icon-wrap">
  227. <text class="order-icon">💳</text>
  228. <text class="order-badge" v-if="orderPending > 0">{{ orderPending }}</text>
  229. </view>
  230. <text class="order-grid-text">待付款</text>
  231. </view>
  232. <view class="order-grid-item" @click="goToOrderStatus('paid')">
  233. <view class="order-icon-wrap">
  234. <text class="order-icon">📦</text>
  235. <text class="order-badge" v-if="orderUnpaid > 0">{{ orderUnpaid }}</text>
  236. </view>
  237. <text class="order-grid-text">待发货</text>
  238. </view>
  239. <view class="order-grid-item" @click="goToOrderStatus('shipped')">
  240. <view class="order-icon-wrap">
  241. <text class="order-icon">🚚</text>
  242. <text class="order-badge" v-if="orderShipped > 0">{{ orderShipped }}</text>
  243. </view>
  244. <text class="order-grid-text">待收货</text>
  245. </view>
  246. <view class="order-grid-item" @click="goToOrderStatus('refunding')">
  247. <view class="order-icon-wrap">
  248. <text class="order-icon">🔧</text>
  249. <text class="order-badge" v-if="orderAfterSale > 0">{{ orderAfterSale }}</text>
  250. </view>
  251. <text class="order-grid-text">售后</text>
  252. </view>
  253. <view class="order-grid-item" @click="goToOrders">
  254. <view class="order-icon-wrap">
  255. <text class="order-icon">📋</text>
  256. </view>
  257. <text class="order-grid-text">全部</text>
  258. </view>
  259. </view>
  260. <view class="order-extra-row">
  261. <view class="order-extra-item" @click="goToCart">
  262. <text class="order-extra-icon">🛒</text>
  263. <text class="order-extra-text">购物车</text>
  264. <text class="order-extra-badge" v-if="cartCount > 0">{{ cartCount > 99 ? '99+' : cartCount }}</text>
  265. </view>
  266. <view class="order-extra-divider"></view>
  267. <view class="order-extra-item" @click="goToAddress">
  268. <text class="order-extra-icon">📍</text>
  269. <text class="order-extra-text">收货地址</text>
  270. </view>
  271. </view>
  272. </view>
  273. </view>
  274. <!-- 卡券中心(我的优惠券 + 获得奖励) -->
  275. <view class="achievement-section">
  276. <view class="section-header-row">
  277. <text class="section-title">🎫 卡券中心</text>
  278. <text class="section-sub">优惠券与权益</text>
  279. </view>
  280. <view class="achievement-grid">
  281. <view class="ach-item" @click="goToCoupons">
  282. <view class="ach-icon-wrap" style="background:rgba(245,158,11,0.12)">
  283. <text class="ach-icon">🎟️</text>
  284. </view>
  285. <text class="ach-num">{{ couponCount }}</text>
  286. <text class="ach-label">我的优惠券</text>
  287. </view>
  288. <view class="ach-item" @click="goToWishes">
  289. <view class="ach-icon-wrap" style="background:rgba(245,158,11,0.12)">
  290. <text class="ach-icon">🎁</text>
  291. </view>
  292. <text class="ach-num">{{ rewardsEarned }}</text>
  293. <text class="ach-label">获得奖励</text>
  294. </view>
  295. </view>
  296. </view>
  297. <!-- 健康档案(上传报告) -->
  298. <view class="menu-row" @click="goToHealthReports">
  299. <text class="menu-row-icon">📋</text>
  300. <text class="menu-row-text">我的健康报告</text>
  301. <text class="menu-row-sub">{{ healthReports }} 份</text>
  302. <text class="menu-row-arrow">›</text>
  303. </view>
  304. <!-- 规划师服务中心入口(仅规划师可见) -->
  305. <view class="service-center-section" v-if="isTeacherUser && teacherStatus === 'approved'">
  306. <view class="service-center-card" @click="goToServiceCenter">
  307. <view class="service-center-icon">👨‍🏫</view>
  308. <view class="service-center-info">
  309. <text class="service-center-title">服务中心</text>
  310. <text class="service-center-desc">待处理任务:{{ pendingTasks }} 条 · 消息:{{ unreadMessages }} 条</text>
  311. </view>
  312. <text class="service-center-arrow">›</text>
  313. </view>
  314. </view>
  315. <!-- 规划师待审核提示 -->
  316. <view class="service-center-section" v-if="isTeacherUser && teacherStatus !== 'approved'">
  317. <view class="service-center-card disabled-card">
  318. <view class="service-center-icon">👨‍🏫</view>
  319. <view class="service-center-info">
  320. <text class="service-center-title">服务中心</text>
  321. <text class="service-center-desc">{{ teacherStatus === 'pending' ? '申请审核中,暂未开放' : teacherStatus === 'rejected' ? '申请未通过,请联系管理员' : '规划师服务' }}</text>
  322. </view>
  323. </view>
  324. </view>
  325. <!-- 设置 + 退出 -->
  326. <view class="bottom-menu-section">
  327. <view class="menu-row" v-if="memberActive" @click="goToMessageHistory">
  328. <text class="menu-row-icon">📨</text>
  329. <text class="menu-row-text">历史消息</text>
  330. <text class="menu-row-arrow">›</text>
  331. </view>
  332. <view class="menu-row" @click="goToSettings">
  333. <text class="menu-row-icon">⚙️</text>
  334. <text class="menu-row-text">设置</text>
  335. <text class="menu-row-arrow">›</text>
  336. </view>
  337. <view class="logout-btn" @click="logout">
  338. <text class="logout-text">退出登录</text>
  339. </view>
  340. </view>
  341. </template>
  342. <!-- 我的分享海报:复用文章/活动/商品同一套 ContentSharePoster 组件(canvas 绘制 + 保存到相册) -->
  343. <ContentSharePoster
  344. :show="showSharePoster"
  345. :title="shareHeadline"
  346. :energyData="posterEnergyData"
  347. :brandFallback="true"
  348. :qrCodeBase64="posterQrCode || ''"
  349. typeLabel="邀友加入"
  350. :summary="posterSummary"
  351. ctaText="长按识别二维码 · 加入浠艾福"
  352. :inviteText="posterInviteText"
  353. @close="closeSharePoster"
  354. />
  355. </view>
  356. </template>
  357. <script>
  358. import ContentSharePoster from '../../components/ContentSharePoster.vue'
  359. import {
  360. getChildren, getFamilyMemberList,
  361. getTodayTasksByCategory, getChallengeList, getMyMembership,
  362. verifyPassword, getPointsBalance, getUserInfo,
  363. cartCount, getOrderCounts, getCfSummary,
  364. getProfileStats, getMyReferrer, getVendorTeamList, getVendorHierarchyInfo, getMyCoupons,
  365. getTeacherInfo, getTeacherPendingTasks, getTeacherUnreadCount, getUserRoles,
  366. getReferralCode, extractReferralCode, getShareQrCode, getEnergySandbox,
  367. vendorStatus
  368. } from '../../utils/api.js'
  369. import { BrandColors } from '../../utils/brand-colors.js'
  370. import { isApprovedActivityProvider } from '../../utils/activity-role.js'
  371. import fontScaleMixin from '@/mixins/font-scale.js'
  372. import { isActiveMember } from '@/utils/membershipGate.js'
  373. import shareMixin from '../../components/share-mixin.js'
  374. // 团队邀请:本人推广码本地缓存 key(模块级常量,供同步分享钩子使用,不依赖组件 this)。
  375. // 与用户级 storage.refCode(被邀请人码)、记录级 storage.serviceRoleApplyRefCode 均不同,互不覆盖。
  376. var TEAM_INVITE_SHARE_CODE_KEY = 'myReferralCode'
  377. export default {
  378. mixins: [fontScaleMixin, shareMixin],
  379. components: { ContentSharePoster },
  380. data() {
  381. return {
  382. nickname: '',
  383. role: 'parent',
  384. isSwitchedChild: false,
  385. userRoles: [],
  386. isTeacherUser: false,
  387. userInfo: {},
  388. memberLevel: null,
  389. membershipDays: 0,
  390. // 会员有效态(isActive):控制「历史消息」等入口可见性,默认 false(fail-closed)
  391. memberActive: false,
  392. totalPoints: 0,
  393. referralEarnings: 0,
  394. teamMembers: 0,
  395. // 个人成就
  396. completedTasks: 0,
  397. streakDays: 0,
  398. rewardsEarned: 0,
  399. badgesCollected: 0,
  400. growthRecords: 0,
  401. challengesJoined: 0,
  402. healthReports: 0,
  403. // 家庭
  404. familyMembers: [],
  405. // 商城
  406. orderPending: 0,
  407. orderUnpaid: 0,
  408. orderShipped: 0,
  409. orderAfterSale: 0,
  410. cartCount: 0,
  411. couponCount: 0,
  412. // 待办
  413. pendingTasks: 0,
  414. unreadMessages: 0,
  415. teacherStatus: 'pending',
  416. isVendor: false,
  417. profileProgress: 0,
  418. myReferrer: null,
  419. // 分享推广码
  420. showSharePoster: false,
  421. referralCode: '',
  422. posterQrCode: '',
  423. posterEnergyData: null,
  424. referralCodeLoaded: false,
  425. // 登录态:响应式字段(非 computed)。computed 依赖非响应式的 Storage 读取,
  426. // 登录成功写入 token 后不会触发重算,导致页面仍显示登录前状态。
  427. // 改为 data 字段并在 onShow / 登录成功回调中重新赋值,登录后页面即时刷新。
  428. isLoggedIn: !!uni.getStorageSync('token'),
  429. }
  430. },
  431. computed: {
  432. roleLabel() {
  433. var map = { parent: '', child: '成员', teacher: '规划师' }
  434. return map[this.role] || '用户'
  435. },
  436. memberLevelText() {
  437. var map = { FREE: '免费用户', BASIC: '体验会员', FAMILY: '家庭会员', PREMIUM: '高级会员', LIFETIME: '终身会员' }
  438. return map[this.memberLevel] || this.memberLevel || ''
  439. },
  440. isLifetime() {
  441. return this.memberLevel === 'LIFETIME'
  442. },
  443. hasUpgradeSpace() {
  444. return this.memberLevel === 'FREE' || this.memberLevel === 'FAMILY'
  445. },
  446. upgradeBtnText() {
  447. return this.hasUpgradeSpace ? '升级' : '立即开通'
  448. },
  449. // 分享海报标题:XXX邀请你关注家庭健康(昵称过长自动截断)
  450. shareHeadline() {
  451. var name = (this.nickname || '').trim()
  452. if (!name) return '邀请你关注家庭健康'
  453. if (name.length > 8) name = name.substring(0, 8) + '…'
  454. return name + '邀请你关注家庭健康'
  455. },
  456. posterSummary() {
  457. return '身体 · 心理 · 智慧 · 行动 · 财富,一家专注全家健康的成长平台'
  458. },
  459. posterInviteText() {
  460. var name = (this.nickname || '').trim()
  461. if (!name) return '扫码加入浠艾福,一起照顾好这个家'
  462. if (name.length > 8) name = name.substring(0, 8) + '…'
  463. return '「' + name + '」邀请你加入浠艾福'
  464. }
  465. },
  466. /**
  467. * 团队邀请:页面级微信转发配置(覆盖 share-mixin.js 的同名 hook 返回值)。
  468. * 已核实 mp.runtime 的 __call_hook 按 mixin→页面顺序调用并返回最后一个 ret,
  469. * 故这里的返回值生效,mixin 的默认首页分享不再覆盖本页邀请 path。
  470. * 分享 path 直达服务角色申请表,携带本人推广码作为 refCode(用户级/记录级两级共用此码)。
  471. */
  472. onShareAppMessage() {
  473. // 同步钩子:data 未就绪时读本地缓存兜底,确保 refCode 不为空(否则推荐人丢失)
  474. var code = (this.referralCode || '') || uni.getStorageSync(TEAM_INVITE_SHARE_CODE_KEY) || ''
  475. return {
  476. title: '邀请你加入浠艾福服务团队',
  477. path: '/pages/profile/service-role-apply' + (code ? '?refCode=' + code : ''),
  478. imageUrl: '/static/logo.png'
  479. }
  480. },
  481. onShow() {
  482. // 重新读取登录态(登录浮层成功后 mixin 会触发 onShow),驱动页面切换到已登录视图
  483. this.isLoggedIn = !!uni.getStorageSync('token')
  484. if (!this.isLoggedIn) {
  485. return
  486. }
  487. // 团队邀请:进入即预热本人推广码,保证任意时刻点分享时 refCode 已就绪;
  488. // 已缓存则 loadReferralCode 内部直接复用,不重复请求。
  489. this.loadReferralCode()
  490. // 每次进入刷新会员有效态(覆盖从升级/续费页返回)
  491. this.refreshMemberActive()
  492. var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
  493. this.role = role
  494. this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
  495. this.nickname = (uni.getStorageSync('userInfo') || {}).nickname || ''
  496. // 服务商身份判断(成就区「我的团队」入口按此分发)
  497. this.checkVendorStatus()
  498. // 规划师身份探测(主角色 teacher 或 roles 含 teacher 均生效),并加载其待办/消息数据
  499. this.loadTeacherIdentity()
  500. // 主角色为 parent 时加载本人/家庭数据;教师主角色保持原逻辑(不加载家庭区块)
  501. if (role !== 'teacher') {
  502. this.loadAllData()
  503. this.loadMyReferrer()
  504. }
  505. },
  506. methods: {
  507. // 会员有效态刷新:唯一判据 /api/ai/gate 的 data.isActive(不随运营开关,fail-closed)
  508. refreshMemberActive: function() {
  509. var self = this
  510. isActiveMember().then(function(active) {
  511. self.memberActive = active
  512. })
  513. },
  514. // 服务商身份:兼容两条申请/审核链路(vendor 入驻 / 服务角色申请)
  515. // 用 isApprovedActivityProvider 统一判定,避免只认 vendorStatus 漏掉服务角色申请链路
  516. checkVendorStatus() {
  517. var self = this
  518. vendorStatus().then(function(res) {
  519. self.isVendor = isApprovedActivityProvider((res && res.data) || {})
  520. }).catch(function() {
  521. self.isVendor = false
  522. })
  523. },
  524. loadTeacherStatus() {
  525. var self = this
  526. getTeacherInfo().then(function(res) {
  527. if (res && res.code === 200 && res.data) {
  528. self.teacherStatus = res.data.verificationStatus || res.data.status || 'pending'
  529. }
  530. }).catch(function() {})
  531. },
  532. loadTeacherIdentity() {
  533. var self = this
  534. var rolesP = (typeof getUserRoles === 'function' ? getUserRoles() : Promise.resolve({ data: [] }))
  535. .catch(function() { return { data: [] } })
  536. rolesP.then(function(res) {
  537. var rolesData = (res && res.data) || []
  538. self.userRoles = Array.isArray(rolesData) ? rolesData : []
  539. uni.setStorageSync('userRoles', self.userRoles)
  540. self.isTeacherUser = self.role === 'teacher' || self.userRoles.indexOf('teacher') > -1
  541. // 仅对规划师拉取认证状态与待办/消息,避免普通家长额外请求
  542. if (self.isTeacherUser) {
  543. var teacherP = (typeof getTeacherInfo === 'function' ? getTeacherInfo() : Promise.resolve({}))
  544. .catch(function() { return {} })
  545. teacherP.then(function(tres) {
  546. var t = (tres && tres.data) || {}
  547. self.teacherStatus = t.verificationStatus || t.status || 'pending'
  548. uni.setStorageSync('teacherStatus', self.teacherStatus)
  549. if (self.teacherStatus === 'approved') {
  550. self.loadTeacherData()
  551. }
  552. })
  553. }
  554. })
  555. },
  556. loadTeacherData() {
  557. var self = this
  558. // 并行加载待处理任务和未读消息
  559. getTeacherPendingTasks().then(function(res) {
  560. if (res && res.data && Array.isArray(res.data)) {
  561. self.pendingTasks = res.data.length
  562. } else if (res && res.data && res.data.pendingCount != null) {
  563. self.pendingTasks = res.data.pendingCount
  564. } else if (res && res.data && res.data.pendingReviewTasks != null) {
  565. self.pendingTasks = res.data.pendingReviewTasks
  566. }
  567. }).catch(function() {})
  568. getTeacherUnreadCount().then(function(res) {
  569. if (res && res.data != null) {
  570. self.unreadMessages = res.data
  571. }
  572. }).catch(function() {})
  573. },
  574. loadAllData() {
  575. this.loadUserInfo()
  576. this.loadMembership()
  577. this.loadPoints()
  578. this.loadFamily()
  579. this.loadTasks()
  580. this.loadChallenges()
  581. this.loadOrderCounts()
  582. this.loadCartCount()
  583. this.loadProfileStats()
  584. this.loadReferralEarnings()
  585. this.loadTeamInfo()
  586. this.loadCoupons()
  587. },
  588. loadUserInfo() {
  589. var self = this
  590. getUserInfo().then(function(res) {
  591. if (res && res.code === 200 && res.data) {
  592. self.userInfo = res.data
  593. if (!self.nickname) self.nickname = res.data.nickname || ''
  594. }
  595. }).catch(function() {})
  596. },
  597. loadMembership() {
  598. var self = this
  599. getMyMembership().then(function(res) {
  600. if (res && res.data) {
  601. self.memberLevel = res.data.memberLevel || res.data.levelCode || null
  602. self.membershipDays = res.data.membershipDays || res.data.daysRemaining || 0
  603. }
  604. }).catch(function() {})
  605. },
  606. loadPoints() {
  607. // 累计积分由 loadProfileStats 汇总家庭成员积分,此处不再单独覆盖
  608. },
  609. loadFamily() {
  610. var self = this
  611. getFamilyMemberList({ visibleOnly: true }).then(function(res) {
  612. var data = res && res.data ? res.data : []
  613. self.familyMembers = Array.isArray(data) ? data : []
  614. }).catch(function() {
  615. self.familyMembers = []
  616. })
  617. },
  618. loadTasks() {
  619. var self = this
  620. var memberId = uni.getStorageSync('currentChildId') || uni.getStorageSync('userId')
  621. if (!memberId) return
  622. getTodayTasksByCategory(memberId, 'action').then(function(res) {
  623. if (res && res.data) {
  624. self.pendingTasks = Array.isArray(res.data) ? res.data.length : 0
  625. }
  626. }).catch(function() {})
  627. // fallback to storage
  628. if (!self.pendingTasks) {
  629. self.pendingTasks = parseInt(uni.getStorageSync('pendingTaskCount') || 0)
  630. }
  631. },
  632. loadChallenges() {
  633. var self = this
  634. getChallengeList({}).then(function(res) {
  635. if (res && res.data) {
  636. // 不在此处使用,仅确保请求
  637. }
  638. }).catch(function() {})
  639. },
  640. loadOrderCounts() {
  641. var self = this
  642. getOrderCounts().then(function(res) {
  643. if (res && res.data) {
  644. self.orderPending = res.data.pending || 0
  645. self.orderUnpaid = res.data.paid || 0
  646. self.orderShipped = res.data.shipped || 0
  647. self.orderAfterSale = res.data.refunding || 0
  648. }
  649. }).catch(function() {})
  650. },
  651. loadCartCount() {
  652. var self = this
  653. cartCount().then(function(res) {
  654. if (res && res.data != null) {
  655. self.cartCount = res.data || 0
  656. }
  657. }).catch(function() {})
  658. },
  659. loadProfileStats() {
  660. var self = this
  661. getProfileStats().then(function(res) {
  662. if (res && res.code === 200 && res.data) {
  663. var d = res.data
  664. if (d.totalPoints != null) self.totalPoints = d.totalPoints
  665. if (d.streakDays != null) self.streakDays = d.streakDays
  666. if (d.completedTasks != null) self.completedTasks = d.completedTasks
  667. if (d.rewardsEarned != null) self.rewardsEarned = d.rewardsEarned
  668. if (d.badgesCollected != null) self.badgesCollected = d.badgesCollected
  669. if (d.growthRecords != null) self.growthRecords = d.growthRecords
  670. if (d.challengesJoined != null) self.challengesJoined = d.challengesJoined
  671. if (d.healthReports != null) self.healthReports = d.healthReports
  672. }
  673. }).catch(function() {})
  674. },
  675. loadReferralEarnings() {
  676. var self = this
  677. // CF 总览口径:与推广中心 promotion/index.vue 收益总览("累计获取CF")保持一致。
  678. // promotion 用 cfVal(summary.totalEarned) 直接展示原始值(cfVal 不做分→元换算),
  679. // 因此这里也不除 100,保证"我的团队"推广收益 = 推广中心"累计获取CF"数字一致。
  680. getCfSummary().then(function(res) {
  681. if (res && res.code === 200 && res.data) {
  682. self.referralEarnings = res.data.totalEarned || 0
  683. }
  684. }).catch(function() {})
  685. },
  686. loadTeamInfo() {
  687. var self = this
  688. getVendorTeamList().then(function(res) {
  689. var teams = (res && res.data) || []
  690. if (!teams.length) {
  691. self.teamMembers = 0
  692. return
  693. }
  694. var reqs = teams.map(function(t) {
  695. return getVendorHierarchyInfo(t.id).then(function(h) {
  696. return (h && h.data && h.data.totalChildren) || 0
  697. }).catch(function() {
  698. return 0
  699. })
  700. })
  701. Promise.all(reqs).then(function(counts) {
  702. self.teamMembers = counts.reduce(function(a, b) { return a + b }, 0)
  703. }).catch(function() {
  704. self.teamMembers = 0
  705. })
  706. }).catch(function() {
  707. self.teamMembers = 0
  708. })
  709. },
  710. loadCoupons() {
  711. var self = this
  712. getMyCoupons().then(function(res) {
  713. if (res && res.code === 200 && res.data) {
  714. var list = Array.isArray(res.data) ? res.data : (res.data.list || [])
  715. self.couponCount = list.length
  716. }
  717. }).catch(function() {})
  718. },
  719. async loadMyReferrer() {
  720. try {
  721. var memberId = uni.getStorageSync('currentMemberId') || uni.getStorageSync('currentChildId') || 0
  722. var res = await getMyReferrer(memberId)
  723. if (res && res.code === 200 && res.data && res.data.hasReferrer) {
  724. this.myReferrer = res.data
  725. }
  726. } catch (e) {
  727. console.error('获取推荐人失败', e)
  728. }
  729. },
  730. // ===== 分享海报(复用 ContentSharePoster,与文章/活动/商品同一套生成逻辑)=====
  731. async showShareQr() {
  732. uni.showLoading({ title: '生成海报中...' })
  733. try {
  734. if (!this.referralCodeLoaded) {
  735. await this.loadReferralCode()
  736. }
  737. var scene = 'ref=' + (this.referralCode || '')
  738. if (scene.length > 32) {
  739. scene = scene.substring(0, 32)
  740. }
  741. // 首页路径,扫码后进入首页并绑定推荐人
  742. // 注意:微信 getwxacodeunlimit 的 page 不能带前导斜杠,否则报 errcode 41030 invalid page rid
  743. var res = await getShareQrCode('pages/index-home/index', scene)
  744. if (res && res.code === 200 && res.data && res.data.qrCodeBase64) {
  745. this.posterQrCode = res.data.qrCodeBase64
  746. // 必须在 showSharePoster=true 之前取到数据:组件 watch 到 show 后 300ms 即开始绘制
  747. await this.loadPosterEnergy()
  748. this.showSharePoster = true
  749. } else {
  750. uni.showToast({ title: '生成失败,请重试', icon: 'none' })
  751. }
  752. } catch (e) {
  753. console.error('生成分享海报失败', e)
  754. uni.showToast({ title: '生成失败,请重试', icon: 'none' })
  755. } finally {
  756. uni.hideLoading()
  757. }
  758. },
  759. closeSharePoster() {
  760. this.showSharePoster = false
  761. },
  762. // 五维能量数据卡数据(方案C):家庭聚合视角;未解锁全景/取数失败时置空,海报降级为品牌卡
  763. loadPosterEnergy() {
  764. var self = this
  765. return getEnergySandbox('family').then(function(res) {
  766. self.posterEnergyData = self.mapPosterEnergy(res)
  767. }).catch(function(e) {
  768. console.error('获取五维能量失败,海报降级为品牌卡', e)
  769. self.posterEnergyData = null
  770. })
  771. },
  772. mapPosterEnergy(res) {
  773. if (!res || res.code !== 200 || !res.data) return null
  774. // locked=true 表示用户未解锁全景,此时不展示任何数据,改为品牌卡
  775. if (res.data.locked) return null
  776. // 只认家庭聚合视角;仅当接口返回的是裸 DTO(无 personalData/familyData 包装)时才直接取 res.data
  777. var d = res.data.familyData || null
  778. if (!d) {
  779. if (res.data.personalData) return null
  780. d = res.data
  781. }
  782. if (!d || typeof d !== 'object') return null
  783. var defs = [
  784. { key: 'body', label: '身', color: BrandColors.body },
  785. { key: 'mind', label: '心', color: BrandColors.mind },
  786. { key: 'wisdom', label: '智', color: BrandColors.wisdom },
  787. { key: 'action', label: '行', color: BrandColors.action },
  788. { key: 'wealth', label: '富', color: BrandColors.wealth }
  789. ]
  790. var dims = []
  791. var sum = 0
  792. for (var i = 0; i < defs.length; i++) {
  793. var raw = d[defs[i].key + 'Score']
  794. if (raw === null || raw === undefined || raw === '' || isNaN(raw)) continue
  795. var n = Number(raw)
  796. if (n < 0) n = 0
  797. if (n > 100) n = 100
  798. sum += n
  799. dims.push({ key: defs[i].key, label: defs[i].label, score: n, color: defs[i].color })
  800. }
  801. if (dims.length === 0) return null
  802. var overall = d.overallScore
  803. if (overall === null || overall === undefined || overall === '' || isNaN(overall)) {
  804. overall = Math.round(sum / dims.length)
  805. }
  806. return { label: '我们家的能量', overall: Number(overall), dims: dims }
  807. },
  808. async loadReferralCode() {
  809. if (this.referralCodeLoaded) return
  810. var self = this
  811. try {
  812. var res = await getReferralCode()
  813. self.referralCode = extractReferralCode(res) || ''
  814. // 团队邀请:写本地缓存,供同步 onShareAppMessage 在 data 尚未就绪时兜底读,保证 refCode 非空
  815. if (self.referralCode) {
  816. uni.setStorageSync(TEAM_INVITE_SHARE_CODE_KEY, self.referralCode)
  817. }
  818. } catch (e) {
  819. console.error('获取推广码失败', e)
  820. } finally {
  821. self.referralCodeLoaded = true
  822. }
  823. },
  824. // 团队邀请:分享按钮点按时的前置兜底。onShow 已预热缓存,这里再确保一次:
  825. // 若本地无码且 data 也为空(如冷启动首帧即点),因 onShareAppMessage 是同步钩子无法 await,
  826. // 只能提示用户「请稍候重试」——但正常路径 onShow 预热已完成,此分支仅为极端时序保险。
  827. ensureShareCode() {
  828. var code = (this.referralCode || '') || uni.getStorageSync(TEAM_INVITE_SHARE_CODE_KEY) || ''
  829. if (!code) {
  830. uni.showToast({ title: '邀请码准备中,请稍候重试', icon: 'none' })
  831. this.loadReferralCode()
  832. }
  833. },
  834. goToServiceCenter() {
  835. uni.navigateTo({ url: '/pages/service-center/index' })
  836. },
  837. goTeamTree() {
  838. // 服务商 → 服务商团队;非服务商 → 引导申请
  839. if (this.isVendor) {
  840. uni.navigateTo({ url: '/pages/vendor/team-system/team-system' })
  841. return
  842. }
  843. uni.showModal({
  844. title: '提示',
  845. content: '您尚未申请任何服务角色,是否立即申请?',
  846. confirmText: '去申请',
  847. cancelText: '取消',
  848. success: function(res) {
  849. if (res.confirm) {
  850. uni.navigateTo({ url: '/pages/profile/service-role-apply' })
  851. }
  852. }
  853. })
  854. },
  855. goLogin: function() {
  856. this.openLoginSheet()
  857. },
  858. // 登录浮层成功回调:立即切换到已登录视图并刷新个人资料与登录后数据
  859. onLoginSuccess: function() {
  860. this.isLoggedIn = true
  861. if (this.loadUserInfo) this.loadUserInfo()
  862. },
  863. goSkip: function() {
  864. uni.switchTab({ url: '/pages/index-home/index' })
  865. },
  866. goToEditInfo: function() {
  867. uni.navigateTo({ url: '/pages/user-edit/user-edit' })
  868. },
  869. goToPoints: function() {
  870. uni.navigateTo({ url: '/pages/points/points' })
  871. },
  872. goToStreak: function() {
  873. var memberId = uni.getStorageSync('currentMemberId') || uni.getStorageSync('currentChildId')
  874. var url = '/pages/stats/completion-rate'
  875. if (memberId) {
  876. url += '?memberId=' + memberId
  877. } else {
  878. url += '?familyView=1'
  879. }
  880. uni.navigateTo({ url: url })
  881. },
  882. goToTasks: function() {
  883. uni.navigateTo({ url: '/pages/tasks/tasks' })
  884. },
  885. goToTaskHistory: function() {
  886. uni.navigateTo({ url: '/pages/tasks/history' })
  887. },
  888. goToWishes: function() {
  889. uni.navigateTo({ url: '/pages/wishes/index' })
  890. },
  891. goToBadges: function() {
  892. uni.navigateTo({ url: '/pages/rewards/badge' })
  893. },
  894. goToGrowth: function() {
  895. uni.navigateTo({ url: '/pages/growth/history' })
  896. },
  897. goToChallenges: function() {
  898. uni.navigateTo({ url: '/pages/health/challenge-manage' })
  899. },
  900. goToHealthReports: function() {
  901. uni.navigateTo({ url: '/pages/health/report-list' })
  902. },
  903. goToWealthCenter: function() {
  904. uni.navigateTo({ url: '/pages/promotion/index' })
  905. },
  906. goToCoupons: function() {
  907. uni.navigateTo({ url: '/pages/profile-extra/coupons' })
  908. },
  909. goUpgrade: function() {
  910. uni.navigateTo({ url: '/pages/membership/upgrade' })
  911. },
  912. goToFamily: function() {
  913. uni.navigateTo({ url: '/pages/profile-extra/family-members' })
  914. },
  915. goMemberDetail: function(member) {
  916. uni.navigateTo({ url: '/pages/home-pages/member-home-detail?memberId=' + member.id })
  917. },
  918. goToAppointments: function() {
  919. uni.navigateTo({ url: '/pages/parent/appointments' })
  920. },
  921. goToOrders: function() {
  922. uni.navigateTo({ url: '/pages/shop/order-list/order-list' })
  923. },
  924. goToOrderStatus: function(status) {
  925. uni.navigateTo({ url: '/pages/shop/order-list/order-list?status=' + status })
  926. },
  927. goToCart: function() {
  928. uni.navigateTo({ url: '/pages/shop/cart/cart' })
  929. },
  930. goToAddress: function() {
  931. uni.navigateTo({ url: '/pages/shop/address/address' })
  932. },
  933. goToMessageHistory: function() {
  934. uni.navigateTo({ url: '/pages/profile/message-history' })
  935. },
  936. goToSettings: function() {
  937. uni.showActionSheet({
  938. itemList: ['完善信息', '家庭成员', '隐私政策', '用户协议', '我的画像', '提醒设置'],
  939. success: function(res) {
  940. var urls = {
  941. 0: '/pages/user-edit/user-edit',
  942. 1: '/pages/profile-extra/family-members',
  943. 2: '/pages/policy/privacy',
  944. 3: '/pages/policy/agreement',
  945. 4: '/pages/profile/portrait-edit',
  946. 5: '/pages/reminder-config/index'
  947. }
  948. if (urls[res.tapIndex]) {
  949. uni.navigateTo({ url: urls[res.tapIndex] })
  950. }
  951. }
  952. })
  953. },
  954. memberRoleLabel: function(role) {
  955. var map = { parent: '本人', child: '成员', teacher: '规划师' }
  956. return map[role] || '成员'
  957. },
  958. onExitSwitch: function() {
  959. var self = this
  960. uni.showModal({
  961. title: '退出切换',
  962. content: '请输入家庭主账号密码以确认退出',
  963. editable: true,
  964. success: function(res) {
  965. if (res.confirm && res.content) {
  966. verifyPassword(res.content).then(function(result) {
  967. if (result.code === 200) {
  968. self.$store.commit('switchBackToParent')
  969. self.isSwitchedChild = false
  970. self.role = 'parent'
  971. uni.showToast({ title: '已退出切换', icon: 'success' })
  972. uni.reLaunch({ url: '/pages/index-home/index' })
  973. } else {
  974. uni.showToast({ title: '密码错误', icon: 'none' })
  975. }
  976. }).catch(function() {
  977. uni.showToast({ title: '验证失败', icon: 'none' })
  978. })
  979. }
  980. }
  981. })
  982. },
  983. logout: function() {
  984. uni.showModal({
  985. title: '确认退出',
  986. content: '确定要退出登录吗?',
  987. success: function(res) {
  988. if (res.confirm) {
  989. this.$store.commit('logout')
  990. uni.reLaunch({ url: '/pages/index-home/index' })
  991. }
  992. }.bind(this)
  993. })
  994. }
  995. }
  996. }
  997. </script>
  998. <style scoped lang="scss">
  999. // ===== 页面级局部调色板(单页专有色阶;同值才映射全局令牌,约定见 uni.scss §14) =====
  1000. $c-text-gray-400: $facade-text-gray-400;
  1001. $c-fill-2b: #F2F2F2;
  1002. .container {
  1003. min-height: 100vh;
  1004. background: $facade-fill-warm-gray;
  1005. padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
  1006. }
  1007. /* ===== 访客态(新暖调配色 · 令牌化) ===== */
  1008. $gp-white: str-slice('#{$app-surface}', 2);
  1009. $gp-brand-hex: '#{$brand-primary}';
  1010. $gp-brand: str-slice($gp-brand-hex, 2);
  1011. $gp-ghost-hex: '#{$facade-text-ghost}';
  1012. $gp-ghost: str-slice($gp-ghost-hex, 2);
  1013. .gp-page { background: $app-bg; min-height: 100vh; padding: 28rpx 0 40rpx; }
  1014. /* 登录大卡 */
  1015. .gp-login { margin: 0 32rpx 24rpx; background: $app-surface; border-radius: 24rpx; padding: 48rpx 32rpx 40rpx; border: 1rpx solid $app-border-subtle; display: flex; flex-direction: column; align-items: center; box-shadow: 0 8rpx 24rpx rgba($brand-primary, 0.06); }
  1016. .gp-logo { width: 112rpx; height: 112rpx; border-radius: 28rpx; background: linear-gradient(135deg, $brand-primary, $brand-primary-dark); display: flex; flex-direction: row; align-items: center; justify-content: center; box-shadow: 0 8rpx 20rpx rgba($brand-primary, 0.22); }
  1017. .gp-logo-heart {
  1018. width: 56rpx; height: 56rpx;
  1019. background-repeat: no-repeat;
  1020. background-position: center;
  1021. background-size: 56rpx 56rpx;
  1022. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23#{$gp-white}' d='M12 20.6 4.6 13.2a4.8 4.8 0 0 1 6.8-6.8l.6.6.6-.6a4.8 4.8 0 0 1 6.8 6.8z'/%3E%3C/svg%3E");
  1023. }
  1024. .gp-login-title { font-size: calc(38rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; margin-top: 24rpx; }
  1025. .gp-login-desc { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 12rpx; text-align: center; }
  1026. .gp-login-btn { margin-top: 32rpx; width: 100%; display: flex; flex-direction: row; align-items: center; justify-content: center; padding: 26rpx 0; border-radius: 999rpx; background: linear-gradient(135deg, $brand-primary, $brand-primary-dark); box-shadow: 0 10rpx 24rpx rgba($brand-primary, 0.22); }
  1027. .gp-login-btn:active { opacity: 0.9; }
  1028. .gp-login-btn-ic {
  1029. width: 36rpx; height: 36rpx; flex-shrink: 0;
  1030. background-repeat: no-repeat;
  1031. background-position: center;
  1032. background-size: 36rpx 36rpx;
  1033. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23#{$gp-white}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M4.8 20.4a7.2 7.2 0 0 1 14.4 0'/%3E%3C/svg%3E");
  1034. }
  1035. .gp-login-btn-text { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 600; color: $app-surface; margin-left: 12rpx; }
  1036. .gp-skip { font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-muted; margin-top: 24rpx; }
  1037. /* 登录后开启 */
  1038. .gp-block { margin: 0 32rpx 24rpx; background: $app-surface; border-radius: 24rpx; padding: 24rpx; border: 1rpx solid $app-border-subtle; }
  1039. .gp-tag { font-size: calc(24rpx * var(--font-scale, 1)); font-weight: 700; color: $brand-primary; letter-spacing: 1rpx; }
  1040. .gp-rows { margin-top: 8rpx; display: flex; flex-direction: column; }
  1041. .gp-row { display: flex; flex-direction: row; align-items: center; padding: 20rpx 0; border-top: 1rpx solid $app-border-subtle; }
  1042. .gp-row:first-child { border-top: none; }
  1043. .gp-ic { width: 76rpx; height: 76rpx; border-radius: 20rpx; display: flex; flex-direction: row; align-items: center; justify-content: center; flex-shrink: 0; }
  1044. .gp-ic-wisdom { background: $dim-wisdom-tint; }
  1045. .gp-ic-action { background: $dim-action-tint; }
  1046. .gp-ic-wealth { background: $dim-wealth-tint; }
  1047. .gp-glyph { font-size: calc(30rpx * var(--font-scale, 1)); font-weight: 700; }
  1048. .gp-ic-wisdom .gp-glyph { color: $dim-wisdom-deep; }
  1049. .gp-ic-action .gp-glyph { color: $dim-action-deep; }
  1050. .gp-ic-wealth .gp-glyph { color: $dim-wealth-deep; }
  1051. .gp-row-info { flex: 1; min-width: 0; margin-left: 20rpx; display: flex; flex-direction: column; }
  1052. .gp-row-name { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 600; color: $facade-text-strong; }
  1053. .gp-row-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: $facade-text-body; margin-top: 6rpx; }
  1054. .gp-lock {
  1055. width: 32rpx; height: 32rpx; flex-shrink: 0; margin-left: 12rpx;
  1056. background-repeat: no-repeat;
  1057. background-position: center;
  1058. background-size: 32rpx 32rpx;
  1059. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23#{$gp-ghost}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10' width='16' height='10.5' rx='2.5'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  1060. }
  1061. /* 理念卡 */
  1062. .gp-philosophy { margin: 0 32rpx 8rpx; background: $facade-brand-tint; border-radius: 24rpx; padding: 28rpx 24rpx; border-left: 6rpx solid $brand-primary; }
  1063. .gp-philosophy-title { display: block; font-size: calc(28rpx * var(--font-scale, 1)); font-weight: 700; color: $facade-text-strong; }
  1064. .gp-philosophy-desc { display: block; font-size: calc(24rpx * var(--font-scale, 1)); color: $facade-text-body; line-height: 1.65; margin-top: 10rpx; }
  1065. /* 退出切换 */
  1066. .exit-switch {
  1067. margin: 0 $uni-space-lg 16rpx;
  1068. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  1069. color: $app-surface;
  1070. padding: 16rpx;
  1071. border-radius: 16rpx;
  1072. text-align: center;
  1073. font-size: calc(26rpx * var(--font-scale, 1));
  1074. }
  1075. /* 身份卡 */
  1076. .user-card {
  1077. margin: 24rpx $uni-space-lg 20rpx;
  1078. background: linear-gradient(135deg, $brand-primary 0%, $brand-primary-light 100%);
  1079. border-radius: 24rpx;
  1080. padding: 32rpx 32rpx;
  1081. display: flex;
  1082. justify-content: space-between;
  1083. align-items: center;
  1084. box-shadow: 0 8rpx 32rpx rgba($accent-indigo, 0.3);
  1085. }
  1086. .user-card-left {
  1087. display: flex;
  1088. align-items: center;
  1089. flex: 1;
  1090. }
  1091. .avatar-wrap {
  1092. width: 100rpx;
  1093. height: 100rpx;
  1094. border-radius: 50%;
  1095. background: rgba($app-surface, 0.2);
  1096. display: flex;
  1097. align-items: center;
  1098. justify-content: center;
  1099. margin-right: 20rpx;
  1100. overflow: hidden;
  1101. border: 3rpx solid rgba($app-surface, 0.3);
  1102. }
  1103. .avatar-img {
  1104. width: 100rpx;
  1105. height: 100rpx;
  1106. border-radius: 50%;
  1107. }
  1108. .avatar-text {
  1109. font-size: calc(44rpx * var(--font-scale, 1));
  1110. color: $app-surface;
  1111. }
  1112. .user-meta { flex: 1; }
  1113. .user-name-row {
  1114. display: flex;
  1115. align-items: center;
  1116. gap: 12rpx;
  1117. margin-bottom: 8rpx;
  1118. }
  1119. .nickname {
  1120. font-size: calc(34rpx * var(--font-scale, 1));
  1121. font-weight: bold;
  1122. color: $app-surface;
  1123. }
  1124. .role-tag {
  1125. font-size: calc(20rpx * var(--font-scale, 1));
  1126. background: rgba($app-surface, 0.2);
  1127. color: $app-surface;
  1128. padding: 4rpx 14rpx;
  1129. border-radius: 24rpx;
  1130. }
  1131. .referrer-line {
  1132. font-size: calc(24rpx * var(--font-scale, 1));
  1133. color: rgba($app-surface, 0.7);
  1134. margin-bottom: 6rpx;
  1135. }
  1136. .user-sub {
  1137. display: flex;
  1138. align-items: center;
  1139. gap: 12rpx;
  1140. }
  1141. .level-badge {
  1142. font-size: calc(22rpx * var(--font-scale, 1));
  1143. padding: 6rpx 20rpx;
  1144. border-radius: 24rpx;
  1145. font-weight: bold;
  1146. border: 2rpx solid rgba($app-surface, 0.35);
  1147. display: flex;
  1148. align-items: center;
  1149. gap: 6rpx;
  1150. box-sizing: border-box;
  1151. height: 40rpx;
  1152. }
  1153. .level-badge::before {
  1154. content: '👑';
  1155. font-size: calc(18rpx * var(--font-scale, 1));
  1156. }
  1157. .level-FREE { background: linear-gradient(135deg, $c-text-gray-400, $facade-text-slate); color: $app-surface; }
  1158. .level-FREE::before { content: ''; }
  1159. .level-FAMILY { background: linear-gradient(135deg, $dim-wealth, $status-warning-deep); color: $app-surface; }
  1160. .level-PREMIUM { background: linear-gradient(135deg, $dim-wisdom, $dim-wisdom-deep); color: $app-surface; }
  1161. .level-LIFETIME {
  1162. background: linear-gradient(135deg, $accent-pink, $accent-pink-deep);
  1163. color: $app-surface;
  1164. box-shadow: 0 4rpx 16rpx rgba($accent-pink, 0.45);
  1165. border-color: rgba($app-surface, 0.55);
  1166. }
  1167. .days-left {
  1168. font-size: calc(20rpx * var(--font-scale, 1));
  1169. color: rgba($app-surface, 0.85);
  1170. }
  1171. .upgrade-btn {
  1172. background: rgba($app-surface, 0.22);
  1173. border: 2rpx solid rgba($app-surface, 0.6);
  1174. border-radius: 24rpx;
  1175. padding: 6rpx 20rpx;
  1176. flex-shrink: 0;
  1177. box-sizing: border-box;
  1178. height: 40rpx;
  1179. display: flex;
  1180. align-items: center;
  1181. }
  1182. .upgrade-btn-text {
  1183. font-size: calc(20rpx * var(--font-scale, 1));
  1184. font-weight: bold;
  1185. color: $app-surface;
  1186. line-height: 1;
  1187. }
  1188. .user-card-right {
  1189. display: flex;
  1190. flex-direction: column;
  1191. align-items: center;
  1192. gap: 6rpx;
  1193. background: rgba($app-surface, 0.15);
  1194. padding: 12rpx 24rpx;
  1195. border-radius: 16rpx;
  1196. }
  1197. .points-num {
  1198. font-size: calc(36rpx * var(--font-scale, 1));
  1199. font-weight: bold;
  1200. color: $app-surface;
  1201. }
  1202. .points-label {
  1203. font-size: calc(20rpx * var(--font-scale, 1));
  1204. color: rgba($app-surface, 0.7);
  1205. }
  1206. /* 家庭成员速览 */
  1207. .family-strip {
  1208. margin: 0 $uni-space-lg 20rpx;
  1209. background: $app-surface;
  1210. border-radius: 24rpx;
  1211. padding: 20rpx 24rpx 16rpx;
  1212. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1213. }
  1214. .family-strip-header {
  1215. display: flex;
  1216. justify-content: space-between;
  1217. align-items: center;
  1218. margin-bottom: 14rpx;
  1219. }
  1220. .family-strip-title {
  1221. font-size: calc(26rpx * var(--font-scale, 1));
  1222. font-weight: bold;
  1223. color: $facade-text-strong;
  1224. }
  1225. .family-strip-count {
  1226. font-size: calc(22rpx * var(--font-scale, 1));
  1227. color: $facade-text-muted;
  1228. }
  1229. .family-avatars {
  1230. display: flex;
  1231. flex-direction: row;
  1232. align-items: center;
  1233. gap: 16rpx;
  1234. overflow-x: auto;
  1235. padding-bottom: 4rpx;
  1236. }
  1237. .family-avatar-item {
  1238. display: flex;
  1239. flex-direction: column;
  1240. align-items: center;
  1241. gap: 6rpx;
  1242. flex-shrink: 0;
  1243. }
  1244. .family-avatar-wrap {
  1245. width: 72rpx;
  1246. height: 72rpx;
  1247. border-radius: 50%;
  1248. background: $facade-fill;
  1249. display: flex;
  1250. align-items: center;
  1251. justify-content: center;
  1252. overflow: hidden;
  1253. position: relative;
  1254. }
  1255. .family-avatar-img {
  1256. width: 72rpx;
  1257. height: 72rpx;
  1258. border-radius: 50%;
  1259. }
  1260. .family-avatar-text {
  1261. font-size: calc(28rpx * var(--font-scale, 1));
  1262. color: $facade-text-body;
  1263. }
  1264. .family-avatar-wrap.family-avatar-add {
  1265. background: $facade-fill-warm-gray;
  1266. border: 2rpx dashed $facade-text-ghost;
  1267. }
  1268. .family-avatar-plus {
  1269. font-size: calc(36rpx * var(--font-scale, 1));
  1270. color: $facade-text-muted;
  1271. }
  1272. .family-avatar-tag {
  1273. position: absolute;
  1274. bottom: -4rpx;
  1275. right: -4rpx;
  1276. font-size: calc(14rpx * var(--font-scale, 1));
  1277. padding: 2rpx 6rpx;
  1278. border-radius: 8rpx;
  1279. color: $app-surface;
  1280. }
  1281. .family-avatar-tag.tag-parent { background: $dim-wisdom; }
  1282. .family-avatar-tag.tag-child { background: $brand-primary; }
  1283. .family-avatar-tag.tag-teacher { background: $dim-action; }
  1284. .family-avatar-tag.tag-member { background: $c-text-gray-400; }
  1285. .family-avatar-name {
  1286. font-size: calc(20rpx * var(--font-scale, 1));
  1287. color: $facade-text-body;
  1288. white-space: nowrap;
  1289. }
  1290. /* 个人成就 */
  1291. .achievement-section {
  1292. margin: 0 $uni-space-lg 20rpx;
  1293. background: $app-surface;
  1294. border-radius: 24rpx;
  1295. padding: 24rpx;
  1296. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1297. }
  1298. .section-header-row {
  1299. display: flex;
  1300. justify-content: space-between;
  1301. align-items: baseline;
  1302. margin-bottom: 16rpx;
  1303. }
  1304. .section-title {
  1305. font-size: calc(28rpx * var(--font-scale, 1));
  1306. font-weight: bold;
  1307. color: $facade-text-strong;
  1308. }
  1309. .section-sub {
  1310. font-size: calc(22rpx * var(--font-scale, 1));
  1311. color: $facade-text-muted;
  1312. }
  1313. .achievement-grid {
  1314. display: flex;
  1315. flex-wrap: wrap;
  1316. gap: 0;
  1317. }
  1318. .ach-item {
  1319. width: 25%;
  1320. display: flex;
  1321. flex-direction: column;
  1322. align-items: center;
  1323. gap: 6rpx;
  1324. padding: 10rpx 0;
  1325. }
  1326. .ach-icon-wrap {
  1327. width: 64rpx;
  1328. height: 64rpx;
  1329. border-radius: 50%;
  1330. display: flex;
  1331. align-items: center;
  1332. justify-content: center;
  1333. margin-bottom: 4rpx;
  1334. }
  1335. .ach-icon {
  1336. font-size: calc(32rpx * var(--font-scale, 1));
  1337. line-height: 1;
  1338. }
  1339. .ach-num {
  1340. font-size: calc(28rpx * var(--font-scale, 1));
  1341. font-weight: bold;
  1342. color: $facade-text-strong;
  1343. line-height: 1;
  1344. }
  1345. .ach-label {
  1346. font-size: calc(20rpx * var(--font-scale, 1));
  1347. color: $facade-text-muted;
  1348. line-height: 1;
  1349. }
  1350. /* 我的团队网格:3 列(我的团队 / 推广收益 / 邀请成员)等宽,保持既有视觉协调 */
  1351. .achievement-grid.team-grid .ach-item {
  1352. width: 33.33%;
  1353. }
  1354. /* 我的成就网格:5 列固定等分(连续打卡/完成任务/收集勋章/成长记录/参加挑战) */
  1355. .achievement-grid.cols-5 .ach-item {
  1356. width: 20%;
  1357. }
  1358. /* 我的订单(电商风格) */
  1359. .order-section {
  1360. margin: 0 $uni-space-lg 20rpx;
  1361. }
  1362. .order-section-header {
  1363. display: flex;
  1364. align-items: center;
  1365. justify-content: space-between;
  1366. margin-bottom: 14rpx;
  1367. }
  1368. .order-all-link {
  1369. font-size: calc(24rpx * var(--font-scale, 1));
  1370. color: $facade-text-muted;
  1371. }
  1372. .order-card {
  1373. background: $app-surface;
  1374. border-radius: 24rpx;
  1375. padding: 24rpx 12rpx;
  1376. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  1377. }
  1378. .order-grid {
  1379. display: flex;
  1380. flex-wrap: wrap;
  1381. }
  1382. .order-grid-item {
  1383. width: 20%;
  1384. display: flex;
  1385. flex-direction: column;
  1386. align-items: center;
  1387. gap: 10rpx;
  1388. padding: 8rpx 0;
  1389. }
  1390. .order-icon-wrap {
  1391. position: relative;
  1392. width: 64rpx;
  1393. height: 64rpx;
  1394. display: flex;
  1395. align-items: center;
  1396. justify-content: center;
  1397. }
  1398. .order-icon {
  1399. font-size: calc(40rpx * var(--font-scale, 1));
  1400. line-height: 1;
  1401. }
  1402. .order-badge {
  1403. position: absolute;
  1404. top: -8rpx;
  1405. right: -14rpx;
  1406. min-width: 30rpx;
  1407. height: 30rpx;
  1408. line-height: 30rpx;
  1409. border-radius: 16rpx;
  1410. background: $status-danger-2;
  1411. color: $app-surface;
  1412. font-size: calc(18rpx * var(--font-scale, 1));
  1413. text-align: center;
  1414. padding: 0 6rpx;
  1415. }
  1416. .order-grid-text {
  1417. font-size: calc(22rpx * var(--font-scale, 1));
  1418. color: $facade-text-body;
  1419. line-height: 1;
  1420. }
  1421. .order-extra-row {
  1422. display: flex;
  1423. align-items: center;
  1424. margin-top: 20rpx;
  1425. padding-top: 20rpx;
  1426. border-top: 1rpx solid $c-fill-2b;
  1427. }
  1428. .order-extra-item {
  1429. flex: 1;
  1430. display: flex;
  1431. align-items: center;
  1432. justify-content: center;
  1433. gap: 8rpx;
  1434. }
  1435. .order-extra-icon {
  1436. font-size: calc(28rpx * var(--font-scale, 1));
  1437. }
  1438. .order-extra-text {
  1439. font-size: calc(24rpx * var(--font-scale, 1));
  1440. color: $facade-text-strong;
  1441. }
  1442. .order-extra-badge {
  1443. min-width: 30rpx;
  1444. height: 30rpx;
  1445. line-height: 30rpx;
  1446. border-radius: 16rpx;
  1447. background: $brand-primary;
  1448. color: $app-surface;
  1449. font-size: calc(18rpx * var(--font-scale, 1));
  1450. text-align: center;
  1451. padding: 0 6rpx;
  1452. }
  1453. .order-extra-divider {
  1454. width: 1rpx;
  1455. height: 30rpx;
  1456. background: $c-fill-2b;
  1457. }
  1458. /* 规划师服务中心入口 */
  1459. .service-center-section {
  1460. margin: 0 $uni-space-lg 20rpx;
  1461. }
  1462. .service-center-card {
  1463. background: linear-gradient(135deg, $brand-primary 0%, $brand-primary-light 100%);
  1464. border-radius: 24rpx;
  1465. padding: 24rpx;
  1466. display: flex;
  1467. align-items: center;
  1468. gap: 20rpx;
  1469. box-shadow: 0 4rpx 16rpx rgba($brand-primary, 0.25);
  1470. }
  1471. .service-center-card.disabled-card {
  1472. background: linear-gradient(135deg, $uni-border-color-light, $app-text-subtle);
  1473. box-shadow: none;
  1474. opacity: 0.8;
  1475. }
  1476. .service-center-icon {
  1477. font-size: calc(48rpx * var(--font-scale, 1));
  1478. }
  1479. .service-center-info {
  1480. flex: 1;
  1481. }
  1482. .service-center-title {
  1483. font-size: calc(30rpx * var(--font-scale, 1));
  1484. font-weight: bold;
  1485. color: $app-surface;
  1486. display: block;
  1487. }
  1488. .service-center-desc {
  1489. font-size: calc(22rpx * var(--font-scale, 1));
  1490. color: rgba($app-surface, 0.8);
  1491. margin-top: 6rpx;
  1492. display: block;
  1493. }
  1494. .service-center-card.disabled-card .service-center-title {
  1495. color: $app-surface;
  1496. }
  1497. .service-center-card.disabled-card .service-center-desc {
  1498. color: rgba($app-surface, 0.9);
  1499. }
  1500. .service-center-arrow {
  1501. font-size: calc(40rpx * var(--font-scale, 1));
  1502. color: $app-surface;
  1503. }
  1504. /* 设置 + 退出 */
  1505. .bottom-menu-section {
  1506. margin: 0 $uni-space-lg;
  1507. padding-bottom: 20rpx;
  1508. }
  1509. .menu-row {
  1510. width: 100%;
  1511. background: $app-surface;
  1512. border-radius: 16rpx;
  1513. padding: 24rpx;
  1514. display: flex;
  1515. align-items: center;
  1516. gap: 14rpx;
  1517. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  1518. margin-bottom: 20rpx;
  1519. }
  1520. .menu-row-icon {
  1521. font-size: calc(30rpx * var(--font-scale, 1));
  1522. }
  1523. .menu-row-text {
  1524. flex: 1;
  1525. font-size: calc(26rpx * var(--font-scale, 1));
  1526. color: $facade-text-strong;
  1527. }
  1528. .menu-row-sub {
  1529. font-size: calc(24rpx * var(--font-scale, 1));
  1530. color: $facade-text-muted;
  1531. margin-right: 8rpx;
  1532. }
  1533. .menu-row-arrow {
  1534. font-size: calc(28rpx * var(--font-scale, 1));
  1535. color: $facade-text-ghost;
  1536. }
  1537. .logout-btn {
  1538. width: 100%;
  1539. background: $app-surface;
  1540. border-radius: 16rpx;
  1541. padding: 24rpx;
  1542. text-align: center;
  1543. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  1544. }
  1545. .logout-text {
  1546. font-size: calc(26rpx * var(--font-scale, 1));
  1547. color: $status-danger-2;
  1548. font-weight: 500;
  1549. }
  1550. /* 团队邀请:透明原生分享按钮,绝对定位铺满父入口,仅由微信接管点击、不改变任何视觉。
  1551. 彻底重置 uni-app <button> 默认样式(margin/padding/line-height/border/背景),
  1552. 用 opacity:0 而非 display:none(后者会使按钮不可点击)。父入口需为定位上下文。 */
  1553. .share-overlay-btn {
  1554. position: absolute;
  1555. left: 0;
  1556. top: 0;
  1557. width: 100%;
  1558. height: 100%;
  1559. margin: 0;
  1560. padding: 0;
  1561. border: none;
  1562. border-radius: inherit;
  1563. background: transparent;
  1564. line-height: 1;
  1565. font-size: 0;
  1566. opacity: 0;
  1567. z-index: 2;
  1568. }
  1569. .share-overlay-btn::after {
  1570. border: none;
  1571. }
  1572. /* 网格「邀请成员」项作为透明分享按钮的定位上下文;项本身已是 flex 布局,仅补定位 */
  1573. .ach-item-share {
  1574. position: relative;
  1575. overflow: hidden;
  1576. }
  1577. /* 分享推广码浮动按钮 */
  1578. .share-qr-float {
  1579. position: fixed;
  1580. top: 180rpx;
  1581. right: 30rpx;
  1582. width: 80rpx;
  1583. height: 80rpx;
  1584. border-radius: 50%;
  1585. background: $app-surface;
  1586. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.15);
  1587. display: flex;
  1588. align-items: center;
  1589. justify-content: center;
  1590. z-index: 99;
  1591. }
  1592. /* 二维码图标(纯 CSS 绘制,不依赖 emoji 字体) */
  1593. .qr-glyph {
  1594. position: relative;
  1595. width: 46rpx;
  1596. height: 46rpx;
  1597. }
  1598. .qr-eye {
  1599. position: absolute;
  1600. width: 16rpx;
  1601. height: 16rpx;
  1602. border: 4rpx solid $uni-text-color;
  1603. border-radius: 8rpx;
  1604. box-sizing: border-box;
  1605. }
  1606. .qr-eye-tl { left: 0; top: 0; }
  1607. .qr-eye-tr { right: 0; top: 0; }
  1608. .qr-eye-bl { left: 0; bottom: 0; }
  1609. .qr-mid {
  1610. position: absolute;
  1611. left: 20rpx;
  1612. top: 20rpx;
  1613. width: 7rpx;
  1614. height: 7rpx;
  1615. background: $uni-text-color;
  1616. border-radius: 8rpx;
  1617. }
  1618. .qr-cluster {
  1619. position: absolute;
  1620. right: 0;
  1621. bottom: 0;
  1622. width: 18rpx;
  1623. display: flex;
  1624. flex-wrap: wrap;
  1625. }
  1626. .qr-pip {
  1627. width: 7rpx;
  1628. height: 7rpx;
  1629. margin: 1rpx;
  1630. background: $uni-text-color;
  1631. border-radius: 8rpx;
  1632. }
  1633. </style>