完成创建靶点
This commit is contained in:
18
src/util.js
18
src/util.js
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user