index.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237
  1. <template>
  2. <view class="mine-page">
  3. <!-- 用户信息区域 -->
  4. <view class="user-section">
  5. <view class="user-info">
  6. <image class="avatar" :src="userInfo.avatar" mode="aspectFill"></image>
  7. <view class="user-details">
  8. <view class="nickname-row">
  9. <text class="nickname">{{ userInfo.nickname }}</text>
  10. <!-- VIP标志 -->
  11. <view class="vip-badge" v-if="userInfo.isVip">
  12. <text class="vip-badge-text">VIP</text>
  13. </view>
  14. <view class="verify-badge" @click="goVerify" v-if="!userInfo.isVerified">
  15. <text class="verify-text">未实名,立即认证</text>
  16. </view>
  17. </view>
  18. <!-- 基本信息展示 -->
  19. <view class="user-basic-info">
  20. <view class="info-item" v-if="userInfo.gender">
  21. <text class="info-icon">{{ userInfo.gender === 1 ? '👨' : '👩' }}</text>
  22. <text class="info-text">{{ userInfo.genderText }}</text>
  23. </view>
  24. <view class="info-item" v-if="userInfo.age">
  25. <text class="info-icon">🎂</text>
  26. <text class="info-text">{{ userInfo.age }}岁</text>
  27. </view>
  28. <view class="info-item" v-if="userInfo.height">
  29. <text class="info-icon">📏</text>
  30. <text class="info-text">{{ userInfo.height }}cm</text>
  31. </view>
  32. <!-- <view class="info-item" v-if="userInfo.educationText">-->
  33. <!-- <text class="info-icon">🎓</text>-->
  34. <!-- <text class="info-text">{{ userInfo.educationText }}</text>-->
  35. <!-- </view>-->
  36. </view>
  37. <view class="progress-row">
  38. <view class="progress-bar">
  39. <view class="progress-fill" :style="{ width: userInfo.profileProgress + '%' }"></view>
  40. </view>
  41. <text class="progress-text" @click="goCompleteProfile">完善资料 ></text>
  42. </view>
  43. </view>
  44. </view>
  45. <!-- 统计数据展示 -->
  46. <view class="user-stats">
  47. <view class="stats-item" @click="goToLikedByMe">
  48. <text class="stats-number">{{ stats.myConnection }}</text>
  49. <text class="stats-label">我喜欢的</text>
  50. </view>
  51. <view class="stats-item" @click="goToLikedMe">
  52. <text class="stats-number">{{ stats.myFavorites }}</text>
  53. <text class="stats-label">喜欢我的</text>
  54. </view>
  55. <view class="stats-item" @click="goToVisitedByMe">
  56. <text class="stats-number">{{ stats.iViewed }}</text>
  57. <text class="stats-label">我浏览的</text>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- VIP会员卡片 -->
  62. <view class="vip-card" @click="goVip" v-if="!userInfo.isVip">
  63. <view class="vip-content">
  64. <view class="vip-icon">👑</view>
  65. <view class="vip-info">
  66. <text class="vip-title">VIP会员未开通</text>
  67. <text class="vip-subtitle">开通会员可享受尊贵服务哦</text>
  68. </view>
  69. </view>
  70. <view class="vip-button">立即开通</view>
  71. </view>
  72. <!-- 快捷入口 -->
  73. <view class="quick-actions">
  74. <view class="action-item" @click="goToPage('basicInfo')">
  75. <view class="action-icon calendar-icon">🆔</view>
  76. <text class="action-label">基本资料</text>
  77. </view>
  78. <view class="action-item" @click="goToPage('partnerRequirement')">
  79. <view class="action-icon heart-icon">💜</view>
  80. <text class="action-label">对象要求</text>
  81. </view>
  82. <view class="action-item" @click="goToPage('verifyRealName')">
  83. <view class="action-icon phone-icon">🪪</view>
  84. <text class="action-label">实名认证</text>
  85. </view>
  86. <view class="action-item" @click="goToPage('verifyEducation')">
  87. <view class="action-icon phone-icon">🎓</view>
  88. <text class="action-label">学历认证</text>
  89. </view>
  90. </view>
  91. <!-- 签到弹窗 -->
  92. <uni-popup ref="checkinPopup" type="center" :mask-click="true">
  93. <view class="checkin-popup">
  94. <view class="popup-header">
  95. <text class="popup-title">每日签到</text>
  96. <view class="close-btn" @click="closeCheckinPopup">
  97. <text class="close-icon">✕</text>
  98. </view>
  99. </view>
  100. <view class="checkin-info">
  101. <view class="info-item">
  102. <text class="info-label">已连续签到</text>
  103. <text class="info-value">{{ checkinData.continuousDays }} 天</text>
  104. </view>
  105. <view class="info-item">
  106. <text class="info-label">累计签到</text>
  107. <text class="info-value">{{ checkinData.totalDays }} 天</text>
  108. </view>
  109. </view>
  110. <scroll-view scroll-y class="checkin-content">
  111. <view class="checkin-calendar">
  112. <view class="calendar-header">
  113. <text class="month-text">{{ currentMonth }}</text>
  114. </view>
  115. <view class="week-header">
  116. <text class="week-day" v-for="day in weekDays" :key="day">{{ day }}</text>
  117. </view>
  118. <view class="calendar-body">
  119. <view
  120. class="calendar-day"
  121. v-for="(day, index) in calendarDays"
  122. :key="index"
  123. :class="{
  124. 'empty': !day.date,
  125. 'checked': day.checked,
  126. 'today': day.isToday
  127. }"
  128. >
  129. <text class="day-num" v-if="day.date">{{ day.date }}</text>
  130. <view class="check-mark" v-if="day.checked">✓</view>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="checkin-rewards">
  135. <text class="rewards-title">签到奖励</text>
  136. <view class="rewards-list">
  137. <view
  138. class="reward-item"
  139. v-for="(reward, index) in checkinRewards"
  140. :key="index"
  141. :class="{ 'received': reward.received, 'current': reward.isCurrent }"
  142. >
  143. <view class="reward-icon">{{ reward.icon }}</view>
  144. <text class="reward-day">第{{ reward.day }}天</text>
  145. <text class="reward-text">{{ reward.reward }}</text>
  146. <view class="received-mark" v-if="reward.received">✓</view>
  147. </view>
  148. </view>
  149. </view>
  150. </scroll-view>
  151. <view class="checkin-button-wrapper">
  152. <button
  153. class="checkin-btn"
  154. :class="{ 'disabled': checkinData.todayChecked }"
  155. @click="handleCheckin"
  156. :disabled="checkinData.todayChecked"
  157. >
  158. {{ checkinData.todayChecked ? '今日已签到' : '立即签到' }}
  159. </button>
  160. </view>
  161. </view>
  162. </uni-popup>
  163. <!-- 功能菜单列表 -->
  164. <view class="menu-list">
  165. <view class="menu-item" @click="showCheckinPopup">
  166. <view class="menu-left">
  167. <text class="menu-icon">📅</text>
  168. <text class="menu-text">签到</text>
  169. </view>
  170. <text class="menu-arrow">›</text>
  171. </view>
  172. <view class="menu-item" @click="goToPage('myDynamics')">
  173. <view class="menu-left">
  174. <text class="menu-icon">📝</text>
  175. <text class="menu-text">我的动态</text>
  176. </view>
  177. <text class="menu-arrow">›</text>
  178. </view>
  179. <view class="menu-item" @click="goToPage('myActivity')">
  180. <view class="menu-left">
  181. <text class="menu-icon">📷</text>
  182. <text class="menu-text">课程活动</text>
  183. </view>
  184. <text class="menu-arrow">›</text>
  185. </view>
  186. <view class="menu-item" @click="goToPage('partTimeMatchmaker')">
  187. <view class="menu-left">
  188. <text class="menu-icon">💎</text>
  189. <text class="menu-text">兼职红娘</text>
  190. </view>
  191. <text class="menu-arrow">›</text>
  192. </view>
  193. <view class="menu-item" @click="goToPage('feedback')">
  194. <view class="menu-left">
  195. <text class="menu-icon">💬</text>
  196. <text class="menu-text">用户反馈</text>
  197. </view>
  198. <text class="menu-arrow">›</text>
  199. </view>
  200. <!-- <view class="menu-item" @click="goToPage('blacklist')">
  201. <view class="menu-left">
  202. <text class="menu-icon">📋</text>
  203. <text class="menu-text">黑名单</text>
  204. </view>
  205. <text class="menu-arrow">›</text>
  206. </view> -->
  207. <view class="menu-item" @click="goToPage('settings')">
  208. <view class="menu-left">
  209. <text class="menu-icon">⚙️</text>
  210. <text class="menu-text">设置</text>
  211. </view>
  212. <text class="menu-arrow">›</text>
  213. </view>
  214. </view>
  215. <!-- 底部导航栏 -->
  216. <view class="tabbar">
  217. <view class="tabbar-item" @click="switchTab('index')">
  218. <text class="tabbar-icon">🏠</text>
  219. <text class="tabbar-text">首页</text>
  220. </view>
  221. <view class="tabbar-item" @click="switchTab('plaza')">
  222. <text class="tabbar-icon">💕</text>
  223. <text class="tabbar-text">动态</text>
  224. </view>
  225. <view class="tabbar-item" @click="switchTab('recommend')">
  226. <text class="tabbar-icon">👍</text>
  227. <text class="tabbar-text">推荐</text>
  228. </view>
  229. <!-- <view class="tabbar-item" @click="switchTab('message')">
  230. <text class="tabbar-icon">💬</text>
  231. <text class="tabbar-text">消息</text>
  232. <view v-if="unreadCount >= 1" class="tabbar-badge">{{ unreadCount }}</view>
  233. </view> -->
  234. <view class="tabbar-item active" @click="switchTab('mine')">
  235. <text class="tabbar-icon">👤</text>
  236. <text class="tabbar-text">我的</text>
  237. </view>
  238. </view>
  239. </view>
  240. </template>
  241. <script>
  242. import api from '@/utils/api.js'
  243. export default {
  244. data() {
  245. return {
  246. // 网关地址
  247. gatewayURL: 'https://api.zhongruanke.cn',
  248. // 用户ID(如果没有登录,默认为1)
  249. currentUserId: null,
  250. // 用户信息(从后端获取)
  251. userInfo: {
  252. userId: null,
  253. nickname: '准备加载...',
  254. avatar: 'https://via.placeholder.com/100',
  255. phone: '',
  256. email: '',
  257. gender: null,
  258. genderText: '未知',
  259. birthDate: null,
  260. age: null,
  261. isVerified: false,
  262. profileProgress: 0,
  263. isVip: false
  264. },
  265. stats: {
  266. myConnection: 0,
  267. myFavorites: 0,
  268. whoViewedMe: 0,
  269. iViewed: 0
  270. },
  271. matchmaker: {
  272. code: 'xxxxx',
  273. phone: '99*******99'
  274. },
  275. // 签到数据
  276. checkinData: {
  277. continuousDays: 0,
  278. totalDays: 0,
  279. todayChecked: false,
  280. checkedDates: []
  281. },
  282. weekDays: ['日', '一', '二', '三', '四', '五', '六'],
  283. currentMonth: '',
  284. calendarDays: [],
  285. checkinRewards: []
  286. }
  287. },
  288. computed: {
  289. unreadCount() {
  290. return this.$store.getters.getTotalUnread || 0;
  291. }
  292. },
  293. onLoad() {
  294. // 立即检查登录状态
  295. const token = uni.getStorageSync('token')
  296. const userInfo = uni.getStorageSync('userInfo')
  297. if (!token || !userInfo) {
  298. // 未登录,立即强制跳转到登录页
  299. uni.showModal({
  300. title: '需要登录',
  301. content: '请先登录后查看个人信息',
  302. showCancel: false, // 不允许取消
  303. confirmText: '去登录',
  304. success: () => {
  305. uni.navigateTo({
  306. url: '/pages/page3/page3'
  307. })
  308. }
  309. })
  310. return
  311. }
  312. // 已登录,同步登录状态
  313. this.syncLoginStatus()
  314. // 监听VIP购买成功事件
  315. uni.$on('vipPurchased', this.handleVipPurchased)
  316. },
  317. onUnload() {
  318. // 页面卸载时移除事件监听
  319. uni.$off('vipPurchased', this.handleVipPurchased)
  320. },
  321. onShow() {
  322. // 检查登录状态
  323. const token = uni.getStorageSync('token')
  324. const userInfo = uni.getStorageSync('userInfo')
  325. if (!token || !userInfo) {
  326. // 未登录,直接跳转(不显示弹窗,因为onLoad已经显示过了)
  327. uni.navigateTo({
  328. url: '/pages/page3/page3'
  329. })
  330. return
  331. }
  332. // 已登录,同步登录状态
  333. this.syncLoginStatus()
  334. },
  335. methods: {
  336. // 同步登录状态并更新页面数据
  337. syncLoginStatus() {
  338. // 获取最新的登录信息
  339. const token = uni.getStorageSync('token')
  340. const userInfo = uni.getStorageSync('userInfo')
  341. const userId = uni.getStorageSync('userId')
  342. if (token && userInfo && userId) {
  343. this.currentUserId = parseInt(userId)
  344. // 直接使用存储的用户信息更新页面
  345. this.userInfo = {
  346. userId: userInfo.userId || userId,
  347. nickname: userInfo.nickname || '用户',
  348. avatar: userInfo.avatarUrl || userInfo.avatar || 'https://via.placeholder.com/100',
  349. phone: this.maskPhone(userInfo.phone) || '',
  350. email: userInfo.email || '',
  351. gender: userInfo.gender,
  352. genderText: this.getGenderText(userInfo.gender),
  353. birthDate: userInfo.birthDate,
  354. age: this.calculateAge(userInfo.birthDate),
  355. isVerified: false,
  356. profileProgress: userInfo.profileProgress || 0,
  357. isVip: false
  358. }
  359. // 强制页面刷新
  360. this.$forceUpdate()
  361. // 设置统计数据
  362. this.stats = {
  363. myConnection: 0,
  364. myFavorites: 0,
  365. whoViewedMe: 0,
  366. iViewed: 0
  367. }
  368. // 获取我喜欢的用户真实数量
  369. this.getLikedUsersCount()
  370. // 获取喜欢我的用户真实数量
  371. this.getLikedMeUsersCount()
  372. // 获取我浏览的用户真实数量
  373. this.getBrowseHistoryCount()
  374. // 立即加载最新用户信息(不延迟)
  375. this.loadUserInfo()
  376. } else {
  377. this.currentUserId = null
  378. // 设置未登录状态的用户信息
  379. this.userInfo = {
  380. userId: null,
  381. nickname: '未登录',
  382. avatar: 'https://via.placeholder.com/100?text=未登录',
  383. phone: '',
  384. email: '',
  385. gender: 0,
  386. genderText: '未知',
  387. birthDate: null,
  388. age: null,
  389. isVerified: false,
  390. profileProgress: 0,
  391. isVip: false
  392. }
  393. // 清空统计数据
  394. this.stats = {
  395. myConnection: 0,
  396. myFavorites: 0,
  397. whoViewedMe: 0,
  398. iViewed: 0
  399. }
  400. // 强制页面更新
  401. this.$forceUpdate()
  402. // 提示需要登录
  403. setTimeout(() => {
  404. uni.showModal({
  405. title: '需要登录',
  406. content: '请先登录后查看完整功能',
  407. showCancel: false,
  408. confirmText: '去登录',
  409. success: () => {
  410. uni.navigateTo({
  411. url: '/pages/page3/page3'
  412. })
  413. }
  414. })
  415. }, 500)
  416. }
  417. },
  418. // 简单的手机号脱敏
  419. maskPhone(phone) {
  420. if (!phone || phone.length < 11) return phone
  421. return phone.substring(0, 3) + '****' + phone.substring(7)
  422. },
  423. // 获取性别文字
  424. getGenderText(gender) {
  425. switch (gender) {
  426. case 1:
  427. return '男'
  428. case 2:
  429. return '女'
  430. default:
  431. return '未知'
  432. }
  433. },
  434. // 计算年龄
  435. calculateAge(birthDate) {
  436. if (!birthDate) return null
  437. const birth = new Date(birthDate)
  438. const today = new Date()
  439. let age = today.getFullYear() - birth.getFullYear()
  440. const monthDiff = today.getMonth() - birth.getMonth()
  441. if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
  442. age--
  443. }
  444. return age
  445. },
  446. // 从后端加载用户信息(通过网关)
  447. loadUserInfo() {
  448. // 检查是否真正登录(必须有token和userInfo)
  449. const token = uni.getStorageSync('token')
  450. const userInfo = uni.getStorageSync('userInfo')
  451. if (!token || !userInfo) {
  452. console.warn('未登录,不加载用户信息')
  453. return
  454. }
  455. // 检查用户ID是否有效
  456. if (!this.currentUserId || this.currentUserId <= 0) {
  457. console.warn('无有效用户ID,无法加载用户信息')
  458. this.setDefaultUserInfo()
  459. return
  460. }
  461. // 获取用户基本信息
  462. uni.request({
  463. url: this.gatewayURL + '/api/user/info?userId=' + this.currentUserId,
  464. method: 'GET',
  465. success: (res) => {
  466. if (res.data && res.data.code === 200) {
  467. const data = res.data.data
  468. // 更新用户信息
  469. this.userInfo = {
  470. userId: data.userId,
  471. nickname: data.nickname || '用户',
  472. avatar: data.avatar || 'https://via.placeholder.com/100',
  473. phone: data.phone,
  474. email: data.email,
  475. gender: data.gender,
  476. genderText: data.genderText,
  477. birthDate: data.birthDate,
  478. age: data.age,
  479. isVerified: data.isVerified || false,
  480. profileProgress: data.profileProgress || 0,
  481. isVip: data.isVip || false,
  482. // 扩展信息
  483. height: data.height,
  484. weight: data.weight,
  485. star: data.star,
  486. animal: data.animal,
  487. educationLevel: data.educationLevel,
  488. educationText: data.educationText,
  489. schoolName: data.schoolName,
  490. company: data.company,
  491. jobTitle: data.jobTitle,
  492. salaryRange: data.salaryRange,
  493. salaryText: data.salaryText,
  494. maritalStatus: data.maritalStatus,
  495. maritalText: data.maritalText,
  496. house: data.house,
  497. houseText: data.houseText,
  498. car: data.car,
  499. carText: data.carText,
  500. hobby: data.hobby,
  501. authenticityScore: data.authenticityScore
  502. }
  503. // 强制页面更新
  504. this.$forceUpdate()
  505. // 加载签到信息
  506. this.loadCheckinInfo()
  507. } else {
  508. console.error('获取用户信息失败:', res.data)
  509. const errorMsg = res.data?.message || '获取用户信息失败'
  510. // 如果是用户不存在的错误,给出特殊提示
  511. if (errorMsg.includes('用户不存在') || errorMsg.includes('用户ID无效')) {
  512. uni.showModal({
  513. title: '用户不存在',
  514. content: `当前用户ID(${this.currentUserId})在数据库中不存在,登录信息有误,请重新登录`,
  515. showCancel: false,
  516. confirmText: '重新登录',
  517. success: () => {
  518. // 清除登录信息并跳转登录页
  519. uni.clearStorageSync()
  520. uni.navigateTo({
  521. url: '/pages/page3/page3?redirect=' + encodeURIComponent('/pages/mine/index')
  522. })
  523. }
  524. })
  525. } else {
  526. uni.showToast({
  527. title: errorMsg,
  528. icon: 'none'
  529. })
  530. // 设置默认用户信息
  531. this.setDefaultUserInfo()
  532. }
  533. }
  534. },
  535. fail: (err) => {
  536. console.error('获取用户信息失败:', err)
  537. // API失败时,提示用户网络错误
  538. uni.showModal({
  539. title: '网络错误',
  540. content: '无法连接到服务器,请检查网络连接或稍后重试',
  541. showCancel: true,
  542. cancelText: '返回',
  543. confirmText: '重试',
  544. success: (modalRes) => {
  545. if (modalRes.confirm) {
  546. // 重试加载
  547. this.loadUserInfo()
  548. }
  549. }
  550. })
  551. // 设置默认用户信息以避免页面空白
  552. this.setDefaultUserInfo()
  553. uni.showToast({
  554. title: '网络连接失败',
  555. icon: 'none',
  556. duration: 2000
  557. })
  558. }
  559. })
  560. },
  561. // 设置默认用户信息(未登录或加载失败时)
  562. setDefaultUserInfo() {
  563. this.userInfo = {
  564. userId: null,
  565. nickname: '未登录用户',
  566. avatar: 'https://via.placeholder.com/100?text=未登录',
  567. phone: '',
  568. email: '',
  569. gender: null,
  570. genderText: '未知',
  571. birthDate: null,
  572. age: null,
  573. isVerified: false,
  574. profileProgress: 0,
  575. isVip: false,
  576. height: null,
  577. weight: null,
  578. star: null,
  579. animal: null,
  580. educationLevel: null,
  581. schoolName: null,
  582. company: null,
  583. jobTitle: null,
  584. salaryRange: null,
  585. maritalStatus: null,
  586. house: null,
  587. car: null,
  588. hobby: null,
  589. authenticityScore: 0
  590. }
  591. // 显示登录提示(仅在没有登录时显示)
  592. const token = uni.getStorageSync('token')
  593. if (!token) {
  594. setTimeout(() => {
  595. uni.showModal({
  596. title: '提示',
  597. content: '请先登录以查看完整功能',
  598. showCancel: true,
  599. cancelText: '稍后',
  600. confirmText: '去登录',
  601. success: (res) => {
  602. if (res.confirm) {
  603. uni.navigateTo({
  604. url: '/pages/page3/page3?redirect=' + encodeURIComponent('/pages/mine/index')
  605. })
  606. }
  607. }
  608. })
  609. }, 1000) // 延迟1秒显示,避免页面刚加载就弹窗
  610. }
  611. },
  612. // 加载签到信息
  613. async loadCheckinInfo() {
  614. // 确保有用户ID
  615. if (!this.userInfo.userId) {
  616. console.error('用户ID不存在,无法加载签到信息')
  617. return
  618. }
  619. try {
  620. // 获取当前年月
  621. const today = new Date()
  622. const year = today.getFullYear()
  623. const month = today.getMonth() + 1
  624. // 用户端始终使用用户签到接口(与红娘端签到完全分开)
  625. const checkinInfoRes = await api.user.checkinInfo(this.userInfo.userId, year, month)
  626. // 更新签到数据
  627. this.checkinData = {
  628. continuousDays: checkinInfoRes.continuousDays || 0,
  629. totalDays: checkinInfoRes.totalDays || 0,
  630. todayChecked: checkinInfoRes.todayChecked || false,
  631. checkedDates: checkinInfoRes.checkedDates || []
  632. }
  633. // 生成日历
  634. this.generateCalendarFromBackend(this.checkinData.checkedDates)
  635. // 简单的奖励列表(签到7天给1天会员,14天给3天会员,30天给7天会员)
  636. this.checkinRewards = [
  637. { day: 7, icon: '👑', reward: '会员+1天', received: this.checkinData.continuousDays >= 7, isCurrent: this.checkinData.continuousDays < 7 },
  638. { day: 14, icon: '💎', reward: '会员+3天', received: this.checkinData.continuousDays >= 14, isCurrent: this.checkinData.continuousDays >= 7 && this.checkinData.continuousDays < 14 },
  639. { day: 30, icon: '🏆', reward: '会员+7天', received: this.checkinData.continuousDays >= 30, isCurrent: this.checkinData.continuousDays >= 14 && this.checkinData.continuousDays < 30 }
  640. ]
  641. } catch (err) {
  642. console.error('加载签到信息失败:', err)
  643. // 设置默认值
  644. this.checkinData = {
  645. continuousDays: 0,
  646. totalDays: 0,
  647. todayChecked: false,
  648. checkedDates: []
  649. }
  650. this.generateCalendarFromBackend([])
  651. }
  652. },
  653. // 根据后端数据生成日历(修复版本)
  654. generateCalendarFromBackend(checkedDates) {
  655. const today = new Date()
  656. const year = today.getFullYear()
  657. const month = today.getMonth() // 0-11
  658. // 格式化当前月份显示
  659. this.currentMonth = `${year}年${month + 1}月`
  660. // 获取本月第一天是星期几(0=周日, 1=周一, ..., 6=周六)
  661. const firstDay = new Date(year, month, 1).getDay()
  662. // 获取本月总天数
  663. const daysInMonth = new Date(year, month + 1, 0).getDate()
  664. // 今天的日期字符串(用于比较)
  665. const todayStr = this.formatDate(today)
  666. const days = []
  667. // 添加空白占位(月初前的空白)
  668. for (let i = 0; i < firstDay; i++) {
  669. days.push({ date: null, checked: false, isToday: false })
  670. }
  671. // 添加本月的每一天
  672. for (let i = 1; i <= daysInMonth; i++) {
  673. const date = new Date(year, month, i)
  674. const dateStr = this.formatDate(date)
  675. const isToday = dateStr === todayStr
  676. const checked = checkedDates.includes(dateStr)
  677. days.push({
  678. date: i,
  679. checked: checked,
  680. isToday: isToday,
  681. dateStr: dateStr
  682. })
  683. }
  684. this.calendarDays = days
  685. },
  686. // 格式化日期
  687. formatDate(date) {
  688. const year = date.getFullYear()
  689. const month = String(date.getMonth() + 1).padStart(2, '0')
  690. const day = String(date.getDate()).padStart(2, '0')
  691. return `${year}-${month}-${day}`
  692. },
  693. // 显示签到弹窗
  694. showCheckinPopup() {
  695. this.$refs.checkinPopup.open()
  696. },
  697. // 关闭签到弹窗
  698. closeCheckinPopup() {
  699. this.$refs.checkinPopup.close()
  700. },
  701. // 处理签到(用户和红娘使用不同接口)
  702. async handleCheckin() {
  703. if (this.checkinData.todayChecked) {
  704. uni.showToast({
  705. title: '今日已签到',
  706. icon: 'none'
  707. })
  708. return
  709. }
  710. // 确保有用户ID
  711. if (!this.userInfo.userId) {
  712. uni.showToast({ title: '请先登录', icon: 'none' })
  713. return
  714. }
  715. try {
  716. // 用户端始终使用用户签到接口(与红娘端签到完全分开)
  717. const signRes = await api.user.doCheckin(this.userInfo.userId)
  718. // 签到成功后更新状态
  719. this.checkinData.todayChecked = true
  720. this.checkinData.totalDays++
  721. this.checkinData.continuousDays++
  722. // 获取当前日期字符串
  723. const today = new Date()
  724. const todayStr = this.formatDate(today)
  725. // 更新签到日期列表
  726. if (!this.checkinData.checkedDates.includes(todayStr)) {
  727. this.checkinData.checkedDates.push(todayStr)
  728. }
  729. // 重新生成日历
  730. this.generateCalendarFromBackend(this.checkinData.checkedDates)
  731. uni.showToast({
  732. title: '签到成功',
  733. icon: 'success',
  734. duration: 2500
  735. })
  736. // 重新加载签到信息,确保数据最新
  737. await this.loadCheckinInfo()
  738. } catch (err) {
  739. console.error('签到失败:', err)
  740. uni.showToast({
  741. title: err.message || '签到失败,请稍后重试',
  742. icon: 'none'
  743. })
  744. }
  745. },
  746. goVerify() {
  747. uni.navigateTo({
  748. url: '/pages/settings/id-verification'
  749. })
  750. },
  751. goCompleteProfile() {
  752. this.goToPage('basicInfo')
  753. },
  754. goVip() {
  755. uni.navigateTo({
  756. url: '/pages/vip/index'
  757. })
  758. },
  759. goToPage(page) {
  760. try {
  761. if (page === 'basicInfo') {
  762. uni.navigateTo({
  763. url: '/pages/profile/index',
  764. success: () => {
  765. },
  766. fail: (err) => {
  767. console.error('❌ 基本资料页面跳转失败:', err)
  768. uni.showToast({
  769. title: '页面跳转失败',
  770. icon: 'none'
  771. })
  772. }
  773. })
  774. } else if (page === 'verifyRealName') {
  775. // 跳转到实名认证页面
  776. uni.navigateTo({
  777. url: '/pages/settings/id-verification',
  778. success: () => {
  779. },
  780. fail: (err) => {
  781. console.error('❌ 实名认证页面跳转失败:', err)
  782. uni.showToast({
  783. title: '页面跳转失败',
  784. icon: 'none'
  785. })
  786. }
  787. })
  788. } else if (page === 'verifyEducation') {
  789. // 跳转到实名认证页面
  790. uni.navigateTo({
  791. url: '/pages/settings/id-verification',
  792. success: () => {
  793. },
  794. fail: (err) => {
  795. console.error('❌ 学历认证页面跳转失败:', err)
  796. uni.showToast({
  797. title: '页面跳转失败',
  798. icon: 'none'
  799. })
  800. }
  801. })
  802. } else if (page === 'partTimeMatchmaker') {
  803. // 跳转到兼职红娘页面
  804. uni.navigateTo({
  805. url: '/pages/part-time-matchmaker/index',
  806. success: () => {
  807. },
  808. fail: (err) => {
  809. console.error('❌ 兼职红娘页面跳转失败:', err)
  810. uni.showToast({
  811. title: '页面跳转失败',
  812. icon: 'none'
  813. })
  814. }
  815. })
  816. } else if (page === 'blacklist') {
  817. // 跳转到黑名单页面
  818. uni.navigateTo({
  819. url: '/pages/blacklist/index',
  820. success: () => {
  821. },
  822. fail: (err) => {
  823. console.error('❌ 黑名单页面跳转失败:', err)
  824. uni.showToast({
  825. title: '页面跳转失败',
  826. icon: 'none'
  827. })
  828. }
  829. })
  830. } else if (page === 'partnerRequirement') {
  831. // 跳转到对象要求页面
  832. uni.navigateTo({
  833. url: '/pages/partner-requirement/index',
  834. success: () => {
  835. },
  836. fail: (err) => {
  837. console.error('❌ 对象要求页面跳转失败:', err)
  838. uni.showToast({
  839. title: '页面跳转失败',
  840. icon: 'none'
  841. })
  842. }
  843. })
  844. } else if (page === 'feedback') {
  845. uni.navigateTo({
  846. url: '/pages/feedback/index',
  847. success: () => {
  848. },
  849. fail: (err) => {
  850. console.error('❌ 用户反馈页面跳转失败:', err)
  851. uni.showToast({
  852. title: '页面跳转失败',
  853. icon: 'none'
  854. })
  855. }
  856. })
  857. } else if (page === 'settings') {
  858. uni.navigateTo({
  859. url: '/pages/settings/index',
  860. success: () => {
  861. },
  862. fail: (err) => {
  863. console.error('❌ 设置页面跳转失败:', err)
  864. uni.showToast({
  865. title: '页面跳转失败',
  866. icon: 'none'
  867. })
  868. }
  869. })
  870. }
  871. else if (page === 'part-time-matchmaker') {
  872. uni.navigateTo({
  873. url: '/pages/part-time-matchmaker/index',
  874. success: () => {
  875. },
  876. fail: (err) => {
  877. console.error('❌ 加入红娘页面跳转失败:', err)
  878. uni.showToast({
  879. title: '页面跳转失败',
  880. icon: 'none'
  881. })
  882. }
  883. })
  884. } else if (page === 'myActivity') {
  885. uni.navigateTo({
  886. url: '/pages/mine/my-activities',
  887. success: () => {
  888. },
  889. fail: (err) => {
  890. console.error('❌ 我的活动页面跳转失败:', err)
  891. uni.showToast({
  892. title: '页面跳转失败',
  893. icon: 'none'
  894. })
  895. }
  896. })
  897. } else if (page === 'myDynamics') {
  898. uni.navigateTo({
  899. url: '/pages/mine/my-dynamics',
  900. success: () => {
  901. },
  902. fail: (err) => {
  903. console.error('❌ 我的动态页面跳转失败:', err)
  904. uni.showToast({
  905. title: '页面跳转失败',
  906. icon: 'none'
  907. })
  908. }
  909. })
  910. } else {
  911. uni.showToast({
  912. title: '功能开发中',
  913. icon: 'none'
  914. })
  915. }
  916. } catch (error) {
  917. console.error('❌ goToPage 执行出错:', error)
  918. uni.showToast({
  919. title: '页面跳转异常',
  920. icon: 'none'
  921. })
  922. }
  923. },
  924. switchTab(tab) {
  925. if (tab === 'mine') return
  926. const tabPages = {
  927. index: '/pages/index/index',
  928. plaza: '/pages/plaza/index',
  929. recommend: '/pages/recommend/index',
  930. message: '/pages/message/index'
  931. }
  932. if (tabPages[tab]) {
  933. uni.redirectTo({
  934. url: tabPages[tab]
  935. })
  936. }
  937. },
  938. // 处理退出登录
  939. handleLogout() {
  940. uni.showModal({
  941. title: '退出登录',
  942. content: '确定要退出登录吗?',
  943. showCancel: true,
  944. cancelText: '取消',
  945. confirmText: '确定',
  946. success: (res) => {
  947. if (res.confirm) {
  948. this.executeLogout()
  949. }
  950. }
  951. })
  952. },
  953. // 执行退出登录(最可靠的方式)
  954. executeLogout() {
  955. // 立即显示加载状态
  956. uni.showLoading({
  957. title: '退出中...',
  958. mask: true
  959. })
  960. // 延迟执行,确保UI更新
  961. setTimeout(() => {
  962. try {
  963. // 断开在线状态WebSocket
  964. try {
  965. const timPresenceManager = require('@/utils/tim-presence-manager.js').default;
  966. if (timPresenceManager) {
  967. timPresenceManager.disconnect();
  968. }
  969. } catch (error) {
  970. console.error('❌ 断开在线状态WebSocket失败:', error);
  971. }
  972. // 断开TIM WebSocket
  973. try {
  974. const timManager = require('@/utils/tim-manager.js').default;
  975. if (timManager && timManager.isLogin) {
  976. timManager.logout();
  977. }
  978. } catch (error) {
  979. console.error('❌ TIM登出失败:', error);
  980. }
  981. // 方法1: 逐个清除
  982. uni.removeStorageSync('token')
  983. uni.removeStorageSync('userInfo')
  984. uni.removeStorageSync('userId')
  985. uni.removeStorageSync('rememberedAccount')
  986. const remainToken = uni.getStorageSync('token')
  987. const remainUser = uni.getStorageSync('userInfo')
  988. // 如果还有残留数据,使用强制清除
  989. if (remainToken || remainUser) {
  990. uni.clearStorageSync()
  991. }
  992. this.currentUserId = null
  993. this.userInfo = {
  994. userId: null,
  995. nickname: '未登录用户',
  996. avatar: 'https://via.placeholder.com/100?text=未登录'
  997. }
  998. // 隐藏加载,显示成功
  999. uni.hideLoading()
  1000. uni.showToast({
  1001. title: '退出成功!',
  1002. icon: 'success',
  1003. duration: 1500
  1004. })
  1005. // 延迟跳转
  1006. setTimeout(() => {
  1007. uni.reLaunch({
  1008. url: '/pages/page3/page3'
  1009. })
  1010. }, 1500)
  1011. } catch (error) {
  1012. console.error('退出过程出错:', error)
  1013. uni.hideLoading()
  1014. // 强制退出
  1015. uni.clearStorageSync()
  1016. uni.showModal({
  1017. title: '退出完成',
  1018. content: '已清除登录信息,请重新打开应用',
  1019. showCancel: false,
  1020. confirmText: '知道了'
  1021. })
  1022. }
  1023. }, 300) // 300毫秒延迟确保UI响应
  1024. },
  1025. // 设置测试用户数据(基于数据库真实数据)
  1026. // ⚠️ 已弃用:此方法仅供调试使用,正常流程不再调用测试数据
  1027. setTestUserData() {
  1028. console.warn('⚠️ 警告:正在使用测试数据,这不应该在生产环境中发生')
  1029. // 根据当前用户ID设置对应的数据库用户信息
  1030. const userId = this.currentUserId || 1
  1031. let userData = {}
  1032. // 设置用户信息
  1033. this.userInfo = userData
  1034. // 设置统计数据
  1035. this.stats = {
  1036. myConnection: 0,
  1037. myFavorites: 0,
  1038. whoViewedMe: 0,
  1039. iViewed: 0
  1040. }
  1041. // 获取真实数量
  1042. this.getLikedUsersCount()
  1043. this.getLikedMeUsersCount()
  1044. // 显示提示
  1045. uni.showToast({
  1046. title: '使用测试数据: ' + this.userInfo.nickname,
  1047. icon: 'success',
  1048. duration: 2000
  1049. })
  1050. },
  1051. // 处理VIP购买成功事件
  1052. handleVipPurchased() {
  1053. // 延迟刷新,确保后端数据已更新
  1054. setTimeout(() => {
  1055. this.loadUserInfo()
  1056. }, 500)
  1057. },
  1058. // 统计数据板块点击事件
  1059. goToLikedByMe() {
  1060. // 跳转到我喜欢的页面
  1061. uni.navigateTo({
  1062. url: '/pages/mine/liked-by-me',
  1063. fail: (err) => {
  1064. console.error('跳转我喜欢的页面失败:', err)
  1065. uni.showToast({
  1066. title: '页面跳转失败',
  1067. icon: 'none'
  1068. })
  1069. }
  1070. })
  1071. },
  1072. // 获取我喜欢的用户真实数量
  1073. async getLikedUsersCount() {
  1074. try {
  1075. const userId = this.currentUserId
  1076. if (userId) {
  1077. // 调用后端API获取真实的喜欢用户数量
  1078. const result = await api.recommend.getLikedUsersCount(userId)
  1079. // 确保获取的是数字值
  1080. const count = typeof result === 'number' ? result : (result.data || 0)
  1081. // 更新统计数据
  1082. this.stats.myConnection = count || 0
  1083. }
  1084. } catch (error) {
  1085. console.error('获取喜欢的用户数量失败:', error)
  1086. // 如果获取失败,使用默认值
  1087. this.stats.myConnection = 0
  1088. }
  1089. },
  1090. // 获取喜欢我的用户真实数量
  1091. async getLikedMeUsersCount() {
  1092. try {
  1093. const userId = this.currentUserId
  1094. if (userId) {
  1095. // 调用后端API获取真实的喜欢我的用户数量
  1096. const result = await api.recommend.getLikedMeUsersCount(userId)
  1097. // 确保获取的是数字值
  1098. const count = typeof result === 'number' ? result : (result.data || 0)
  1099. // 更新统计数据
  1100. this.stats.myFavorites = count || 0
  1101. }
  1102. } catch (error) {
  1103. console.error('获取喜欢我的用户数量失败:', error)
  1104. // 如果获取失败,使用默认值
  1105. this.stats.myFavorites = 0
  1106. }
  1107. },
  1108. // 获取我浏览的用户真实数量
  1109. async getBrowseHistoryCount() {
  1110. try {
  1111. const userId = this.currentUserId
  1112. if (userId) {
  1113. // 调用后端API获取真实的浏览记录数量
  1114. const result = await api.recommend.getBrowseHistoryCount(userId)
  1115. // 确保获取的是数字值
  1116. const count = typeof result === 'number' ? result : (result.data || 0)
  1117. // 更新统计数据
  1118. this.stats.iViewed = count || 0
  1119. }
  1120. } catch (error) {
  1121. console.error('获取浏览记录数量失败:', error)
  1122. // 如果获取失败,使用默认值
  1123. this.stats.iViewed = 0
  1124. }
  1125. },
  1126. goToLikedMe() {
  1127. // 跳转到喜欢我的页面
  1128. uni.navigateTo({
  1129. url: '/pages/mine/liked-me',
  1130. fail: (err) => {
  1131. console.error('跳转喜欢我的页面失败:', err)
  1132. uni.showToast({
  1133. title: '页面跳转失败',
  1134. icon: 'none'
  1135. })
  1136. }
  1137. })
  1138. },
  1139. goToVisitedByMe() {
  1140. // 跳转到我浏览的页面
  1141. uni.navigateTo({
  1142. url: '/pages/mine/visited-by-me',
  1143. fail: (err) => {
  1144. console.error('跳转我浏览的页面失败:', err)
  1145. uni.showToast({
  1146. title: '页面跳转失败',
  1147. icon: 'none'
  1148. })
  1149. }
  1150. })
  1151. }
  1152. }
  1153. }
  1154. </script>
  1155. <style lang="scss" scoped>
  1156. /* 扁平化设计风格 */
  1157. .mine-page {
  1158. min-height: 100vh;
  1159. background: #F5F5F5;
  1160. padding-bottom: 120rpx;
  1161. }
  1162. /* 用户信息内的统计数据样式 */
  1163. .user-stats {
  1164. display: flex;
  1165. justify-content: space-around;
  1166. margin: 20rpx 0 0;
  1167. padding: 0;
  1168. background: transparent;
  1169. border-radius: 0;
  1170. box-shadow: none;
  1171. border: none;
  1172. }
  1173. .stats-item {
  1174. flex: 1;
  1175. display: flex;
  1176. flex-direction: column;
  1177. align-items: center;
  1178. justify-content: center;
  1179. padding: 15rpx 20rpx;
  1180. border-radius: 0;
  1181. transition: all 0.3s ease;
  1182. &:not(:last-child) {
  1183. border-right: none;
  1184. }
  1185. .stats-number {
  1186. font-size: 40rpx;
  1187. font-weight: bold;
  1188. color: #FFFFFF;
  1189. margin-bottom: 5rpx;
  1190. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1191. }
  1192. .stats-label {
  1193. font-size: 22rpx;
  1194. color: rgba(255, 255, 255, 0.9);
  1195. font-weight: 500;
  1196. text-shadow: 0 1rpx 4rpx rgba(0, 0, 0, 0.1);
  1197. }
  1198. }
  1199. /* 用户信息区域 - 优化版 */
  1200. .user-section {
  1201. margin: 0;
  1202. margin-top: env(safe-area-inset-top);
  1203. padding: 30rpx;
  1204. background: linear-gradient(135deg, #FF8A9B 0%, #FFB4C0 100%);
  1205. box-shadow: 0 4rpx 20rpx rgba(255, 138, 155, 0.2);
  1206. .user-info {
  1207. display: flex;
  1208. align-items: flex-start;
  1209. margin-bottom: 0;
  1210. .avatar {
  1211. width: 140rpx;
  1212. height: 140rpx;
  1213. border-radius: 50%;
  1214. margin-right: 30rpx;
  1215. background-color: #FFFFFF;
  1216. border: 4rpx solid rgba(255, 255, 255, 0.8);
  1217. box-shadow: 0 8rpx 30rpx rgba(255, 138, 155, 0.3);
  1218. transition: transform 0.3s ease;
  1219. overflow: hidden;
  1220. }
  1221. .avatar:active {
  1222. transform: scale(1.05);
  1223. }
  1224. .user-details {
  1225. flex: 1;
  1226. .nickname-row {
  1227. display: flex;
  1228. align-items: center;
  1229. margin-bottom: 20rpx;
  1230. margin-top: 0;
  1231. .nickname {
  1232. font-size: 44rpx;
  1233. font-weight: bold;
  1234. color: #FFFFFF;
  1235. margin-right: 16rpx;
  1236. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1237. }
  1238. /* VIP标志样式 - 精致版 */
  1239. .vip-badge {
  1240. margin-right: 12rpx;
  1241. display: flex;
  1242. align-items: center;
  1243. justify-content: center;
  1244. background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  1245. color: #FFFFFF;
  1246. padding: 6rpx 16rpx;
  1247. border-radius: 20rpx;
  1248. font-size: 24rpx;
  1249. font-weight: bold;
  1250. box-shadow:
  1251. 0 4rpx 15rpx rgba(255, 215, 0, 0.4),
  1252. 0 0 0 2rpx rgba(255, 255, 255, 0.9);
  1253. transition: all 0.3s ease;
  1254. letter-spacing: 1rpx;
  1255. text-transform: uppercase;
  1256. position: relative;
  1257. overflow: hidden;
  1258. z-index: 1;
  1259. &:before {
  1260. content: '';
  1261. position: absolute;
  1262. top: 0;
  1263. left: -100%;
  1264. width: 100%;
  1265. height: 100%;
  1266. background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  1267. transition: left 0.4s ease;
  1268. z-index: -1;
  1269. }
  1270. &:active {
  1271. transform: scale(0.95);
  1272. box-shadow:
  1273. 0 3rpx 10rpx rgba(255, 215, 0, 0.3),
  1274. 0 0 0 2rpx rgba(255, 255, 255, 0.9);
  1275. }
  1276. &:active:before {
  1277. left: 100%;
  1278. }
  1279. }
  1280. .verify-badge {
  1281. background: rgba(255, 255, 255, 0.9);
  1282. padding: 8rpx 22rpx;
  1283. border-radius: 20rpx;
  1284. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  1285. transition: all 0.3s ease;
  1286. .verify-text {
  1287. font-size: 24rpx;
  1288. color: #FF6B8A;
  1289. font-weight: 600;
  1290. }
  1291. }
  1292. .verify-badge:active {
  1293. transform: scale(0.95);
  1294. background: rgba(255, 255, 255, 1);
  1295. }
  1296. }
  1297. /* 基本信息展示 - 优化版 */
  1298. .user-basic-info {
  1299. display: flex;
  1300. flex-wrap: wrap;
  1301. gap: 18rpx;
  1302. margin-bottom: 24rpx;
  1303. .info-item {
  1304. display: flex;
  1305. align-items: center;
  1306. gap: 10rpx;
  1307. padding: 10rpx 22rpx;
  1308. background: rgba(255, 255, 255, 0.9);
  1309. border-radius: 25rpx;
  1310. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
  1311. backdrop-filter: blur(10rpx);
  1312. transition: all 0.3s ease;
  1313. .info-icon {
  1314. font-size: 30rpx;
  1315. }
  1316. .info-text {
  1317. font-size: 26rpx;
  1318. color: #333333;
  1319. font-weight: 500;
  1320. }
  1321. }
  1322. .info-item:active {
  1323. transform: scale(0.98);
  1324. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.12);
  1325. }
  1326. }
  1327. .progress-row {
  1328. display: flex;
  1329. align-items: center;
  1330. gap: 20rpx;
  1331. .progress-bar {
  1332. flex: 1;
  1333. height: 14rpx;
  1334. background-color: rgba(255, 255, 255, 0.3);
  1335. border-radius: 7rpx;
  1336. overflow: hidden;
  1337. box-shadow: inset 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  1338. .progress-fill {
  1339. height: 100%;
  1340. background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 1) 100%);
  1341. border-radius: 7rpx;
  1342. transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  1343. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.15);
  1344. }
  1345. }
  1346. .progress-text {
  1347. font-size: 26rpx;
  1348. color: rgba(255, 255, 255, 0.95);
  1349. font-weight: 500;
  1350. white-space: nowrap;
  1351. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1352. transition: color 0.3s ease;
  1353. }
  1354. .progress-text:active {
  1355. color: #FFFFFF;
  1356. }
  1357. }
  1358. }
  1359. }
  1360. }
  1361. /* VIP会员卡片 - 优化版 */
  1362. .vip-card {
  1363. margin: 20rpx 30rpx;
  1364. background: linear-gradient(135deg, #F0E6FF 0%, #E8DFFF 100%);
  1365. border-radius: 20rpx;
  1366. padding: 35rpx;
  1367. display: flex;
  1368. align-items: center;
  1369. justify-content: space-between;
  1370. box-shadow: 0 4rpx 20rpx rgba(153, 102, 255, 0.15);
  1371. transition: all 0.3s ease;
  1372. border: none;
  1373. &:active {
  1374. transform: translateY(2rpx);
  1375. box-shadow: 0 2rpx 10rpx rgba(153, 102, 255, 0.1);
  1376. }
  1377. .vip-content {
  1378. display: flex;
  1379. align-items: center;
  1380. .vip-icon {
  1381. font-size: 70rpx;
  1382. margin-right: 25rpx;
  1383. filter: drop-shadow(0 4rpx 15rpx rgba(218, 112, 214, 0.4));
  1384. }
  1385. .vip-info {
  1386. display: flex;
  1387. flex-direction: column;
  1388. gap: 8rpx;
  1389. .vip-title {
  1390. font-size: 34rpx;
  1391. font-weight: bold;
  1392. color: #6B4EA3;
  1393. }
  1394. .vip-subtitle {
  1395. font-size: 24rpx;
  1396. color: #8B7BAA;
  1397. background: rgba(255, 255, 255, 0.6);
  1398. padding: 6rpx 18rpx;
  1399. border-radius: 15rpx;
  1400. }
  1401. }
  1402. }
  1403. .vip-button {
  1404. background: linear-gradient(135deg, #9575CD 0%, #7E57C2 100%);
  1405. color: #FFFFFF;
  1406. padding: 18rpx 35rpx;
  1407. border-radius: 30rpx;
  1408. font-size: 28rpx;
  1409. white-space: nowrap;
  1410. font-weight: 600;
  1411. box-shadow: 0 4rpx 15rpx rgba(149, 117, 205, 0.3);
  1412. transition: all 0.3s ease;
  1413. }
  1414. .vip-button:active {
  1415. transform: scale(0.95);
  1416. box-shadow: 0 2rpx 10rpx rgba(149, 117, 205, 0.2);
  1417. }
  1418. }
  1419. /* 专属红娘 - 优化版 */
  1420. .matchmaker-card {
  1421. margin: 20rpx 30rpx;
  1422. background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  1423. border-radius: 20rpx;
  1424. padding: 25rpx;
  1425. text-align: center;
  1426. box-shadow: 0 4rpx 20rpx rgba(255, 193, 7, 0.15);
  1427. border: none;
  1428. .matchmaker-text {
  1429. font-size: 28rpx;
  1430. color: #F57C00;
  1431. font-weight: 500;
  1432. display: flex;
  1433. align-items: center;
  1434. justify-content: center;
  1435. gap: 10rpx;
  1436. }
  1437. }
  1438. /* 快捷入口 - 优化版 */
  1439. .quick-actions {
  1440. margin: 20rpx 30rpx;
  1441. background: rgba(255, 255, 255, 0.95);
  1442. backdrop-filter: blur(10rpx);
  1443. border-radius: 20rpx;
  1444. padding: 45rpx 30rpx;
  1445. display: flex;
  1446. justify-content: space-around;
  1447. box-shadow: 0 4rpx 25rpx rgba(0, 0, 0, 0.08);
  1448. border: none;
  1449. .action-item {
  1450. display: flex;
  1451. flex-direction: column;
  1452. align-items: center;
  1453. gap: 15rpx;
  1454. transition: all 0.3s ease;
  1455. padding: 15rpx;
  1456. border-radius: 15rpx;
  1457. &:active {
  1458. transform: translateY(2rpx);
  1459. background: rgba(255, 255, 255, 0.8);
  1460. }
  1461. .action-icon {
  1462. width: 110rpx;
  1463. height: 110rpx;
  1464. border-radius: 20rpx;
  1465. display: flex;
  1466. align-items: center;
  1467. justify-content: center;
  1468. font-size: 55rpx;
  1469. box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.1);
  1470. transition: all 0.3s ease;
  1471. border: none;
  1472. }
  1473. .action-icon:active {
  1474. transform: scale(0.95);
  1475. }
  1476. .calendar-icon {
  1477. background: linear-gradient(135deg, #E8F5E8 0%, #C8E6C9 100%);
  1478. color: #4CAF50;
  1479. }
  1480. .phone-icon {
  1481. background: linear-gradient(135deg, #FFF3CD 0%, #FFEEBA 100%);
  1482. color: #FFA726;
  1483. }
  1484. .heart-icon {
  1485. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  1486. color: #F44336;
  1487. }
  1488. .action-label {
  1489. font-size: 28rpx;
  1490. color: #333333;
  1491. font-weight: 500;
  1492. }
  1493. }
  1494. }
  1495. /* 功能菜单列表 - 优化版 */
  1496. .menu-list {
  1497. margin: 20rpx 30rpx 30rpx;
  1498. background: rgba(255, 255, 255, 0.95);
  1499. backdrop-filter: blur(10rpx);
  1500. border-radius: 20rpx;
  1501. overflow: hidden;
  1502. box-shadow: 0 4rpx 25rpx rgba(0, 0, 0, 0.08);
  1503. border: none;
  1504. .menu-item {
  1505. display: flex;
  1506. align-items: center;
  1507. justify-content: space-between;
  1508. padding: 40rpx 35rpx;
  1509. border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
  1510. transition: all 0.3s ease;
  1511. position: relative;
  1512. overflow: hidden;
  1513. &:before {
  1514. content: '';
  1515. position: absolute;
  1516. left: 0;
  1517. top: 0;
  1518. width: 5rpx;
  1519. height: 100%;
  1520. background: linear-gradient(135deg, #FF8A9B 0%, #FFB4C0 100%);
  1521. transform: scaleY(0);
  1522. transition: transform 0.3s ease;
  1523. }
  1524. &:last-child {
  1525. border-bottom: none;
  1526. }
  1527. &:active {
  1528. background: linear-gradient(135deg, #FFF8FA 0%, #FFF0F2 100%);
  1529. transform: translateX(5rpx);
  1530. &:before {
  1531. transform: scaleY(1);
  1532. }
  1533. }
  1534. .menu-left {
  1535. display: flex;
  1536. align-items: center;
  1537. gap: 25rpx;
  1538. .menu-icon {
  1539. font-size: 48rpx;
  1540. transition: transform 0.3s ease;
  1541. }
  1542. .menu-text {
  1543. font-size: 32rpx;
  1544. color: #333333;
  1545. font-weight: 500;
  1546. transition: color 0.3s ease;
  1547. }
  1548. }
  1549. .menu-arrow {
  1550. font-size: 48rpx;
  1551. color: #E0E0E0;
  1552. font-weight: 300;
  1553. transition: color 0.3s ease;
  1554. }
  1555. &:active .menu-arrow {
  1556. color: #FF8A9B;
  1557. transform: translateX(5rpx);
  1558. }
  1559. }
  1560. /* 退出登录特殊样式 - 优化版 */
  1561. .menu-item.logout-item {
  1562. border-top: 3rpx solid rgba(255, 99, 132, 0.2);
  1563. background: linear-gradient(135deg, #FFF8F8 0%, #FFF0F0 100%);
  1564. .menu-left .menu-icon {
  1565. color: #F44336;
  1566. font-size: 50rpx;
  1567. }
  1568. .menu-left .menu-text {
  1569. color: #F44336;
  1570. font-weight: bold;
  1571. font-size: 34rpx;
  1572. }
  1573. .menu-arrow {
  1574. color: #F44336;
  1575. }
  1576. &:active {
  1577. background: linear-gradient(135deg, #FFEEEE 0%, #FFDDDD 100%);
  1578. }
  1579. &:before {
  1580. background: linear-gradient(135deg, #F44336 0%, #FF6B8A 100%);
  1581. }
  1582. }
  1583. }
  1584. /* 签到弹窗样式 - 优化版 */
  1585. .checkin-popup {
  1586. width: 640rpx;
  1587. max-height: 85vh;
  1588. background: rgba(255, 255, 255, 0.98);
  1589. backdrop-filter: blur(20rpx);
  1590. border-radius: 25rpx;
  1591. overflow: hidden;
  1592. display: flex;
  1593. flex-direction: column;
  1594. box-shadow: 0 10rpx 50rpx rgba(0, 0, 0, 0.15);
  1595. border: none;
  1596. transform: translateY(-80rpx);
  1597. .popup-header {
  1598. display: flex;
  1599. align-items: center;
  1600. justify-content: center;
  1601. padding: 40rpx 30rpx 30rpx;
  1602. position: relative;
  1603. background: linear-gradient(135deg, #FF8A9B 0%, #FFB4C0 100%);
  1604. flex-shrink: 0;
  1605. .popup-title {
  1606. font-size: 36rpx;
  1607. font-weight: bold;
  1608. color: #FFFFFF;
  1609. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1610. }
  1611. .close-btn {
  1612. position: absolute;
  1613. right: 25rpx;
  1614. top: 30rpx;
  1615. width: 60rpx;
  1616. height: 60rpx;
  1617. display: flex;
  1618. align-items: center;
  1619. justify-content: center;
  1620. background: rgba(255, 255, 255, 0.2);
  1621. border-radius: 50%;
  1622. transition: all 0.3s ease;
  1623. &:active {
  1624. transform: scale(0.9);
  1625. background: rgba(255, 255, 255, 0.3);
  1626. }
  1627. .close-icon {
  1628. font-size: 40rpx;
  1629. color: #FFFFFF;
  1630. line-height: 1;
  1631. }
  1632. }
  1633. }
  1634. .checkin-info {
  1635. display: flex;
  1636. justify-content: space-around;
  1637. padding: 30rpx;
  1638. background: linear-gradient(135deg, #FFF8FA 0%, #FFF0F2 100%);
  1639. flex-shrink: 0;
  1640. .info-item {
  1641. display: flex;
  1642. flex-direction: column;
  1643. align-items: center;
  1644. gap: 12rpx;
  1645. .info-label {
  1646. font-size: 24rpx;
  1647. color: #999999;
  1648. font-weight: 500;
  1649. }
  1650. .info-value {
  1651. font-size: 42rpx;
  1652. font-weight: bold;
  1653. color: #FF6B8A;
  1654. text-shadow: 0 2rpx 8rpx rgba(255, 107, 138, 0.2);
  1655. }
  1656. }
  1657. }
  1658. .checkin-content {
  1659. flex: 1;
  1660. overflow-y: auto;
  1661. max-height: 55vh;
  1662. }
  1663. .checkin-calendar {
  1664. padding: 30rpx;
  1665. .calendar-header {
  1666. text-align: center;
  1667. margin-bottom: 25rpx;
  1668. .month-text {
  1669. font-size: 30rpx;
  1670. font-weight: bold;
  1671. color: #333333;
  1672. background: linear-gradient(135deg, #FF8A9B 0%, #FFB4C0 100%);
  1673. -webkit-background-clip: text;
  1674. -webkit-text-fill-color: transparent;
  1675. background-clip: text;
  1676. }
  1677. }
  1678. .week-header {
  1679. display: flex;
  1680. margin-bottom: 15rpx;
  1681. .week-day {
  1682. flex: 1;
  1683. text-align: center;
  1684. font-size: 24rpx;
  1685. color: #666666;
  1686. font-weight: 600;
  1687. }
  1688. }
  1689. .calendar-body {
  1690. display: grid;
  1691. grid-template-columns: repeat(7, 1fr);
  1692. gap: 12rpx;
  1693. .calendar-day {
  1694. height: 80rpx;
  1695. display: flex;
  1696. align-items: center;
  1697. justify-content: center;
  1698. position: relative;
  1699. box-sizing: border-box;
  1700. border-radius: 15rpx;
  1701. transition: all 0.3s ease;
  1702. background: rgba(255, 255, 255, 0.5);
  1703. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  1704. .day-num {
  1705. font-size: 26rpx;
  1706. color: #333333;
  1707. font-weight: 500;
  1708. }
  1709. .check-mark {
  1710. position: absolute;
  1711. top: 8rpx;
  1712. right: 8rpx;
  1713. font-size: 20rpx;
  1714. color: #FFFFFF;
  1715. background: linear-gradient(135deg, #FF6B8A 0%, #FF8A9B 100%);
  1716. width: 30rpx;
  1717. height: 30rpx;
  1718. border-radius: 50%;
  1719. display: flex;
  1720. align-items: center;
  1721. justify-content: center;
  1722. box-shadow: 0 2rpx 8rpx rgba(255, 107, 138, 0.3);
  1723. }
  1724. &.empty {
  1725. visibility: hidden;
  1726. }
  1727. &.checked {
  1728. background: linear-gradient(135deg, #FFE0E6 0%, #FFCCD5 100%);
  1729. box-shadow: 0 4rpx 15rpx rgba(255, 107, 138, 0.2);
  1730. .day-num {
  1731. color: #FF6B8A;
  1732. font-weight: bold;
  1733. }
  1734. }
  1735. &.today {
  1736. background: linear-gradient(135deg, #FF6B8A 0%, #FF8A9B 100%);
  1737. box-shadow: 0 6rpx 20rpx rgba(255, 107, 138, 0.3);
  1738. .day-num {
  1739. color: #FFFFFF;
  1740. font-weight: bold;
  1741. font-size: 28rpx;
  1742. }
  1743. }
  1744. &.today.checked {
  1745. .check-mark {
  1746. background: rgba(255, 255, 255, 0.9);
  1747. color: #FF6B8A;
  1748. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1749. }
  1750. }
  1751. }
  1752. }
  1753. }
  1754. .checkin-rewards {
  1755. padding: 25rpx 30rpx 30rpx;
  1756. background: linear-gradient(135deg, #FFF8FA 0%, #FFF0F2 100%);
  1757. flex-shrink: 0;
  1758. .rewards-title {
  1759. font-size: 30rpx;
  1760. font-weight: bold;
  1761. color: #333333;
  1762. margin-bottom: 20rpx;
  1763. display: block;
  1764. }
  1765. .rewards-list {
  1766. display: flex;
  1767. justify-content: space-between;
  1768. gap: 18rpx;
  1769. .reward-item {
  1770. flex: 1;
  1771. background: rgba(255, 255, 255, 0.9);
  1772. border-radius: 18rpx;
  1773. padding: 25rpx 15rpx;
  1774. display: flex;
  1775. flex-direction: column;
  1776. align-items: center;
  1777. position: relative;
  1778. box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.08);
  1779. transition: all 0.3s ease;
  1780. .reward-icon {
  1781. font-size: 60rpx;
  1782. margin-bottom: 15rpx;
  1783. filter: drop-shadow(0 4rpx 15rpx rgba(0, 0, 0, 0.1));
  1784. }
  1785. .reward-day {
  1786. font-size: 26rpx;
  1787. color: #666666;
  1788. margin-bottom: 12rpx;
  1789. font-weight: 500;
  1790. }
  1791. .reward-text {
  1792. font-size: 28rpx;
  1793. color: #333333;
  1794. font-weight: bold;
  1795. }
  1796. .received-mark {
  1797. position: absolute;
  1798. top: 15rpx;
  1799. right: 15rpx;
  1800. width: 36rpx;
  1801. height: 36rpx;
  1802. background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
  1803. color: #FFFFFF;
  1804. border-radius: 50%;
  1805. display: flex;
  1806. align-items: center;
  1807. justify-content: center;
  1808. font-size: 22rpx;
  1809. box-shadow: 0 2rpx 8rpx rgba(76, 175, 80, 0.3);
  1810. }
  1811. &.received {
  1812. opacity: 0.7;
  1813. transform: scale(0.95);
  1814. }
  1815. &.current {
  1816. background: linear-gradient(135deg, #FFE0E6 0%, #FFCCD5 100%);
  1817. box-shadow: 0 6rpx 20rpx rgba(255, 107, 138, 0.2);
  1818. .reward-text {
  1819. color: #FF6B8A;
  1820. }
  1821. .reward-icon {
  1822. transform: scale(1.1);
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. .checkin-button-wrapper {
  1829. padding: 0 30rpx 40rpx;
  1830. flex-shrink: 0;
  1831. .checkin-btn {
  1832. width: 100%;
  1833. background: linear-gradient(135deg, #FF6B8A 0%, #FF8A9B 100%);
  1834. color: #FFFFFF;
  1835. font-size: 34rpx;
  1836. font-weight: bold;
  1837. border-radius: 35rpx;
  1838. padding: 20rpx;
  1839. border: none;
  1840. transition: all 0.3s ease;
  1841. box-shadow: 0 6rpx 25rpx rgba(255, 107, 138, 0.3);
  1842. &:active:not(.disabled) {
  1843. transform: translateY(2rpx);
  1844. box-shadow: 0 4rpx 15rpx rgba(255, 107, 138, 0.2);
  1845. }
  1846. &.disabled {
  1847. background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%);
  1848. box-shadow: none;
  1849. }
  1850. &::after {
  1851. border: none;
  1852. }
  1853. }
  1854. }
  1855. }
  1856. /* 底部导航栏 - 优化版 */
  1857. .tabbar {
  1858. position: fixed;
  1859. bottom: 0;
  1860. left: 0;
  1861. right: 0;
  1862. display: flex;
  1863. background-color: #FFFFFF;
  1864. border-top: 1rpx solid #F0F0F0;
  1865. padding-bottom: constant(safe-area-inset-bottom);
  1866. padding-bottom: env(safe-area-inset-bottom);
  1867. z-index: 999;
  1868. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1869. .tabbar-item {
  1870. flex: 1;
  1871. display: flex;
  1872. flex-direction: column;
  1873. align-items: center;
  1874. justify-content: center;
  1875. padding: 10rpx 0;
  1876. position: relative;
  1877. transition: all 0.3s ease;
  1878. .tabbar-icon {
  1879. font-size: 44rpx;
  1880. margin-bottom: 8rpx;
  1881. transition: all 0.3s ease;
  1882. }
  1883. .first-icon{
  1884. width: 20px;
  1885. height: 20px;
  1886. margin-bottom: 5px;
  1887. margin-top: 5px;
  1888. }
  1889. .tabbar-text {
  1890. font-size: 24rpx;
  1891. color: #999999;
  1892. transition: all 0.3s ease;
  1893. font-weight: 500;
  1894. }
  1895. &.active {
  1896. /* 移除translateY变换,与其他页面保持一致 */
  1897. .tabbar-icon {
  1898. color: #E91E63;
  1899. /* 移除scale变换,与其他页面保持一致 */
  1900. filter: drop-shadow(0 4rpx 15rpx rgba(233, 30, 99, 0.3));
  1901. }
  1902. .tabbar-text {
  1903. color: #E91E63;
  1904. font-weight: bold;
  1905. }
  1906. }
  1907. &:active:not(.active) {
  1908. transform: translateY(2rpx);
  1909. }
  1910. }
  1911. }
  1912. .tabbar-badge {
  1913. position: absolute;
  1914. top: 8rpx;
  1915. right: 50%;
  1916. margin-right: -40rpx;
  1917. min-width: 36rpx;
  1918. height: 36rpx;
  1919. line-height: 36rpx;
  1920. padding: 0 10rpx;
  1921. background: linear-gradient(135deg, #E91E63 0%, #EC407A 100%);
  1922. border-radius: 18rpx;
  1923. font-size: 22rpx;
  1924. color: #FFFFFF;
  1925. text-align: center;
  1926. font-weight: bold;
  1927. box-shadow: 0 4rpx 15rpx rgba(233, 30, 99, 0.3);
  1928. transform: scale(1);
  1929. transition: all 0.3s ease;
  1930. }
  1931. .tabbar-item.active .tabbar-badge {
  1932. transform: scale(1.1);
  1933. }
  1934. </style>