diff --git a/src/components/BowTargetEdit.vue b/src/components/BowTargetEdit.vue
index 5e1342b..e735772 100644
--- a/src/components/BowTargetEdit.vue
+++ b/src/components/BowTargetEdit.vue
@@ -19,6 +19,10 @@ const props = defineProps({
type: Function,
default: null,
},
+ editMode: {
+ type: Boolean,
+ default: true,
+ },
});
const rect = ref({});
@@ -150,6 +154,7 @@ onMounted(async () => {
{
width: 100vw;
height: 100vw;
overflow-x: hidden;
- overflow-y: auto;
}
.container::-webkit-scrollbar {
width: 0;
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 0147f2a..055c48b 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -273,6 +273,6 @@ onBeforeUnmount(() => {
font-size: 30rpx;
color: #333333;
margin: 0 20rpx;
- max-width: 280rpx;
+ max-width: 300rpx;
}
diff --git a/src/components/RingBarChart.vue b/src/components/RingBarChart.vue
index a8ebd98..b4d4e0d 100644
--- a/src/components/RingBarChart.vue
+++ b/src/components/RingBarChart.vue
@@ -6,6 +6,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
+ total: {
+ type: Number,
+ default: 0,
+ },
});
const barColor = (rate) => {
@@ -15,20 +19,16 @@ const barColor = (rate) => {
};
const bars = computed(() => {
- let data = Object.values(props.data);
- if (!data.length) data = new Array(11).fill({ ring: 0, rate: 0 });
- const newList = data.map((item, index) => {
+ const newList = new Array(12).fill({ ring: 0, rate: 0 }).map((_, index) => {
let ring = index;
if (ring === 11) ring = "M";
if (ring === 0) ring = "X";
return {
ring: ring,
- rate: item,
+ rate: props.data[index] || 0,
};
});
- if (newList.length >= 12) {
- [newList[0], newList[11]] = [newList[11], newList[0]];
- }
+ [newList[0], newList[11]] = [newList[11], newList[0]];
return newList.reverse();
});
@@ -44,12 +44,12 @@ const ringText = (ring) => {
- {{ Number((b.rate * 100).toFixed(1)) }}%
+ {{ total === 0 ? `${Number((b.rate * 100).toFixed(1))}%` : b.rate }}
@@ -64,6 +64,12 @@ const ringText = (ring) => {
diff --git a/src/pages/point-book.vue b/src/pages/point-book.vue
index ff90745..aa5200e 100644
--- a/src/pages/point-book.vue
+++ b/src/pages/point-book.vue
@@ -31,6 +31,7 @@ const isIOS = computed(() => {
return systemInfo.osName === "ios";
});
+const loadImage = ref(false);
const showModal = ref(false);
const showTip = ref(false);
const data = ref({
@@ -75,6 +76,7 @@ const loadData = async () => {
else if (result2.checkInCount >= 5) hot = 3;
else if (result2.checkInCount === 7) hot = 4;
uni.$emit("update-hot", hot);
+ loadImage.value = true;
const generateHeatmapAsync = async () => {
const weekArrows = result2.weekArrows
.filter((item) => item.x && item.y)
@@ -108,9 +110,11 @@ const loadData = async () => {
}
);
heatMapImageSrc.value = finalPath;
+ loadImage.value = false;
console.log("热力图图片地址:", finalPath);
} catch (error) {
console.error("生成热力图图片失败:", error);
+ loadImage.value = false;
}
};
@@ -282,6 +286,9 @@ onShareTimeline(() => {
:src="heatMapImageSrc"
mode="aspectFill"
/>
+
+ 生成中...
+