index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  1. <template>
  2. <view class="page-profile">
  3. <!-- ========== Merged Region 1+2: User Card + Membership ========== -->
  4. <view class="user-card">
  5. <!-- Login prompt for unauthenticated users -->
  6. <view v-if="!userStore.isLoggedIn" class="user-card__login" @click="goLogin">
  7. <view class="avatar avatar--empty">
  8. <text class="avatar__icon">+</text>
  9. </view>
  10. <text class="user-card__nickname">未登录</text>
  11. <text class="user-card__login-hint">点击登录 / 注册</text>
  12. </view>
  13. <!-- Authenticated user card — tap to edit -->
  14. <view v-else class="user-card__logged" @click="goEditProfile">
  15. <view class="user-card__inner">
  16. <view class="avatar">
  17. <image :src="userStore.avatarUrl || '/static/default-avatar.png'" mode="aspectFill" />
  18. </view>
  19. <view class="user-card__info">
  20. <text class="user-card__nickname">{{ userStore.nickname }}</text>
  21. <!-- Role tag -->
  22. <view
  23. class="user-card__tag"
  24. :class="{
  25. 'user-card__tag--practitioner': userStore.vipType === 'practitioner',
  26. 'user-card__tag--annual': userStore.vipType === 'annual',
  27. 'user-card__tag--normal': !userStore.vipType
  28. }"
  29. >
  30. <text v-if="!userStore.vipType">普通用户</text>
  31. <text v-else-if="userStore.vipType === 'annual'">C端会员</text>
  32. <text v-else>能量师 🌟</text>
  33. </view>
  34. <!-- Social summary (optional) -->
  35. <text v-if="userStore.bio || userStore.city" class="user-card__summary">
  36. {{ userStore.city || '' }}{{ userStore.city && userStore.bio ? ' · ' : '' }}{{ userStore.bio || '' }}
  37. </text>
  38. </view>
  39. <text class="user-card__arrow">›</text>
  40. <!-- Theme switcher inside user card -->
  41. <view class="user-card__theme">
  42. <ThemeToggle />
  43. </view>
  44. </view>
  45. </view>
  46. <!-- ========== Membership Status (merged into User Card) ========== -->
  47. <!-- US-5.1 §13: Profile incomplete banner -->
  48. <view v-if="userStore.isLoggedIn && userStore.profileIncomplete" class="banner" @click="goEditProfile">
  49. <text class="banner__text">📝 请完善个人资料,开启能量匹配</text>
  50. <text class="banner__arrow">›</text>
  51. </view>
  52. <!-- US-4.3: Renewal reminder (7 days before expiry) -->
  53. <view v-if="isExpiringSoon" class="banner banner--warning" @click="goRenew">
  54. <text class="banner__text">⏰ 您的会员即将到期,请及时续费</text>
  55. <text class="banner__arrow">›</text>
  56. </view>
  57. <!-- Seed-price badge -->
  58. <view v-if="userStore.isSeedPriceUser" class="seed-badge">
  59. <text class="seed-badge__text">🌱 种子价专属会员</text>
  60. </view>
  61. <!-- VIP status card — role-based -->
  62. <!-- Case 1: Energy master (practitioner, in valid period) -->
  63. <view
  64. v-if="userStore.vipType === 'practitioner' && userStore.isVip && !isExpired"
  65. class="vip-card vip-card--practitioner"
  66. >
  67. <view class="vip-card__body">
  68. <text class="vip-card__title">能量师会员 🌟</text>
  69. <text class="vip-card__desc">
  70. 有效期至 {{ formatDate(userStore.vipEndTime) }}
  71. </text>
  72. </view>
  73. <text class="vip-card__action" @click="goRenew">续费</text>
  74. </view>
  75. <!-- Case 2: Super annual subscriber (in valid period) -->
  76. <view
  77. v-else-if="userStore.vipType === 'super_annual' && userStore.isVip && !isExpired"
  78. class="vip-card vip-card--super"
  79. >
  80. <view class="vip-card__body">
  81. <text class="vip-card__title">超级会员 🏆</text>
  82. <text class="vip-card__desc">
  83. 有效期至 {{ formatDate(userStore.vipEndTime) }}
  84. </text>
  85. <view class="vip-card__perks">
  86. <text class="perk-tag">关系能量</text>
  87. <text class="perk-tag">八星号码</text>
  88. <text class="perk-tag">分销推广</text>
  89. </view>
  90. </view>
  91. <text class="vip-card__action" @click="goUpgradePractitioner">升级能量师</text>
  92. </view>
  93. <!-- Case 3: C-end annual subscriber (in valid period) -->
  94. <view
  95. v-else-if="userStore.vipType === 'annual' && userStore.isVip && !isExpired"
  96. class="vip-card vip-card--annual"
  97. >
  98. <view class="vip-card__body">
  99. <text class="vip-card__title">C端会员</text>
  100. <text class="vip-card__desc">
  101. 有效期至 {{ formatDate(userStore.vipEndTime) }}
  102. </text>
  103. </view>
  104. <view style="display:flex;gap:8px;flex-shrink:0;">
  105. <text class="vip-card__action" @click="goSuperMember">升超级</text>
  106. <text class="vip-card__action" @click="goUpgradePractitioner">升能量师</text>
  107. </view>
  108. </view>
  109. <!-- Case 4: Expired member (vipEndTime < now) -->
  110. <view v-else-if="userStore.vipType && isExpired" class="vip-card vip-card--expired">
  111. <view class="vip-card__body">
  112. <text class="vip-card__title">会员已过期</text>
  113. <text class="vip-card__desc">
  114. 过期时间 {{ formatDate(userStore.vipEndTime) }}
  115. </text>
  116. </view>
  117. <text class="vip-card__action" @click="goPayment">重新开通</text>
  118. </view>
  119. <!-- Case 5: Free user — three payment options -->
  120. <view v-else class="vip-card vip-card--upsell">
  121. <view class="vip-card__body">
  122. <text class="vip-card__title">选择方案</text>
  123. <view class="vip-card__dual">
  124. <view class="vip-card__option" @click="goPayment">
  125. <text class="option-title">C端会员</text>
  126. <text class="option-price">¥131/年</text>
  127. <text class="option-desc">无限AI解读</text>
  128. <button class="option-btn light">开通</button>
  129. </view>
  130. <view class="vip-card__option" @click="goSuperMember">
  131. <text class="option-title">超级会员</text>
  132. <text class="option-price">¥1,314/年</text>
  133. <text class="option-desc">关系能量+号码分析</text>
  134. <button class="option-btn light">开通</button>
  135. </view>
  136. <view class="vip-card__option vip-card__option--pro" @click="goUpgradePractitioner">
  137. <text class="option-title">能量师</text>
  138. <text class="option-price">¥1,314/年</text>
  139. <text class="option-desc">完整功能+分销</text>
  140. <button class="option-btn primary">申请</button>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- Daily quota (non-VIP only) -->
  146. <view v-if="!userStore.isVip" class="quota-bar">
  147. <view class="quota-bar__item">
  148. <text class="quota-bar__label">今日分析</text>
  149. <text class="quota-bar__value">{{ userStore.usedCharts }}/{{ userStore.maxCharts }}</text>
  150. </view>
  151. <view class="quota-bar__divider"></view>
  152. <view class="quota-bar__item">
  153. <text class="quota-bar__label">今日解读</text>
  154. <text class="quota-bar__value">{{ userStore.usedChats }}/{{ userStore.maxChats }}</text>
  155. </view>
  156. </view>
  157. </view>
  158. <!-- ========== Region 3: Feature Menu ========== -->
  159. <!-- Group 1: My Services -->
  160. <view class="menu-section">
  161. <view class="menu-section__header">我的服务</view>
  162. <!-- Analysis history (all logged-in) -->
  163. <view v-if="userStore.isLoggedIn" class="menu-item" @click="goRecords">
  164. <text class="menu-item__label">📋 我的分析</text>
  165. <text class="menu-item__arrow">›</text>
  166. </view>
  167. <!-- Distribution panel (paid users only) -->
  168. <view v-if="userStore.isLoggedIn && userStore.isVip" class="menu-item" @click="goCommission">
  169. <text class="menu-item__label">💰 我的推广</text>
  170. <text class="menu-item__arrow">›</text>
  171. </view>
  172. <!-- Practitioner workbench (practitioners only) — EPIC 9 -->
  173. <view v-if="userStore.vipType === 'practitioner' && userStore.isVip" class="menu-item" @click="goWorkbench">
  174. <text class="menu-item__label">🔧 工作台</text>
  175. <view class="menu-item__badge menu-item__badge--new">NEW</view>
  176. <text class="menu-item__arrow">›</text>
  177. </view>
  178. </view>
  179. <!-- Group 2: Promotion Tools (paid users only) -->
  180. <view v-if="userStore.isLoggedIn && userStore.isVip && userStore.referralCode" class="menu-section">
  181. <view class="menu-section__header">推广工具</view>
  182. <view class="promo-card">
  183. <view class="promo-card__code-area">
  184. <text class="promo-card__prefix">推广码</text>
  185. <text class="promo-card__code">{{ userStore.referralCode }}</text>
  186. </view>
  187. <view class="promo-card__actions">
  188. <text class="promo-card__btn" @click="copyReferral">复制推广码</text>
  189. <text class="promo-card__divider">|</text>
  190. <text class="promo-card__btn" @click="generatePoster">生成推广海报</text>
  191. </view>
  192. </view>
  193. </view>
  194. <!-- Group 3: More -->
  195. <view class="menu-section">
  196. <view class="menu-section__header">更多</view>
  197. <!-- My tags (practitioner only, P2) -->
  198. <view v-if="userStore.vipType === 'practitioner'" class="menu-item" @click="goTags">
  199. <text class="menu-item__label">🏷 我的标签</text>
  200. <text class="menu-item__arrow">›</text>
  201. </view>
  202. <!-- About us (all) -->
  203. <view class="menu-item" @click="goAbout">
  204. <text class="menu-item__label">ℹ️ 关于我们</text>
  205. <text class="menu-item__arrow">›</text>
  206. </view>
  207. </view>
  208. <!-- ========== Region 4: Logout ========== -->
  209. <view v-if="userStore.isLoggedIn" class="menu-section">
  210. <view class="menu-item menu-item--danger" @click="handleLogout">
  211. <text class="menu-item__label menu-item__label--danger">退出登录</text>
  212. </view>
  213. </view>
  214. <!-- Hidden canvas for poster generation -->
  215. <canvas canvas-id="posterCanvas" id="posterCanvas" class="poster-canvas" />
  216. </view>
  217. </template>
  218. <script setup>
  219. import { computed, getCurrentInstance } from 'vue'
  220. import { onShow } from '@dcloudio/uni-app'
  221. import { useUserStore } from '@/stores/user'
  222. import { useThemeStore } from '@/stores/theme'
  223. import { profileApi } from '@/utils/api'
  224. const userStore = useUserStore()
  225. const themeStore = useThemeStore()
  226. // Initialize theme on page show
  227. onShow(() => {
  228. themeStore.init()
  229. })
  230. // US-4.3: Renewal reminder if expiry within 7 days
  231. const isExpiringSoon = computed(() => {
  232. if (!userStore.vipEndTime) return false
  233. const expiry = new Date(userStore.vipEndTime)
  234. const now = new Date()
  235. const diffHours = (expiry - now) / (1000 * 60 * 60)
  236. return diffHours > 0 && diffHours <= 7 * 24
  237. })
  238. // US-4.3: Expired check
  239. const isExpired = computed(() => {
  240. if (!userStore.vipEndTime) return false
  241. return new Date(userStore.vipEndTime) < new Date()
  242. })
  243. function formatDate(dateStr) {
  244. if (!dateStr) return ''
  245. return dateStr.slice(0, 10)
  246. }
  247. onShow(() => {
  248. if (userStore.isLoggedIn) {
  249. userStore.fetchProfile()
  250. userStore.fetchQuota()
  251. userStore.fetchCommissionSummary()
  252. }
  253. })
  254. function goLogin() {
  255. uni.navigateTo({ url: '/pages/login/index' })
  256. }
  257. function goEditProfile() {
  258. if (!userStore.isLoggedIn) {
  259. uni.navigateTo({ url: '/pages/login/index' })
  260. return
  261. }
  262. uni.navigateTo({ url: '/pages/profile/edit' })
  263. }
  264. function goPayment() {
  265. uni.navigateTo({ url: '/pages/payment/index?product=annual' })
  266. }
  267. function goRenew() {
  268. const product = userStore.vipType === 'practitioner' ? 'practitioner' : 'annual'
  269. uni.navigateTo({ url: `/pages/payment/index?product=${product}` })
  270. }
  271. function goUpgradePractitioner() {
  272. uni.navigateTo({ url: '/pages/payment/index?product=practitioner' })
  273. }
  274. function goSuperMember() {
  275. uni.navigateTo({ url: '/pages/payment/index?product=super_member' })
  276. }
  277. function goRecords() {
  278. uni.switchTab({ url: '/pages/records/index' })
  279. }
  280. function goCommission() {
  281. if (!userStore.isLoggedIn) {
  282. uni.navigateTo({ url: '/pages/login/index' })
  283. return
  284. }
  285. uni.navigateTo({ url: '/pages/commission/index' })
  286. }
  287. // EPIC 9: Navigate to practitioner workbench
  288. function goWorkbench() {
  289. uni.navigateTo({ url: '/pages/plan/workbench' })
  290. }
  291. function copyReferral() {
  292. if (userStore.referralCode) {
  293. uni.setClipboardData({
  294. data: userStore.referralCode,
  295. success: () => uni.showToast({ title: '已复制推广码', icon: 'success' })
  296. })
  297. }
  298. }
  299. function generatePoster() {
  300. uni.showLoading({ title: '生成海报…', mask: true })
  301. const baseUrl = 'http://127.0.0.1:8186'
  302. Promise.all([
  303. downloadImage(userStore.avatarUrl),
  304. profileApi.qrcode().then(res => {
  305. const url = res.qrCodeUrl.startsWith('http') ? res.qrCodeUrl : baseUrl + res.qrCodeUrl
  306. return downloadImage(url)
  307. })
  308. ]).then(([avatarPath, qrPath]) => {
  309. const ctx = uni.createCanvasContext('posterCanvas')
  310. const W = 375, H = 670
  311. // Background
  312. const grd = ctx.createLinearGradient(0, 0, 0, H)
  313. grd.addColorStop(0, '#0c0a1a')
  314. grd.addColorStop(1, '#1a1040')
  315. ctx.fillStyle = grd
  316. ctx.fillRect(0, 0, W, H)
  317. // Top glow
  318. const topGlow = ctx.createLinearGradient(0, 0, 0, 220)
  319. topGlow.addColorStop(0, 'rgba(90, 50, 180, 0.35)')
  320. topGlow.addColorStop(1, 'rgba(90, 50, 180, 0)')
  321. ctx.fillStyle = topGlow
  322. ctx.fillRect(0, 0, W, 220)
  323. // Gold accent line
  324. ctx.fillStyle = '#C9A84C'
  325. ctx.fillRect(W * 0.32, 28, W * 0.36, 1.5)
  326. // Brand title
  327. ctx.font = '13px sans-serif'
  328. ctx.fillStyle = 'rgba(201, 168, 76, 0.7)'
  329. ctx.textAlign = 'center'
  330. ctx.fillText('数字能量学', W / 2, 52)
  331. // Avatar (circular)
  332. const avatarSize = 76
  333. ctx.save()
  334. ctx.beginPath()
  335. ctx.arc(W / 2, 128, avatarSize / 2, 0, 2 * Math.PI)
  336. ctx.closePath()
  337. ctx.fillStyle = '#ffffff'
  338. ctx.fill()
  339. if (avatarPath) {
  340. ctx.clip()
  341. ctx.drawImage(avatarPath, (W - avatarSize) / 2, 128 - avatarSize / 2, avatarSize, avatarSize)
  342. }
  343. ctx.restore()
  344. // Nickname
  345. ctx.font = 'bold 18px sans-serif'
  346. ctx.fillStyle = '#FFFFFF'
  347. ctx.textAlign = 'center'
  348. ctx.fillText(userStore.nickname || '数字能量探索者', W / 2, 192)
  349. // Role badge
  350. const roleText = userStore.vipType === 'practitioner' ? '能量师' : userStore.vipType === 'annual' ? 'C端会员' : '探索者'
  351. ctx.font = '11px sans-serif'
  352. ctx.fillStyle = userStore.vipType === 'practitioner' ? '#C9A84C' : 'rgba(255,255,255,0.5)'
  353. ctx.fillText(roleText, W / 2, 214)
  354. // Divider
  355. ctx.fillStyle = 'rgba(255,255,255,0.07)'
  356. ctx.fillRect(30, 240, W - 60, 1)
  357. // Section title
  358. ctx.font = '12px sans-serif'
  359. ctx.fillStyle = 'rgba(255,255,255,0.38)'
  360. ctx.fillText('推荐体验', W / 2, 270)
  361. // QR code background
  362. const qrSize = 160
  363. const qrX = (W - qrSize) / 2
  364. const qrY = 288
  365. ctx.fillStyle = '#FFFFFF'
  366. ctx.fillRect(qrX, qrY, qrSize, qrSize)
  367. if (qrPath) {
  368. ctx.drawImage(qrPath, qrX + 8, qrY + 8, qrSize - 16, qrSize - 16)
  369. }
  370. // Hint
  371. ctx.font = '11px sans-serif'
  372. ctx.fillStyle = 'rgba(255,255,255,0.32)'
  373. ctx.fillText('扫码开启你的数字能量之旅', W / 2, qrY + qrSize + 24)
  374. // Bottom
  375. ctx.font = '10px sans-serif'
  376. ctx.fillStyle = 'rgba(255,255,255,0.18)'
  377. ctx.fillText('数字能量学 · 数字能量智能体', W / 2, H - 22)
  378. ctx.draw(false)
  379. setTimeout(() => {
  380. uni.canvasToTempFilePath({
  381. canvasId: 'posterCanvas',
  382. quality: 1,
  383. success: (res) => {
  384. uni.saveImageToPhotosAlbum({
  385. filePath: res.tempFilePath,
  386. success: () => {
  387. uni.hideLoading()
  388. uni.showToast({ title: '海报已保存到相册', icon: 'success' })
  389. },
  390. fail: (e) => {
  391. uni.hideLoading()
  392. if (e.errMsg && e.errMsg.includes('auth deny')) {
  393. uni.showModal({
  394. title: '保存海报',
  395. content: '需要相册权限才能保存海报到本地',
  396. confirmText: '去设置',
  397. success: (r) => { if (r.confirm) uni.openSetting() }
  398. })
  399. } else {
  400. uni.showToast({ title: '保存失败,请重试', icon: 'none' })
  401. }
  402. }
  403. })
  404. },
  405. fail: () => {
  406. uni.hideLoading()
  407. uni.showToast({ title: '生成失败,请重试', icon: 'none' })
  408. }
  409. }, getCurrentInstance())
  410. }, 150)
  411. }).catch(e => {
  412. console.error('generatePoster error:', e)
  413. uni.hideLoading()
  414. uni.showToast({ title: '生成失败,请重试', icon: 'none' })
  415. })
  416. }
  417. function downloadImage(url) {
  418. if (!url) return Promise.resolve('')
  419. return new Promise((resolve) => {
  420. uni.downloadFile({
  421. url,
  422. success: (res) => resolve(res.tempFilePath),
  423. fail: () => resolve('')
  424. })
  425. })
  426. }
  427. function goTags() {
  428. uni.navigateTo({ url: '/pages/tags/index' })
  429. }
  430. function goAbout() {
  431. uni.navigateTo({ url: '/pages/about/index' })
  432. }
  433. function handleLogout() {
  434. uni.showModal({
  435. title: '确认退出',
  436. content: '确定要退出登录吗?',
  437. success: (res) => {
  438. if (res.confirm) {
  439. userStore.logout()
  440. uni.showToast({ title: '已退出', icon: 'success' })
  441. }
  442. }
  443. })
  444. }
  445. </script>
  446. <style scoped lang="scss">
  447. // Brand colors (aligned with style-guide.md)
  448. $blue-dark: #1E3A5F;
  449. $gold: #C9A84C;
  450. $gold-light: #F8F0D8;
  451. $warm-white: #F8F6F1;
  452. $white: #FFFFFF;
  453. $text-primary: #1F2937;
  454. $text-secondary: #6B7280;
  455. $text-muted: #9CA3AF;
  456. $danger: #EF4444;
  457. .page-profile {
  458. padding: 16px;
  459. min-height: 100vh;
  460. background: $warm-white;
  461. }
  462. // ========== Merged Region 1+2: User Card + Membership ==========
  463. .user-card {
  464. background: linear-gradient(135deg, $blue-dark, darken($blue-dark, 6%));
  465. border-radius: 16px;
  466. padding: 20px 18px;
  467. margin-bottom: 16px;
  468. &__login {
  469. cursor: pointer;
  470. text-align: center;
  471. padding: 8px 0;
  472. }
  473. &__logged {
  474. cursor: pointer;
  475. }
  476. &__inner {
  477. display: flex;
  478. align-items: center;
  479. gap: 14px;
  480. }
  481. &__info {
  482. flex: 1;
  483. min-width: 0;
  484. }
  485. &__nickname {
  486. font-size: 17px;
  487. font-weight: 600;
  488. color: $white;
  489. display: block;
  490. }
  491. &__login-hint {
  492. font-size: 12px;
  493. color: rgba(255, 255, 255, 0.7);
  494. display: block;
  495. margin-top: 4px;
  496. }
  497. &__tag {
  498. display: inline-flex;
  499. padding: 2px 12px;
  500. border-radius: 20px;
  501. font-size: 11px;
  502. margin-top: 6px;
  503. &--practitioner {
  504. background: $gold;
  505. color: $blue-dark;
  506. font-weight: 600;
  507. }
  508. &--annual {
  509. background: rgba($gold, 0.25);
  510. color: $gold;
  511. }
  512. &--normal {
  513. background: rgba(255, 255, 255, 0.15);
  514. color: rgba(255, 255, 255, 0.8);
  515. }
  516. }
  517. &__summary {
  518. font-size: 11px;
  519. color: rgba(255, 255, 255, 0.55);
  520. margin-top: 4px;
  521. display: block;
  522. overflow: hidden;
  523. text-overflow: ellipsis;
  524. white-space: nowrap;
  525. }
  526. &__arrow {
  527. font-size: 22px;
  528. color: rgba(255, 255, 255, 0.3);
  529. flex-shrink: 0;
  530. padding-left: 4px;
  531. }
  532. }
  533. // Avatar
  534. .avatar {
  535. width: 56px;
  536. height: 56px;
  537. border-radius: 50%;
  538. overflow: hidden;
  539. flex-shrink: 0;
  540. image {
  541. width: 100%;
  542. height: 100%;
  543. border-radius: 50%;
  544. border: 2px solid rgba(255, 255, 255, 0.25);
  545. }
  546. &--empty {
  547. width: 56px;
  548. height: 56px;
  549. background: rgba(255, 255, 255, 0.12);
  550. display: flex;
  551. align-items: center;
  552. justify-content: center;
  553. border: 2px dashed rgba(255, 255, 255, 0.25);
  554. }
  555. &__icon {
  556. font-size: 24px;
  557. color: rgba(255, 255, 255, 0.5);
  558. }
  559. }
  560. // ========== (merged into Region 1+2) ==========
  561. // Banners
  562. .banner {
  563. display: flex;
  564. align-items: center;
  565. justify-content: space-between;
  566. padding: 10px 14px;
  567. border-radius: 10px;
  568. margin-bottom: 12px;
  569. background: #FEF3C7;
  570. border: 1px solid #FDE68A;
  571. &--warning {
  572. background: #FEF3C7;
  573. border-color: #FDE68A;
  574. }
  575. &__text {
  576. font-size: 13px;
  577. color: #92400E;
  578. flex: 1;
  579. }
  580. &__arrow {
  581. font-size: 18px;
  582. color: #92400E;
  583. margin-left: 8px;
  584. }
  585. }
  586. // Seed-price badge
  587. .seed-badge {
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. padding: 6px 14px;
  592. border-radius: 8px;
  593. margin-bottom: 12px;
  594. background: $gold-light;
  595. border: 1px solid $gold;
  596. &__text {
  597. font-size: 12px;
  598. color: $blue-dark;
  599. font-weight: 500;
  600. }
  601. }
  602. // VIP status card
  603. .vip-card {
  604. border-radius: 12px;
  605. padding: 16px;
  606. display: flex;
  607. justify-content: space-between;
  608. align-items: center;
  609. margin-bottom: 16px;
  610. &__body {
  611. flex: 1;
  612. }
  613. &__title {
  614. font-weight: 600;
  615. font-size: 16px;
  616. display: block;
  617. }
  618. &__desc {
  619. font-size: 12px;
  620. opacity: 0.8;
  621. display: block;
  622. margin-top: 4px;
  623. }
  624. &__action {
  625. font-size: 14px;
  626. font-weight: 500;
  627. padding: 6px 14px;
  628. border-radius: 8px;
  629. white-space: nowrap;
  630. cursor: pointer;
  631. }
  632. // Practitioner
  633. &--practitioner {
  634. background: linear-gradient(135deg, #7c3aed, #6d28d9);
  635. .vip-card__title, .vip-card__desc { color: #fff; }
  636. .vip-card__action {
  637. color: #7c3aed;
  638. background: rgba(255, 255, 255, 0.95);
  639. }
  640. }
  641. // Super member
  642. &--super {
  643. background: linear-gradient(135deg, #C9A84C, #B8922E);
  644. .vip-card__title, .vip-card__desc { color: #1E3A5F; }
  645. .vip-card__action {
  646. color: #C9A84C;
  647. background: #1E3A5F;
  648. }
  649. .vip-card__perks {
  650. display: flex;
  651. gap: 6px;
  652. margin-top: 6px;
  653. }
  654. .perk-tag {
  655. font-size: 10px;
  656. font-weight: 500;
  657. padding: 2px 8px;
  658. border-radius: 4px;
  659. background: rgba(30, 58, 95, 0.15);
  660. color: #1E3A5F;
  661. }
  662. }
  663. // Annual
  664. &--annual {
  665. background: linear-gradient(135deg, #f59e0b, #d97706);
  666. .vip-card__title, .vip-card__desc { color: #fff; }
  667. .vip-card__action {
  668. color: #d97706;
  669. background: rgba(255, 255, 255, 0.95);
  670. }
  671. }
  672. // Expired
  673. &--expired {
  674. background: #E5E7EB;
  675. .vip-card__title { color: $text-secondary; }
  676. .vip-card__desc { color: $text-muted; }
  677. .vip-card__action {
  678. color: $text-secondary;
  679. background: $white;
  680. }
  681. }
  682. // Upsell (free user — two options)
  683. &--upsell {
  684. background: linear-gradient(135deg, $blue-dark, darken($blue-dark, 4%));
  685. flex-direction: column;
  686. align-items: flex-start;
  687. gap: 14px;
  688. .vip-card__body {
  689. width: 100%;
  690. }
  691. .vip-card__title {
  692. color: $gold;
  693. font-size: 16px;
  694. margin-bottom: 8px;
  695. }
  696. .vip-card__dual {
  697. display: flex;
  698. gap: 12px;
  699. width: 100%;
  700. }
  701. .vip-card__option {
  702. flex: 1;
  703. background: rgba(255, 255, 255, 0.06);
  704. border: 1px solid rgba(255, 255, 255, 0.08);
  705. border-radius: 12px;
  706. padding: 14px 12px;
  707. display: flex;
  708. flex-direction: column;
  709. align-items: center;
  710. gap: 6px;
  711. cursor: pointer;
  712. }
  713. .vip-card__option:active {
  714. background: rgba(255, 255, 255, 0.1);
  715. }
  716. .vip-card__option .option-title {
  717. font-size: 15px;
  718. font-weight: 600;
  719. color: rgba(255, 255, 255, 0.9);
  720. }
  721. .vip-card__option .option-price {
  722. font-size: 18px;
  723. font-weight: 700;
  724. color: $gold;
  725. }
  726. .vip-card__option .option-desc {
  727. font-size: 11px;
  728. color: rgba(255, 255, 255, 0.45);
  729. }
  730. .vip-card__option .option-btn {
  731. width: 100%;
  732. border: none;
  733. border-radius: 8px;
  734. padding: 8px 0;
  735. font-size: 13px;
  736. font-weight: 600;
  737. cursor: pointer;
  738. margin-top: 4px;
  739. }
  740. .option-btn.light {
  741. background: rgba(255, 255, 255, 0.12);
  742. color: #fff;
  743. }
  744. .option-btn.primary {
  745. background: $gold;
  746. color: $blue-dark;
  747. }
  748. .vip-card__option--pro {
  749. border-color: rgba($gold, 0.2);
  750. background: rgba($gold, 0.06);
  751. }
  752. }
  753. }
  754. // Daily quota
  755. .quota-bar {
  756. background: $white;
  757. border-radius: 12px;
  758. padding: 16px;
  759. margin-bottom: 16px;
  760. display: flex;
  761. align-items: center;
  762. justify-content: space-around;
  763. &__item {
  764. text-align: center;
  765. }
  766. &__label {
  767. font-size: 12px;
  768. color: $text-secondary;
  769. display: block;
  770. margin-bottom: 4px;
  771. }
  772. &__value {
  773. font-size: 20px;
  774. font-weight: 700;
  775. color: $text-primary;
  776. }
  777. &__divider {
  778. width: 1px;
  779. height: 36px;
  780. background: #E5E7EB;
  781. }
  782. }
  783. // ========== Region 3: Feature Menu ==========
  784. .menu-section {
  785. background: $white;
  786. border-radius: 12px;
  787. margin-bottom: 16px;
  788. overflow: hidden;
  789. &__header {
  790. font-size: 12px;
  791. font-weight: 600;
  792. color: $text-muted;
  793. text-transform: uppercase;
  794. letter-spacing: 0.5px;
  795. padding: 14px 16px 6px;
  796. }
  797. }
  798. .menu-item {
  799. display: flex;
  800. align-items: center;
  801. gap: 8px;
  802. padding: 14px 16px;
  803. border-bottom: 1px solid #F3F4F6;
  804. cursor: pointer;
  805. transition: background 0.15s;
  806. &:active {
  807. background: #F9FAFB;
  808. }
  809. &:last-child {
  810. border-bottom: none;
  811. }
  812. &__label {
  813. flex: 1;
  814. font-size: 15px;
  815. color: $text-primary;
  816. &--danger {
  817. color: $danger;
  818. }
  819. }
  820. &__badge {
  821. font-size: 10px;
  822. font-weight: 700;
  823. padding: 2px 6px;
  824. border-radius: 4px;
  825. &--new {
  826. background: #FEF3C7;
  827. color: #D97706;
  828. }
  829. }
  830. &__arrow {
  831. color: $text-muted;
  832. font-size: 18px;
  833. }
  834. &--danger {
  835. justify-content: center;
  836. border-bottom: none;
  837. }
  838. }
  839. // Promotion tools card
  840. .promo-card {
  841. margin: 0 16px 14px;
  842. background: #FFFBEB;
  843. border: 1px solid #FDE68A;
  844. border-radius: 10px;
  845. overflow: hidden;
  846. &__code-area {
  847. display: flex;
  848. align-items: center;
  849. justify-content: center;
  850. gap: 10px;
  851. padding: 14px 16px 8px;
  852. }
  853. &__prefix {
  854. font-size: 13px;
  855. color: $text-secondary;
  856. }
  857. &__code {
  858. font-size: 22px;
  859. font-weight: 700;
  860. color: $blue-dark;
  861. letter-spacing: 3px;
  862. font-family: monospace;
  863. }
  864. &__actions {
  865. display: flex;
  866. align-items: center;
  867. justify-content: center;
  868. gap: 10px;
  869. padding: 6px 16px 14px;
  870. }
  871. &__btn {
  872. font-size: 12px;
  873. color: $blue-dark;
  874. font-weight: 500;
  875. cursor: pointer;
  876. }
  877. &__divider {
  878. color: #D1D5DB;
  879. font-size: 12px;
  880. }
  881. }
  882. .poster-canvas {
  883. position: fixed;
  884. left: -9999px;
  885. top: -9999px;
  886. width: 375px;
  887. height: 670px;
  888. }
  889. </style>