完成创建靶点

This commit is contained in:
kron
2025-07-31 14:32:14 +08:00
parent 0ebe34cc1e
commit af888c68be
8 changed files with 269 additions and 12 deletions

View File

@@ -282,3 +282,21 @@ export const isGameEnded = async (battleId) => {
}
return !isGaming;
};
// 获取元素尺寸和位置信息
export const getElementRect = () => {
return new Promise((resolve) => {
const query = uni.createSelectorQuery();
query
.select(".container")
.boundingClientRect((rect) => {
resolve(rect);
})
.exec();
});
};
export const calcRing = (x, y) => {
console.log(1111, x, y);
return 8;
};