index.vue 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886
  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="matchmaker-card" v-if="currentUserId">
  59. <text class="matchmaker-text">您的专属红娘:{{ matchmaker.code || '暂无' }} {{ matchmaker.phone || '' }}</text>
  60. </view>
  61. <!-- 快捷入口 -->
  62. <view class="quick-actions">
  63. <view class="action-item" @click="showCheckinPopup">
  64. <view class="action-icon calendar-icon">📅</view>
  65. <text class="action-label">签到</text>
  66. </view>
  67. <view class="action-item" @click="goToPage('customize')">
  68. <view class="action-icon phone-icon">📞</view>
  69. <text class="action-label">私人定制</text>
  70. </view>
  71. <view class="action-item" @click="goToPage('part-time-matchmaker')">
  72. <view class="action-icon heart-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="goToPage('myDynamics')">
  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('basicInfo')">
  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('partnerRequirement')">
  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('blacklist')">
  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('myActivity')">
  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('partTimeMatchmaker')">
  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: return '男'
  419. case 2: return '女'
  420. default: return '未知'
  421. }
  422. },
  423. // 计算年龄
  424. calculateAge(birthDate) {
  425. if (!birthDate) return null
  426. const birth = new Date(birthDate)
  427. const today = new Date()
  428. let age = today.getFullYear() - birth.getFullYear()
  429. const monthDiff = today.getMonth() - birth.getMonth()
  430. if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
  431. age--
  432. }
  433. return age
  434. },
  435. // 从后端加载用户信息(通过网关)
  436. loadUserInfo() {
  437. // 检查是否真正登录(必须有token和userInfo)
  438. const token = uni.getStorageSync('token')
  439. const userInfo = uni.getStorageSync('userInfo')
  440. if (!token || !userInfo) {
  441. console.warn('未登录,不加载用户信息')
  442. return
  443. }
  444. // 检查用户ID是否有效
  445. if (!this.currentUserId || this.currentUserId <= 0) {
  446. console.warn('无有效用户ID,无法加载用户信息')
  447. this.setDefaultUserInfo()
  448. return
  449. }
  450. console.log('加载用户信息,用户ID:', this.currentUserId)
  451. // 获取用户基本信息
  452. uni.request({
  453. url: this.gatewayURL + '/api/user/info?userId=' + this.currentUserId,
  454. method: 'GET',
  455. success: (res) => {
  456. console.log('用户信息API响应:', res.data)
  457. if (res.data && res.data.code === 200) {
  458. const data = res.data.data
  459. console.log('✅ API返回用户数据:', data)
  460. // 更新用户信息
  461. this.userInfo = {
  462. userId: data.userId,
  463. nickname: data.nickname || '用户',
  464. avatar: data.avatar || 'https://via.placeholder.com/100',
  465. phone: data.phone,
  466. email: data.email,
  467. gender: data.gender,
  468. genderText: data.genderText,
  469. birthDate: data.birthDate,
  470. age: data.age,
  471. isVerified: data.isVerified || false,
  472. profileProgress: data.profileProgress || 0,
  473. isVip: data.isVip || false,
  474. // 扩展信息
  475. height: data.height,
  476. weight: data.weight,
  477. star: data.star,
  478. animal: data.animal,
  479. educationLevel: data.educationLevel,
  480. educationText: data.educationText,
  481. schoolName: data.schoolName,
  482. company: data.company,
  483. jobTitle: data.jobTitle,
  484. salaryRange: data.salaryRange,
  485. salaryText: data.salaryText,
  486. maritalStatus: data.maritalStatus,
  487. maritalText: data.maritalText,
  488. house: data.house,
  489. houseText: data.houseText,
  490. car: data.car,
  491. carText: data.carText,
  492. hobby: data.hobby,
  493. authenticityScore: data.authenticityScore
  494. }
  495. console.log('✅ 用户信息更新完成:', this.userInfo.nickname)
  496. // 强制页面更新
  497. this.$forceUpdate()
  498. // 加载签到信息
  499. this.loadCheckinInfo()
  500. } else {
  501. console.error('获取用户信息失败:', res.data)
  502. const errorMsg = res.data?.message || '获取用户信息失败'
  503. // 如果是用户不存在的错误,给出特殊提示
  504. if (errorMsg.includes('用户不存在') || errorMsg.includes('用户ID无效')) {
  505. uni.showModal({
  506. title: '用户不存在',
  507. content: `当前用户ID(${this.currentUserId})在数据库中不存在,登录信息有误,请重新登录`,
  508. showCancel: false,
  509. confirmText: '重新登录',
  510. success: () => {
  511. // 清除登录信息并跳转登录页
  512. uni.clearStorageSync()
  513. uni.navigateTo({
  514. url: '/pages/page3/page3?redirect=' + encodeURIComponent('/pages/mine/index')
  515. })
  516. }
  517. })
  518. } else {
  519. uni.showToast({
  520. title: errorMsg,
  521. icon: 'none'
  522. })
  523. // 设置默认用户信息
  524. this.setDefaultUserInfo()
  525. }
  526. }
  527. },
  528. fail: (err) => {
  529. console.error('获取用户信息失败:', err)
  530. // API失败时,提示用户网络错误
  531. uni.showModal({
  532. title: '网络错误',
  533. content: '无法连接到服务器,请检查网络连接或稍后重试',
  534. showCancel: true,
  535. cancelText: '返回',
  536. confirmText: '重试',
  537. success: (modalRes) => {
  538. if (modalRes.confirm) {
  539. // 重试加载
  540. this.loadUserInfo()
  541. }
  542. }
  543. })
  544. // 设置默认用户信息以避免页面空白
  545. this.setDefaultUserInfo()
  546. uni.showToast({
  547. title: '网络连接失败',
  548. icon: 'none',
  549. duration: 2000
  550. })
  551. }
  552. })
  553. },
  554. // 设置默认用户信息(未登录或加载失败时)
  555. setDefaultUserInfo() {
  556. this.userInfo = {
  557. userId: null,
  558. nickname: '未登录用户',
  559. avatar: 'https://via.placeholder.com/100?text=未登录',
  560. phone: '',
  561. email: '',
  562. gender: null,
  563. genderText: '未知',
  564. birthDate: null,
  565. age: null,
  566. isVerified: false,
  567. profileProgress: 0,
  568. isVip: false,
  569. height: null,
  570. weight: null,
  571. star: null,
  572. animal: null,
  573. educationLevel: null,
  574. schoolName: null,
  575. company: null,
  576. jobTitle: null,
  577. salaryRange: null,
  578. maritalStatus: null,
  579. house: null,
  580. car: null,
  581. hobby: null,
  582. authenticityScore: 0
  583. }
  584. // 显示登录提示(仅在没有登录时显示)
  585. const token = uni.getStorageSync('token')
  586. if (!token) {
  587. setTimeout(() => {
  588. uni.showModal({
  589. title: '提示',
  590. content: '请先登录以查看完整功能',
  591. showCancel: true,
  592. cancelText: '稍后',
  593. confirmText: '去登录',
  594. success: (res) => {
  595. if (res.confirm) {
  596. uni.navigateTo({
  597. url: '/pages/page3/page3?redirect=' + encodeURIComponent('/pages/mine/index')
  598. })
  599. }
  600. }
  601. })
  602. }, 1000) // 延迟1秒显示,避免页面刚加载就弹窗
  603. }
  604. },
  605. // 加载签到信息
  606. loadCheckinInfo() {
  607. // 确保有用户ID
  608. if (!this.userInfo.userId) {
  609. console.error('用户ID不存在,无法加载签到信息')
  610. return
  611. }
  612. uni.request({
  613. url: this.gatewayURL + '/api/checkin/info',
  614. method: 'GET',
  615. data: {
  616. userId: this.userInfo.userId
  617. },
  618. success: (res) => {
  619. console.log('签到信息:', res.data)
  620. if (res.data.code === 200) {
  621. const data = res.data.data
  622. // 更新签到数据
  623. this.checkinData = {
  624. continuousDays: data.continuousDays,
  625. totalDays: data.totalDays,
  626. todayChecked: data.todayChecked,
  627. checkedDates: data.checkedDates
  628. }
  629. // 更新奖励列表
  630. this.checkinRewards = data.rewards
  631. // 生成日历
  632. this.generateCalendarFromBackend(data.checkedDates)
  633. }
  634. },
  635. fail: (err) => {
  636. console.error('获取签到信息失败:', err)
  637. uni.showToast({
  638. title: '加载签到信息失败',
  639. icon: 'none'
  640. })
  641. }
  642. })
  643. },
  644. // 根据后端数据生成日历
  645. generateCalendarFromBackend(checkedDates) {
  646. const today = new Date()
  647. const year = today.getFullYear()
  648. const month = today.getMonth()
  649. const todayStr = this.formatDate(today) // 今天的日期字符串
  650. this.currentMonth = `${year}年${month + 1}月`
  651. const firstDay = new Date(year, month, 1).getDay()
  652. const daysInMonth = new Date(year, month + 1, 0).getDate()
  653. const days = []
  654. for (let i = 0; i < firstDay; i++) {
  655. days.push({ date: null, checked: false, isToday: false })
  656. }
  657. for (let i = 1; i <= daysInMonth; i++) {
  658. const date = new Date(year, month, i)
  659. const dateStr = this.formatDate(date)
  660. const isToday = dateStr === todayStr // 通过日期字符串比较,更准确
  661. const checked = checkedDates.includes(dateStr)
  662. days.push({
  663. date: i,
  664. checked: checked,
  665. isToday: isToday,
  666. dateStr: dateStr
  667. })
  668. }
  669. this.calendarDays = days
  670. },
  671. // 格式化日期
  672. formatDate(date) {
  673. const year = date.getFullYear()
  674. const month = String(date.getMonth() + 1).padStart(2, '0')
  675. const day = String(date.getDate()).padStart(2, '0')
  676. return `${year}-${month}-${day}`
  677. },
  678. // 显示签到弹窗
  679. showCheckinPopup() {
  680. this.$refs.checkinPopup.open()
  681. },
  682. // 关闭签到弹窗
  683. closeCheckinPopup() {
  684. this.$refs.checkinPopup.close()
  685. },
  686. // 处理签到(通过网关)
  687. handleCheckin() {
  688. if (this.checkinData.todayChecked) {
  689. uni.showToast({
  690. title: '今日已签到',
  691. icon: 'none'
  692. })
  693. return
  694. }
  695. // 确保有用户ID
  696. if (!this.userInfo.userId) {
  697. uni.showToast({
  698. title: '请先登录',
  699. icon: 'none'
  700. })
  701. return
  702. }
  703. // 调用后端签到接口(通过网关)
  704. uni.request({
  705. url: this.gatewayURL + '/api/checkin/sign?userId=' + this.userInfo.userId,
  706. method: 'POST',
  707. success: (res) => {
  708. console.log('签到结果:', res.data)
  709. if (res.data.code === 200) {
  710. // 显示签到成功提示
  711. uni.showToast({
  712. title: res.data.message,
  713. icon: 'success',
  714. duration: 2500
  715. })
  716. const data = res.data.data
  717. // 更新签到数据
  718. this.checkinData = {
  719. continuousDays: data.continuousDays,
  720. totalDays: data.totalDays,
  721. todayChecked: data.todayChecked,
  722. checkedDates: data.checkedDates
  723. }
  724. // 更新奖励列表
  725. this.checkinRewards = data.rewards
  726. // 重新生成日历
  727. this.generateCalendarFromBackend(data.checkedDates)
  728. } else {
  729. // 签到失败
  730. uni.showToast({
  731. title: res.data.message,
  732. icon: 'none',
  733. duration: 2000
  734. })
  735. }
  736. },
  737. fail: (err) => {
  738. console.error('签到失败:', err)
  739. uni.showToast({
  740. title: '签到失败,请稍后重试',
  741. icon: 'none'
  742. })
  743. }
  744. })
  745. },
  746. goVerify() {
  747. uni.showToast({
  748. title: '前往实名认证',
  749. icon: 'none'
  750. })
  751. },
  752. goCompleteProfile() {
  753. this.goToPage('basicInfo')
  754. },
  755. goVip() {
  756. uni.navigateTo({
  757. url: '/pages/vip/index'
  758. })
  759. },
  760. goToPage(page) {
  761. console.log('=== goToPage 被调用 ===')
  762. console.log('页面参数:', page)
  763. console.log('当前用户ID:', this.currentUserId)
  764. try {
  765. if (page === 'basicInfo') {
  766. console.log('✅ 跳转到基本资料页面')
  767. // 跳转到基本资料页面
  768. uni.navigateTo({
  769. url: '/pages/profile/index',
  770. success: () => {
  771. console.log('✅ 基本资料页面跳转成功')
  772. },
  773. fail: (err) => {
  774. console.error('❌ 基本资料页面跳转失败:', err)
  775. uni.showToast({
  776. title: '页面跳转失败',
  777. icon: 'none'
  778. })
  779. }
  780. })
  781. } else if (page === 'partTimeMatchmaker') {
  782. console.log('✅ 跳转到兼职红娘页面')
  783. // 跳转到兼职红娘页面
  784. uni.navigateTo({
  785. url: '/pages/part-time-matchmaker/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 === 'blacklist') {
  798. console.log('✅ 跳转到黑名单页面')
  799. // 跳转到黑名单页面
  800. uni.navigateTo({
  801. url: '/pages/blacklist/index',
  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 === 'partnerRequirement') {
  814. console.log('✅ 跳转到对象要求页面')
  815. // 跳转到对象要求页面
  816. uni.navigateTo({
  817. url: '/pages/partner-requirement/index',
  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 === 'settings') {
  830. console.log('✅ 跳转到设置页面')
  831. // 跳转到设置页面
  832. uni.navigateTo({
  833. url: '/pages/settings/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 === 'customize') {
  846. console.log('✅ 跳转到私人定制页面')
  847. // 跳转到私人定制页面
  848. uni.navigateTo({
  849. url: '/pages/customize/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 === 'part-time-matchmaker') {
  862. console.log('✅ 跳转到加入红娘页面')
  863. // 跳转到加入红娘页面
  864. uni.navigateTo({
  865. url: '/pages/part-time-matchmaker/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 === 'myActivity') {
  878. console.log('✅ 跳转到我的活动页面')
  879. // 跳转到我的活动页面
  880. uni.navigateTo({
  881. url: '/pages/mine/my-activities',
  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 === 'myDynamics') {
  894. console.log('✅ 跳转到我的动态页面')
  895. // 跳转到我的动态页面
  896. uni.navigateTo({
  897. url: '/pages/mine/my-dynamics',
  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. } else {
  910. console.log('⚠️ 未知页面类型:', page)
  911. uni.showToast({
  912. title: '功能开发中',
  913. icon: 'none'
  914. })
  915. }
  916. } catch (error) {
  917. console.error('❌ goToPage 执行出错:', error)
  918. uni.showToast({
  919. title: '页面跳转异常',
  920. icon: 'none'
  921. })
  922. }
  923. },
  924. switchTab(tab) {
  925. if (tab === 'mine') return
  926. const tabPages = {
  927. index: '/pages/index/index',
  928. plaza: '/pages/plaza/index',
  929. recommend: '/pages/recommend/index',
  930. message: '/pages/message/index'
  931. }
  932. if (tabPages[tab]) {
  933. uni.redirectTo({
  934. url: tabPages[tab]
  935. })
  936. }
  937. },
  938. // 处理退出登录
  939. handleLogout() {
  940. console.log('点击退出登录按钮')
  941. uni.showModal({
  942. title: '退出登录',
  943. content: '确定要退出登录吗?',
  944. showCancel: true,
  945. cancelText: '取消',
  946. confirmText: '确定',
  947. success: (res) => {
  948. if (res.confirm) {
  949. console.log('用户确认退出登录')
  950. this.executeLogout()
  951. } else {
  952. console.log('用户取消退出登录')
  953. }
  954. }
  955. })
  956. },
  957. // 执行退出登录(最可靠的方式)
  958. executeLogout() {
  959. console.log('=== 执行退出登录 ===')
  960. // 立即显示加载状态
  961. uni.showLoading({
  962. title: '退出中...',
  963. mask: true
  964. })
  965. // 延迟执行,确保UI更新
  966. setTimeout(() => {
  967. try {
  968. console.log('步骤1: 清除登录数据')
  969. // 方法1: 逐个清除
  970. uni.removeStorageSync('token')
  971. uni.removeStorageSync('userInfo')
  972. uni.removeStorageSync('userId')
  973. uni.removeStorageSync('rememberedAccount')
  974. console.log('步骤2: 验证数据清除')
  975. const remainToken = uni.getStorageSync('token')
  976. const remainUser = uni.getStorageSync('userInfo')
  977. console.log('清除后检查 - token:', remainToken, 'userInfo:', remainUser)
  978. // 如果还有残留数据,使用强制清除
  979. if (remainToken || remainUser) {
  980. console.log('检测到残留数据,执行强制清除')
  981. uni.clearStorageSync()
  982. }
  983. console.log('步骤3: 重置页面状态')
  984. this.currentUserId = null
  985. this.userInfo = {
  986. userId: null,
  987. nickname: '未登录用户',
  988. avatar: 'https://via.placeholder.com/100?text=未登录'
  989. }
  990. // 隐藏加载,显示成功
  991. uni.hideLoading()
  992. uni.showToast({
  993. title: '退出成功!',
  994. icon: 'success',
  995. duration: 1500
  996. })
  997. // 延迟跳转
  998. setTimeout(() => {
  999. console.log('步骤4: 跳转到登录页面')
  1000. uni.reLaunch({
  1001. url: '/pages/page3/page3'
  1002. })
  1003. }, 1500)
  1004. } catch (error) {
  1005. console.error('退出过程出错:', error)
  1006. uni.hideLoading()
  1007. // 强制退出
  1008. uni.clearStorageSync()
  1009. uni.showModal({
  1010. title: '退出完成',
  1011. content: '已清除登录信息,请重新打开应用',
  1012. showCancel: false,
  1013. confirmText: '知道了'
  1014. })
  1015. }
  1016. }, 300) // 300毫秒延迟确保UI响应
  1017. },
  1018. // 设置测试用户数据(基于数据库真实数据)
  1019. // ⚠️ 已弃用:此方法仅供调试使用,正常流程不再调用测试数据
  1020. setTestUserData() {
  1021. console.log('=== 设置测试用户数据 ===')
  1022. console.warn('⚠️ 警告:正在使用测试数据,这不应该在生产环境中发生')
  1023. // 根据当前用户ID设置对应的数据库用户信息
  1024. const userId = this.currentUserId || 1
  1025. let userData = {}
  1026. switch(userId) {
  1027. case 1:
  1028. userData = {
  1029. userId: 1,
  1030. nickname: '小明',
  1031. avatar: 'https://example.com/avatar1.jpg',
  1032. phone: '138****8001',
  1033. email: 'user1@example.com',
  1034. gender: 1,
  1035. genderText: '男',
  1036. birthDate: '1990-05-05',
  1037. age: 34,
  1038. isVerified: true,
  1039. profileProgress: 80,
  1040. isVip: false
  1041. }
  1042. break
  1043. case 2:
  1044. userData = {
  1045. userId: 2,
  1046. nickname: '小红',
  1047. avatar: 'https://example.com/avatar2.jpg',
  1048. phone: '138****8002',
  1049. email: 'user2@example.com',
  1050. gender: 2,
  1051. genderText: '女',
  1052. birthDate: '1992-08-22',
  1053. age: 32,
  1054. isVerified: true,
  1055. profileProgress: 90,
  1056. isVip: true
  1057. }
  1058. break
  1059. case 3:
  1060. userData = {
  1061. userId: 3,
  1062. nickname: '用户5718',
  1063. avatar: 'https://via.placeholder.com/100?text=用户',
  1064. phone: '188****5718',
  1065. email: '',
  1066. gender: 0,
  1067. genderText: '未知',
  1068. birthDate: null,
  1069. age: null,
  1070. isVerified: false,
  1071. profileProgress: 30,
  1072. isVip: false
  1073. }
  1074. break
  1075. default:
  1076. userData = {
  1077. userId: userId,
  1078. nickname: '测试用户',
  1079. avatar: 'https://via.placeholder.com/100?text=测试',
  1080. phone: '',
  1081. email: '',
  1082. gender: 0,
  1083. genderText: '未知',
  1084. birthDate: null,
  1085. age: null,
  1086. isVerified: false,
  1087. profileProgress: 20,
  1088. isVip: false
  1089. }
  1090. }
  1091. // 设置用户信息
  1092. this.userInfo = userData
  1093. console.log('✅ 测试用户数据设置完成:', this.userInfo.nickname)
  1094. // 设置统计数据
  1095. this.stats = {
  1096. myConnection: Math.floor(Math.random() * 10),
  1097. myFavorites: Math.floor(Math.random() * 20),
  1098. whoViewedMe: Math.floor(Math.random() * 15),
  1099. iViewed: Math.floor(Math.random() * 25)
  1100. }
  1101. // 显示提示
  1102. uni.showToast({
  1103. title: '使用测试数据: ' + this.userInfo.nickname,
  1104. icon: 'success',
  1105. duration: 2000
  1106. })
  1107. },
  1108. // 处理VIP购买成功事件
  1109. handleVipPurchased() {
  1110. console.log('=== 收到VIP购买成功通知 ===')
  1111. // 延迟刷新,确保后端数据已更新
  1112. setTimeout(() => {
  1113. console.log('开始刷新用户信息...')
  1114. this.loadUserInfo()
  1115. }, 500)
  1116. }
  1117. }
  1118. }
  1119. </script>
  1120. <style lang="scss" scoped>
  1121. /* 扁平化设计风格 */
  1122. .mine-page {
  1123. min-height: 100vh;
  1124. background: #F5F5F5;
  1125. padding-bottom: 120rpx;
  1126. }
  1127. /* 用户信息区域 - 扁平化 */
  1128. .user-section {
  1129. margin: 0;
  1130. margin-top: env(safe-area-inset-top);
  1131. padding: 30rpx;
  1132. background: #FFE5F1;
  1133. .user-info {
  1134. display: flex;
  1135. align-items: flex-start;
  1136. margin-bottom: 40rpx;
  1137. .avatar {
  1138. width: 120rpx;
  1139. height: 120rpx;
  1140. border-radius: 12rpx;
  1141. margin-right: 25rpx;
  1142. background-color: #FFFFFF;
  1143. border: 2rpx solid #E0E0E0;
  1144. }
  1145. .user-details {
  1146. flex: 1;
  1147. .nickname-row {
  1148. display: flex;
  1149. align-items: center;
  1150. margin-bottom: 16rpx;
  1151. margin-top: 10rpx;
  1152. .nickname {
  1153. font-size: 38rpx;
  1154. font-weight: bold;
  1155. color: #333333;
  1156. margin-right: 20rpx;
  1157. }
  1158. /* VIP标志样式 */
  1159. .vip-badge {
  1160. background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  1161. padding: 6rpx 16rpx;
  1162. border-radius: 6rpx;
  1163. margin-right: 12rpx;
  1164. box-shadow: 0 2rpx 8rpx rgba(255, 215, 0, 0.3);
  1165. .vip-badge-text {
  1166. font-size: 20rpx;
  1167. color: #FFFFFF;
  1168. font-weight: 700;
  1169. letter-spacing: 1rpx;
  1170. }
  1171. }
  1172. .verify-badge {
  1173. background: #B8E986;
  1174. padding: 8rpx 20rpx;
  1175. border-radius: 6rpx;
  1176. .verify-text {
  1177. font-size: 22rpx;
  1178. color: #FFFFFF;
  1179. font-weight: 600;
  1180. }
  1181. }
  1182. }
  1183. /* 基本信息展示 - 扁平化 */
  1184. .user-basic-info {
  1185. display: flex;
  1186. flex-wrap: wrap;
  1187. gap: 16rpx;
  1188. margin-bottom: 20rpx;
  1189. .info-item {
  1190. display: flex;
  1191. align-items: center;
  1192. gap: 8rpx;
  1193. padding: 8rpx 16rpx;
  1194. background: #FFFFFF;
  1195. border-radius: 8rpx;
  1196. border: 2rpx solid #E0E0E0;
  1197. .info-icon {
  1198. font-size: 28rpx;
  1199. }
  1200. .info-text {
  1201. font-size: 24rpx;
  1202. color: #666666;
  1203. font-weight: 500;
  1204. }
  1205. }
  1206. }
  1207. .progress-row {
  1208. display: flex;
  1209. align-items: center;
  1210. .progress-bar {
  1211. flex: 1;
  1212. height: 16rpx;
  1213. background-color: #FFFFFF;
  1214. border-radius: 8rpx;
  1215. overflow: hidden;
  1216. margin-right: 20rpx;
  1217. border: 2rpx solid #E0E0E0;
  1218. .progress-fill {
  1219. height: 100%;
  1220. background: #B8E986;
  1221. border-radius: 6rpx;
  1222. transition: width 0.3s;
  1223. }
  1224. }
  1225. .progress-text {
  1226. font-size: 24rpx;
  1227. color: #666666;
  1228. white-space: nowrap;
  1229. }
  1230. }
  1231. }
  1232. }
  1233. }
  1234. /* VIP会员卡片 - 扁平化 */
  1235. .vip-card {
  1236. margin: 30rpx;
  1237. background: #E8E5FF;
  1238. border-radius: 12rpx;
  1239. padding: 30rpx;
  1240. display: flex;
  1241. align-items: center;
  1242. justify-content: space-between;
  1243. border: 2rpx solid #D5CFFF;
  1244. transition: all 0.2s ease;
  1245. &:active {
  1246. background: #D5CFFF;
  1247. }
  1248. .vip-content {
  1249. display: flex;
  1250. align-items: center;
  1251. .vip-icon {
  1252. font-size: 60rpx;
  1253. margin-right: 20rpx;
  1254. }
  1255. .vip-info {
  1256. display: flex;
  1257. flex-direction: column;
  1258. .vip-title {
  1259. font-size: 32rpx;
  1260. font-weight: bold;
  1261. color: #6B4EA3;
  1262. margin-bottom: 8rpx;
  1263. }
  1264. .vip-subtitle {
  1265. font-size: 24rpx;
  1266. color: #8B7BAA;
  1267. }
  1268. }
  1269. }
  1270. .vip-button {
  1271. background: #9575CD;
  1272. color: #FFFFFF;
  1273. padding: 16rpx 32rpx;
  1274. border-radius: 8rpx;
  1275. font-size: 26rpx;
  1276. white-space: nowrap;
  1277. font-weight: 600;
  1278. }
  1279. }
  1280. /* 专属红娘 - 扁平化 */
  1281. .matchmaker-card {
  1282. margin: 30rpx;
  1283. margin-top: 20rpx;
  1284. background: #FFF8E1;
  1285. border-radius: 12rpx;
  1286. padding: 25rpx;
  1287. text-align: center;
  1288. border: 2rpx solid #FFD54F;
  1289. .matchmaker-text {
  1290. font-size: 26rpx;
  1291. color: #F57C00;
  1292. font-weight: 500;
  1293. }
  1294. }
  1295. /* 快捷入口 - 扁平化 */
  1296. .quick-actions {
  1297. margin: 30rpx;
  1298. background-color: #FFFFFF;
  1299. border-radius: 12rpx;
  1300. padding: 40rpx;
  1301. display: flex;
  1302. justify-content: space-around;
  1303. border: 2rpx solid #E0E0E0;
  1304. .action-item {
  1305. display: flex;
  1306. flex-direction: column;
  1307. align-items: center;
  1308. transition: all 0.2s ease;
  1309. &:active {
  1310. transform: scale(0.95);
  1311. }
  1312. .action-icon {
  1313. width: 100rpx;
  1314. height: 100rpx;
  1315. border-radius: 12rpx;
  1316. display: flex;
  1317. align-items: center;
  1318. justify-content: center;
  1319. font-size: 50rpx;
  1320. margin-bottom: 15rpx;
  1321. border: 2rpx solid #E0E0E0;
  1322. }
  1323. .calendar-icon {
  1324. background: #FFE5E5;
  1325. }
  1326. .phone-icon {
  1327. background: #FFE8F5;
  1328. }
  1329. .heart-icon {
  1330. background: #FFE5E5;
  1331. }
  1332. .action-label {
  1333. font-size: 26rpx;
  1334. color: #666666;
  1335. }
  1336. }
  1337. }
  1338. /* 功能菜单列表 - 扁平化 */
  1339. .menu-list {
  1340. margin: 30rpx;
  1341. background-color: #FFFFFF;
  1342. border-radius: 12rpx;
  1343. overflow: hidden;
  1344. border: 2rpx solid #E0E0E0;
  1345. .menu-item {
  1346. display: flex;
  1347. align-items: center;
  1348. justify-content: space-between;
  1349. padding: 35rpx 30rpx;
  1350. border-bottom: 2rpx solid #F5F5F5;
  1351. transition: all 0.2s ease;
  1352. &:last-child {
  1353. border-bottom: none;
  1354. }
  1355. &:active {
  1356. background: #F5F5F5;
  1357. }
  1358. .menu-left {
  1359. display: flex;
  1360. align-items: center;
  1361. .menu-icon {
  1362. font-size: 44rpx;
  1363. margin-right: 20rpx;
  1364. }
  1365. .menu-text {
  1366. font-size: 30rpx;
  1367. color: #333333;
  1368. }
  1369. }
  1370. .menu-arrow {
  1371. font-size: 50rpx;
  1372. color: #CCCCCC;
  1373. font-weight: 300;
  1374. }
  1375. }
  1376. /* 退出登录特殊样式 - 扁平化 */
  1377. .menu-item.logout-item {
  1378. border-top: 2rpx solid #FFE5E5;
  1379. background: #FFF5F5;
  1380. .menu-left .menu-icon {
  1381. color: #E74C3C;
  1382. }
  1383. .menu-left .menu-text {
  1384. color: #E74C3C;
  1385. font-weight: 500;
  1386. }
  1387. .menu-arrow {
  1388. color: #E74C3C;
  1389. }
  1390. &:active {
  1391. background: #FFEBEB;
  1392. }
  1393. }
  1394. }
  1395. /* 签到弹窗样式 - 扁平化 */
  1396. .checkin-popup {
  1397. width: 650rpx;
  1398. max-height: 85vh;
  1399. background-color: #FFFFFF;
  1400. border-radius: 16rpx;
  1401. overflow: hidden;
  1402. display: flex;
  1403. flex-direction: column;
  1404. border: 2rpx solid #E0E0E0;
  1405. .popup-header {
  1406. display: flex;
  1407. align-items: center;
  1408. justify-content: center;
  1409. padding: 30rpx 30rpx 20rpx;
  1410. position: relative;
  1411. background: #FFE5F1;
  1412. flex-shrink: 0;
  1413. border-bottom: 2rpx solid #E0E0E0;
  1414. .popup-title {
  1415. font-size: 32rpx;
  1416. font-weight: bold;
  1417. color: #E91E63;
  1418. }
  1419. .close-btn {
  1420. position: absolute;
  1421. right: 20rpx;
  1422. top: 25rpx;
  1423. width: 50rpx;
  1424. height: 50rpx;
  1425. display: flex;
  1426. align-items: center;
  1427. justify-content: center;
  1428. .close-icon {
  1429. font-size: 36rpx;
  1430. color: #666666;
  1431. }
  1432. }
  1433. }
  1434. .checkin-info {
  1435. display: flex;
  1436. justify-content: space-around;
  1437. padding: 20rpx 30rpx;
  1438. background: #FFFFFF;
  1439. flex-shrink: 0;
  1440. border-bottom: 2rpx solid #E0E0E0;
  1441. .info-item {
  1442. display: flex;
  1443. flex-direction: column;
  1444. align-items: center;
  1445. .info-label {
  1446. font-size: 22rpx;
  1447. color: #999999;
  1448. margin-bottom: 8rpx;
  1449. }
  1450. .info-value {
  1451. font-size: 36rpx;
  1452. font-weight: bold;
  1453. color: #E91E63;
  1454. }
  1455. }
  1456. }
  1457. .checkin-content {
  1458. flex: 1;
  1459. overflow-y: auto;
  1460. max-height: 50vh;
  1461. }
  1462. .checkin-calendar {
  1463. padding: 20rpx 30rpx;
  1464. .calendar-header {
  1465. text-align: center;
  1466. margin-bottom: 15rpx;
  1467. .month-text {
  1468. font-size: 26rpx;
  1469. font-weight: bold;
  1470. color: #333333;
  1471. }
  1472. }
  1473. .week-header {
  1474. display: flex;
  1475. margin-bottom: 10rpx;
  1476. .week-day {
  1477. flex: 1;
  1478. text-align: center;
  1479. font-size: 22rpx;
  1480. color: #999999;
  1481. }
  1482. }
  1483. .calendar-body {
  1484. display: flex;
  1485. flex-wrap: wrap;
  1486. .calendar-day {
  1487. width: calc(100% / 7);
  1488. height: 70rpx;
  1489. display: flex;
  1490. align-items: center;
  1491. justify-content: center;
  1492. position: relative;
  1493. margin-bottom: 8rpx;
  1494. .day-num {
  1495. font-size: 24rpx;
  1496. color: #333333;
  1497. }
  1498. .check-mark {
  1499. position: absolute;
  1500. top: 3rpx;
  1501. right: 3rpx;
  1502. font-size: 18rpx;
  1503. color: #FFFFFF;
  1504. background: #E91E63;
  1505. width: 26rpx;
  1506. height: 26rpx;
  1507. border-radius: 50%;
  1508. display: flex;
  1509. align-items: center;
  1510. justify-content: center;
  1511. }
  1512. &.empty {
  1513. visibility: hidden;
  1514. }
  1515. &.checked {
  1516. background: #FFE5F1;
  1517. border-radius: 8rpx;
  1518. border: 2rpx solid #E91E63;
  1519. .day-num {
  1520. color: #E91E63;
  1521. font-weight: bold;
  1522. }
  1523. }
  1524. &.today {
  1525. background: #E91E63;
  1526. border-radius: 8rpx;
  1527. .day-num {
  1528. color: #FFFFFF;
  1529. font-weight: bold;
  1530. }
  1531. }
  1532. &.today.checked {
  1533. .check-mark {
  1534. background: #FFFFFF;
  1535. color: #E91E63;
  1536. }
  1537. }
  1538. }
  1539. }
  1540. }
  1541. .checkin-rewards {
  1542. padding: 15rpx 30rpx 20rpx;
  1543. border-top: 1rpx solid #F5F5F5;
  1544. flex-shrink: 0;
  1545. .rewards-title {
  1546. font-size: 26rpx;
  1547. font-weight: bold;
  1548. color: #333333;
  1549. margin-bottom: 15rpx;
  1550. display: block;
  1551. }
  1552. .rewards-list {
  1553. display: flex;
  1554. justify-content: space-between;
  1555. gap: 15rpx;
  1556. .reward-item {
  1557. flex: 1;
  1558. background: #F5F5F5;
  1559. border-radius: 12rpx;
  1560. padding: 20rpx 12rpx;
  1561. display: flex;
  1562. flex-direction: column;
  1563. align-items: center;
  1564. position: relative;
  1565. border: 2rpx solid #E0E0E0;
  1566. .reward-icon {
  1567. font-size: 50rpx;
  1568. margin-bottom: 10rpx;
  1569. }
  1570. .reward-day {
  1571. font-size: 24rpx;
  1572. color: #666666;
  1573. margin-bottom: 8rpx;
  1574. }
  1575. .reward-text {
  1576. font-size: 26rpx;
  1577. color: #333333;
  1578. font-weight: bold;
  1579. }
  1580. .received-mark {
  1581. position: absolute;
  1582. top: 8rpx;
  1583. right: 8rpx;
  1584. width: 32rpx;
  1585. height: 32rpx;
  1586. background: #B8E986;
  1587. color: #FFFFFF;
  1588. border-radius: 50%;
  1589. display: flex;
  1590. align-items: center;
  1591. justify-content: center;
  1592. font-size: 20rpx;
  1593. }
  1594. &.received {
  1595. opacity: 0.6;
  1596. }
  1597. &.current {
  1598. border-color: #E91E63;
  1599. background: #FFE5F1;
  1600. .reward-text {
  1601. color: #E91E63;
  1602. }
  1603. }
  1604. }
  1605. }
  1606. }
  1607. .checkin-button-wrapper {
  1608. padding: 0 30rpx 25rpx;
  1609. flex-shrink: 0;
  1610. .checkin-btn {
  1611. width: 100%;
  1612. background: #E91E63;
  1613. color: #FFFFFF;
  1614. font-size: 30rpx;
  1615. font-weight: bold;
  1616. border-radius: 8rpx;
  1617. padding: 20rpx;
  1618. border: none;
  1619. transition: all 0.2s ease;
  1620. &:active:not(.disabled) {
  1621. opacity: 0.8;
  1622. }
  1623. &.disabled {
  1624. background: #CCCCCC;
  1625. }
  1626. &::after {
  1627. border: none;
  1628. }
  1629. }
  1630. }
  1631. }
  1632. /* 底部导航栏 - 扁平化 */
  1633. .tabbar {
  1634. position: fixed;
  1635. bottom: 0;
  1636. left: 0;
  1637. right: 0;
  1638. display: flex;
  1639. background-color: #FFFFFF;
  1640. border-top: 1rpx solid #F0F0F0;
  1641. padding-bottom: constant(safe-area-inset-bottom);
  1642. padding-bottom: env(safe-area-inset-bottom);
  1643. z-index: 999;
  1644. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
  1645. .tabbar-item {
  1646. flex: 1;
  1647. display: flex;
  1648. flex-direction: column;
  1649. align-items: center;
  1650. justify-content: center;
  1651. padding: 15rpx 0;
  1652. position: relative;
  1653. .tabbar-icon {
  1654. font-size: 44rpx;
  1655. margin-bottom: 5rpx;
  1656. }
  1657. .tabbar-text {
  1658. font-size: 22rpx;
  1659. color: #666666;
  1660. }
  1661. &.active {
  1662. .tabbar-text {
  1663. color: #E91E63;
  1664. font-weight: bold;
  1665. }
  1666. }
  1667. }
  1668. }
  1669. .tabbar-badge {
  1670. position: absolute;
  1671. top: 8rpx;
  1672. right: 50%;
  1673. margin-right: -40rpx;
  1674. min-width: 32rpx;
  1675. height: 32rpx;
  1676. line-height: 32rpx;
  1677. padding: 0 6rpx;
  1678. background-color: #FA5151;
  1679. border-radius: 16rpx;
  1680. font-size: 20rpx;
  1681. color: #FFFFFF;
  1682. text-align: center;
  1683. }
  1684. </style>