diff --git a/src/App.vue b/src/App.vue
index 37d5c66..d45b4ab 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -203,4 +203,19 @@ button::after {
margin-top: 20px;
color: #fff9;
}
+.see-more {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-top: 5px;
+}
+.see-more > text {
+ color: #39a8ff;
+ margin-top: 2px;
+ font-size: 13px;
+}
+.see-more > image {
+ width: 15px;
+ margin-top: 2px;
+}
diff --git a/src/apis.js b/src/apis.js
index 24fcf38..bfe195b 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -15,7 +15,7 @@ function request(method, url, data = {}) {
if (res.data) {
const { code, data, message } = res.data;
if (code === 0) resolve(data);
- else {
+ else if (message) {
if (message.indexOf("登录身份已失效") !== -1) {
uni.removeStorageSync("token");
}
@@ -365,3 +365,48 @@ export const getCurrentGameAPI = async () => {
const result = await request("GET", "/user/join/battle");
return result.currentGame || {};
};
+
+export const getPointBookConfigAPI = async () => {
+ return request("GET", "/user/score/sheet/option");
+};
+
+export const savePointBookAPI = async (
+ bowType,
+ distance,
+ targetType,
+ groups,
+ arrows,
+ data = []
+) => {
+ return request("POST", "/user/score/sheet/report", {
+ bowType,
+ distance,
+ targetType,
+ groups,
+ arrows,
+ group_data: data.map((item) =>
+ item.map((i) => ({
+ ...i,
+ ring: i.ring === "M" ? -1 : i.ring === "X" ? 0 : Number(i.ring),
+ }))
+ ),
+ });
+};
+
+export const getPointBookListAPI = async (
+ page = 1,
+ bowType,
+ distance,
+ targetType
+) => {
+ let url = `/user/score/sheet/list?pageNum=${page}&pageSize=10`;
+ if (bowType) url += `&bowType=${bowType}`;
+ if (distance) url += `&distance=${distance}`;
+ if (targetType) url += `&targetType=${targetType}`;
+ const result = await request("GET", url);
+ return result.list || [];
+};
+
+export const getPointBookDetailAPI = async (id) => {
+ return request("GET", `/user/score/sheet/detail?id=${id}`);
+};
diff --git a/src/components/AppBackground.vue b/src/components/AppBackground.vue
index 160c042..6011659 100644
--- a/src/components/AppBackground.vue
+++ b/src/components/AppBackground.vue
@@ -5,11 +5,15 @@ const props = defineProps({
type: Number,
default: 0,
},
+ bgColor: {
+ type: String,
+ default: "#050b19",
+ },
});
-
+
+
@@ -34,7 +44,6 @@ const props = defineProps({
left: 0;
top: 0;
z-index: -1;
- background-color: #050b19;
}
.bg-image {
diff --git a/src/components/AppFooter.vue b/src/components/AppFooter.vue
index 4c7caf8..52285fc 100644
--- a/src/components/AppFooter.vue
+++ b/src/components/AppFooter.vue
@@ -13,7 +13,7 @@ const props = defineProps({
const tabs = [
{ image: "../static/tab-vip.png" },
- { image: "../static/tab-grow.png" },
+ { image: "../static/tab-point-book.png" },
{ image: "../static/tab-mall.png" },
];
@@ -26,7 +26,7 @@ function handleTabClick(index) {
}
if (index === 1) {
uni.navigateTo({
- url: "/pages/my-growth",
+ url: "/pages/point-book-create",
});
}
if (index === 2) {
@@ -45,14 +45,11 @@ function handleTabClick(index) {
:key="index"
class="tab-item"
@click="handleTabClick(index)"
+ :style="{
+ width: index === 1 ? '32%' : '10%',
+ }"
>
-
+
@@ -76,10 +73,16 @@ function handleTabClick(index) {
.tab-item {
z-index: 1;
}
+.tab-item > image {
+ width: 88%;
+}
.tab-item:nth-child(2) {
- transform: translateY(10px);
+ transform: translateY(20%) translateX(25%);
+}
+.tab-item:nth-child(3) {
+ transform: translateY(-10%) translateX(5%);
}
.tab-item:nth-child(4) {
- transform: translateY(10px) translateX(-10px);
+ transform: translateY(20%) translateX(-25%);
}
diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue
index 34cca2f..46b4ef1 100644
--- a/src/components/BowTarget.vue
+++ b/src/components/BowTarget.vue
@@ -249,6 +249,7 @@ const simulShoot2 = async () => {
text-align: center;
line-height: 10px;
box-sizing: border-box;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.hit > text {
transform: scaleX(0.7);
diff --git a/src/components/BowTargetEdit.vue b/src/components/BowTargetEdit.vue
new file mode 100644
index 0000000..57ea4ba
--- /dev/null
+++ b/src/components/BowTargetEdit.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+ {{ index + 1 }}
+
+
+
+
+
+
+
+ {{ arrow.ring === 0 ? "未上靶" : arrow.ring
+ }}{{ arrow.ring > 0 ? "环" : "" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Container.vue b/src/components/Container.vue
index 10591b5..d0aafb9 100644
--- a/src/components/Container.vue
+++ b/src/components/Container.vue
@@ -32,6 +32,14 @@ defineProps({
type: Boolean,
default: false,
},
+ bgColor: {
+ type: String,
+ default: "#050b19",
+ },
+ whiteBackArrow: {
+ type: Boolean,
+ default: true,
+ },
});
const isIos = ref(true);
const showHint = ref(false);
@@ -67,8 +75,13 @@ const goBack = () => {
-
-
+
+
+import { ref, watch, onMounted, onUnmounted } from "vue";
+const props = defineProps({
+ itemIndex: {
+ type: Number,
+ default: 0,
+ },
+ expand: {
+ type: Boolean,
+ default: false,
+ },
+ onExpand: {
+ type: Function,
+ default: () => {},
+ },
+ onSelect: {
+ type: Function,
+ default: () => {},
+ },
+ noArrow: {
+ type: Boolean,
+ default: false,
+ },
+ value: {
+ type: String,
+ default: "",
+ },
+});
+const itemTexts = ["选择弓种", "选择练习距离", "选择靶纸", "选择组/箭数"];
+const distances = [5, 8, 10, 18, 25, 30, 50, 60, 70];
+const groupArrows = [3, 6, 12, 18];
+
+const data = ref([]);
+const selectedIndex = ref(-1);
+const secondSelectIndex = ref(-1);
+const onSelectItem = (index) => {
+ selectedIndex.value = index;
+ if (props.itemIndex === 0) {
+ props.onSelect(props.itemIndex, data.value[index]);
+ } else if (props.itemIndex === 1) {
+ props.onSelect(props.itemIndex, distances[index]);
+ } else if (props.itemIndex === 2) {
+ props.onSelect(props.itemIndex, data.value[index]);
+ } else if (props.itemIndex === 3 && secondSelectIndex.value !== -1) {
+ props.onSelect(
+ props.itemIndex,
+ `${selectedIndex.value}/${groupArrows[secondSelectIndex.value]}`
+ );
+ }
+};
+const onSelectSecondItem = (index) => {
+ secondSelectIndex.value = index;
+ if (selectedIndex.value !== -1) {
+ props.onSelect(
+ props.itemIndex,
+ `${selectedIndex.value}/${groupArrows[secondSelectIndex.value]}`
+ );
+ }
+};
+const meter = ref("");
+const onMeterChange = (e) => {
+ meter.value = e.detail.value;
+ props.onSelect(props.itemIndex, e.detail.value);
+};
+watch(
+ () => props.value,
+ (newValue) => {
+ if (!newValue) {
+ selectedIndex.value = -1;
+ return;
+ }
+ if (props.itemIndex === 0 || props.itemIndex === 2) {
+ data.value.forEach((item, index) => {
+ if (item.name === newValue) {
+ selectedIndex.value = index;
+ }
+ });
+ }
+ if (props.itemIndex === 1) {
+ distances.forEach((item, index) => {
+ if (item == newValue) {
+ selectedIndex.value = index;
+ }
+ if (selectedIndex.value === -1) {
+ meter.value = newValue;
+ }
+ });
+ }
+ }
+);
+onMounted(() => {
+ const config = uni.getStorageSync("point-book-config");
+ if (config) {
+ if (props.itemIndex === 0) {
+ data.value = config.bowOption;
+ } else if (props.itemIndex === 2) {
+ data.value = config.targetOption;
+ }
+ }
+});
+
+
+
+
+ onExpand(itemIndex, !expand)">
+ {{
+ itemIndex !== 3 ? itemTexts[itemIndex] : "选择组"
+ }}
+
+ {{
+ value || itemTexts[itemIndex]
+ }}
+ {{
+ value ? value + "米" : itemTexts[itemIndex]
+ }}
+ {{
+ value || itemTexts[itemIndex]
+ }}
+ {{
+ selectedIndex !== -1 && secondSelectIndex !== -1
+ ? `${selectedIndex + 1}组/${groupArrows[secondSelectIndex]}箭`
+ : itemTexts[itemIndex]
+ }}
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+ {{ item }}
+ 米
+
+
+ (selectedIndex = 9)"
+ @change="onMeterChange"
+ />
+ 米
+
+
+
+
+ {{ item.name.substring(0, item.name.length - 3) }}
+ {{ item.name.substring(item.name.length - 3) }}
+
+
+
+
+
+ {{ i }}
+ 组
+
+
+ 选择每组的箭数
+
+
+ {{ item }}
+ 箭
+
+
+
+
+
+
+
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 9b4ab99..8a04f49 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -11,6 +11,10 @@ const props = defineProps({
type: Function,
default: null,
},
+ whiteBackArrow: {
+ type: Boolean,
+ default: true,
+ },
});
const onClick = () => {
@@ -20,6 +24,7 @@ const onClick = () => {
const loading = ref(false);
const showLoader = ref(false);
+const pointBook = ref(null);
const updateLoading = (value) => {
loading.value = value;
};
@@ -29,6 +34,9 @@ onMounted(() => {
isIos.value = deviceInfo.osName === "ios";
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
+ if (currentPage.route === "pages/point-book-edit") {
+ pointBook.value = uni.getStorageSync("point-book");
+ }
if (
currentPage.route === "pages/battle-room" ||
currentPage.route === "pages/team-match" ||
@@ -46,9 +54,14 @@ onUnmounted(() => {
-
+
+
-
+
+
+ {{ pointBook.bowType.name }}
+ {{ pointBook.distance }} 米
+ {{
+ pointBook.bowtargetType.name.substring(
+ 0,
+ pointBook.bowtargetType.name.length - 3
+ )
+ }}
+ {{
+ pointBook.bowtargetType.name.substring(pointBook.bowtargetType.name.length - 3)
+ }}
+
@@ -95,7 +123,8 @@ onUnmounted(() => {
height: 100rpx;
/* margin-top: var(--status-bar-height); */
padding-left: 15px;
- color: #fff;
+}
+.container > view:nth-child(2) {
font-size: 16px;
font-weight: bold;
}
@@ -104,8 +133,8 @@ onUnmounted(() => {
align-items: center;
}
.back-btn > image {
- width: 18px;
- height: 18px;
+ width: 22px;
+ height: 22px;
margin-right: 10px;
}
.first-try-steps {
@@ -133,4 +162,19 @@ onUnmounted(() => {
background-blend-mode: darken;
animation: rotate 2s linear infinite;
}
+.point-book-info {
+ color: #333;
+ position: fixed;
+ width: 60%;
+ left: 20%;
+ display: flex;
+ justify-content: center;
+}
+.point-book-info > text {
+ border-radius: 6px;
+ background-color: #fff;
+ font-size: 10px;
+ padding: 5px 10px;
+ margin: 3px;
+}
diff --git a/src/components/PointRecord.vue b/src/components/PointRecord.vue
new file mode 100644
index 0000000..6b1459b
--- /dev/null
+++ b/src/components/PointRecord.vue
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+ {{
+ bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
+ }}
+ {{ data.distance }} 米
+ {{
+ targetOptions[data.targetType]
+ ? targetOptions[data.targetType].name
+ : ""
+ }}
+
+
+ {{ data.createAt }}
+
+
+
+
+
+ 共
+ {{ data.arrows * data.groups }}
+ 箭
+
+
+
+
+
+
diff --git a/src/components/SButton.vue b/src/components/SButton.vue
index 3a55872..541107f 100644
--- a/src/components/SButton.vue
+++ b/src/components/SButton.vue
@@ -26,6 +26,10 @@ const props = defineProps({
type: String,
default: "#000",
},
+ disabledColor:{
+ type: String,
+ default: "#757575",
+ }
});
const loading = ref(false);
@@ -55,7 +59,7 @@ const onBtnClick = debounce(async () => {
:style="{
width: width,
borderRadius: rounded + 'px',
- backgroundColor: disabled ? '#757575' : backgroundColor,
+ backgroundColor: disabled ? disabledColor : backgroundColor,
color,
}"
open-type="getUserInfo"
diff --git a/src/components/SModal.vue b/src/components/SModal.vue
index c9fa6e8..3349e80 100644
--- a/src/components/SModal.vue
+++ b/src/components/SModal.vue
@@ -9,32 +9,50 @@ const props = defineProps({
type: Function,
default: () => {},
},
+ noBg: {
+ type: Boolean,
+ default: false,
+ },
});
+const showContainer = ref(false);
const showContent = ref(false);
watch(
() => props.show,
(newValue) => {
- setTimeout(() => {
- showContent.value = newValue;
- }, 100);
- }
+ if (newValue) {
+ showContainer.value = true;
+ setTimeout(() => {
+ showContent.value = true;
+ }, 100);
+ } else {
+ showContent.value = false;
+ setTimeout(() => {
+ showContainer.value = false;
+ }, 100);
+ }
+ },
+ {}
);
-const closeModal = () => {
- showContent.value = false;
- setTimeout(() => {
- props.onClose();
- }, 300);
-};
-
+
-
-
+
+
@@ -60,7 +78,6 @@ const closeModal = () => {
}
.modal-content {
width: 100%;
- height: 260px;
transform: translateY(100%);
transition: all 0.3s ease;
position: relative;
diff --git a/src/components/ScreenHint2.vue b/src/components/ScreenHint2.vue
new file mode 100644
index 0000000..0314671
--- /dev/null
+++ b/src/components/ScreenHint2.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages.json b/src/pages.json
index 4b27d32..08ba596 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -6,6 +6,18 @@
{
"path": "pages/battle-result"
},
+ {
+ "path": "pages/point-book-edit"
+ },
+ {
+ "path": "pages/point-book-create"
+ },
+ {
+ "path": "pages/point-book-list"
+ },
+ {
+ "path": "pages/point-book-detail"
+ },
{
"path": "pages/match-page"
},
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 22b0d9a..a6e01eb 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -18,7 +18,8 @@ import { topThreeColors } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
-const { updateConfig, updateUser, updateDevice, updateRank } = store;
+const { updateConfig, updateUser, updateDevice, updateRank, getLvlName } =
+ store;
// 使用storeToRefs,用于UI里显示,保持响应性
const { user, device, rankData } = storeToRefs(store);
const showModal = ref(false);
@@ -109,11 +110,10 @@ const comingSoon = () => {
toPage('/pages/my-device')"
/>
-
我的弓箭
请绑定设备
{
>{{ device.deviceName }}
toPage('/pages/first-try')"
/>
@@ -135,20 +135,17 @@ const comingSoon = () => {
快来报到吧~
-
- toPage('/pages/practise')">
-
-
-
- toPage('/pages/friend-battle')"
- >
-
+
+ toPage('/pages/practise')">
+
+
+ toPage('/pages/friend-battle')">
+
+
-
+
-
+
+ toPage('/pages/my-growth')">
+
+
+
+
+ 段位
+ {{ user.scores ? getLvlName(user.scores) : "-" }}
+
+
+ 赛季平均环数
+ {{ user.avg_ring ? user.avg_ring + "环" : "-" }}
+
+
+ 赛季胜率
+ {{
+ user.avg_win
+ ? Number((user.avg_win * 100).toFixed(2)) + "%"
+ : "-"
+ }}
+
+
+
+
@@ -254,17 +274,19 @@ const comingSoon = () => {
}
.feature-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- grid-template-areas: "bow practice" "bow friend";
- row-gap: 5px;
- column-gap: 10px;
- margin-bottom: 10px;
+ width: 100%;
+ display: flex;
+ margin-bottom: 5px;
+}
+
+.feature-grid > view {
+ position: relative;
+ display: flex;
+ flex-direction: column;
}
.bow-card {
- grid-area: bow;
- position: relative;
+ width: 50%;
}
.feature-grid > view > image {
@@ -281,21 +303,16 @@ const comingSoon = () => {
color: #b3b3b3;
}
-.bow-card > image:first-child {
- transform: scaleY(1.08) translateY(9px);
-}
-
.bow-card > image:nth-child(3) {
transform: translateY(-1px);
}
-.practice-card {
- grid-area: practice;
- width: 100%;
+.play-card {
+ width: 48%;
+ margin-left: 2%;
}
-.friend-card {
- grid-area: friend;
+.play-card > view > image {
width: 100%;
}
@@ -382,7 +399,7 @@ const comingSoon = () => {
}
.more-players {
- background: rgba(255, 255, 255, 0.2);
+ background: #3c445a;
font-size: 9px;
line-height: 80rpx;
text-align: center;
@@ -447,4 +464,39 @@ const comingSoon = () => {
line-height: 20px;
margin-bottom: 5px;
}
+.my-data {
+ display: flex;
+ margin-top: 20px;
+ justify-content: space-between;
+}
+.my-data > view:first-child {
+ width: 28%;
+}
+.my-data > view:first-child > image {
+ width: 100%;
+ transform: translateX(-8px);
+}
+.my-data > view:nth-child(2) {
+ width: 68%;
+ font-size: 12px;
+ color: #fff6;
+ display: flex;
+ justify-content: space-between;
+}
+.my-data > view:nth-child(2) > view:nth-child(2) {
+ width: 38%;
+}
+.my-data > view:nth-child(2) > view {
+ width: 28%;
+ border-radius: 10px;
+ background: linear-gradient(180deg, #303b4c 30%, #2c384a 100%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+.my-data > view:nth-child(2) > view > text:last-child {
+ color: #fff;
+ line-height: 25px;
+}
diff --git a/src/pages/point-book-create.vue b/src/pages/point-book-create.vue
new file mode 100644
index 0000000..8870bc1
--- /dev/null
+++ b/src/pages/point-book-create.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 开始计分
+
+
+ 历史计分记录
+
+
+
+
+
+
+
diff --git a/src/pages/point-book-detail.vue b/src/pages/point-book-detail.vue
new file mode 100644
index 0000000..1dbf105
--- /dev/null
+++ b/src/pages/point-book-detail.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+ {{ index === 0 ? "全部" : `第${index}组` }}
+
+
+
+
+
+ openTip(1)"
+ >
+ 落点稳定性
+
+
+ {{ Number((data.stability || 0).toFixed(2)) }}
+
+
+ 黄心率
+ {{ Number((data.yellowRate * 100).toFixed(2)) }}%
+
+
+ 10环数
+ {{ data.tenRings }}
+
+
+ 平均环数
+ {{ Number((data.averageRing || 0).toFixed(2)) }}
+
+
+ 总环数
+ {{ data.userTotalRing }}/{{ data.totalRing }}
+
+
+
+
+ 落点分布
+
+
+
+
+
+
+ 落点稳定性说明
+ 通过计算每支箭与其他箭的平均距离衡一量射击的稳定性,数字越小则说明射击越稳定。该数据只能在用户标记落点的情况下生成。
+
+
+ 落点分布说明
+ 展示用户某次练习中射击的点位
+
+
+
+
+
+
+
+
diff --git a/src/pages/point-book-edit.vue b/src/pages/point-book-edit.vue
new file mode 100644
index 0000000..64ea321
--- /dev/null
+++ b/src/pages/point-book-edit.vue
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+ 第 {{ currentGroup }} 组
+
+
+
+ 删除
+
+
+
+ {{
+ isNaN(arrow.ring)
+ ? arrow.ring
+ : arrow.ring
+ ? arrow.ring + " 环"
+ : ""
+ }}
+
+ 输入分值的情况下,系统不提供落点稳定性分
+
+ onClickRing(item.ring)"
+ :style="{ backgroundColor: item.color }"
+ >{{ item.ring }}
+ onClickRing('M')"
+ >M
+
+
+
+ 现在离开会导致
+ 未提交的数据丢失,是否继续?
+
+
+
+
+
+
+
+
+
+ {{ currentGroup === groups ? "记完了,提交看分析" : "下一组" }}
+
+
+
+
+
+
diff --git a/src/pages/point-book-list.vue b/src/pages/point-book-list.vue
new file mode 100644
index 0000000..c9eee19
--- /dev/null
+++ b/src/pages/point-book-list.vue
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+ openSelector(0)">
+ {{
+ bowType.name || "请选择"
+ }}
+
+
+ openSelector(1)">
+ {{
+ distance ? distance + " 米" : "请选择"
+ }}
+
+
+ openSelector(2)">
+ {{
+ bowtargetType.name || "请选择"
+ }}
+
+
+
+
+
+ toDetailPage(item.id)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/static/a2@2x(1).png b/src/static/a2@2x(1).png
deleted file mode 100644
index af32db3..0000000
Binary files a/src/static/a2@2x(1).png and /dev/null differ
diff --git a/src/static/a2@2x.png b/src/static/a2@2x.png
deleted file mode 100644
index 0a92375..0000000
Binary files a/src/static/a2@2x.png and /dev/null differ
diff --git a/src/static/a3@2x.png b/src/static/a3@2x.png
deleted file mode 100644
index a1b2a60..0000000
Binary files a/src/static/a3@2x.png and /dev/null differ
diff --git a/src/static/a4@2x.png b/src/static/a4@2x.png
deleted file mode 100644
index 4fd3518..0000000
Binary files a/src/static/a4@2x.png and /dev/null differ
diff --git a/src/static/app-bg3.png b/src/static/app-bg3.png
new file mode 100644
index 0000000..43288cb
Binary files /dev/null and b/src/static/app-bg3.png differ
diff --git a/src/static/arrow-edit-delete.png b/src/static/arrow-edit-delete.png
new file mode 100644
index 0000000..c3b6076
Binary files /dev/null and b/src/static/arrow-edit-delete.png differ
diff --git a/src/static/arrow-edit-move.png b/src/static/arrow-edit-move.png
new file mode 100644
index 0000000..15713f4
Binary files /dev/null and b/src/static/arrow-edit-move.png differ
diff --git a/src/static/arrow-edit-save.png b/src/static/arrow-edit-save.png
new file mode 100644
index 0000000..50e065e
Binary files /dev/null and b/src/static/arrow-edit-save.png differ
diff --git a/src/static/arrow-grey.png b/src/static/arrow-grey.png
new file mode 100644
index 0000000..5faf819
Binary files /dev/null and b/src/static/arrow-grey.png differ
diff --git a/src/static/back-black.png b/src/static/back-black.png
new file mode 100644
index 0000000..4f86e03
Binary files /dev/null and b/src/static/back-black.png differ
diff --git a/src/static/back.png b/src/static/back.png
index 0c52813..3fac35f 100644
Binary files a/src/static/back.png and b/src/static/back.png differ
diff --git a/src/static/close-grey.png b/src/static/close-grey.png
new file mode 100644
index 0000000..c79b417
Binary files /dev/null and b/src/static/close-grey.png differ
diff --git a/src/static/close-white-outline.png b/src/static/close-white-outline.png
new file mode 100644
index 0000000..d0955db
Binary files /dev/null and b/src/static/close-white-outline.png differ
diff --git a/src/static/delete.png b/src/static/delete.png
new file mode 100644
index 0000000..f0774cc
Binary files /dev/null and b/src/static/delete.png differ
diff --git a/src/static/first-try.png b/src/static/first-try.png
new file mode 100644
index 0000000..ba9456b
Binary files /dev/null and b/src/static/first-try.png differ
diff --git a/src/static/friend-battle.png b/src/static/friend-battle.png
new file mode 100644
index 0000000..3201fe1
Binary files /dev/null and b/src/static/friend-battle.png differ
diff --git a/src/static/my-bow.png b/src/static/my-bow.png
new file mode 100644
index 0000000..61cddec
Binary files /dev/null and b/src/static/my-bow.png differ
diff --git a/src/static/my-growth.png b/src/static/my-growth.png
new file mode 100644
index 0000000..1594922
Binary files /dev/null and b/src/static/my-growth.png differ
diff --git a/src/static/my-practise.png b/src/static/my-practise.png
new file mode 100644
index 0000000..f4e5540
Binary files /dev/null and b/src/static/my-practise.png differ
diff --git a/src/static/point-book-tip-bg.png b/src/static/point-book-tip-bg.png
new file mode 100644
index 0000000..80d4695
Binary files /dev/null and b/src/static/point-book-tip-bg.png differ
diff --git a/src/static/rank-bg.png b/src/static/rank-bg.png
new file mode 100644
index 0000000..f35e5f4
Binary files /dev/null and b/src/static/rank-bg.png differ
diff --git a/src/static/region-1.png b/src/static/region-1.png
deleted file mode 100644
index bceed48..0000000
Binary files a/src/static/region-1.png and /dev/null differ
diff --git a/src/static/region-2.png b/src/static/region-2.png
deleted file mode 100644
index 4f179f4..0000000
Binary files a/src/static/region-2.png and /dev/null differ
diff --git a/src/static/region-3.png b/src/static/region-3.png
deleted file mode 100644
index 5b62ba3..0000000
Binary files a/src/static/region-3.png and /dev/null differ
diff --git a/src/static/region-4.png b/src/static/region-4.png
deleted file mode 100644
index 4313ea0..0000000
Binary files a/src/static/region-4.png and /dev/null differ
diff --git a/src/static/region-5.png b/src/static/region-5.png
deleted file mode 100644
index 6a57973..0000000
Binary files a/src/static/region-5.png and /dev/null differ
diff --git a/src/static/region-bg.png b/src/static/region-bg.png
deleted file mode 100644
index 72a9af9..0000000
Binary files a/src/static/region-bg.png and /dev/null differ
diff --git a/src/static/region-more.png b/src/static/region-more.png
deleted file mode 100644
index 543f168..0000000
Binary files a/src/static/region-more.png and /dev/null differ
diff --git a/src/static/s-question-mark.png b/src/static/s-question-mark.png
new file mode 100644
index 0000000..961e682
Binary files /dev/null and b/src/static/s-question-mark.png differ
diff --git a/src/static/s-triangle.png b/src/static/s-triangle.png
new file mode 100644
index 0000000..7de05fd
Binary files /dev/null and b/src/static/s-triangle.png differ
diff --git a/src/static/tab-bg.png b/src/static/tab-bg.png
index 55e6234..1392443 100644
Binary files a/src/static/tab-bg.png and b/src/static/tab-bg.png differ
diff --git a/src/static/tab-point-book.png b/src/static/tab-point-book.png
new file mode 100644
index 0000000..0736de7
Binary files /dev/null and b/src/static/tab-point-book.png differ
diff --git a/src/util.js b/src/util.js
index 687c9f9..56cc05a 100644
--- a/src/util.js
+++ b/src/util.js
@@ -286,3 +286,155 @@ 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();
+ });
+};
+
+const calcNormalBowTarget = (x, y, targetWidth, targetHeight) => {
+ // 计算靶心坐标(靶纸中心)
+ const centerX = targetWidth / 2;
+ const centerY = targetHeight / 2;
+
+ // 计算点击点到靶心的距离
+ const deltaX = x - centerX;
+ const deltaY = y - centerY;
+ const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
+
+ // 计算靶纸半径(取宽高中较小值的一半)
+ // const targetRadius = Math.min(targetWidth, targetHeight) / 2;
+ const targetRadius = targetWidth / 2;
+
+ // 如果距离超过靶纸半径,则脱靶
+ if (distance > targetRadius) return 0;
+
+ // 计算相对距离(0-1之间)
+ const relativeDistance = distance / targetRadius;
+ // 全环靶有10个环,每个环占半径的10%
+ // 从外到内:1环到10环
+ // 距离越近靶心,环数越高
+ if (relativeDistance <= 0.05) return "X";
+ if (relativeDistance <= 0.1) return 10;
+ if (relativeDistance <= 0.2) return 9;
+ if (relativeDistance <= 0.3) return 8;
+ if (relativeDistance <= 0.4) return 7;
+ if (relativeDistance <= 0.5) return 6;
+ if (relativeDistance <= 0.6) return 5;
+ if (relativeDistance <= 0.7) return 4;
+ if (relativeDistance <= 0.8) return 3;
+ if (relativeDistance <= 0.9) return 2;
+ if (relativeDistance <= 1.0) return 1;
+
+ return 0; // 脱靶
+};
+
+const calcHalfBowTarget = (x, y, side, noX = false) => {
+ // 计算靶心坐标(靶纸中心)
+ const centerX = side / 2;
+ const centerY = side / 2;
+
+ // 计算点击点到靶心的距离
+ const deltaX = x - centerX;
+ const deltaY = y - centerY;
+ const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
+
+ // 计算靶纸半径(取宽高中较小值的一半)
+ const targetRadius = side / 2;
+
+ // 如果距离超过靶纸半径,则脱靶
+ if (distance > targetRadius) return 0;
+
+ // 计算相对距离(0-1之间)
+ const relativeDistance = distance / targetRadius;
+ if (relativeDistance <= 0.1) return noX ? 10 : "X";
+ if (relativeDistance <= 0.2) return noX ? 9 : 10;
+ if (relativeDistance <= 0.4) return 9;
+ if (relativeDistance <= 0.6) return 8;
+ if (relativeDistance <= 0.8) return 7;
+ if (relativeDistance <= 1.0) return 6;
+
+ return 0; // 脱靶
+};
+
+export const calcTripleBowTarget = (
+ x,
+ y,
+ targetWidth,
+ targetHeight,
+ noX = false
+) => {
+ const side = targetWidth * 0.325;
+ if (x / targetWidth >= 0.337 && x / targetWidth <= 0.663) {
+ if (y / targetHeight <= 0.325) {
+ return calcHalfBowTarget(x - targetWidth * 0.337, y, side, noX);
+ } else if (y / targetHeight >= 0.335 && y / targetHeight <= 0.662) {
+ return calcHalfBowTarget(
+ x - targetWidth * 0.337,
+ y - targetHeight * 0.335,
+ side,
+ noX
+ );
+ } else if (y / targetHeight >= 0.674) {
+ return calcHalfBowTarget(
+ x - targetWidth * 0.337,
+ y - targetHeight * 0.674,
+ side,
+ noX
+ );
+ }
+ }
+ return 0;
+};
+
+export const calcPinBowTarget = (
+ x,
+ y,
+ targetWidth,
+ targetHeight,
+ noX = false
+) => {
+ const side = targetWidth * 0.48;
+ if (
+ x / targetWidth >= 0.26 &&
+ x / targetWidth <= 0.74 &&
+ y / targetHeight <= 0.48
+ ) {
+ return calcHalfBowTarget(x - targetWidth * 0.26, y, side, noX);
+ } else if (x / targetHeight <= 0.48 && y / targetHeight >= 0.456) {
+ return calcHalfBowTarget(x, y - targetHeight * 0.456, side, noX);
+ } else if (x / targetHeight >= 0.52 && y / targetHeight >= 0.456) {
+ return calcHalfBowTarget(
+ x - targetWidth * 0.52,
+ y - targetHeight * 0.456,
+ side,
+ noX
+ );
+ }
+ return 0;
+};
+
+export const calcRing = (bowtargetId, x, y, targetWidth, targetHeight) => {
+ if (bowtargetId < 4) {
+ return calcNormalBowTarget(x, y, targetWidth, targetHeight);
+ } else if (bowtargetId < 7) {
+ return calcHalfBowTarget(x, y, targetWidth);
+ } else if (bowtargetId === 7) {
+ return calcTripleBowTarget(x, y, targetWidth, targetHeight);
+ } else if (bowtargetId === 8) {
+ return calcPinBowTarget(x, y, targetWidth, targetHeight);
+ } else if (bowtargetId === 9) {
+ return calcTripleBowTarget(x, y, targetWidth, targetHeight, true);
+ } else if (bowtargetId === 10) {
+ return calcPinBowTarget(x, y, targetWidth, targetHeight, true);
+ }
+ return 0;
+};