细节完善

This commit is contained in:
kron
2025-09-27 10:09:02 +08:00
parent f8bc5d094e
commit b75ab93af9
8 changed files with 124 additions and 63 deletions

View File

@@ -59,13 +59,13 @@ const toEditPage = () => {
});
}
};
onShow(async () => {
const result = await getPointBookDataAPI();
if (result) {
days.value = result.total_day || 0;
arrows.value = result.total_arrow || 0;
}
});
// onShow(async () => {
// const result = await getPointBookDataAPI();
// if (result) {
// days.value = result.total_day || 0;
// arrows.value = result.total_arrow || 0;
// }
// });
onMounted(async () => {
const pointBook = uni.getStorageSync("point-book");
if (pointBook) {
@@ -82,10 +82,10 @@ onMounted(async () => {
:bgType="2"
bgColor="#F5F5F5"
:whiteBackArrow="false"
title="计分与技术分析"
title="选择参数"
>
<view class="container">
<view class="header">
<!-- <view class="header">
<image
src="https://static.shelingxingqiu.com/attachment/2025-08-06/dbv8w5ak76hozbfpy2.png"
mode="widthFix"
@@ -104,7 +104,7 @@ onMounted(async () => {
</view>
<text>训练箭数</text>
</view>
</view>
</view> -->
<view>
<EditOption
:itemIndex="0"
@@ -136,7 +136,7 @@ onMounted(async () => {
</view>
</view>
<view :style="{ marginBottom: '20px' }">
<SButton :rounded="50" :onClick="toEditPage">开始计分</SButton>
<SButton :rounded="50" :onClick="toEditPage">下一步</SButton>
<view class="see-more" @click="toListPage">
<text>历史计分记录</text>
<image src="../static/enter-arrow-blue.png" mode="widthFix" />

View File

@@ -34,8 +34,10 @@ const onSelect = (index) => {
};
const goBack = () => {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 2];
uni.navigateBack({
delta: 2,
delta: currentPage.route === "pages/point-book" ? 1 : 2,
});
};

View File

@@ -37,6 +37,7 @@ const data = ref({
const list = ref([]);
const bowTargetSrc = ref("");
const heatMapImageSrc = ref(""); // 存储热力图图片地址
const toListPage = () => {
uni.navigateTo({
@@ -71,8 +72,18 @@ const loadData = async () => {
uni.$emit("update-hot", hot);
const rect = await getElementRect(".heat-map");
// 延迟绘制热力图确保Canvas准备就绪
setTimeout(() => {
drawHeatMap(rect.width, rect.height, result2.weekArrows);
setTimeout(async () => {
try {
const imagePath = await drawHeatMap(
rect.width,
rect.height,
result2.weekArrows
);
heatMapImageSrc.value = imagePath; // 存储生成的图片地址
console.log("热力图图片地址:", imagePath);
} catch (error) {
console.error("生成热力图图片失败:", error);
}
}, 500);
};
@@ -235,6 +246,7 @@ onShareTimeline(() => {
:src="bowTargetSrc || '../static/bow-target.png'"
mode="widthFix"
/>
<image v-if="heatMapImageSrc" :src="heatMapImageSrc" mode="widthFix" />
<canvas canvas-id="heatMapCanvas" style="width: 100%; height: 100%" />
</view>
<view class="reward" v-if="data.totalArrow">
@@ -373,12 +385,15 @@ onShareTimeline(() => {
.heat-map > image {
width: 100%;
position: absolute;
top: 0;
left: 0;
}
.heat-map > canvas {
position: absolute;
top: 0;
left: 0;
left: -1000px;
width: 100%;
height: 100%;
z-index: 2;