index.vue 60 KB

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