|
před 2 týdny | |
---|---|---|
.. | ||
components | před 2 týdny | |
css | před 2 týdny | |
pages | před 2 týdny | |
.DS_Store | před 2 týdny | |
README.md | před 2 týdny | |
index.html | před 2 týdny | |
request.md | před 2 týdny |
LineFunQueue是一款面向排队场景的微信小程序,提供多种互动小游戏,帮助用户在排队等待过程中消遣时间、增进社交互动。产品采用"轻交互、重线下沟通"理念,鼓励用户在现实场景中进行面对面互动。
所有游戏必须实现以下标准接口:
interface Game {
gameId: string; // 游戏唯一标识
gameName: string; // 游戏名称
gameDescription: string; // 游戏描述
minPlayers: number; // 最少玩家数
maxPlayers: number; // 最多玩家数
timeEstimate: string; // 预计游戏时长
// 游戏初始化
initialize: (roomId: string, hostId: string) => Promise<boolean>;
// 开始游戏
start: (roomId: string) => Promise<boolean>;
// 结束游戏
end: (roomId: string) => Promise<GameResult>;
// 获取主持人视图
getHostView: (roomId: string, userId: string) => Promise<HostViewData>;
// 获取玩家视图
getPlayerView: (roomId: string, userId: string) => Promise<PlayerViewData>;
// 处理用户行为
handleAction: (roomId: string, userId: string, action: UserAction) => Promise<ActionResult>;
}
interface TurtleSoupGame extends Game {
// 特有属性
questions: TurtleSoupQuestion[];
currentQuestion: TurtleSoupQuestion;
playerAnswers: Record<string, string>;
// 特有方法
revealClue: (roomId: string, clueId: string) => Promise<boolean>;
answerQuestion: (roomId: string, userId: string, answer: string) => Promise<AnswerResult>;
transferHost: (roomId: string, newHostId: string) => Promise<boolean>;
}
interface TurtleSoupQuestion {
question_id: string;
category: string;
汤面: string;
汤底: string;
关联IP?: string;
难度等级: number;
游戏时长: string;
适合人数: string;
关键线索: Array<{类型: string, 值: string}>;
引导问题: string[];
是否付费: boolean;
创建时间: string;
}
interface User {
userId: string; // 微信OpenID
nickName: string; // 昵称
avatarUrl: string; // 头像URL
gender: number; // 性别
gameHistory: GameHistoryItem[]; // 游戏历史
premiumUser: boolean; // 是否付费用户
createdAt: Date; // 创建时间
lastLoginAt: Date; // 最后登录时间
}
interface GameHistoryItem {
gameId: string; // 游戏ID
roomId: string; // 房间ID
role: 'host' | 'player'; // 角色
result: string; // 结果
playedAt: Date; // 游戏时间
}
interface Room {
roomId: string; // 房间ID
roomCode: string; // 房间码
hostId: string; // 主持人ID
gameId: string; // 当前游戏ID
players: Player[]; // 玩家列表
status: 'waiting' | 'playing' | 'ended'; // 房间状态
gameData: any; // 游戏数据(根据不同游戏类型有不同结构)
createdAt: Date; // 创建时间
updatedAt: Date; // 更新时间
}
interface Player {
userId: string; // 用户ID
nickName: string; // 昵称
avatarUrl: string; // 头像
role: 'host' | 'player'; // 角色
status: 'online' | 'offline'; // 状态
joinedAt: Date; // 加入时间
}
miniprogram-lineforfun/
├── client/ # 小程序客户端
│ ├── config/ # 配置文件
│ ├── src/ # 源代码
│ │ ├── app.config.ts # 应用配置
│ │ ├── app.scss # 全局样式
│ │ ├── app.ts # 应用入口
│ │ ├── index.html # HTML模板
│ │ ├── assets/ # 静态资源
│ │ ├── components/ # 通用组件
│ │ │ ├── base/ # 基础组件
│ │ │ ├── game/ # 游戏相关组件
│ │ │ └── room/ # 房间相关组件
│ │ ├── constants/ # 常量定义
│ │ ├── hooks/ # 自定义Hooks
│ │ ├── interfaces/ # 类型定义
│ │ ├── pages/ # 页面
│ │ │ ├── game-plaza/ # 游戏广场
│ │ │ ├── login/ # 登录页
│ │ │ ├── game-detail/ # 游戏详情页
│ │ │ ├── room/ # 房间页面
│ │ │ │ ├── create/ # 创建房间
│ │ │ │ └── join/ # 加入房间
│ │ │ ├── games/ # 游戏页面
│ │ │ │ ├── turtle-soup/ # 海龟汤游戏
│ │ │ │ │ ├── host/ # 主持人视图
│ │ │ │ │ └── player/ # 玩家视图
│ │ │ │ └── [game-template]/ # 游戏模板
│ │ │ └── profile/ # 个人中心
│ │ ├── services/ # 服务
│ │ │ ├── api.ts # API接口
│ │ │ ├── cloud.ts # 云开发服务
│ │ │ └── game.ts # 游戏服务
│ │ ├── store/ # 状态管理
│ │ ├── styles/ # 样式文件
│ │ └── utils/ # 工具函数
│ └── package.json # 依赖配置
├── cloud/ # 云开发目录
│ ├── functions/ # 云函数
│ │ ├── login/ # 登录相关
│ │ ├── room/ # 房间管理
│ │ ├── games/ # 游戏逻辑
│ │ │ ├── common/ # 通用游戏逻辑
│ │ │ └── turtle-soup/ # 海龟汤游戏逻辑
│ │ └── pay/ # 支付相关
│ └── database/ # 数据库结构
│ └── db_structure.json # 数据库结构定义
└── README.md # 项目说明
index.html
查看所有原型页面© 2023 LineFunQueue 排队互动游戏平台