diff --git a/gym-manage-uniapp/common/memberInfo/mockData.js b/gym-manage-uniapp/common/memberInfo/mockData.js index 573deaa..e88bacc 100644 --- a/gym-manage-uniapp/common/memberInfo/mockData.js +++ b/gym-manage-uniapp/common/memberInfo/mockData.js @@ -5,7 +5,7 @@ export const memberCenterMock = { name: '张小芳', phone: '13812345678 已绑定微信', memberLevel: '黄金会员', - avatar: '/static/images/AvatarEditWrap.png' + avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AvatarEditWrap.png' }, stats: { checkInCount: 128, @@ -75,7 +75,7 @@ export const userInfoMock = { height: '165', weight: '63.5', fitnessGoals: ['减脂', '塑形'], - avatar: '/static/images/AvatarEditWrap.png' + avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AvatarEditWrap.png' } export const fitnessGoalOptions = ['减脂', '塑形', '增肌', '提升耐力', '改善体态'] @@ -102,7 +102,7 @@ export const memberCardMock = { time: '2024-07-12 09:05', value: '-1次', valueType: 'negative', - icon: '/static/images/dumbbell.png', + icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/dumbbell.png', iconTheme: 'orange' }, { @@ -112,7 +112,7 @@ export const memberCardMock = { time: '2024-07-11 18:30', value: '-1天', valueType: 'negative', - icon: '/static/images/mappin.png', + icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/mappin.png', iconTheme: 'green' }, { @@ -122,7 +122,7 @@ export const memberCardMock = { time: '2024-07-01 10:00', value: '+90天', valueType: 'positive', - icon: '/static/images/pluscircle.png', + icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/pluscircle.png', iconTheme: 'orange' } ], @@ -156,14 +156,14 @@ export const bodyTestMock = { { step: 3, title: '确认连接', desc: '点击下方按钮搜索并配对设备' } ], metricDefs: [ - { key: 'weight', label: '体重', unit: 'kg', icon: '/static/images/target.png' }, - { key: 'bmi', label: 'BMI', unit: '', icon: '/static/images/activity.png' }, - { key: 'bodyFat', label: '体脂率', unit: '%', icon: '/static/images/trendingdown.png' }, - { key: 'muscleMass', label: '肌肉量', unit: 'kg', icon: '/static/images/dumbbell.png' }, - { key: 'visceralFat', label: '内脏脂肪', unit: '级', icon: '/static/images/alertcircle.png' }, - { key: 'bmr', label: '基础代谢', unit: 'kcal', icon: '/static/images/clock.png' }, - { key: 'bodyWater', label: '体水分', unit: '%', icon: '/static/images/shield.png' }, - { key: 'boneMass', label: '骨量', unit: 'kg', icon: '/static/images/user.png' } + { key: 'weight', label: '体重', unit: 'kg', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/target.png' }, + { key: 'bmi', label: 'BMI', unit: '', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/activity.png' }, + { key: 'bodyFat', label: '体脂率', unit: '%', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/trendingdown.png' }, + { key: 'muscleMass', label: '肌肉量', unit: 'kg', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/dumbbell.png' }, + { key: 'visceralFat', label: '内脏脂肪', unit: '级', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/alertcircle.png' }, + { key: 'bmr', label: '基础代谢', unit: 'kcal', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/clock.png' }, + { key: 'bodyWater', label: '体水分', unit: '%', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/shield.png' }, + { key: 'boneMass', label: '骨量', unit: 'kg', icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user.png' } ], radarLabels: [ { key: 'weight', label: '体重控制' }, @@ -185,7 +185,7 @@ export const bodyTestMock = { title: '燃脂 HIIT 团课', coach: '李明教练', schedule: '每周二、四 19:00', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', tag: '减脂推荐' }, { @@ -193,7 +193,7 @@ export const bodyTestMock = { title: '核心力量塑形', coach: '王强教练', schedule: '每周一、三 18:30', - banner: '/static/images/AC2Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', tag: '塑形推荐' } ], @@ -352,7 +352,7 @@ export const bookingMock = { { id: 1, title: '瑜伽基础班', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', status: 'booked', statusLabel: '已预约', schedule: '07月15日 09:00-10:00', @@ -368,7 +368,7 @@ export const bookingMock = { { id: 2, title: '私教健身课', - banner: '/static/images/AC2Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', status: 'pending', statusLabel: '待上课', schedule: '07月18日 14:00-15:00', @@ -386,7 +386,7 @@ export const bookingMock = { { id: 3, title: '动感单车', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', status: 'completed', statusLabel: '已完成', schedule: '07月10日 19:00-20:00', @@ -397,7 +397,7 @@ export const bookingMock = { { id: 4, title: '普拉提进阶', - banner: '/static/images/AC2Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', status: 'cancelled', statusLabel: '已取消', schedule: '07月05日 10:00-11:00', @@ -428,7 +428,7 @@ export const courseCatalogMock = { title: '瑜伽基础班', type: 'group', coach: '李明教练', - coachAvatar: '/static/images/user0.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user0.png', date: '2024-07-15', startTime: '09:00', endTime: '10:00', @@ -438,7 +438,7 @@ export const courseCatalogMock = { price: '次卡扣 1 次', payType: 'session', period: 'morning', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', intro: '适合零基础学员,重点提升柔韧性与呼吸控制。', suitable: '久坐办公族、初学者、想改善体态者', coachBio: '国家一级瑜伽指导员,5年教学经验', @@ -454,7 +454,7 @@ export const courseCatalogMock = { title: 'HIIT 燃脂团课', type: 'group', coach: '赵敏教练', - coachAvatar: '/static/images/user1.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user1.png', date: '2024-07-15', startTime: '19:00', endTime: '20:00', @@ -464,7 +464,7 @@ export const courseCatalogMock = { price: '时长卡', payType: 'duration', period: 'evening', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', intro: '高强度间歇训练,快速燃脂提升心肺。', suitable: '有一定运动基础、目标减脂者', coachBio: 'ACE 认证教练,擅长 HIIT 与动感单车', @@ -477,7 +477,7 @@ export const courseCatalogMock = { title: '私教 · 力量训练', type: 'private', coach: '王强教练', - coachAvatar: '/static/images/user2.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user2.png', date: '2024-07-16', startTime: '14:00', endTime: '15:00', @@ -487,7 +487,7 @@ export const courseCatalogMock = { price: '私教课时卡', payType: 'private', period: 'afternoon', - banner: '/static/images/AC2Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', intro: '一对一力量训练,定制训练计划。', suitable: '增肌塑形、康复训练', coachBio: 'NSCA 认证私教,8年从业经验', @@ -500,7 +500,7 @@ export const courseCatalogMock = { title: '普拉提进阶', type: 'group', coach: '李明教练', - coachAvatar: '/static/images/user0.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user0.png', date: '2024-07-17', startTime: '10:30', endTime: '11:30', @@ -510,7 +510,7 @@ export const courseCatalogMock = { price: '次卡扣 1 次', payType: 'session', period: 'morning', - banner: '/static/images/AC2Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', intro: '核心稳定与体态矫正进阶课程。', suitable: '有普拉提基础者', coachBio: '国家一级瑜伽指导员', @@ -523,7 +523,7 @@ export const courseCatalogMock = { title: '动感单车', type: 'group', coach: '赵敏教练', - coachAvatar: '/static/images/user1.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user1.png', date: '2024-07-18', startTime: '18:30', endTime: '19:30', @@ -533,7 +533,7 @@ export const courseCatalogMock = { price: '储值卡 ¥39', payType: 'stored', period: 'evening', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', intro: '音乐骑行,团队氛围燃脂。', suitable: '所有级别,可调节阻力', coachBio: 'ACE 认证教练', @@ -720,10 +720,10 @@ export const moduleMock = { rule: '签到、训练、邀请好友、购课均可获得积分;积分可用于商城兑换。' }, pointsRewards: [ - { id: 1, name: '团课体验券', cost: 500, stock: 12, icon: '/static/images/ticket.png' }, - { id: 2, name: '运动毛巾', cost: 800, stock: 5, icon: '/static/images/dumbbell.png' }, - { id: 3, name: '私教体验30分钟', cost: 2000, stock: 3, icon: '/static/images/usercheck.png' }, - { id: 4, name: '蛋白粉小样', cost: 350, stock: 20, icon: '/static/images/star.png' } + { id: 1, name: '团课体验券', cost: 500, stock: 12, icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/ticket.png' }, + { id: 2, name: '运动毛巾', cost: 800, stock: 5, icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/dumbbell.png' }, + { id: 3, name: '私教体验30分钟', cost: 2000, stock: 3, icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/usercheck.png' }, + { id: 4, name: '蛋白粉小样', cost: 350, stock: 20, icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/star.png' } ], pointsHistory: [ { id: 1, type: 'earn', title: '团课签到', amount: 50, time: '2024-07-12 09:10', balance: 1250 }, @@ -739,11 +739,11 @@ export const moduleMock = { '积分可用于兑换课程体验券及周边礼品' ], referralRecords: [ - { id: 1, name: '李**', avatar: '/static/images/user0.png', status: 'purchased', statusLabel: '已购课', time: '2024-07-05', reward: '+300积分', rewardStatus: '已发放' }, - { id: 2, name: '王**', avatar: '/static/images/user1.png', status: 'registered', statusLabel: '已注册', time: '2024-06-20', reward: '+100积分', rewardStatus: '已发放' }, - { id: 3, name: '陈**', avatar: '/static/images/user2.png', status: 'invited', statusLabel: '已邀请', time: '2024-06-15', reward: '待注册', rewardStatus: '待发放' }, - { id: 4, name: '赵**', avatar: '/static/images/user3.png', status: 'purchased', statusLabel: '已购课', time: '2024-06-01', reward: '+300积分', rewardStatus: '已发放' }, - { id: 5, name: '刘**', avatar: '/static/images/user0.png', status: 'registered', statusLabel: '已注册', time: '2024-05-28', reward: '+100积分', rewardStatus: '已发放' } + { id: 1, name: '李**', avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user0.png', status: 'purchased', statusLabel: '已购课', time: '2024-07-05', reward: '+300积分', rewardStatus: '已发放' }, + { id: 2, name: '王**', avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user1.png', status: 'registered', statusLabel: '已注册', time: '2024-06-20', reward: '+100积分', rewardStatus: '已发放' }, + { id: 3, name: '陈**', avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user2.png', status: 'invited', statusLabel: '已邀请', time: '2024-06-15', reward: '待注册', rewardStatus: '待发放' }, + { id: 4, name: '赵**', avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user3.png', status: 'purchased', statusLabel: '已购课', time: '2024-06-01', reward: '+300积分', rewardStatus: '已发放' }, + { id: 5, name: '刘**', avatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user0.png', status: 'registered', statusLabel: '已注册', time: '2024-05-28', reward: '+100积分', rewardStatus: '已发放' } ], referralRewardSummary: { totalPoints: 800, @@ -763,7 +763,7 @@ export const moduleMock = { id: 1, title: '瑜伽基础班', coach: '李明教练', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', progress: 6, total: 12, schedule: '每周二、四 09:00', @@ -778,7 +778,7 @@ export const moduleMock = { id: 3, title: '动感单车入门', coach: '赵敏教练', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', progress: 8, total: 8, schedule: '已结课', @@ -791,7 +791,7 @@ export const moduleMock = { private: { remaining: 7, coach: '王强教练', - coachAvatar: '/static/images/user2.png', + coachAvatar: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/user2.png', nextClass: '07月15日 14:00', bookings: [ { id: 2, title: '私教 · 力量训练', time: '07月18日 14:00', status: '已预约', location: 'B区私教室' } @@ -804,7 +804,7 @@ export const moduleMock = { { id: 201, title: '居家核心训练', - cover: '/static/images/AC2Banner.png', + cover: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC2Banner.png', duration: '45分钟', progress: 60, chapters: 6, @@ -814,7 +814,7 @@ export const moduleMock = { { id: 202, title: '直播 · 晨间拉伸', - cover: '/static/images/AC1Banner.png', + cover: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', duration: '30分钟', progress: 0, liveTime: '07月20日 07:00', @@ -825,7 +825,7 @@ export const moduleMock = { { id: 301, title: '28天减脂训练营', - banner: '/static/images/AC1Banner.png', + banner: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/AC1Banner.png', progress: 3, total: 10, coach: '李明教练', diff --git a/gym-manage-uniapp/common/memberInfo/store.js b/gym-manage-uniapp/common/memberInfo/store.js index b161e7d..3d79750 100644 --- a/gym-manage-uniapp/common/memberInfo/store.js +++ b/gym-manage-uniapp/common/memberInfo/store.js @@ -275,7 +275,7 @@ export function renewMemberCard(store, addDays = 90) { time: formatRecordTime(new Date()), value: `+${addDays}天`, valueType: 'positive', - icon: '/static/images/pluscircle.png', + icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/images/pluscircle.png', iconTheme: 'orange' }) diff --git a/gym-manage-uniapp/common/style/tabbar_icon/tabbar.css b/gym-manage-uniapp/common/style/tabbar_icon/tabbar.css new file mode 100644 index 0000000..a690072 --- /dev/null +++ b/gym-manage-uniapp/common/style/tabbar_icon/tabbar.css @@ -0,0 +1,33 @@ +@font-face { + font-family: "iconfont"; /* Project id */ + src: url('tabbar.ttf?t=1780818759010') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-home:before { + content: "\e666"; +} + +.icon-course:before { + content: "\e692"; +} + +.icon-train:before { + content: "\e8be"; +} + +.icon-discover:before { + content: "\e726"; +} + +.icon-profile:before { + content: "\e501"; +} + diff --git a/gym-manage-uniapp/common/style/tabbar_icon/tabbar.ttf b/gym-manage-uniapp/common/style/tabbar_icon/tabbar.ttf new file mode 100644 index 0000000..0712fed Binary files /dev/null and b/gym-manage-uniapp/common/style/tabbar_icon/tabbar.ttf differ diff --git a/gym-manage-uniapp/components/Skeleton/SkeletonBase.vue b/gym-manage-uniapp/components/Skeleton/SkeletonBase.vue new file mode 100644 index 0000000..5d8710d --- /dev/null +++ b/gym-manage-uniapp/components/Skeleton/SkeletonBase.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/gym-manage-uniapp/components/TabBar.vue b/gym-manage-uniapp/components/TabBar.vue index a7054e6..0fdb25b 100644 --- a/gym-manage-uniapp/components/TabBar.vue +++ b/gym-manage-uniapp/components/TabBar.vue @@ -8,11 +8,13 @@ hover-class="tab-item--hover" @tap.stop="onTabTap(index)" > - + + {{ tab.label }} @@ -34,32 +36,27 @@ const props = defineProps({ const emit = defineEmits(['update:active', 'tab-change']) -// 当前激活的索引 - 默认从路由获取 const currentActiveIndex = ref(-1) - -// 是否需要显示 TabBar const shouldShowTabBar = ref(true) -// 不需要显示 TabBar 的页面路径列表(注意:不要带开头的 /) const HIDE_TABBAR_PAGES = [ - 'pages/memberInfo/courseList', // 预约课程 - 'pages/memberInfo/courseDetail', // 课程详情 - 'pages/memberInfo/booking', // 我的预约 - 'pages/memberInfo/bodyTestReport', // 体测报告 - 'pages/groupCourse/list', // 团课列表 - 'pages/groupCourse/detail', // 团课详情 - 'pages/searchCourse/searchCourse', // 搜索课程 - 'pages/checkIn/checkIn', // 会员签到 - 'pages/memberInfo/myCourses', // 我的课程 - 'pages/memberInfo/coupons', // 我的优惠券 - 'pages/memberInfo/points', // 我的积分 - 'pages/memberInfo/pointsMall', // 积分商城 - 'pages/memberInfo/referral', // 邀请好友 - 'pages/memberInfo/userInfo', // 个人信息 - 'pages/memberInfo/memberCard', // 我的会员卡 + 'pages/memberInfo/courseList', + 'pages/memberInfo/courseDetail', + 'pages/memberInfo/booking', + 'pages/memberInfo/bodyTestReport', + 'pages/groupCourse/list', + 'pages/groupCourse/detail', + 'pages/searchCourse/searchCourse', + 'pages/checkIn/checkIn', + 'pages/memberInfo/myCourses', + 'pages/memberInfo/coupons', + 'pages/memberInfo/points', + 'pages/memberInfo/pointsMall', + 'pages/memberInfo/referral', + 'pages/memberInfo/userInfo', + 'pages/memberInfo/memberCard', ] -// 从路由获取当前激活的 tab function getActiveIndexFromRoute() { const routePath = getCurrentRoutePath() const index = getTabIndexByRoute(routePath) @@ -67,16 +64,12 @@ function getActiveIndexFromRoute() { return index >= 0 ? index : 0 } -// 同步激活状态(高优先级:路由 > props) function syncActiveState() { - // 优先从路由获取(最准确) const routeIndex = getActiveIndexFromRoute() if (routeIndex >= 0) { currentActiveIndex.value = routeIndex return } - - // 其次使用 props if (props.active >= 0) { currentActiveIndex.value = props.active } else if (props.activeTab >= 0) { @@ -86,23 +79,16 @@ function syncActiveState() { } } -// 检查当前页面是否需要隐藏 TabBar function checkShouldShow() { let routePath = getCurrentRoutePath() - - // 标准化路径:去掉开头的 / if (routePath.startsWith('/')) { routePath = routePath.slice(1) } - // 去掉查询参数(?后面的内容) if (routePath.includes('?')) { routePath = routePath.split('?')[0] } - - // 检查是否在隐藏列表中 const shouldHide = HIDE_TABBAR_PAGES.includes(routePath) shouldShowTabBar.value = !shouldHide - console.log('=== TabBar 显示控制 ===') console.log('原始路径:', getCurrentRoutePath()) console.log('标准化路径:', routePath) @@ -110,25 +96,19 @@ function checkShouldShow() { console.log('是否显示 TabBar:', shouldShowTabBar.value) } -// 监听路由变化(页面切换时自动同步) let routeWatcher = null let appRouteCallback = null onMounted(() => { - // 初始同步 syncActiveState() checkShouldShow() - // #ifdef APP-PLUS - // App 端:监听页面显示 routeWatcher = setInterval(() => { syncActiveState() checkShouldShow() }, 300) // #endif - // #ifdef MP-WEIXIN - // 小程序端:监听路由变化 if (typeof uni.onAppRoute === 'function') { appRouteCallback = () => { setTimeout(() => { @@ -143,11 +123,8 @@ onMounted(() => { onBeforeUnmount(() => { // #ifdef APP-PLUS - if (routeWatcher) { - clearInterval(routeWatcher) - } + if (routeWatcher) { clearInterval(routeWatcher) } // #endif - // #ifdef MP-WEIXIN if (appRouteCallback && typeof uni.offAppRoute === 'function') { uni.offAppRoute(appRouteCallback) @@ -155,44 +132,48 @@ onBeforeUnmount(() => { // #endif }) -// 监听 props 变化 watch(() => props.active, () => { const routeIndex = getActiveIndexFromRoute() - if (routeIndex !== currentActiveIndex.value) { - syncActiveState() - } + if (routeIndex !== currentActiveIndex.value) { syncActiveState() } }) +// tabs 配置:只有"我的"用字体图标 const tabs = [ { path: PAGE.INDEX, - icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/home.png', - iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/home.png', - label: '首页' + icon: 'icon-home', + label: '首页', + useFontIcon: true, + fontSize:"36rpx" }, { path: PAGE.COURSE, - icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/course.png', - iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/course.png', - label: '课程' + icon: 'icon-course', + iconActive: '/static/tabBar/active/course.png', + label: '课程', + useFontIcon: true, + fontSize:"36rpx" }, { path: PAGE.TRAIN, - icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/train.png', - iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/train.png', - label: '训练' + icon: 'icon-train', + label: '训练', + useFontIcon: true, + fontSize:"48rpx" }, { path: PAGE.DISCOVER, - icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/discover.png', - iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/discover.png', - label: '发现' + icon: 'icon-discover', + label: '发现', + useFontIcon: true, + fontSize:"48rpx" }, { path: PAGE.MEMBER, - icon: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/profile.png', - iconActive: 'https://gymfuture.oss-cn-chengdu.aliyuncs.com/static/tabBar/active/profile.png', - label: '我的' + icon: 'icon-profile', + label: '我的', + useFontIcon: true, + fontSize:"36rpx" } ] @@ -200,37 +181,22 @@ let isSwitching = false function onTabTap(index) { if (isSwitching) return - const targetPath = TAB_ROUTES[index] const currentPath = TAB_ROUTES[currentActiveIndex.value] - if (targetPath === currentPath) return - console.log('Tab 点击:', index, targetPath) - - // 1. 立即更新 UI 高亮 currentActiveIndex.value = index - - // 2. 通知父组件 emit('update:active', index) emit('tab-change', index) - - // 3. 显示 loading(可选) let timer = setTimeout(() => { uni.showLoading({ title: '加载中...', mask: true }) }, 50) - isSwitching = true - - // 4. 执行跳转 uni.switchTab({ url: targetPath, - success: () => { - console.log('switchTab 成功:', targetPath) - }, + success: () => { console.log('switchTab 成功:', targetPath) }, fail: (err) => { console.error('switchTab 失败:', err) - // 降级 uni.reLaunch({ url: targetPath }) }, complete: () => { @@ -238,7 +204,6 @@ function onTabTap(index) { uni.hideLoading() setTimeout(() => { isSwitching = false - // 跳转完成后,再次同步确保高亮正确 syncActiveState() checkShouldShow() }, 100) @@ -248,19 +213,24 @@ function onTabTap(index) { \ No newline at end of file diff --git a/gym-manage-uniapp/components/global/GlobalLoading.vue b/gym-manage-uniapp/components/global/GlobalLoading.vue new file mode 100644 index 0000000..a99b35d --- /dev/null +++ b/gym-manage-uniapp/components/global/GlobalLoading.vue @@ -0,0 +1,85 @@ + + + + + + \ No newline at end of file diff --git a/gym-manage-uniapp/components/index/BannerSwiper.vue b/gym-manage-uniapp/components/index/BannerSwiper.vue index 25eb838..094d64f 100644 --- a/gym-manage-uniapp/components/index/BannerSwiper.vue +++ b/gym-manage-uniapp/components/index/BannerSwiper.vue @@ -1,7 +1,5 @@