mine.vue 31 KB

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