fix(tongji): 修复小游戏平台同步与并发问题

This commit is contained in:
大哥大哥的大哥哥
2026-07-17 21:21:43 +08:00
parent 7192c4db8c
commit fd7e6071a8
8 changed files with 262 additions and 50 deletions
@@ -302,7 +302,7 @@ import { onLoad, onShareAppMessage, onShareTimeline, onShow, onUnload } from '@d
import TongjiIcon from './components/TongjiIcon.vue'
import { useGameSfx } from './composables/useGameSfx.js'
import { useGamePlatform } from './composables/useGamePlatform.js'
import { useTongjiAuth } from '../composables/useTongjiAuth.js'
import { useGameAuth } from './composables/useGameAuth.js'
const FOOD_IMAGE_MODULES = import.meta.glob('./assets/food/*.jpg', {
eager: true,
@@ -398,7 +398,7 @@ const {
} = useGameSfx()
const { proxy } = getCurrentInstance()
const { ensureLoggedIn } = useTongjiAuth(proxy)
const { ensureLoggedIn } = useGameAuth(proxy)
const {
connected: platformConnected,
loading: platformLoading,
@@ -953,7 +953,11 @@ async function resolveMatches(initialGroups, movedIndex) {
const camelMatchCount = Math.max(bentCamelCount, camelGroup?.indices.length || 0)
if (camelMatchCount >= 3) applyCamelJackpot(camelMatchCount, remove)
const removedTiles = [...remove].map(i => board.value[i]).filter(Boolean)
const removedNormal = removedTiles.filter(tile => !foodOf(tile.key).high)
// 排名统计的是正确认识并消除的普通食物;驼乳是道具,不计入认糖数。
const removedNormal = removedTiles.filter(tile => {
const food = foodOf(tile.key)
return !food.high && !food.product
})
const fireRemovedHigh = fireClearingIndices.value.some(index => foodOf(board.value[index]?.key).high)
const largestMatch = Math.max(
...groups.map(group => group.indices.length),