mine.vue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  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. currentDate: new Date(),
  187. calendarTitle: '',
  188. calendarDays: []
  189. }
  190. },
  191. onLoad() {
  192. this.loadProfileData()
  193. this.checkSignInStatus()
  194. this.generateCalendar()
  195. },
  196. methods: {
  197. // 生成日历数据
  198. generateCalendar() {
  199. const date = this.currentDate || new Date()
  200. const year = date.getFullYear()
  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. this.isSignedToday = res || false
  321. // 获取签到统计
  322. const stats = await api.matchmaker.checkinStats(userId)
  323. console.log('获取签到统计返回结果:', stats)
  324. if (stats) {
  325. this.continuousDays = stats.continuousDays || 0
  326. this.totalDays = stats.totalDays || 0
  327. }
  328. } else {
  329. // 没有有效的userId,重置签到状态
  330. this.isSignedToday = false
  331. this.continuousDays = 0
  332. this.totalDays = 0
  333. console.warn('没有有效的userId,无法检查签到状态')
  334. }
  335. } catch (error) {
  336. console.error('检查签到状态失败:', error)
  337. // API调用失败时,重置签到状态
  338. this.isSignedToday = false
  339. this.continuousDays = 0
  340. this.totalDays = 0
  341. }
  342. },
  343. // 显示签到弹框
  344. showSignInPopup() {
  345. // 无论是否已签到,都显示签到弹框,让用户可以看到签到记录
  346. this.$refs.signInPopup.open()
  347. },
  348. // 关闭签到弹框
  349. closeSignInPopup() {
  350. this.$refs.signInPopup.close()
  351. },
  352. // 执行签到
  353. async doSignIn() {
  354. try {
  355. // 从本地存储获取用户信息
  356. const userInfo = uni.getStorageSync('userInfo')
  357. const userId = userInfo && userInfo.userId ? userInfo.userId : null
  358. // 只有在有有效userId时才调用API
  359. if (userId) {
  360. // 调用签到API
  361. const res = await api.matchmaker.doCheckin(userId)
  362. console.log('签到API返回结果:', res)
  363. // 直接使用返回的布尔值判断签到结果
  364. if (res) {
  365. // 签到成功
  366. uni.showToast({
  367. title: '签到成功',
  368. icon: 'success'
  369. })
  370. // 更新签到状态
  371. this.isSignedToday = true
  372. // 重新生成日历,更新当天签到状态
  373. this.generateCalendar()
  374. // 刷新个人资料(更新积分)
  375. this.loadProfileData()
  376. // 关闭弹框
  377. this.closeSignInPopup()
  378. } else {
  379. // 今日已签到
  380. uni.showToast({
  381. title: '今日已签到',
  382. icon: 'none'
  383. })
  384. }
  385. } else {
  386. // 没有有效的userId,提示用户登录
  387. uni.showToast({
  388. title: '请先登录',
  389. icon: 'none'
  390. })
  391. // 跳转到登录页
  392. setTimeout(() => {
  393. uni.navigateTo({
  394. url: '/pages/page3/page3'
  395. })
  396. }, 1000)
  397. }
  398. } catch (error) {
  399. console.error('签到失败:', error)
  400. uni.showToast({
  401. title: error.msg || '签到失败,请稍后重试',
  402. icon: 'none'
  403. })
  404. }
  405. },
  406. // 签到(旧方法,保持兼容)
  407. handleSignIn() {
  408. this.showSignInPopup()
  409. },
  410. // 我的资源
  411. handleMyResources() {
  412. uni.navigateTo({
  413. url: '/pages/matchmaker-workbench/my-resources'
  414. })
  415. },
  416. // 活动中心
  417. handleActivityCenter() {
  418. uni.navigateTo({
  419. url: '/pages/activities/list'
  420. })
  421. },
  422. // 积分商城
  423. handlePointsMall() {
  424. console.log('积分商城')
  425. uni.showToast({
  426. title: '积分商城开发中',
  427. icon: 'none'
  428. })
  429. },
  430. // 编辑资料
  431. handleEditProfile() {
  432. console.log('编辑资料')
  433. uni.navigateTo({
  434. url: '/pages/matchmaker-workbench/edit-profile'
  435. })
  436. },
  437. // 账户设置
  438. handleAccountSettings() {
  439. console.log('账户设置')
  440. uni.showToast({
  441. title: '账户设置开发中',
  442. icon: 'none'
  443. })
  444. },
  445. // 退出登录
  446. handleLogout() {
  447. uni.showModal({
  448. title: '退出登录',
  449. content: '确定要退出登录吗?',
  450. success: (res) => {
  451. if (res.confirm) {
  452. // 清除本地存储
  453. uni.removeStorageSync('token')
  454. uni.removeStorageSync('userInfo')
  455. // 跳转到登录页
  456. uni.navigateTo({
  457. url: '/pages/page3/page3'
  458. })
  459. }
  460. }
  461. })
  462. },
  463. // 导航到工作台
  464. navigateToWorkbench() {
  465. uni.navigateTo({
  466. url: '/pages/matchmaker-workbench/index'
  467. })
  468. },
  469. // 导航到我的资源
  470. navigateToMyResources() {
  471. uni.navigateTo({
  472. url: '/pages/matchmaker-workbench/my-resources'
  473. })
  474. },
  475. // 导航到排行榜
  476. navigateToRanking() {
  477. uni.navigateTo({
  478. url: '/pages/matchmaker-workbench/ranking'
  479. })
  480. },
  481. // 导航到消息
  482. navigateToMessage() {
  483. uni.navigateTo({
  484. url: '/pages/matchmaker-workbench/message'
  485. })
  486. },
  487. // 导航到我的
  488. navigateToMine() {
  489. // 已在我的页面,无需跳转
  490. }
  491. }
  492. }
  493. </script>
  494. <style lang="scss" scoped>
  495. .matchmaker-mine {
  496. min-height: 100vh;
  497. background: #FFF9F9;
  498. display: flex;
  499. flex-direction: column;
  500. }
  501. /* 顶部导航栏 */
  502. .header {
  503. display: flex;
  504. align-items: center;
  505. justify-content: space-between;
  506. padding: 25rpx 30rpx;
  507. padding-top: calc(25rpx + env(safe-area-inset-top));
  508. background: #FFF9F9;
  509. border-bottom: 1rpx solid #F0F0F0;
  510. .back-btn {
  511. width: 70rpx;
  512. height: 70rpx;
  513. display: flex;
  514. align-items: center;
  515. justify-content: center;
  516. background: rgba(240, 240, 240, 0.5);
  517. border-radius: 50%;
  518. 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>');
  519. background-size: 40rpx 40rpx;
  520. background-repeat: no-repeat;
  521. background-position: center;
  522. }
  523. .header-title {
  524. font-size: 38rpx;
  525. font-weight: bold;
  526. color: #333;
  527. }
  528. .placeholder {
  529. width: 70rpx;
  530. }
  531. }
  532. .content {
  533. flex: 1;
  534. padding: 0;
  535. }
  536. .content-container {
  537. padding: 20rpx 30rpx 120rpx;
  538. }
  539. /* 个人信息卡片 */
  540. .profile-card {
  541. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  542. border-radius: 25rpx;
  543. padding: 35rpx;
  544. margin-bottom: 25rpx;
  545. box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
  546. }
  547. .profile-header {
  548. display: flex;
  549. align-items: center;
  550. margin-bottom: 30rpx;
  551. .profile-avatar {
  552. width: 160rpx;
  553. height: 160rpx;
  554. border-radius: 50%;
  555. background-size: cover;
  556. background-repeat: no-repeat;
  557. background-position: center;
  558. margin-right: 25rpx;
  559. border: 2rpx solid #FFF;
  560. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  561. }
  562. .profile-info {
  563. flex: 1;
  564. .profile-name {
  565. display: block;
  566. font-size: 36rpx;
  567. font-weight: bold;
  568. color: #333;
  569. margin-bottom: 10rpx;
  570. }
  571. .profile-badge {
  572. display: inline-block;
  573. background: #FFD700;
  574. color: #FFFFFF;
  575. font-size: 24rpx;
  576. font-weight: bold;
  577. padding: 6rpx 16rpx;
  578. border-radius: 15rpx;
  579. margin-bottom: 10rpx;
  580. }
  581. .profile-rating {
  582. display: block;
  583. font-size: 28rpx;
  584. color: #666;
  585. }
  586. }
  587. }
  588. /* 等级和积分 */
  589. .level-points {
  590. display: flex;
  591. align-items: center;
  592. justify-content: space-between;
  593. margin-bottom: 30rpx;
  594. .level-info {
  595. display: flex;
  596. align-items: center;
  597. gap: 10rpx;
  598. .level-icon {
  599. width: 44rpx;
  600. height: 44rpx;
  601. 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>');
  602. background-size: contain;
  603. background-repeat: no-repeat;
  604. background-position: center;
  605. }
  606. .level-name {
  607. font-size: 32rpx;
  608. font-weight: bold;
  609. color: #FF9800;
  610. }
  611. }
  612. .points-value {
  613. font-size: 48rpx;
  614. font-weight: bold;
  615. color: #E91E63;
  616. }
  617. .points-label {
  618. font-size: 28rpx;
  619. color: #666;
  620. }
  621. }
  622. /* 等级进度 */
  623. .level-progress {
  624. .progress-label {
  625. display: block;
  626. font-size: 26rpx;
  627. color: #333;
  628. margin-bottom: 15rpx;
  629. }
  630. .progress-bar {
  631. width: 100%;
  632. height: 12rpx;
  633. background: rgba(255, 255, 255, 0.5);
  634. border-radius: 6rpx;
  635. margin-bottom: 10rpx;
  636. .progress-fill {
  637. height: 100%;
  638. background: #FFB74D;
  639. border-radius: 6rpx;
  640. }
  641. }
  642. .progress-values {
  643. display: flex;
  644. justify-content: space-between;
  645. margin-bottom: 15rpx;
  646. .current-value,
  647. .target-value {
  648. font-size: 24rpx;
  649. color: #666;
  650. }
  651. }
  652. .upgrade-tip {
  653. display: block;
  654. background: rgba(255, 255, 255, 0.3);
  655. color: #E91E63;
  656. font-size: 26rpx;
  657. font-weight: bold;
  658. padding: 15rpx;
  659. border-radius: 15rpx;
  660. text-align: center;
  661. }
  662. }
  663. /* 功能菜单 */
  664. .function-grid {
  665. display: grid;
  666. grid-template-columns: repeat(4, 1fr);
  667. gap: 25rpx;
  668. padding: 35rpx;
  669. background: #FFFFFF;
  670. border-radius: 20rpx;
  671. margin-bottom: 20rpx;
  672. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  673. .function-item {
  674. display: flex;
  675. flex-direction: column;
  676. align-items: center;
  677. gap: 15rpx;
  678. .function-icon {
  679. width: 90rpx;
  680. height: 90rpx;
  681. border-radius: 50%;
  682. background-size: 50rpx 50rpx;
  683. background-repeat: no-repeat;
  684. background-position: center;
  685. &.calendar {
  686. background-color: #FFF3E0;
  687. 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>');
  688. display: flex;
  689. align-items: center;
  690. justify-content: center;
  691. font-size: 32rpx;
  692. font-weight: bold;
  693. color: #FF9800;
  694. }
  695. &.resources {
  696. background-color: #E8F5E9;
  697. 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>');
  698. }
  699. &.heart-book {
  700. background-color: #FFEBEE;
  701. 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>');
  702. }
  703. &.money {
  704. background-color: #F3E5F5;
  705. 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>');
  706. }
  707. }
  708. .function-text {
  709. font-size: 26rpx;
  710. color: #333;
  711. }
  712. }
  713. }
  714. /* 设置选项 */
  715. .settings-section {
  716. background: #FFFFFF;
  717. border-radius: 20rpx;
  718. padding: 0;
  719. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  720. .settings-item {
  721. display: flex;
  722. align-items: center;
  723. justify-content: space-between;
  724. padding: 25rpx 35rpx;
  725. margin-bottom: 0;
  726. background: #FFFFFF;
  727. border-radius: 20rpx;
  728. &:last-child {
  729. margin-bottom: 0;
  730. }
  731. .settings-icon {
  732. width: 44rpx;
  733. height: 44rpx;
  734. background-size: contain;
  735. background-repeat: no-repeat;
  736. background-position: center;
  737. margin-right: 20rpx;
  738. }
  739. .settings-icon.user {
  740. 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>');
  741. }
  742. .settings-icon.gear {
  743. 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>');
  744. }
  745. .settings-icon.logout {
  746. 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>');
  747. }
  748. .settings-text {
  749. flex: 1;
  750. font-size: 30rpx;
  751. color: #333;
  752. }
  753. .arrow-right {
  754. width: 24rpx;
  755. height: 24rpx;
  756. 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>');
  757. background-size: contain;
  758. background-repeat: no-repeat;
  759. background-position: center;
  760. }
  761. }
  762. }
  763. /* 底部导航 */
  764. .tabbar {
  765. position: fixed;
  766. bottom: 0;
  767. left: 0;
  768. right: 0;
  769. height: 100rpx;
  770. background: #FFFFFF;
  771. border-top: 1rpx solid #F0F0F0;
  772. display: flex;
  773. justify-content: space-around;
  774. align-items: center;
  775. padding-bottom: env(safe-area-inset-bottom);
  776. .tabbar-item {
  777. display: flex;
  778. flex-direction: column;
  779. align-items: center;
  780. gap: 8rpx;
  781. padding: 10rpx 0;
  782. .tabbar-icon {
  783. width: 44rpx;
  784. height: 44rpx;
  785. background-size: contain;
  786. background-repeat: no-repeat;
  787. background-position: center;
  788. position: relative;
  789. .badge {
  790. position: absolute;
  791. top: -8rpx;
  792. right: -8rpx;
  793. background: #FF4444;
  794. color: #FFFFFF;
  795. font-size: 20rpx;
  796. font-weight: bold;
  797. width: 32rpx;
  798. height: 32rpx;
  799. display: flex;
  800. align-items: center;
  801. justify-content: center;
  802. border-radius: 16rpx;
  803. }
  804. }
  805. .tabbar-text {
  806. font-size: 20rpx;
  807. color: #999;
  808. }
  809. &.active {
  810. .tabbar-text {
  811. color: #9C27B0;
  812. font-weight: bold;
  813. }
  814. }
  815. &.home .tabbar-icon {
  816. 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>');
  817. }
  818. &.active.home .tabbar-icon {
  819. 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>');
  820. }
  821. &.resources .tabbar-icon {
  822. 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>');
  823. }
  824. &.active.resources .tabbar-icon {
  825. 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>');
  826. }
  827. &.trophy .tabbar-icon {
  828. 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>');
  829. }
  830. &.active.trophy .tabbar-icon {
  831. 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>');
  832. }
  833. &.message .tabbar-icon {
  834. 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>');
  835. }
  836. &.active.message .tabbar-icon {
  837. 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>');
  838. }
  839. &.mine .tabbar-icon {
  840. 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>');
  841. }
  842. &.mine.active .tabbar-icon {
  843. 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>');
  844. }
  845. }
  846. }
  847. /* 签到弹框样式 */
  848. .sign-in-popup {
  849. width: 600rpx;
  850. background: #FFFFFF;
  851. border-radius: 20rpx;
  852. overflow: hidden;
  853. .popup-header {
  854. display: flex;
  855. justify-content: space-between;
  856. align-items: center;
  857. padding: 30rpx;
  858. border-bottom: 1rpx solid #F0F0F0;
  859. .popup-title {
  860. font-size: 32rpx;
  861. font-weight: bold;
  862. color: #333;
  863. }
  864. .close-btn {
  865. width: 40rpx;
  866. height: 40rpx;
  867. 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>');
  868. background-size: contain;
  869. background-repeat: no-repeat;
  870. background-position: center;
  871. }
  872. }
  873. .popup-content {
  874. padding: 30rpx;
  875. .calendar-container {
  876. background: #F8F9FA;
  877. border-radius: 15rpx;
  878. padding: 20rpx;
  879. margin-bottom: 30rpx;
  880. .calendar-header {
  881. display: flex;
  882. justify-content: space-between;
  883. align-items: center;
  884. margin-bottom: 20rpx;
  885. .calendar-title {
  886. font-size: 28rpx;
  887. font-weight: bold;
  888. color: #333;
  889. }
  890. .calendar-icon {
  891. width: 40rpx;
  892. height: 40rpx;
  893. 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>');
  894. background-size: contain;
  895. background-repeat: no-repeat;
  896. background-position: center;
  897. }
  898. }
  899. .calendar-week {
  900. display: grid;
  901. grid-template-columns: repeat(7, 1fr);
  902. gap: 10rpx;
  903. margin-bottom: 15rpx;
  904. .week-day {
  905. text-align: center;
  906. font-size: 24rpx;
  907. color: #999;
  908. font-weight: bold;
  909. }
  910. }
  911. .calendar-days {
  912. display: grid;
  913. grid-template-columns: repeat(7, 1fr);
  914. gap: 10rpx;
  915. .calendar-day {
  916. text-align: center;
  917. font-size: 26rpx;
  918. color: #333;
  919. background: #FFFFFF;
  920. border-radius: 50%;
  921. height: 60rpx;
  922. display: flex;
  923. align-items: center;
  924. justify-content: center;
  925. &.other-month {
  926. color: #CCCCCC;
  927. }
  928. &.today {
  929. background: #FFF3E0;
  930. color: #FF9800;
  931. font-weight: bold;
  932. }
  933. &.checked {
  934. background: #E8F5E9;
  935. color: #4CAF50;
  936. font-weight: bold;
  937. }
  938. }
  939. }
  940. }
  941. .sign-in-reward {
  942. display: flex;
  943. flex-direction: column;
  944. align-items: center;
  945. gap: 10rpx;
  946. .reward-title {
  947. font-size: 28rpx;
  948. color: #666;
  949. }
  950. .reward-points {
  951. font-size: 48rpx;
  952. font-weight: bold;
  953. color: #E91E63;
  954. }
  955. }
  956. }
  957. .popup-footer {
  958. padding: 0 30rpx 30rpx;
  959. .sign-in-btn {
  960. width: 100%;
  961. height: 80rpx;
  962. background: #9C27B0;
  963. color: #FFFFFF;
  964. font-size: 32rpx;
  965. border-radius: 40rpx;
  966. border: none;
  967. font-weight: bold;
  968. &:hover {
  969. background: #7B1FA2;
  970. }
  971. &.signed {
  972. background: #E0E0E0;
  973. color: #9E9E9E;
  974. cursor: not-allowed;
  975. &:hover {
  976. background: #E0E0E0;
  977. }
  978. }
  979. }
  980. }
  981. }
  982. </style>