index.vue 60 KB

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