index.vue 53 KB

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