diff --git a/api/appUser.js b/api/appUser.js index 0c30ab2..bbfb30b 100644 --- a/api/appUser.js +++ b/api/appUser.js @@ -174,3 +174,37 @@ export function getInviteRecords(page = 1, page_size = 20) { const user_id = uni.getStorageSync('user_id') return getUserInvites(user_id, page, page_size) } + +// ============================================ +// 对对碰游戏 (Matching Game) 接口 +// ============================================ + +/** + * 开始游戏 + * @param {number} issue_id - 对应的活动期次ID + */ +export function startMatchingGame(issue_id) { + return authRequest({ url: '/api/app/matching/start', method: 'POST', data: { issue_id } }) +} + +/** + * 执行配对 (下一轮) + * @param {string} game_id - start接口返回的游戏ID + */ +export function playMatchingGame(game_id) { + return authRequest({ url: '/api/app/matching/play', method: 'POST', data: { game_id } }) +} + +/** + * 获取游戏状态 (用于重连) + * @param {string} game_id - 游戏ID + */ +export function getMatchingGameState(game_id) { + return authRequest({ url: '/api/app/matching/state', method: 'GET', data: { game_id } }) +} +/** + * 获取所有启用的卡牌配置 + */ +export function getMatchingCardTypes() { + return authRequest({ url: '/api/app/matching/card_types', method: 'GET' }) +} diff --git a/pages/activity/duiduipeng/index.vue b/pages/activity/duiduipeng/index.vue index 1294afc..2e2f18b 100644 --- a/pages/activity/duiduipeng/index.vue +++ b/pages/activity/duiduipeng/index.vue @@ -1,656 +1,1050 @@