mine.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. <template>
  2. <view class="matchmaker-mine">
  3. <!-- 顶部导航栏 -->
  4. <view class="header">
  5. <view class="back-btn" @click="goBack"></view>
  6. <text class="header-title">我的</text>
  7. <view class="placeholder"></view>
  8. </view>
  9. <scroll-view scroll-y class="content">
  10. <view class="content-container">
  11. <!-- 个人信息卡片 -->
  12. <view class="profile-card">
  13. <view class="profile-header">
  14. <view class="profile-avatar" :style="{ backgroundImage: `url(${profile.avatarUrl})` }"></view>
  15. <view class="profile-info">
  16. <text class="profile-name">{{ profile.realName }}</text>
  17. <view class="profile-badge">{{ profile.badge }}</view>
  18. </view>
  19. </view>
  20. <!-- 等级和积分 -->
  21. <view class="level-points">
  22. <view class="level-info">
  23. <view class="level-icon"></view>
  24. <text class="level-name">{{ profile.levelName }}</text>
  25. </view>
  26. <text class="points-value">{{ profile.points }}</text>
  27. <text class="points-label">积分</text>
  28. </view>
  29. <!-- 等级进度 -->
  30. <view class="level-progress">
  31. <text class="progress-label">距离下一等级</text>
  32. <view class="progress-bar">
  33. <view class="progress-fill" :style="{ width: profile.levelProgress + '%' }"></view>
  34. </view>
  35. <view class="progress-values">
  36. <text class="current-value">当前{{ profile.points }}</text>
  37. <text class="target-value">目标{{ profile.nextLevelPoints }}</text>
  38. </view>
  39. <view class="upgrade-tip">再获得{{ profile.pointsToNextLevel }}积分即可晋升{{ profile.nextLevelName }}等级</view>
  40. </view>
  41. </view>
  42. <!-- 功能菜单 -->
  43. <view class="function-grid">
  44. <view class="function-item" @click="showSignInPopup">
  45. <view class="function-icon calendar">22</view>
  46. <text class="function-text">签到</text>
  47. </view>
  48. <view class="function-item" @click="handleMyResources">
  49. <view class="function-icon resources"></view>
  50. <text class="function-text">我的资源</text>
  51. </view>
  52. <view class="function-item" @click="handleActivityCenter">
  53. <view class="function-icon heart-book"></view>
  54. <text class="function-text">我的活动</text>
  55. </view>
  56. <view class="function-item" @click="handlePointsMall">
  57. <view class="function-icon money"></view>
  58. <text class="function-text">我的积分</text>
  59. </view>
  60. </view>
  61. <!-- 设置选项 -->
  62. <view class="settings-section">
  63. <view class="settings-item" @click="handleEditProfile">
  64. <view class="settings-icon user"></view>
  65. <text class="settings-text">编辑资料</text>
  66. <view class="arrow-right"></view>
  67. </view>
  68. <view class="settings-item" @click="handleAccountSettings">
  69. <view class="settings-icon gear"></view>
  70. <text class="settings-text">账户设置</text>
  71. <view class="arrow-right"></view>
  72. </view>
  73. <view class="settings-item" @click="handleLogout">
  74. <view class="settings-icon logout"></view>
  75. <text class="settings-text">退出登录</text>
  76. <view class="arrow-right"></view>
  77. </view>
  78. </view>
  79. </view>
  80. </scroll-view>
  81. <!-- 底部导航 -->
  82. <view class="tabbar">
  83. <view class="tabbar-item home" @click="navigateToWorkbench">
  84. <view class="tabbar-icon"></view>
  85. <text class="tabbar-text">工作台</text>
  86. </view>
  87. <view class="tabbar-item resources" @click="navigateToMyResources">
  88. <view class="tabbar-icon"></view>
  89. <text class="tabbar-text">我的资源</text>
  90. </view>
  91. <view class="tabbar-item trophy" @click="navigateToRanking">
  92. <view class="tabbar-icon"></view>
  93. <text class="tabbar-text">排行榜</text>
  94. </view>
  95. <view class="tabbar-item message" @click="navigateToMessage">
  96. <view class="tabbar-icon">
  97. <view class="badge">3</view>
  98. </view>
  99. <text class="tabbar-text">消息</text>
  100. </view>
  101. <view class="tabbar-item mine active" @click="navigateToMine">
  102. <view class="tabbar-icon"></view>
  103. <text class="tabbar-text">我的</text>
  104. </view>
  105. </view>
  106. <!-- 签到弹框 -->
  107. <uni-popup ref="signInPopup" type="center" :mask-click="false">
  108. <view class="sign-in-popup">
  109. <view class="popup-header">
  110. <text class="popup-title">今日签到</text>
  111. <view class="close-btn" @click="closeSignInPopup"></view>
  112. </view>
  113. <view class="popup-content">
  114. <view class="calendar-container">
  115. <view class="calendar-header">
  116. <text class="calendar-title">{{ calendarTitle }}</text>
  117. <view class="calendar-icon"></view>
  118. </view>
  119. <view class="calendar-week">
  120. <text class="week-day">日</text>
  121. <text class="week-day">一</text>
  122. <text class="week-day">二</text>
  123. <text class="week-day">三</text>
  124. <text class="week-day">四</text>
  125. <text class="week-day">五</text>
  126. <text class="week-day">六</text>
  127. </view>
  128. <view class="calendar-days">
  129. <view
  130. v-for="(day, index) in calendarDays"
  131. :key="index"
  132. :class="[
  133. 'calendar-day',
  134. { 'other-month': !day.isCurrentMonth },
  135. { 'today': day.isToday },
  136. { 'checked': day.isChecked }
  137. ]"
  138. >
  139. <text class="day-text">{{ day.date }}</text>
  140. <view v-if="day.isChecked" class="check-mark"></view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="sign-in-reward">
  145. <text class="reward-title">签到奖励</text>
  146. <text class="reward-points">+5积分</text>
  147. </view>
  148. </view>
  149. <view class="popup-footer">
  150. <button
  151. :class="['sign-in-btn', { 'signed': isSignedToday }]"
  152. @click="doSignIn"
  153. :disabled="isSignedToday"
  154. >
  155. {{ isSignedToday ? '今日已签到' : '立即签到' }}
  156. </button>
  157. </view>
  158. </view>
  159. </uni-popup>
  160. </view>
  161. </template>
  162. <script>
  163. import api from '../../utils/api.js'
  164. export default {
  165. data() {
  166. return {
  167. profile: {
  168. realName: '',
  169. avatarUrl: '',
  170. badge: '',
  171. rating: 5.0,
  172. level: '',
  173. levelName: '',
  174. nextLevelName: '',
  175. points: 0,
  176. currentLevelPoints: 0,
  177. nextLevelPoints: 100,
  178. pointsToNextLevel: 0,
  179. levelProgress: 0
  180. },
  181. // 签到相关
  182. isSignedToday: false,
  183. continuousDays: 0,
  184. totalDays: 0,
  185. }
  186. },
  187. onLoad() {
  188. this.loadProfileData()
  189. this.checkSignInStatus()
  190. this.generateCalendar()
  191. },
  192. onShow() {
  193. // 从编辑资料页返回时,自动刷新个人资料
  194. this.loadProfileData()
  195. },
  196. methods: {
  197. // ...
  198. }
  199. }
  200. </script>
  201. const month = date.getMonth()
  202. // 设置日历标题
  203. this.calendarTitle = `${year}年·${month + 1}月`
  204. // 获取当月第一天
  205. const firstDay = new Date(year, month, 1)
  206. // 获取当月第一天是星期几(0-6,0表示周日)
  207. const firstDayWeek = firstDay.getDay()
  208. // 获取当月最后一天
  209. const lastDay = new Date(year, month + 1, 0)
  210. // 获取当月最后一天的日期
  211. const lastDayDate = lastDay.getDate()
  212. // 获取上个月最后一天的日期
  213. const prevMonthLastDay = new Date(year, month, 0).getDate()
  214. const days = []
  215. // 添加上个月的日期
  216. for (let i = firstDayWeek - 1; i >= 0; i--) {
  217. days.push({
  218. date: prevMonthLastDay - i,
  219. isCurrentMonth: false,
  220. isToday: false,
  221. isChecked: false
  222. })
  223. }
  224. // 添加当月的日期
  225. const today = new Date()
  226. const isCurrentMonth = today.getFullYear() === year && today.getMonth() === month
  227. for (let i = 1; i <= lastDayDate; i++) {
  228. const isToday = isCurrentMonth && today.getDate() === i
  229. days.push({
  230. date: i,
  231. isCurrentMonth: true,
  232. isToday: isToday,
  233. isChecked: isToday && this.isSignedToday
  234. })
  235. }
  236. // 添加下个月的日期,补满6行
  237. const totalDays = 42 // 6行7列
  238. const nextMonthDays = totalDays - days.length
  239. for (let i = 1; i <= nextMonthDays; i++) {
  240. days.push({
  241. date: i,
  242. isCurrentMonth: false,
  243. isToday: false,
  244. isChecked: false
  245. })
  246. }
  247. this.calendarDays = days
  248. },
  249. // 加载个人资料数据
  250. async loadProfileData() {
  251. try {
  252. // 从本地存储获取用户信息
  253. const userInfo = uni.getStorageSync('userInfo')
  254. console.log('从本地存储获取到的用户信息:', userInfo)
  255. // 模拟用户信息,用于测试
  256. const testUserId = 19
  257. const userId = userInfo && userInfo.userId ? userInfo.userId : testUserId
  258. console.log('使用的userId:', userId)
  259. // 调用API获取红娘信息
  260. console.log('开始调用API获取红娘信息...')
  261. const matchmakerInfo = await api.matchmaker.getByUserId(userId)
  262. console.log('API调用结果:', matchmakerInfo)
  263. if (matchmakerInfo) {
  264. // 等级名称映射
  265. const levelNames = ['', '青铜', '白银', '黄金', '铂金', '钻石']
  266. // 获取当前等级和下一级名称
  267. const currentLevel = matchmakerInfo.level || 1
  268. const nextLevel = currentLevel < 5 ? currentLevel + 1 : 5
  269. const nextLevelName = levelNames[nextLevel]
  270. // 根据性别设置默认头像
  271. const defaultAvatars = {
  272. male: 'http://115.190.125.125:9000/dynamic-comments/dynamics/5c645152-9940-41d3-83a9-69ee6e0c0aaa.png',
  273. female: 'http://115.190.125.125:9000/dynamic-comments/dynamics/c7fb04d7-ee4d-4b3d-bcef-f246da9c841f.png'
  274. }
  275. const avatarUrl = matchmakerInfo.gender === 1 ? defaultAvatars.male : defaultAvatars.female
  276. // 打印获取到的数据,用于调试
  277. console.log('获取到的红娘信息:', matchmakerInfo)
  278. // 更新profile数据,将下划线命名转换为驼峰命名
  279. this.profile = {
  280. realName: matchmakerInfo.real_name || '',
  281. avatarUrl: avatarUrl,
  282. badge: matchmakerInfo.type_name || '',
  283. rating: matchmakerInfo.rating || 5.0,
  284. level: currentLevel,
  285. levelName: matchmakerInfo.level_name || levelNames[currentLevel],
  286. nextLevelName: nextLevelName,
  287. points: matchmakerInfo.points || 0,
  288. currentLevelPoints: matchmakerInfo.current_level_points || 0,
  289. nextLevelPoints: matchmakerInfo.next_level_points || 100,
  290. pointsToNextLevel: matchmakerInfo.points_to_next_level || 0,
  291. levelProgress: matchmakerInfo.level_progress || 0
  292. }
  293. console.log('更新后的profile数据:', this.profile)
  294. } else {
  295. console.log('matchmakerInfo为空,无法更新profile数据')
  296. }
  297. } catch (error) {
  298. console.error('加载个人资料失败:', error)
  299. uni.showToast({
  300. title: '加载失败,请稍后重试: ' + error.message,
  301. icon: 'none'
  302. })
  303. }
  304. },
  305. // 返回上一页
  306. goBack() {
  307. uni.navigateBack()
  308. },
  309. // 检查今日是否已签到
  310. async checkSignInStatus() {
  311. try {
  312. // 从本地存储获取用户信息
  313. const userInfo = uni.getStorageSync('userInfo')
  314. const userId = userInfo && userInfo.userId ? userInfo.userId : null
  315. // 只有在有有效userId时才调用API
  316. if (userId) {
  317. // 调用API检查签到状态
  318. const res = await api.matchmaker.checkinStatus(userId)
  319. console.log('检查签到状态返回结果:', res)
  320. // 只在明确标记为已签到时才置为 true,避免对象/字符串被当成 true
  321. let signed = false
  322. if (typeof res === 'boolean') {
  323. signed = res
  324. } else if (typeof res === 'string') {
  325. // 后端可能返回 'true' / 'false'
  326. signed = res === 'true'
  327. } else if (typeof res === 'number') {
  328. // 约定 1 表示已签到,0 表示未签到
  329. signed = res === 1
  330. } else if (res && typeof res === 'object') {
  331. // 常见结构兼容:{ todaySigned: true } / { signed: true } / { isSignedToday: true }
  332. if (typeof res.todaySigned === 'boolean') signed = res.todaySigned
  333. else if (typeof res.signed === 'boolean') signed = res.signed
  334. else if (typeof res.isSignedToday === 'boolean') signed = res.isSignedToday
  335. else if (typeof res.data === 'object' && res.data) {
  336. if (typeof res.data.todaySigned === 'boolean') signed = res.data.todaySigned
  337. else if (typeof res.data.signed === 'boolean') signed = res.data.signed
  338. else if (typeof res.data.isSignedToday === 'boolean') signed = res.data.isSignedToday
  339. }
  340. }
  341. this.isSignedToday = !!signed
  342. // 获取签到统计
  343. const stats = await api.matchmaker.checkinStats(userId)
  344. console.log('获取签到统计返回结果:', stats)
  345. if (stats) {
  346. this.continuousDays = stats.continuousDays || 0
  347. this.totalDays = stats.totalDays || 0
  348. }
  349. } else {
  350. // 没有有效的userId,重置签到状态
  351. this.isSignedToday = false
  352. this.continuousDays = 0
  353. this.totalDays = 0
  354. console.warn('没有有效的userId,无法检查签到状态')
  355. }
  356. } catch (error) {
  357. console.error('检查签到状态失败:', error)
  358. // API调用失败时,重置签到状态
  359. this.isSignedToday = false
  360. this.continuousDays = 0
  361. this.totalDays = 0
  362. }
  363. },
  364. // 显示签到弹框
  365. showSignInPopup() {
  366. // 无论是否已签到,都显示签到弹框,让用户可以看到签到记录
  367. this.$refs.signInPopup.open()
  368. },
  369. // 关闭签到弹框
  370. closeSignInPopup() {
  371. this.$refs.signInPopup.close()
  372. },
  373. // 执行签到
  374. async doSignIn() {
  375. try {
  376. // 从本地存储获取用户信息
  377. const userInfo = uni.getStorageSync('userInfo')
  378. const userId = userInfo && userInfo.userId ? userInfo.userId : null
  379. // 只有在有有效userId时才调用API
  380. if (userId) {
  381. // 调用签到API
  382. const res = await api.matchmaker.doCheckin(userId)
  383. console.log('签到API返回结果:', res)
  384. // 解析返回结果,兼容多种返回结构
  385. let success = false
  386. let alreadySigned = false
  387. if (typeof res === 'boolean') {
  388. // true 表示本次签到成功,false 表示失败或已签到
  389. success = res
  390. } else if (typeof res === 'string') {
  391. // 'ok' / 'success' 之类
  392. success = res === 'true' || res === 'ok' || res === 'success'
  393. } else if (res && typeof res === 'object') {
  394. // { success: true, todaySigned: true } 等结构
  395. if (typeof res.success === 'boolean') success = res.success
  396. if (typeof res.todaySigned === 'boolean') alreadySigned = res.todaySigned
  397. else if (typeof res.signed === 'boolean') alreadySigned = res.signed
  398. else if (typeof res.isSignedToday === 'boolean') alreadySigned = res.isSignedToday
  399. if (res.data && typeof res.data === 'object') {
  400. if (typeof res.data.success === 'boolean') success = res.data.success
  401. if (typeof res.data.todaySigned === 'boolean') alreadySigned = res.data.todaySigned
  402. else if (typeof res.data.signed === 'boolean') alreadySigned = res.data.signed
  403. else if (typeof res.data.isSignedToday === 'boolean') alreadySigned = res.data.isSignedToday
  404. }
  405. }
  406. if (success) {
  407. // 签到成功
  408. uni.showToast({
  409. title: '签到成功',
  410. icon: 'success'
  411. })
  412. // 更新签到状态
  413. this.isSignedToday = true
  414. // 重新生成日历,更新当天签到状态
  415. this.generateCalendar()
  416. // 刷新个人资料(更新积分)
  417. this.loadProfileData()
  418. // 关闭弹框
  419. this.closeSignInPopup()
  420. } else if (alreadySigned) {
  421. // 接口明确表示今日已签到
  422. uni.showToast({
  423. title: '今日已签到',
  424. icon: 'none'
  425. })
  426. } else {
  427. // 签到失败
  428. uni.showToast({
  429. title: '签到失败,请稍后重试',
  430. icon: 'none'
  431. })
  432. }
  433. } else {
  434. // 没有有效的userId,提示用户登录
  435. uni.showToast({
  436. title: '请先登录',
  437. icon: 'none'
  438. })
  439. // 跳转到登录页
  440. setTimeout(() => {
  441. uni.navigateTo({
  442. url: '/pages/page3/page3'
  443. })
  444. }, 1000)
  445. }
  446. } catch (error) {
  447. console.error('签到失败:', error)
  448. uni.showToast({
  449. title: error.msg || '签到失败,请稍后重试',
  450. icon: 'none'
  451. })
  452. }
  453. },
  454. // 签到(旧方法,保持兼容)
  455. handleSignIn() {
  456. this.showSignInPopup()
  457. },
  458. // 我的资源
  459. handleMyResources() {
  460. uni.navigateTo({
  461. url: '/pages/matchmaker-workbench/my-resources'
  462. })
  463. },
  464. // 活动中心
  465. handleActivityCenter() {
  466. uni.navigateTo({
  467. url: '/pages/activities/list'
  468. })
  469. },
  470. // 积分商城
  471. handlePointsMall() {
  472. console.log('积分商城')
  473. uni.showToast({
  474. title: '积分商城开发中',
  475. icon: 'none'
  476. })
  477. },
  478. // 编辑资料
  479. handleEditProfile() {
  480. console.log('编辑资料')
  481. uni.navigateTo({
  482. url: '/pages/matchmaker-workbench/edit-profile'
  483. })
  484. },
  485. // 账户设置
  486. handleAccountSettings() {
  487. console.log('账户设置')
  488. uni.showToast({
  489. title: '账户设置开发中',
  490. icon: 'none'
  491. })
  492. },
  493. // 退出登录
  494. handleLogout() {
  495. uni.showModal({
  496. title: '退出登录',
  497. content: '确定要退出登录吗?',
  498. success: (res) => {
  499. if (res.confirm) {
  500. // 清除本地存储
  501. uni.removeStorageSync('token')
  502. uni.removeStorageSync('userInfo')
  503. // 跳转到登录页
  504. uni.navigateTo({
  505. url: '/pages/page3/page3'
  506. })
  507. }
  508. }
  509. })
  510. },
  511. // 导航到工作台
  512. navigateToWorkbench() {
  513. uni.navigateTo({
  514. url: '/pages/matchmaker-workbench/index'
  515. })
  516. },
  517. // 导航到我的资源
  518. navigateToMyResources() {
  519. uni.navigateTo({
  520. url: '/pages/matchmaker-workbench/my-resources'
  521. })
  522. },
  523. // 导航到排行榜
  524. navigateToRanking() {
  525. uni.navigateTo({
  526. url: '/pages/matchmaker-workbench/ranking'
  527. })
  528. },
  529. // 导航到消息
  530. navigateToMessage() {
  531. uni.navigateTo({
  532. url: '/pages/matchmaker-workbench/message'
  533. })
  534. },
  535. // 导航到我的
  536. navigateToMine() {
  537. // 已在我的页面,无需跳转
  538. }
  539. }
  540. }
  541. </script>
  542. <style lang="scss" scoped>
  543. .matchmaker-mine {
  544. min-height: 100vh;
  545. background: #FFF9F9;
  546. display: flex;
  547. flex-direction: column;
  548. }
  549. /* 顶部导航栏 */
  550. .header {
  551. display: flex;
  552. align-items: center;
  553. justify-content: space-between;
  554. padding: 25rpx 30rpx;
  555. padding-top: calc(25rpx + env(safe-area-inset-top));
  556. background: #FFF9F9;
  557. border-bottom: 1rpx solid #F0F0F0;
  558. .back-btn {
  559. width: 70rpx;
  560. height: 70rpx;
  561. display: flex;
  562. align-items: center;
  563. justify-content: center;
  564. background: rgba(240, 240, 240, 0.5);
  565. border-radius: 50%;
  566. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23333"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>');
  567. background-size: 40rpx 40rpx;
  568. background-repeat: no-repeat;
  569. background-position: center;
  570. }
  571. .header-title {
  572. font-size: 38rpx;
  573. font-weight: bold;
  574. color: #333;
  575. }
  576. .placeholder {
  577. width: 70rpx;
  578. }
  579. }
  580. .content {
  581. flex: 1;
  582. padding: 0;
  583. }
  584. .content-container {
  585. padding: 20rpx 30rpx 120rpx;
  586. }
  587. /* 个人信息卡片 */
  588. .profile-card {
  589. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  590. border-radius: 25rpx;
  591. padding: 35rpx;
  592. margin-bottom: 25rpx;
  593. box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
  594. }
  595. .profile-header {
  596. display: flex;
  597. align-items: center;
  598. margin-bottom: 30rpx;
  599. .profile-avatar {
  600. width: 160rpx;
  601. height: 160rpx;
  602. border-radius: 50%;
  603. background-size: cover;
  604. background-repeat: no-repeat;
  605. background-position: center;
  606. margin-right: 25rpx;
  607. border: 2rpx solid #FFF;
  608. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  609. }
  610. .profile-info {
  611. flex: 1;
  612. .profile-name {
  613. display: block;
  614. font-size: 36rpx;
  615. font-weight: bold;
  616. color: #333;
  617. margin-bottom: 10rpx;
  618. }
  619. .profile-badge {
  620. display: inline-block;
  621. background: #FFD700;
  622. color: #FFFFFF;
  623. font-size: 24rpx;
  624. font-weight: bold;
  625. padding: 6rpx 16rpx;
  626. border-radius: 15rpx;
  627. margin-bottom: 10rpx;
  628. }
  629. .profile-rating {
  630. display: block;
  631. font-size: 28rpx;
  632. color: #666;
  633. }
  634. }
  635. }
  636. /* 等级和积分 */
  637. .level-points {
  638. display: flex;
  639. align-items: center;
  640. justify-content: space-between;
  641. margin-bottom: 30rpx;
  642. .level-info {
  643. display: flex;
  644. align-items: center;
  645. gap: 10rpx;
  646. .level-icon {
  647. width: 44rpx;
  648. height: 44rpx;
  649. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
  650. background-size: contain;
  651. background-repeat: no-repeat;
  652. background-position: center;
  653. }
  654. .level-name {
  655. font-size: 32rpx;
  656. font-weight: bold;
  657. color: #FF9800;
  658. }
  659. }
  660. .points-value {
  661. font-size: 48rpx;
  662. font-weight: bold;
  663. color: #E91E63;
  664. }
  665. .points-label {
  666. font-size: 28rpx;
  667. color: #666;
  668. }
  669. }
  670. /* 等级进度 */
  671. .level-progress {
  672. .progress-label {
  673. display: block;
  674. font-size: 26rpx;
  675. color: #333;
  676. margin-bottom: 15rpx;
  677. }
  678. .progress-bar {
  679. width: 100%;
  680. height: 12rpx;
  681. background: rgba(255, 255, 255, 0.5);
  682. border-radius: 6rpx;
  683. margin-bottom: 10rpx;
  684. .progress-fill {
  685. height: 100%;
  686. background: #FFB74D;
  687. border-radius: 6rpx;
  688. }
  689. }
  690. .progress-values {
  691. display: flex;
  692. justify-content: space-between;
  693. margin-bottom: 15rpx;
  694. .current-value,
  695. .target-value {
  696. font-size: 24rpx;
  697. color: #666;
  698. }
  699. }
  700. .upgrade-tip {
  701. display: block;
  702. background: rgba(255, 255, 255, 0.3);
  703. color: #E91E63;
  704. font-size: 26rpx;
  705. font-weight: bold;
  706. padding: 15rpx;
  707. border-radius: 15rpx;
  708. text-align: center;
  709. }
  710. }
  711. /* 功能菜单 */
  712. .function-grid {
  713. display: grid;
  714. grid-template-columns: repeat(4, 1fr);
  715. gap: 25rpx;
  716. padding: 35rpx;
  717. background: #FFFFFF;
  718. border-radius: 20rpx;
  719. margin-bottom: 20rpx;
  720. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  721. .function-item {
  722. display: flex;
  723. flex-direction: column;
  724. align-items: center;
  725. gap: 15rpx;
  726. .function-icon {
  727. width: 90rpx;
  728. height: 90rpx;
  729. border-radius: 50%;
  730. background-size: 50rpx 50rpx;
  731. background-repeat: no-repeat;
  732. background-position: center;
  733. &.calendar {
  734. background-color: #FFF3E0;
  735. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF9800"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>');
  736. display: flex;
  737. align-items: center;
  738. justify-content: center;
  739. font-size: 32rpx;
  740. font-weight: bold;
  741. color: #FF9800;
  742. }
  743. &.resources {
  744. background-color: #E8F5E9;
  745. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234CAF50"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  746. }
  747. &.heart-book {
  748. background-color: #FFEBEE;
  749. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23F44336"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"/></svg>');
  750. }
  751. &.money {
  752. background-color: #F3E5F5;
  753. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/></svg>');
  754. }
  755. }
  756. .function-text {
  757. font-size: 26rpx;
  758. color: #333;
  759. }
  760. }
  761. }
  762. /* 设置选项 */
  763. .settings-section {
  764. background: #FFFFFF;
  765. border-radius: 20rpx;
  766. padding: 0;
  767. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  768. .settings-item {
  769. display: flex;
  770. align-items: center;
  771. justify-content: space-between;
  772. padding: 25rpx 35rpx;
  773. margin-bottom: 0;
  774. background: #FFFFFF;
  775. border-radius: 20rpx;
  776. &:last-child {
  777. margin-bottom: 0;
  778. }
  779. .settings-icon {
  780. width: 44rpx;
  781. height: 44rpx;
  782. background-size: contain;
  783. background-repeat: no-repeat;
  784. background-position: center;
  785. margin-right: 20rpx;
  786. }
  787. .settings-icon.user {
  788. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  789. }
  790. .settings-icon.gear {
  791. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></svg>');
  792. }
  793. .settings-icon.logout {
  794. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"/></svg>');
  795. }
  796. .settings-text {
  797. flex: 1;
  798. font-size: 30rpx;
  799. color: #333;
  800. }
  801. .arrow-right {
  802. width: 24rpx;
  803. height: 24rpx;
  804. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>');
  805. background-size: contain;
  806. background-repeat: no-repeat;
  807. background-position: center;
  808. }
  809. }
  810. }
  811. /* 底部导航 */
  812. .tabbar {
  813. position: fixed;
  814. bottom: 0;
  815. left: 0;
  816. right: 0;
  817. height: 100rpx;
  818. background: #FFFFFF;
  819. border-top: 1rpx solid #F0F0F0;
  820. display: flex;
  821. justify-content: space-around;
  822. align-items: center;
  823. padding-bottom: env(safe-area-inset-bottom);
  824. .tabbar-item {
  825. display: flex;
  826. flex-direction: column;
  827. align-items: center;
  828. gap: 8rpx;
  829. padding: 10rpx 0;
  830. .tabbar-icon {
  831. width: 44rpx;
  832. height: 44rpx;
  833. background-size: contain;
  834. background-repeat: no-repeat;
  835. background-position: center;
  836. position: relative;
  837. .badge {
  838. position: absolute;
  839. top: -8rpx;
  840. right: -8rpx;
  841. background: #FF4444;
  842. color: #FFFFFF;
  843. font-size: 20rpx;
  844. font-weight: bold;
  845. width: 32rpx;
  846. height: 32rpx;
  847. display: flex;
  848. align-items: center;
  849. justify-content: center;
  850. border-radius: 16rpx;
  851. }
  852. }
  853. .tabbar-text {
  854. font-size: 20rpx;
  855. color: #999;
  856. }
  857. &.active {
  858. .tabbar-text {
  859. color: #9C27B0;
  860. font-weight: bold;
  861. }
  862. }
  863. &.home .tabbar-icon {
  864. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  865. }
  866. &.active.home .tabbar-icon {
  867. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  868. }
  869. &.resources .tabbar-icon {
  870. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  871. }
  872. &.active.resources .tabbar-icon {
  873. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
  874. }
  875. &.trophy .tabbar-icon {
  876. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  877. }
  878. &.active.trophy .tabbar-icon {
  879. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"/></svg>');
  880. }
  881. &.message .tabbar-icon {
  882. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  883. }
  884. &.active.message .tabbar-icon {
  885. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg>');
  886. }
  887. &.mine .tabbar-icon {
  888. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  889. }
  890. &.mine.active .tabbar-icon {
  891. background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  892. }
  893. }
  894. }
  895. /* 签到弹框样式 */
  896. .sign-in-popup {
  897. width: 600rpx;
  898. background: #FFFFFF;
  899. border-radius: 20rpx;
  900. overflow: hidden;
  901. .popup-header {
  902. display: flex;
  903. justify-content: space-between;
  904. align-items: center;
  905. padding: 30rpx;
  906. border-bottom: 1rpx solid #F0F0F0;
  907. .popup-title {
  908. font-size: 32rpx;
  909. font-weight: bold;
  910. color: #333;
  911. }
  912. .close-btn {
  913. width: 40rpx;
  914. height: 40rpx;
  915. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
  916. background-size: contain;
  917. background-repeat: no-repeat;
  918. background-position: center;
  919. }
  920. }
  921. .popup-content {
  922. padding: 30rpx;
  923. .calendar-container {
  924. background: #F8F9FA;
  925. border-radius: 15rpx;
  926. padding: 20rpx;
  927. margin-bottom: 30rpx;
  928. .calendar-header {
  929. display: flex;
  930. justify-content: space-between;
  931. align-items: center;
  932. margin-bottom: 20rpx;
  933. .calendar-title {
  934. font-size: 28rpx;
  935. font-weight: bold;
  936. color: #333;
  937. }
  938. .calendar-icon {
  939. width: 40rpx;
  940. height: 40rpx;
  941. background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239C27B0"><path d="M3 17h18v-2H3v2zm0 4h18v-2H3v2zM3 3v2h18V3H3zm0 6h18V7H3v2z"/></svg>');
  942. background-size: contain;
  943. background-repeat: no-repeat;
  944. background-position: center;
  945. }
  946. }
  947. .calendar-week {
  948. display: grid;
  949. grid-template-columns: repeat(7, 1fr);
  950. gap: 10rpx;
  951. margin-bottom: 15rpx;
  952. .week-day {
  953. text-align: center;
  954. font-size: 24rpx;
  955. color: #999;
  956. font-weight: bold;
  957. }
  958. }
  959. .calendar-days {
  960. display: grid;
  961. grid-template-columns: repeat(7, 1fr);
  962. gap: 10rpx;
  963. .calendar-day {
  964. text-align: center;
  965. font-size: 26rpx;
  966. color: #333;
  967. background: #FFFFFF;
  968. border-radius: 50%;
  969. height: 60rpx;
  970. display: flex;
  971. align-items: center;
  972. justify-content: center;
  973. &.other-month {
  974. color: #CCCCCC;
  975. }
  976. &.today {
  977. background: #FFF3E0;
  978. color: #FF9800;
  979. font-weight: bold;
  980. }
  981. &.checked {
  982. background: #E8F5E9;
  983. color: #4CAF50;
  984. font-weight: bold;
  985. }
  986. }
  987. }
  988. }
  989. .sign-in-reward {
  990. display: flex;
  991. flex-direction: column;
  992. align-items: center;
  993. gap: 10rpx;
  994. .reward-title {
  995. font-size: 28rpx;
  996. color: #666;
  997. }
  998. .reward-points {
  999. font-size: 48rpx;
  1000. font-weight: bold;
  1001. color: #E91E63;
  1002. }
  1003. }
  1004. }
  1005. .popup-footer {
  1006. padding: 0 30rpx 30rpx;
  1007. .sign-in-btn {
  1008. width: 100%;
  1009. height: 80rpx;
  1010. background: #9C27B0;
  1011. color: #FFFFFF;
  1012. font-size: 32rpx;
  1013. border-radius: 40rpx;
  1014. border: none;
  1015. font-weight: bold;
  1016. &:hover {
  1017. background: #7B1FA2;
  1018. }
  1019. &.signed {
  1020. background: #E0E0E0;
  1021. color: #9E9E9E;
  1022. cursor: not-allowed;
  1023. &:hover {
  1024. background: #E0E0E0;
  1025. }
  1026. }
  1027. }
  1028. }
  1029. }
  1030. </style>