签到、课程搜索页面调整为测试模式

This commit is contained in:
future
2026-06-12 12:36:21 +08:00
parent c2a09a5057
commit 0402a1e82d
6 changed files with 580 additions and 864 deletions
+18 -13
View File
@@ -8,11 +8,12 @@
*/ */
:root { :root {
/* ========== 主品牌色(清新浅蓝色系)========== */ /* ========== 主品牌色(首页主题蓝绿色系)========== */
--primary-dark: #0B2B4B; /* 深蓝主色 - 用于重要文字、品牌标识,体现专业信赖感 */ --primary-dark: #2D4A5A; /* 深蓝绿主色 - 用于重要文字、品牌标识,体现专业信赖感 */
--primary-deep: #1A4A6F; /* 中深蓝色 - 用于hover状态、次级按钮、图标点缀,增加层次感 */ --primary-deep: #7AB5CC; /* 蓝绿主色 - 用于按钮、图标、标签背景,首页核心主题色 */
--primary-light: #9CCFDF; /* 浅蓝绿 - 用于hover状态、渐变辅助,增加层次感 */
/* 主页主题蓝渐变色系 */ /* 主页主题蓝绿渐变色系 */
--primary-sky-100: #D6EEF8; /* 最浅蓝 - 渐变起始色,清新自然 */ --primary-sky-100: #D6EEF8; /* 最浅蓝 - 渐变起始色,清新自然 */
--primary-sky-200: #E4F2FA; /* 浅蓝 - 渐变第二层 */ --primary-sky-200: #E4F2FA; /* 浅蓝 - 渐变第二层 */
--primary-sky-300: #EEF6FB; /* 淡蓝 - 渐变第三层 */ --primary-sky-300: #EEF6FB; /* 淡蓝 - 渐变第三层 */
@@ -24,10 +25,13 @@
--glow-blue-2: rgba(180, 220, 240, 0.3); /* 浅蓝色光晕 */ --glow-blue-2: rgba(180, 220, 240, 0.3); /* 浅蓝色光晕 */
--glow-blue-3: rgba(170, 215, 238, 0.25); /* 浅蓝绿色光晕 */ --glow-blue-3: rgba(170, 215, 238, 0.25); /* 浅蓝绿色光晕 */
/* ========== 强调/行动色(活力========== */ /* ========== 强调/行动色(活力绿========== */
--accent-orange: #FF6B35; /* 活力 - 主要CTA按钮、会员标识、高亮徽章、关键数据,刺激行动 */ --accent-green: rgba(130, 220, 130, 0.9); /* 活力绿 - 主要CTA按钮、图标背景,首页核心行动 */
--accent-orange-light: #FF8C5A; /* 浅橙色 - hover轻量背景、渐变辅助,带来温暖运动感 */ --accent-green-light: rgba(150, 230, 150, 0.8); /* 浅绿 - hover轻量背景 */
--accent-orange-dark: #E55A2B; /* 深橙色 - 按压状态或重要警告,保持色彩体系完整 */ --accent-green-dark: rgba(100, 200, 100, 1); /* 深绿 - 按压状态 */
--accent-orange: #FF6B35; /* 活力橙 - 辅助CTA按钮、会员标识、高亮徽章、关键数据 */
--accent-orange-light: #FF8C5A; /* 浅橙色 - hover轻量背景、渐变辅助 */
--accent-orange-dark: #E55A2B; /* 深橙色 - 按压状态或重要警告 */
/* ========== 背景色系(主页主题)========== */ /* ========== 背景色系(主页主题)========== */
--bg-gradient-primary: linear-gradient(180deg, #D6EEF8 0%, #E4F2FA 15%, #EEF6FB 30%, #F5FAFD 50%, #FAFCFE 70%, #FFFFFF 100%); /* 主页主渐变背景 */ --bg-gradient-primary: linear-gradient(180deg, #D6EEF8 0%, #E4F2FA 15%, #EEF6FB 30%, #F5FAFD 50%, #FAFCFE 70%, #FFFFFF 100%); /* 主页主渐变背景 */
@@ -52,19 +56,20 @@
--info-blue: #3498DB; /* 信息蓝 - 提示气泡、帮助文字 */ --info-blue: #3498DB; /* 信息蓝 - 提示气泡、帮助文字 */
/* ========== 渐变色 (提升活力感) ========== */ /* ========== 渐变色 (提升活力感) ========== */
--gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%); /* 色渐变 - 会员按钮、重要徽章 */ --gradient-green: linear-gradient(135deg, rgba(130, 220, 130, 0.9) 0%, rgba(150, 230, 150, 0.8) 100%); /* 绿色渐变 - 主要CTA按钮、图标背景 */
--gradient-blue: linear-gradient(135deg, #0B2B4B 0%, #1A4A6F 100%); /* 深蓝渐变 - 头部banner或特别卡片 */ --gradient-orange: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%); /* 橙色渐变 - 辅助按钮、重要徽章 */
--gradient-blue: linear-gradient(135deg, #7AB5CC 0%, #9CCFDF 100%); /* 蓝绿渐变 - 头部banner或特别卡片,首页核心渐变 */
--gradient-sky: linear-gradient(180deg, #D6EEF8 0%, #E4F2FA 15%, #EEF6FB 30%, #F5FAFD 50%, #FAFCFE 70%, #FFFFFF 100%); /* 主页天空渐变 - 全局背景 */ --gradient-sky: linear-gradient(180deg, #D6EEF8 0%, #E4F2FA 15%, #EEF6FB 30%, #F5FAFD 50%, #FAFCFE 70%, #FFFFFF 100%); /* 主页天空渐变 - 全局背景 */
--gradient-subtle: linear-gradient(120deg, #F9FAFE 0%, #FFFFFF 100%); /* 微弱渐变 - 增加细节精致度 */ --gradient-subtle: linear-gradient(120deg, #F9FAFE 0%, #FFFFFF 100%); /* 微弱渐变 - 增加细节精致度 */
/* ========== TabBar 配色(清新蓝风格)========== */ /* ========== TabBar 配色(清新蓝绿风格)========== */
/* 引用位置:components/TabBar.vue */ /* 引用位置:components/TabBar.vue */
--tabbar-bg: rgba(200, 225, 238, 0.8); /* TabBar背景色 - 半透明浅蓝色毛玻璃效果 */ --tabbar-bg: rgba(200, 225, 238, 0.8); /* TabBar背景色 - 半透明浅蓝色毛玻璃效果 */
--tabbar-shadow: rgba(120, 185, 215, 0.2); /* TabBar阴影色 - 蓝色系柔和阴影 */ --tabbar-shadow: rgba(120, 185, 215, 0.2); /* TabBar阴影色 - 蓝色系柔和阴影 */
--tabbar-icon-inactive: gray; /* 未选中图标颜色 - 灰色 */ --tabbar-icon-inactive: gray; /* 未选中图标颜色 - 灰色 */
--tabbar-icon-active: #5A98B0; /* 选中图标颜色 - 蓝绿色 */ --tabbar-icon-active: #7AB5CC; /* 选中图标颜色 - 蓝绿色(首页主题色) */
--tabbar-text-inactive: #8AABBB; /* 未选中文字颜色 - 浅灰蓝 */ --tabbar-text-inactive: #8AABBB; /* 未选中文字颜色 - 浅灰蓝 */
--tabbar-text-active: #5A98B0; /* 选中文字颜色 - 蓝绿色(与图标一致) */ --tabbar-text-active: #7AB5CC; /* 选中文字颜色 - 蓝绿色(与图标一致,首页主题色 */
/* ========== 通用蓝色系阴影(用于卡片、按钮等)========== */ /* ========== 通用蓝色系阴影(用于卡片、按钮等)========== */
/* 引用位置:components/index/RecommendCourses.vue, QuickEntry.vue, TodayRecommend.vue */ /* 引用位置:components/index/RecommendCourses.vue, QuickEntry.vue, TodayRecommend.vue */
@@ -60,7 +60,7 @@ const recommends = [
participants: '2784' participants: '2784'
}, },
{ {
image: 'https://images.unsplash.com/photo-1581009146145-b5ef050c149a?w=300&q=80', image: 'https://images.unsplash.com/photo-1517836357463-d25dfeac3438?w=300&q=80',
title: '全身力量塑形', title: '全身力量塑形',
tags: ['50分钟', '中级'], tags: ['50分钟', '中级'],
desc: '全身综合训练,塑造完美线条', desc: '全身综合训练,塑造完美线条',
+33 -1
View File
@@ -45,7 +45,39 @@
"dSYMs" : false "dSYMs" : false
}, },
/* SDK */ /* SDK */
"sdkConfigs" : {} "sdkConfigs" : {},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
} }
}, },
/* */ /* */
+1
View File
@@ -237,6 +237,7 @@
{ {
"path": "pages/checkIn/checkIn", "path": "pages/checkIn/checkIn",
"style": { "style": {
"navigationBarTitleText": "会员签到" "navigationBarTitleText": "会员签到"
} }
}, },
+63 -19
View File
@@ -81,19 +81,12 @@
</view> </view>
</view> </view>
<!-- 底部按钮z-index永久置顶 --> <!-- 底部按钮仅保留刷新二维码隐藏签到和清除缓存按钮 -->
<view class="bottom-actions"> <view class="bottom-actions">
<button @tap="handleLongPress">签到</button>
<button class="btn-refresh" @tap="refreshQR"> <button class="btn-refresh" @tap="refreshQR">
<uni-icons type="refresh" size="36rpx" color="#5E6F8D"></uni-icons> <uni-icons type="refresh" size="36rpx" color="#5E6F8D"></uni-icons>
<text>刷新二维码</text> <text>刷新二维码</text>
</button> </button>
<!-- 测试用手动清除缓存按钮 -->
<button class="btn-clear-cache" @tap="handleClearCache">
<uni-icons type="trash" size="36rpx" color="#ef4444"></uni-icons>
<text>清除缓存</text>
</button>
</view> </view>
</view> </view>
</template> </template>
@@ -103,8 +96,9 @@ import { ref } from 'vue';
import { onLoad, onUnload } from '@dcloudio/uni-app' import { onLoad, onUnload } from '@dcloudio/uni-app'
// 引入状态组件(路径与你保持一致) // 引入状态组件(路径与你保持一致)
import QrStatus from '@/components/QRCode/StatusCard.vue' import QrStatus from '@/components/QRCode/StatusCard.vue'
// 引入API封装
import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js' // 测试模式配置
const TEST_MODE = true // 开启测试模式
let image = ref("") let image = ref("")
let width = ref(0) let width = ref(0)
@@ -279,6 +273,13 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
mask: true mask: true
}) })
// 测试模式:直接生成假二维码,内容为"欢迎来到活氧舱"
if (TEST_MODE) {
console.log("测试模式:生成假二维码")
generateTestQRCode()
return
}
// 读取签到状态缓存(自动检查过期) // 读取签到状态缓存(自动检查过期)
// isCheckIn 代表签到状态,从缓存读取 // isCheckIn 代表签到状态,从缓存读取
const cachedIsCheckIn = getCacheData("isCheckIn") const cachedIsCheckIn = getCacheData("isCheckIn")
@@ -313,6 +314,49 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
getStorage(null) getStorage(null)
}) })
// 测试模式:生成假二维码(内容为"欢迎来到活氧舱")
const generateTestQRCode = () => {
// 使用 canvas 生成简单的二维码图案(模拟)
// 由于无法直接生成真正的二维码图片,使用一个静态图片或占位图
// 在实际测试环境中,可以使用第三方库生成二维码
// 模拟网络延迟
setTimeout(() => {
// 使用一个在线二维码生成服务生成内容为"欢迎来到活氧舱"的二维码
const qrContent = "欢迎来到活氧舱"
qrcode.value = qrContent
// 使用在线API生成二维码图片
// 注意:实际使用时应该考虑离线方案
const qrUrl = `https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=${encodeURIComponent(qrContent)}`
// 将在线图片下载为base64(在uniapp中)
uni.request({
url: qrUrl,
method: 'GET',
responseType: 'arraybuffer',
success: (res) => {
const base64 = uni.arrayBufferToBase64(res.data)
image.value = `data:image/png;base64,${base64}`
width.value = 500
height.value = 500
status.value = 'waiting'
QRStatus.value = '请出示二维码签到'
uni.hideLoading()
},
fail: () => {
// 如果无法获取在线二维码,使用默认占位图
image.value = ''
width.value = 500
height.value = 500
status.value = 'waiting'
QRStatus.value = '测试模式 - 欢迎来到活氧舱'
uni.hideLoading()
}
})
}, 1000)
}
// 页面卸载时关闭WebSocket连接(不清除缓存,让缓存自然过期) // 页面卸载时关闭WebSocket连接(不清除缓存,让缓存自然过期)
onUnload(() => { onUnload(() => {
closeWebSocket() closeWebSocket()
@@ -590,13 +634,13 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
left: 0; left: 0;
right: 0; right: 0;
z-index: 99998; /* 低于底部按钮,确保底部按钮永远最上层 */ z-index: 99998; /* 低于底部按钮,确保底部按钮永远最上层 */
background: linear-gradient(135deg, #0B2B4B 0%, #1A4A6F 100%); background: linear-gradient(135deg, #7AB5CC 0%, #9CCFDF 100%);
padding: 64rpx 48rpx 48rpx; padding: 64rpx 48rpx 48rpx;
text-align: center; text-align: center;
color: #FFFFFF; color: #FFFFFF;
border-bottom-left-radius: 56rpx; border-bottom-left-radius: 56rpx;
border-bottom-right-radius: 56rpx; border-bottom-right-radius: 56rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1); box-shadow: 0 4rpx 20rpx rgba(120, 185, 215, 0.3);
.header-title { .header-title {
font-size: 45rpx; font-size: 45rpx;
@@ -632,7 +676,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
height: 120rpx; height: 120rpx;
border-radius: 999px; border-radius: 999px;
overflow: hidden; overflow: hidden;
border: 4rpx solid #FF6B35; border: 4rpx solid #7AB5CC;
flex-shrink: 0; flex-shrink: 0;
image { image {
@@ -664,7 +708,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
flex-wrap: wrap; flex-wrap: wrap;
.level-badge { .level-badge {
background: linear-gradient(135deg, #FF6B35 0%, #FF8C5A 100%); background: linear-gradient(135deg, #7AB5CC 0%, #9CCFDF 100%);
color: white; color: white;
padding: 4rpx 16rpx; padding: 4rpx 16rpx;
border-radius: 24rpx; border-radius: 24rpx;
@@ -691,7 +735,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
.points-value { .points-value {
font-size: 38rpx; font-size: 38rpx;
font-weight: 700; font-weight: 700;
color: #FF6B35; color: #7AB5CC;
} }
.points-label { .points-label {
@@ -763,7 +807,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
border: 6rpx solid #E9EDF2; border: 6rpx solid #E9EDF2;
border-top-color: #FF6B35; border-top-color: #7AB5CC;
border-radius: 50%; border-radius: 50%;
animation: spin 1s linear infinite; animation: spin 1s linear infinite;
} }
@@ -788,7 +832,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
position: absolute; position: absolute;
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
border: 6rpx solid #FF6B35; border: 6rpx solid #7AB5CC;
&.top-left { &.top-left {
top: 0; top: 0;
@@ -855,7 +899,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
.tip-dot { .tip-dot {
width: 12rpx; width: 12rpx;
height: 12rpx; height: 12rpx;
background: #FF6B35; background: #7AB5CC;
border-radius: 50%; border-radius: 50%;
margin-top: 12rpx; margin-top: 12rpx;
flex-shrink: 0; flex-shrink: 0;
@@ -934,7 +978,7 @@ import { getQRCode, checkIn as apiCheckIn } from '@/api/main.js'
} }
.header { .header {
background: linear-gradient(135deg, #123A5E 0%, #1A4A6F 100%); background: linear-gradient(135deg, #5A98B0 0%, #7AB5CC 100%);
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.3); box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.3);
} }
File diff suppressed because it is too large Load Diff