index.vue 60 KB

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