index.vue 60 KB

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