feat: 新增签到墙、摇一摇等功能及开发环境配置

新功能:
- 签到墙页面 (CheckinWallView) 及后端接口
- 摇一摇互动页面 (ShakeView) 及服务
- 头像服务 (avatar.service)
- 微信公众号静默授权登录增强

开发环境:
- 新增 dev-tunnel skill 用于本地调试
- docker-compose.dev.yml 开发环境配置
- 客户端 .env.development 配置文件

其他改进:
- VoteView 投票页面功能增强
- AdminControl 管理控制台更新
- 连接状态管理优化
- 新增马蹄声音效

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-02-04 17:25:56 +08:00
parent c1b4b09e40
commit 48d61a1e15
38 changed files with 2020 additions and 27 deletions

View File

@@ -29,6 +29,7 @@ export const SOCKET_EVENTS = {
// Admin control events
ADMIN_PHASE_CHANGE: 'admin:phase_change',
ADMIN_EVENT_TITLE_UPDATE: 'admin:event_title_update',
ADMIN_VOTING_CONTROL: 'admin:voting_control',
ADMIN_LOTTERY_CONTROL: 'admin:lottery_control',
ADMIN_EMERGENCY_RESET: 'admin:emergency_reset',
@@ -43,6 +44,19 @@ export const SOCKET_EVENTS = {
// QR code display control events
DISPLAY_SHOW_ENTRY_QR: 'display:show_entry_qr',
DISPLAY_HIDE_QR: 'display:hide_qr',
// Checkin wall events
CHECKIN_USER_JOIN: 'checkin:user_join',
CHECKIN_USER_UPDATE: 'checkin:user_update',
CHECKIN_WALL_SYNC: 'checkin:wall_sync',
// Shake events
SHAKE_COUNT: 'shake:count',
SHAKE_UPDATE: 'shake:update',
SHAKE_LEADERBOARD: 'shake:leaderboard',
// Avatar events
AVATAR_UPDATED: 'avatar:updated',
} as const;
export const SOCKET_ROOMS = {

View File

@@ -4,7 +4,7 @@
// System Phase State Machine
// ============================================================================
export type SystemPhase = 'IDLE' | 'VOTING' | 'LOTTERY' | 'RESULTS' | 'LOTTERY_RESULTS';
export type SystemPhase = 'IDLE' | 'VOTING' | 'LOTTERY' | 'RESULTS' | 'LOTTERY_RESULTS' | 'CHECKIN_WALL';
export type VotingSubPhase = 'CLOSED' | 'OPEN' | 'PAUSED';
@@ -23,6 +23,7 @@ export type LotteryRound = 1 | 2 | 3 | 4;
export interface AdminState {
systemPhase: SystemPhase;
eventTitle: string;
voting: VotingState;
lottery: LotteryState;
music: MusicState;
@@ -96,7 +97,7 @@ export interface LotteryWinner {
export interface MusicState {
isPlaying: boolean;
track: 'bgm' | 'lottery' | 'fanfare' | 'award' | 'none';
track: 'bgm' | 'lottery' | 'fanfare' | 'award' | 'horse' | 'none';
volume: number;
}
@@ -174,6 +175,7 @@ export const DEFAULT_PROGRAMS: VotingProgram[] = [
export const INITIAL_ADMIN_STATE: AdminState = {
systemPhase: 'IDLE',
eventTitle: '公司2026年会',
voting: {
subPhase: 'CLOSED',
totalVotes: 0,

View File

@@ -0,0 +1,75 @@
// Checkin Wall & Shake Types
/**
* 签到用户信息
*/
export interface CheckinUser {
id: string;
name: string;
avatar?: string;
shakeCount: number;
checkinTime: number;
}
/**
* 签到墙同步数据
*/
export interface CheckinWallSyncPayload {
users: CheckinUser[];
totalCount: number;
}
/**
* 用户加入签到墙事件
*/
export interface CheckinUserJoinPayload {
user: CheckinUser;
}
/**
* 用户信息更新事件(头像、摇动次数等)
*/
export interface CheckinUserUpdatePayload {
userId: string;
avatar?: string;
shakeCount?: number;
}
/**
* 摇一摇计数事件
*/
export interface ShakeCountPayload {
userId: string;
count: number;
}
/**
* 摇一摇更新广播
*/
export interface ShakeUpdatePayload {
userId: string;
userName: string;
avatar?: string;
shakeCount: number;
}
/**
* 摇一摇排行榜
*/
export interface ShakeLeaderboardPayload {
leaderboard: Array<{
userId: string;
userName: string;
avatar?: string;
shakeCount: number;
rank: number;
}>;
}
/**
* 头像更新事件
*/
export interface AvatarUpdatedPayload {
userId: string;
avatar: string;
}

View File

@@ -5,3 +5,4 @@ export * from './draw.types';
export * from './admin.types';
export * from './scan-login.types';
export * from './wechat.types';
export * from './checkin.types';