index.vue 51 KB

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