mine.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  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 v-if="unreadCount > 0" class="badge">{{ unreadCount }}</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. currentDate: new Date(),
  186. calendarTitle: '',
  187. calendarDays: []
  188. }
  189. },
  190. onLoad() {
  191. this.loadProfileData()
  192. this.checkSignInStatus()
  193. this.generateCalendar()
  194. },
  195. onShow() {
  196. // 从编辑资料页返回时,自动刷新个人资料
  197. this.loadProfileData()
  198. },
  199. computed: {
  200. unreadCount() {
  201. return this.$store.getters.getTotalUnread || 0
  202. }
  203. },
  204. methods: {
  205. // 生成日历数据
  206. generateCalendar() {
  207. const date = this.currentDate || new Date()
  208. const year = date.getFullYear()
  209. const month = date.getMonth()
  210. // 设置日历标题
  211. this.calendarTitle = `${year}年·${month + 1}月`
  212. // 获取当月第一天
  213. const firstDay = new Date(year, month, 1)
  214. // 获取当月第一天是星期几(0-6,0表示周日)
  215. const firstDayWeek = firstDay.getDay()
  216. // 获取当月最后一天
  217. const lastDay = new Date(year, month + 1, 0)
  218. // 获取当月最后一天的日期
  219. const lastDayDate = lastDay.getDate()
  220. // 获取上个月最后一天的日期
  221. const prevMonthLastDay = new Date(year, month, 0).getDate()
  222. const days = []
  223. // 添加上个月的日期
  224. for (let i = firstDayWeek - 1; i >= 0; i--) {
  225. days.push({
  226. date: prevMonthLastDay - i,
  227. isCurrentMonth: false,
  228. isToday: false,
  229. isChecked: false
  230. })
  231. }
  232. // 添加当月的日期
  233. const today = new Date()
  234. const isCurrentMonth = today.getFullYear() === year && today.getMonth() === month
  235. for (let i = 1; i <= lastDayDate; i++) {
  236. const isToday = isCurrentMonth && today.getDate() === i
  237. days.push({
  238. date: i,
  239. isCurrentMonth: true,
  240. isToday: isToday,
  241. isChecked: isToday && this.isSignedToday
  242. })
  243. }
  244. // 添加下个月的日期,补满6行
  245. const totalDays = 42 // 6行7列
  246. const nextMonthDays = totalDays - days.length
  247. for (let i = 1; i <= nextMonthDays; i++) {
  248. days.push({
  249. date: i,
  250. isCurrentMonth: false,
  251. isToday: false,
  252. isChecked: false
  253. })
  254. }
  255. this.calendarDays = days
  256. },
  257. // 加载个人资料数据
  258. async loadProfileData() {
  259. try {
  260. const userInfo = uni.getStorageSync('userInfo')
  261. console.log('从本地存储获取到的用户信息:', userInfo)
  262. // 模拟用户信息,用于测试
  263. const testUserId = 19
  264. const userId = userInfo && userInfo.userId ? userInfo.userId : testUserId
  265. console.log('使用的userId:', userId)
  266. // 调用API获取红娘信息
  267. console.log('开始调用API获取红娘信息...')
  268. const matchmakerInfo = await api.matchmaker.getByUserId(userId)
  269. console.log('API调用结果:', matchmakerInfo)
  270. if (matchmakerInfo) {
  271. const levelNames = ['', '青铜', '白银', '黄金', '铂金', '钻石']
  272. const currentLevel = matchmakerInfo.level || 1
  273. const nextLevel = currentLevel < 5 ? currentLevel + 1 : 5
  274. const nextLevelName = levelNames[nextLevel]
  275. const defaultAvatars = {
  276. male: 'http://115.190.125.125:9000/dynamic-comments/dynamics/5c645152-9940-41d3-83a9-69ee6e0c0aaa.png',
  277. female: 'http://115.190.125.125:9000/dynamic-comments/dynamics/c7fb04d7-ee4d-4b3d-bcef-f246da9c841f.png'
  278. }
  279. const avatarUrl = matchmakerInfo.gender === 1 ? defaultAvatars.male : defaultAvatars.female
  280. console.log('获取到的红娘信息:', matchmakerInfo)
  281. this.profile = {
  282. realName: matchmakerInfo.real_name || '',
  283. avatarUrl: avatarUrl,
  284. badge: matchmakerInfo.type_name || '',
  285. rating: matchmakerInfo.rating || 5.0,
  286. level: currentLevel,
  287. levelName: matchmakerInfo.level_name || levelNames[currentLevel],
  288. nextLevelName: nextLevelName,
  289. points: matchmakerInfo.points || 0,
  290. currentLevelPoints: matchmakerInfo.current_level_points || 0,
  291. nextLevelPoints: matchmakerInfo.next_level_points || 100,
  292. pointsToNextLevel: matchmakerInfo.points_to_next_level || 0,
  293. levelProgress: matchmakerInfo.level_progress || 0
  294. }
  295. console.log('更新后的profile数据:', this.profile)
  296. } else {
  297. console.log('matchmakerInfo为空,无法更新profile数据')
  298. }
  299. } catch (error) {
  300. console.error('加载个人资料失败:', error)
  301. uni.showToast({
  302. title: '加载失败,请稍后重试: ' + error.message,
  303. icon: 'none'
  304. })
  305. }
  306. },
  307. // 返回上一页
  308. goBack() {
  309. uni.navigateBack()
  310. },
  311. // 检查今日是否已签到
  312. async checkSignInStatus() {
  313. try {
  314. const userInfo = uni.getStorageSync('userInfo')
  315. const userId = userInfo && userInfo.userId ? userInfo.userId : null
  316. if (userId) {
  317. const res = await api.matchmaker.checkinStatus(userId)
  318. console.log('检查签到状态返回结果:', res)
  319. let signed = false
  320. if (typeof res === 'boolean') {
  321. signed = res
  322. } else if (typeof res === 'string') {
  323. signed = res === 'true'
  324. } else if (typeof res === 'number') {
  325. signed = res === 1
  326. } else if (res && typeof res === 'object') {
  327. if (typeof res.todaySigned === 'boolean') signed = res.todaySigned
  328. else if (typeof res.signed === 'boolean') signed = res.signed
  329. else if (typeof res.isSignedToday === 'boolean') signed = res.isSignedToday
  330. else if (typeof res.data === 'object' && res.data) {
  331. if (typeof res.data.todaySigned === 'boolean') signed = res.data.todaySigned
  332. else if (typeof res.data.signed === 'boolean') signed = res.data.signed
  333. else if (typeof res.data.isSignedToday === 'boolean') signed = res.data.isSignedToday
  334. }
  335. }
  336. this.isSignedToday = !!signed
  337. const stats = await api.matchmaker.checkinStats(userId)
  338. console.log('获取签到统计返回结果:', stats)
  339. if (stats) {
  340. this.continuousDays = stats.continuousDays || 0
  341. this.totalDays = stats.totalDays || 0
  342. }
  343. } else {
  344. this.isSignedToday = false
  345. this.continuousDays = 0
  346. this.totalDays = 0
  347. console.warn('没有有效的userId,无法检查签到状态')
  348. }
  349. } catch (error) {
  350. console.error('检查签到状态失败:', error)
  351. this.isSignedToday = false
  352. this.continuousDays = 0
  353. this.totalDays = 0
  354. }
  355. },
  356. // 显示签到弹框
  357. showSignInPopup() {
  358. this.$refs.signInPopup.open()
  359. },
  360. // 关闭签到弹框
  361. closeSignInPopup() {
  362. this.$refs.signInPopup.close()
  363. },
  364. // 执行签到
  365. async doSignIn() {
  366. try {
  367. const userInfo = uni.getStorageSync('userInfo')
  368. const userId = userInfo && userInfo.userId ? userInfo.userId : null
  369. if (userId) {
  370. const res = await api.matchmaker.doCheckin(userId)
  371. console.log('签到API返回结果:', res)
  372. let success = false
  373. let alreadySigned = false
  374. if (typeof res === 'boolean') {
  375. success = res
  376. } else if (typeof res === 'string') {
  377. success = res === 'true' || res === 'ok' || res === 'success'
  378. } else if (res && typeof res === 'object') {
  379. if (typeof res.success === 'boolean') success = res.success
  380. if (typeof res.todaySigned === 'boolean') alreadySigned = res.todaySigned
  381. else if (typeof res.signed === 'boolean') alreadySigned = res.signed
  382. else if (typeof res.isSignedToday === 'boolean') alreadySigned = res.isSignedToday
  383. if (res.data && typeof res.data === 'object') {
  384. if (typeof res.data.success === 'boolean') success = res.data.success
  385. if (typeof res.data.todaySigned === 'boolean') alreadySigned = res.data.todaySigned
  386. else if (typeof res.data.signed === 'boolean') alreadySigned = res.data.signed
  387. else if (typeof res.data.isSignedToday === 'boolean') alreadySigned = res.data.isSignedToday
  388. }
  389. }
  390. if (success) {
  391. uni.showToast({
  392. title: '签到成功',
  393. icon: 'success'
  394. })
  395. this.isSignedToday = true
  396. this.generateCalendar()
  397. this.loadProfileData()
  398. this.closeSignInPopup()
  399. } else if (alreadySigned) {
  400. uni.showToast({
  401. title: '今日已签到',
  402. icon: 'none'
  403. })
  404. } else {
  405. uni.showToast({
  406. title: '签到失败,请稍后重试',
  407. icon: 'none'
  408. })
  409. }
  410. } else {
  411. uni.showToast({
  412. title: '请先登录',
  413. icon: 'none'
  414. })
  415. setTimeout(() => {
  416. uni.navigateTo({
  417. url: '/pages/page3/page3'
  418. })
  419. }, 1000)
  420. }
  421. } catch (error) {
  422. console.error('签到失败:', error)
  423. uni.showToast({
  424. title: error.msg || '签到失败,请稍后重试',
  425. icon: 'none'
  426. })
  427. }
  428. },
  429. // 签到(旧方法,保持兼容)
  430. handleSignIn() {
  431. this.showSignInPopup()
  432. },
  433. // 我的资源
  434. handleMyResources() {
  435. uni.navigateTo({
  436. url: '/pages/matchmaker-workbench/my-resources'
  437. })
  438. },
  439. // 活动中心
  440. handleActivityCenter() {
  441. uni.navigateTo({
  442. url: '/pages/activities/list'
  443. })
  444. },
  445. // 积分商城
  446. handlePointsMall() {
  447. console.log('积分商城')
  448. uni.showToast({
  449. title: '积分商城开发中',
  450. icon: 'none'
  451. })
  452. },
  453. // 编辑资料
  454. handleEditProfile() {
  455. console.log('编辑资料')
  456. uni.navigateTo({
  457. url: '/pages/matchmaker-workbench/edit-profile'
  458. })
  459. },
  460. // 账户设置
  461. handleAccountSettings() {
  462. console.log('账户设置')
  463. uni.showToast({
  464. title: '账户设置开发中',
  465. icon: 'none'
  466. })
  467. },
  468. // 退出登录
  469. handleLogout() {
  470. uni.showModal({
  471. title: '退出登录',
  472. content: '确定要退出登录吗?',
  473. success: (res) => {
  474. if (res.confirm) {
  475. uni.removeStorageSync('token')
  476. uni.removeStorageSync('userInfo')
  477. uni.navigateTo({
  478. url: '/pages/page3/page3'
  479. })
  480. }
  481. }
  482. })
  483. },
  484. // 导航到工作台
  485. navigateToWorkbench() {
  486. uni.navigateTo({
  487. url: '/pages/matchmaker-workbench/index'
  488. })
  489. },
  490. // 导航到我的资源
  491. navigateToMyResources() {
  492. uni.navigateTo({
  493. url: '/pages/matchmaker-workbench/my-resources'
  494. })
  495. },
  496. // 导航到排行榜
  497. navigateToRanking() {
  498. uni.navigateTo({
  499. url: '/pages/matchmaker-workbench/ranking'
  500. })
  501. },
  502. // 导航到消息
  503. navigateToMessage() {
  504. uni.navigateTo({
  505. url: '/pages/matchmaker-workbench/message'
  506. })
  507. },
  508. // 导航到我的
  509. navigateToMine() {
  510. // 已在我的页面,无需跳转
  511. }
  512. }
  513. }
  514. </script>
  515. <style lang="scss" scoped>
  516. .matchmaker-mine {
  517. min-height: 100vh;
  518. background: #FFF9F9;
  519. display: flex;
  520. flex-direction: column;
  521. }
  522. /* 顶部导航栏 */
  523. .header {
  524. display: flex;
  525. align-items: center;
  526. justify-content: space-between;
  527. padding: 25rpx 30rpx;
  528. padding-top: calc(25rpx + env(safe-area-inset-top));
  529. background: #FFF9F9;
  530. border-bottom: 1rpx solid #F0F0F0;
  531. .back-btn {
  532. width: 70rpx;
  533. height: 70rpx;
  534. display: flex;
  535. align-items: center;
  536. justify-content: center;
  537. background: rgba(240, 240, 240, 0.5);
  538. border-radius: 50%;
  539. 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>');
  540. background-size: 40rpx 40rpx;
  541. background-repeat: no-repeat;
  542. background-position: center;
  543. }
  544. .header-title {
  545. font-size: 38rpx;
  546. font-weight: bold;
  547. color: #333;
  548. }
  549. .placeholder {
  550. width: 70rpx;
  551. }
  552. }
  553. .content {
  554. flex: 1;
  555. padding: 0;
  556. }
  557. .content-container {
  558. padding: 20rpx 30rpx 120rpx;
  559. }
  560. /* 个人信息卡片 */
  561. .profile-card {
  562. background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  563. border-radius: 25rpx;
  564. padding: 35rpx;
  565. margin-bottom: 25rpx;
  566. box-shadow: 0 4rpx 15rpx rgba(0, 0, 0, 0.1);
  567. }
  568. .profile-header {
  569. display: flex;
  570. align-items: center;
  571. margin-bottom: 30rpx;
  572. .profile-avatar {
  573. width: 160rpx;
  574. height: 160rpx;
  575. border-radius: 50%;
  576. background-size: cover;
  577. background-repeat: no-repeat;
  578. background-position: center;
  579. margin-right: 25rpx;
  580. border: 2rpx solid #FFF;
  581. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  582. }
  583. .profile-info {
  584. flex: 1;
  585. .profile-name {
  586. display: block;
  587. font-size: 36rpx;
  588. font-weight: bold;
  589. color: #333;
  590. margin-bottom: 10rpx;
  591. }
  592. .profile-badge {
  593. display: inline-block;
  594. background: #FFD700;
  595. color: #FFFFFF;
  596. font-size: 24rpx;
  597. font-weight: bold;
  598. padding: 6rpx 16rpx;
  599. border-radius: 15rpx;
  600. margin-bottom: 10rpx;
  601. }
  602. .profile-rating {
  603. display: block;
  604. font-size: 28rpx;
  605. color: #666;
  606. }
  607. }
  608. }
  609. /* 等级和积分 */
  610. .level-points {
  611. display: flex;
  612. align-items: center;
  613. justify-content: space-between;
  614. margin-bottom: 30rpx;
  615. .level-info {
  616. display: flex;
  617. align-items: center;
  618. gap: 10rpx;
  619. .level-icon {
  620. width: 44rpx;
  621. height: 44rpx;
  622. 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>');
  623. background-size: contain;
  624. background-repeat: no-repeat;
  625. background-position: center;
  626. }
  627. .level-name {
  628. font-size: 32rpx;
  629. font-weight: bold;
  630. color: #FF9800;
  631. }
  632. }
  633. .points-value {
  634. font-size: 48rpx;
  635. font-weight: bold;
  636. color: #E91E63;
  637. }
  638. .points-label {
  639. font-size: 28rpx;
  640. color: #666;
  641. }
  642. }
  643. /* 等级进度 */
  644. .level-progress {
  645. .progress-label {
  646. display: block;
  647. font-size: 26rpx;
  648. color: #333;
  649. margin-bottom: 15rpx;
  650. }
  651. .progress-bar {
  652. width: 100%;
  653. height: 12rpx;
  654. background: rgba(255, 255, 255, 0.5);
  655. border-radius: 6rpx;
  656. margin-bottom: 10rpx;
  657. .progress-fill {
  658. height: 100%;
  659. background: #FFB74D;
  660. border-radius: 6rpx;
  661. }
  662. }
  663. .progress-values {
  664. display: flex;
  665. justify-content: space-between;
  666. margin-bottom: 15rpx;
  667. .current-value,
  668. .target-value {
  669. font-size: 24rpx;
  670. color: #666;
  671. }
  672. }
  673. .upgrade-tip {
  674. display: block;
  675. background: rgba(255, 255, 255, 0.3);
  676. color: #E91E63;
  677. font-size: 26rpx;
  678. font-weight: bold;
  679. padding: 15rpx;
  680. border-radius: 15rpx;
  681. text-align: center;
  682. }
  683. }
  684. /* 功能菜单 */
  685. .function-grid {
  686. display: grid;
  687. grid-template-columns: repeat(4, 1fr);
  688. gap: 25rpx;
  689. padding: 35rpx;
  690. background: #FFFFFF;
  691. border-radius: 20rpx;
  692. margin-bottom: 20rpx;
  693. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  694. .function-item {
  695. display: flex;
  696. flex-direction: column;
  697. align-items: center;
  698. gap: 15rpx;
  699. .function-icon {
  700. width: 90rpx;
  701. height: 90rpx;
  702. border-radius: 50%;
  703. background-size: 50rpx 50rpx;
  704. background-repeat: no-repeat;
  705. background-position: center;
  706. &.calendar {
  707. background-color: #FFF3E0;
  708. 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>');
  709. display: flex;
  710. align-items: center;
  711. justify-content: center;
  712. font-size: 32rpx;
  713. font-weight: bold;
  714. color: #FF9800;
  715. }
  716. &.resources {
  717. background-color: #E8F5E9;
  718. 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>');
  719. }
  720. &.heart-book {
  721. background-color: #FFEBEE;
  722. 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>');
  723. }
  724. &.money {
  725. background-color: #F3E5F5;
  726. 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>');
  727. }
  728. }
  729. .function-text {
  730. font-size: 26rpx;
  731. color: #333;
  732. }
  733. }
  734. }
  735. /* 设置选项 */
  736. .settings-section {
  737. background: #FFFFFF;
  738. border-radius: 20rpx;
  739. padding: 0;
  740. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  741. .settings-item {
  742. display: flex;
  743. align-items: center;
  744. justify-content: space-between;
  745. padding: 25rpx 35rpx;
  746. margin-bottom: 0;
  747. background: #FFFFFF;
  748. border-radius: 20rpx;
  749. &:last-child {
  750. margin-bottom: 0;
  751. }
  752. .settings-icon {
  753. width: 44rpx;
  754. height: 44rpx;
  755. background-size: contain;
  756. background-repeat: no-repeat;
  757. background-position: center;
  758. margin-right: 20rpx;
  759. }
  760. .settings-icon.user {
  761. 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>');
  762. }
  763. .settings-icon.gear {
  764. 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>');
  765. }
  766. .settings-icon.logout {
  767. 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>');
  768. }
  769. .settings-text {
  770. flex: 1;
  771. font-size: 30rpx;
  772. color: #333;
  773. }
  774. .arrow-right {
  775. width: 24rpx;
  776. height: 24rpx;
  777. 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>');
  778. background-size: contain;
  779. background-repeat: no-repeat;
  780. background-position: center;
  781. }
  782. }
  783. }
  784. /* 底部导航 */
  785. .tabbar {
  786. position: fixed;
  787. bottom: 0;
  788. left: 0;
  789. right: 0;
  790. height: 100rpx;
  791. background: #FFFFFF;
  792. border-top: 1rpx solid #F0F0F0;
  793. display: flex;
  794. justify-content: space-around;
  795. align-items: center;
  796. padding-bottom: env(safe-area-inset-bottom);
  797. .tabbar-item {
  798. display: flex;
  799. flex-direction: column;
  800. align-items: center;
  801. gap: 8rpx;
  802. padding: 10rpx 0;
  803. .tabbar-icon {
  804. width: 44rpx;
  805. height: 44rpx;
  806. background-size: contain;
  807. background-repeat: no-repeat;
  808. background-position: center;
  809. position: relative;
  810. .badge {
  811. position: absolute;
  812. top: -8rpx;
  813. right: -8rpx;
  814. background: #FF4444;
  815. color: #FFFFFF;
  816. font-size: 20rpx;
  817. font-weight: bold;
  818. width: 32rpx;
  819. height: 32rpx;
  820. display: flex;
  821. align-items: center;
  822. justify-content: center;
  823. border-radius: 16rpx;
  824. }
  825. }
  826. .tabbar-text {
  827. font-size: 20rpx;
  828. color: #999;
  829. }
  830. &.active {
  831. .tabbar-text {
  832. color: #9C27B0;
  833. font-weight: bold;
  834. }
  835. }
  836. &.home .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="%23999"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
  838. }
  839. &.active.home .tabbar-icon {
  840. 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>');
  841. }
  842. &.resources .tabbar-icon {
  843. 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>');
  844. }
  845. &.active.resources .tabbar-icon {
  846. 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>');
  847. }
  848. &.trophy .tabbar-icon {
  849. 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>');
  850. }
  851. &.active.trophy .tabbar-icon {
  852. 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>');
  853. }
  854. &.message .tabbar-icon {
  855. 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>');
  856. }
  857. &.active.message .tabbar-icon {
  858. 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>');
  859. }
  860. &.mine .tabbar-icon {
  861. 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>');
  862. }
  863. &.mine.active .tabbar-icon {
  864. 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>');
  865. }
  866. }
  867. }
  868. /* 签到弹框样式 */
  869. .sign-in-popup {
  870. width: 600rpx;
  871. background: #FFFFFF;
  872. border-radius: 20rpx;
  873. overflow: hidden;
  874. .popup-header {
  875. display: flex;
  876. justify-content: space-between;
  877. align-items: center;
  878. padding: 30rpx;
  879. border-bottom: 1rpx solid #F0F0F0;
  880. .popup-title {
  881. font-size: 32rpx;
  882. font-weight: bold;
  883. color: #333;
  884. }
  885. .close-btn {
  886. width: 40rpx;
  887. height: 40rpx;
  888. 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>');
  889. background-size: contain;
  890. background-repeat: no-repeat;
  891. background-position: center;
  892. }
  893. }
  894. .popup-content {
  895. padding: 30rpx;
  896. .calendar-container {
  897. background: #F8F9FA;
  898. border-radius: 15rpx;
  899. padding: 20rpx;
  900. margin-bottom: 30rpx;
  901. .calendar-header {
  902. display: flex;
  903. justify-content: space-between;
  904. align-items: center;
  905. margin-bottom: 20rpx;
  906. .calendar-title {
  907. font-size: 28rpx;
  908. font-weight: bold;
  909. color: #333;
  910. }
  911. .calendar-icon {
  912. width: 40rpx;
  913. height: 40rpx;
  914. 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>');
  915. background-size: contain;
  916. background-repeat: no-repeat;
  917. background-position: center;
  918. }
  919. }
  920. .calendar-week {
  921. display: grid;
  922. grid-template-columns: repeat(7, 1fr);
  923. gap: 10rpx;
  924. margin-bottom: 15rpx;
  925. .week-day {
  926. text-align: center;
  927. font-size: 24rpx;
  928. color: #999;
  929. font-weight: bold;
  930. }
  931. }
  932. .calendar-days {
  933. display: grid;
  934. grid-template-columns: repeat(7, 1fr);
  935. gap: 10rpx;
  936. .calendar-day {
  937. text-align: center;
  938. font-size: 26rpx;
  939. color: #333;
  940. background: #FFFFFF;
  941. border-radius: 50%;
  942. height: 60rpx;
  943. display: flex;
  944. align-items: center;
  945. justify-content: center;
  946. &.other-month {
  947. color: #CCCCCC;
  948. }
  949. &.today {
  950. background: #FFF3E0;
  951. color: #FF9800;
  952. font-weight: bold;
  953. }
  954. &.checked {
  955. background: #E8F5E9;
  956. color: #4CAF50;
  957. font-weight: bold;
  958. }
  959. }
  960. }
  961. }
  962. .sign-in-reward {
  963. display: flex;
  964. flex-direction: column;
  965. align-items: center;
  966. gap: 10rpx;
  967. .reward-title {
  968. font-size: 28rpx;
  969. color: #666;
  970. }
  971. .reward-points {
  972. font-size: 48rpx;
  973. font-weight: bold;
  974. color: #E91E63;
  975. }
  976. }
  977. }
  978. .popup-footer {
  979. padding: 0 30rpx 30rpx;
  980. .sign-in-btn {
  981. width: 100%;
  982. height: 80rpx;
  983. background: #9C27B0;
  984. color: #FFFFFF;
  985. font-size: 32rpx;
  986. border-radius: 40rpx;
  987. border: none;
  988. font-weight: bold;
  989. &:hover {
  990. background: #7B1FA2;
  991. }
  992. &.signed {
  993. background: #E0E0E0;
  994. color: #9E9E9E;
  995. cursor: not-allowed;
  996. &:hover {
  997. background: #E0E0E0;
  998. }
  999. }
  1000. }
  1001. }
  1002. }
  1003. </style>