Commit Graph

24 Commits

Author SHA1 Message Date
148e21f3b0 refactor(game): 重构游戏动作处理和WebSocket连接管理
- 重构sendGameAction函数参数结构,添加上下文支持
- 新增sendStartGame和sendLeaveRoom函数统一处理游戏开始和离开房间逻辑
- 移除路由相关依赖,简化ChengduGamePage组件
- 更新WebSocket客户端实现,添加状态变化订阅功能
- 移除requestId生成函数和相关参数,精简消息结构
- 优化座位玩家卡片数据模型,移除在线状态和金钱字段
- 整理游戏阶段常量定义,添加标签映射
- 移除过期的游戏状态字段如needDraw、lastDiscardTile等
- 添加座位类型定义和改进游戏类型文件组织结构
2026-03-25 13:34:47 +08:00
4f6ef1d0ec refactor(game): 重构游戏模块并添加WebSocket客户端
- 修改开发环境配置中的代理目标地址
- 移除旧的活动房间状态管理模块
- 移除成都麻将游戏相关的测试用例
- 添加新的游戏动作发送功能
- 实现WebSocket客户端类并支持自动重连
- 添加WebSocket消息处理器注册机制
- 创建游戏相关状态类型定义
- 添加ID生成工具函数
- 移除废弃的游戏相关模块和常量定义
- 添加WebSocket消息结构定义
- 重构游戏状态相关类型定义
2026-03-24 23:42:03 +08:00
7316588d9e refactor(game): 移除废弃的房间状态管理文件并优化游戏页面
- 删除 src/state/active-room.ts 文件及其相关导入引用
- 更新 ChengduGamePage.vue 中的导入路径从 features/chengdu-game/useChengduGameRoom 到 game/chengdu
- 移除 ChengduGamePage.vue 中不再需要的状态变量如 roomId、startGamePending 等
- 简化 roomStatusText 计算属性逻辑,移除 "等待中" 默认值
- 调整 phaseLabelMap 映射,移除 "摸牌" 阶段显示
- 删除多个废弃的计算属性如 centerTimer、selectedTileText、pendingClaimText 等
- 移除 actionTheme 函数及相关的按钮样式绑定
- 清理游戏场景中的装饰元素如 diamond outline、scene watermark、center desk 等
- 更新 HallPage.vue 中的导入路径到 store/active-room-store
- 添加缺失的玩家数据字段如 hand、melds、outTiles、hasHu
- 调整 CSS 样式包括工具栏位置、动画角度和时钟位置等视觉优化
2026-03-24 22:09:03 +08:00
3219639b04 ```
fix(ChengduGamePage): update game title from '指尖四川麻将' to '四川麻将'

- Changed the game title in the scene watermark from '指尖四川麻将' to '四川麻将'
- This updates the display text to be more concise while maintaining the core game identity
```
2026-03-24 19:09:03 +08:00
679116e455 feat(game): 添加游戏房间菜单和托管功能
- 引入机器人和退出图标资源
- 实现游戏房间顶部菜单触发器和弹出菜单
- 添加托管模式切换功能
- 实现退出房间功能
- 添加全局点击和ESC键关闭菜单事件监听
- 优化菜单动画效果和交互反馈
- 移除侧边按钮区域的聊天、赞赏和开局按钮
- 调整时钟位置以适应新菜单布局
2026-03-24 17:25:37 +08:00
716bc2b106 style(game): 优化成都麻将游戏页面样式和代码结构
- 将CSS样式提取到独立的room.css文件中
- 移除组件中的内联样式定义
- 调整了顶部工具栏位置参数
- 更新了计数器指示灯的样式
- 精简了导入语句的空格格式
- 移除了调试用的编辑按钮
- 更新游戏标题为"指尖四川麻将"
- 移除了冗余的import类型声明顺序
- 优化了数组创建语法格式
- 统一了图片标签的alt属性格式
- 调整了循环渲染元素的缩进格式
2026-03-24 17:01:02 +08:00
ceba41fb08 ```
style(global): update background gradients and visual styling

- Replace radial gradient with combined radial and linear gradients
- Update color schemes with warmer tones and improved transparency
- Adjust border colors and add subtle glow effects
- Increase blur intensity for better glassmorphism effect

style(game): enhance seat player card design

- Add avatar panel container for better layout structure
- Implement dealer mark positioning with absolute placement
- Add missing suit icons with computed property mapping
- Replace text-based missing marks with image icons when available
- Improve visual hierarchy and spacing between elements

refactor(game): add computed property for dynamic suit icon selection

- Import suit icon assets (wan, tong, tiao)
- Create computed property to map suit labels to corresponding icons
- Handle fallback to text display when no icon is available
```
2026-03-24 16:26:13 +08:00
72253b1391 Update open-four-players.mjs 2026-03-24 15:29:32 +08:00
58fe43607a update 2026-03-24 15:25:40 +08:00
292a4181ce Create chengdu-mahjong-features.md 2026-03-24 14:40:28 +08:00
84ce67b9be ```
feat(game): update websocket URL configuration and improve game room logic

- Change VITE_GAME_WS_URL from /api/v1/ws to /ws in .env.development
- Update proxy configuration in vite.config.ts to match new websocket path
- Refactor leave room functionality to properly disconnect websocket
and destroy room state
- Add e2e testing script to package.json
```
2026-03-24 14:38:47 +08:00
1b15748d0d ```
refactor(ChengduGamePage): replace manual WebSocket logic with composable hook

- Replace manual WebSocket connection and state management with
  useChengduGameRoom composable
- Remove unused imports and authentication related code
- Simplify component by extracting room state logic into separate hook
- Clean up redundant functions and variables that are now handled
 by the composable
- Update component lifecycle to use the new composable's methods
  for connecting WebSocket and managing room state
```
2026-03-24 14:12:04 +08:00
f97f1ffdbc ```
feat(game): add player cards and topbar styling for Chengdu Mahjong game

- Add new CSS classes for topbar layout including .topbar-left,
  .topbar-back-btn, .topbar-room-meta, .eyebrow, and .topbar-room-name
- Create dedicated player card components for each seat position
  (top, right, bottom, left)
- Refactor seatDecor computed property to use SeatPlayerCardModel
  interface with proper typing
- Replace inline player badge rendering with reusable player card
  components
- Update game header layout to use new topbar structure with
  back button and room metadata
- Adjust spacing and font sizes in game header elements
```
2026-03-24 14:02:21 +08:00
d4e217b11b Merge branch 'main' into dev
# Conflicts:
#	src/views/ChengduGamePage.vue
#	vite.config.ts
2026-03-24 13:45:30 +08:00
a5c833c769 feat(game): 完善成都麻将游戏页面功能
- 添加WebSocket URL构建逻辑和认证令牌刷新功能
- 实现游戏状态显示包括阶段、网络状态、时钟等信息
- 添加游戏桌面背景图片和玩家座位装饰组件
- 重构CSS样式为网格布局提升响应式体验
- 配置环境变量支持API和WebSocket代理目标设置
- 优化WebSocket连接管理增加错误处理机制
- 添加游戏桌墙体和中心计数器等UI元素
- 修复多处字符串国际化和路径处理问题
2026-03-24 13:44:53 +08:00
fcb9a02c68 ```
fix(backend): resolve merge conflicts and update API proxy configuration

- Remove leftover merge conflict markers from ChengduGamePage.vue
- Fix broken HTML structure by properly closing header and section tags
- Update proxy configuration to point to correct backend port (19000)
- Clean up import statements and remove conflicting code blocks
```
2026-03-24 09:36:58 +08:00
bb3b55f69b Update ChengduGamePage.vue 2026-03-24 09:30:50 +08:00
ee797ebb14 Merge remote-tracking branch 'origin/dev'
# Conflicts:
#	src/views/ChengduGamePage.vue
2026-03-24 09:13:16 +08:00
1308ca5a2c Update vite.config.ts 2026-03-24 09:03:11 +08:00
632a0267a4 update 2026-03-23 21:13:38 +08:00
fba407c1bf chore(config): 更新开发服务器代理配置
- 将 API 代理目标端口从 8080 更改为 18080
- 将 WebSocket 代理目标端口从 8080 更改为 18080
- 保持了原有的 changeOrigin 和 ws 配置选项
2026-03-20 17:27:13 +08:00
0fa14ca407 feat(game): 实现成都麻将游戏界面和核心功能
- 添加麻将桌面背景和完整的UI布局设计
- 实现玩家座位渲染、牌面显示和游戏状态管理
- 集成定缺选择、碰牌操作和结算功能
- 添加计时器、网络状态和实时消息显示
- 创建麻将牌面图片资源和动态加载机制
- 实现游戏流程控制和玩家交互逻辑
2026-03-18 17:26:20 +08:00
5210b8309f chore(project): 更新项目配置和文档
- 添加 pnpm 包管理器配置到 package.json
- 将 README.md 重命名为 Mahjong Web 并更新项目描述
- 添加项目设置说明包括安装依赖命令
- 添加开发服务器启动命令说明
- 添加生产构建命令说明
- 添加预览生产构建命令说明
2026-03-18 15:19:03 +08:00
f79920ad6a first commit 2026-02-18 14:30:42 +08:00