This commit is contained in:
kron
2025-07-30 09:55:15 +08:00
parent e073f3eb0f
commit e963c52e3a
13 changed files with 655 additions and 50 deletions

View File

@@ -4,7 +4,7 @@ import Container from "@/components/Container.vue";
import EditOption from "@/components/EditOption.vue";
import SButton from "@/components/SButton.vue";
const clickable = ref(false);
const clickable = ref(true);
const expandIndex = ref(-1);
const bowType = ref("");
const distance = ref(0);
@@ -14,8 +14,6 @@ const onExpandChange = (index, expand) => {
expandIndex.value = !expand ? -1 : index;
};
const onClick = () => {};
const toListPage = () => {
uni.navigateTo({
url: "/pages/point-book-list",
@@ -35,6 +33,11 @@ const onSelect = (itemIndex, value) => {
clickable.value = true;
}
};
const toEditPage = () => {
uni.navigateTo({
url: "/pages/point-book-edit",
});
};
</script>
<template>
@@ -46,35 +49,37 @@ const onSelect = (itemIndex, value) => {
>
<view class="container">
<image src="../static/point-book-banner.png" mode="widthFix" />
<EditOption
:itemIndex="0"
:expand="expandIndex === 0"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="1"
:expand="expandIndex === 1"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="2"
:expand="expandIndex === 2"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="3"
:expand="expandIndex === 3"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<view>
<EditOption
:itemIndex="0"
:expand="expandIndex === 0"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="1"
:expand="expandIndex === 1"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="2"
:expand="expandIndex === 2"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
<EditOption
:itemIndex="3"
:expand="expandIndex === 3"
:onExpand="onExpandChange"
:onSelect="onSelect"
/>
</view>
</view>
<view :style="{ marginBottom: '20px' }">
<SButton
:disabled="!clickable"
:onClick="onClick"
:onClick="toEditPage"
disabledColor="#DDDDDD"
:color="clickable ? '#000' : '#fff'"
>
@@ -102,4 +107,7 @@ const onSelect = (itemIndex, value) => {
box-sizing: border-box;
border-radius: 10px;
}
.container > view:nth-child(2) {
margin: 0 10px;
}
</style>

View File

@@ -1,9 +1,203 @@
<script setup>
import { ref, onMounted, onUnmounted } from "vue";
import Container from "@/components/Container.vue";
import BowTarget from "@/components/BowTarget.vue";
import ScreenHint2 from "@/components/ScreenHint2.vue";
const selectedIndex = ref(0);
const showTip = ref(false);
const showTip2 = ref(false);
const openTip = (index) => {
if (index === 1) showTip.value = true;
else if (index === 2) showTip2.value = true;
};
const closeTip = () => {
showTip.value = false;
showTip2.value = false;
};
</script>
<template>
<Container> </Container>
<Container :bgType="2" bgColor="#F5F5F5" :whiteBackArrow="false" title="分析">
<view class="container">
<view class="tab-bar">
<view
v-for="(_, index) in [1, 2, 3, 4, 5]"
:key="index"
@click="selectedIndex = index"
>
<text
:style="{
color: selectedIndex === index ? '#FF8709' : '#333',
fontSize: selectedIndex === index ? '15px' : '13px',
letterSpacing: index !== 0 ? '2px' : '0',
}"
>{{ index === 0 ? "全部" : `${index}` }}</text
>
<image
src="../static/s-triangle.png"
mode="widthFix"
:style="{ bottom: selectedIndex !== index ? '0' : '-6px' }"
/>
</view>
</view>
<view class="detail-data">
<view>
<view
:style="{ display: 'flex', alignItems: 'center' }"
@click="() => openTip(1)"
>
<text>落点稳定性</text>
<image
src="../static/s-question-mark.png"
mode="widthFix"
class="question-mark"
/>
</view>
<text>98.99</text>
</view>
<view>
<view>黄心率</view>
<text>86.3%</text>
</view>
<view>
<view>10环数</view>
<text>65</text>
</view>
<view>
<view>平均环数</view>
<text>8.99</text>
</view>
<view>
<view>总环数</view>
<text>700/999</text>
</view>
</view>
<view class="title-bar">
<view />
<text>落点分布</text>
<button hover-class="none" @click="() => openTip(2)">
<image
src="../static/s-question-mark.png"
mode="widthFix"
class="question-mark"
/>
</button>
</view>
<BowTarget />
<ScreenHint2 :show="showTip || showTip2" :onClose="closeTip">
<view class="tip-content">
<block v-if="showTip">
<text>落点稳定性说明</text>
<text
>通过计算每支箭与其他箭的平均距离衡一量射击的稳定性数字越小则说明射击越稳定该数据只能在用户标记落点的情况下生成</text
>
</block>
<block v-if="showTip2">
<text>落点分布说明</text>
<text>展示用户某次练习中射击的点位</text>
</block>
</view>
</ScreenHint2>
</view>
</Container>
</template>
<style scoped></style>
<style scoped>
.container {
width: 100%;
}
.tab-bar {
display: flex;
width: clac(100% - 20px);
overflow-x: auto;
padding: 0 10px;
}
.tab-bar::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.tab-bar > view {
border-radius: 10px;
background-color: #fff;
width: 24vw;
height: 13vw;
line-height: 13vw;
text-align: center;
margin: 5px;
margin-top: 0;
font-size: 14px;
flex: 0 0 auto;
position: relative;
}
.tab-bar > view > text {
transition: all 0.2s ease;
}
.tab-bar > view > image {
position: absolute;
width: 14px;
height: 4px;
left: calc(50% - 7px);
transition: all 0.3s ease;
}
.detail-data {
display: grid;
grid-template-columns: repeat(3, 1fr);
column-gap: 3vw;
margin: 10px 15px;
}
.detail-data > view {
border-radius: 10px;
background-color: #fff;
margin-bottom: 10px;
padding: 12px;
}
.detail-data > view > view {
font-size: 13px;
color: #999;
margin-bottom: 8px;
}
.question-mark {
width: 15px;
height: 15px;
margin-left: 3px;
}
.title-bar {
width: 100%;
display: flex;
align-items: center;
font-size: 13px;
color: #999;
}
.title-bar > view:first-child {
width: 5px;
height: 15px;
border-radius: 10px;
background-color: #fed847;
margin-right: 7px;
margin-left: 15px;
}
.title-bar > text {
margin-bottom: 2px;
}
.tip-content {
width: 100%;
padding: 25px;
display: flex;
flex-direction: column;
}
.tip-content > text {
width: 100%;
}
.tip-content > text:first-child {
text-align: center;
}
.tip-content > text:last-child {
font-size: 13px;
margin-top: 20px;
opacity: 0.8;
}
</style>

View File

@@ -0,0 +1,79 @@
<script setup>
import { ref } from "vue";
import Container from "@/components/Container.vue";
import ScreenHint2 from "@/components/ScreenHint2.vue";
import SButton from "@/components/SButton.vue";
const clickable = ref(false);
const showTip = ref(false);
const onBack = () => {
uni.navigateBack();
};
const onClick = () => {};
</script>
<template>
<Container
:bgType="2"
bgColor="#F5F5F5"
:whiteBackArrow="false"
:onBack="() => (showTip = true)"
>
<view>
<ScreenHint2 :show="showTip">
<view class="tip-content">
<text>现在离开会导致</text>
<text>未提交的数据丢失是否继续</text>
<view>
<button hover-class="none" @click="onBack">退出</button>
<button hover-class="none" @click="showTip = false">
继续记录
</button>
</view>
</view>
</ScreenHint2>
</view>
<view :style="{ marginBottom: '20px' }">
<SButton
:disabled="!clickable"
:onClick="onClick"
disabledColor="#DDDDDD"
:color="clickable ? '#000' : '#fff'"
>
记完了提交看分析
</SButton>
</view>
</Container>
</template>
<style scoped>
.tip-content {
width: 100%;
padding: 25px;
display: flex;
flex-direction: column;
}
.tip-content > text {
width: 100%;
text-align: center;
font-size: 14px;
margin-top: 5px;
}
.tip-content > view {
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.tip-content > view > button {
width: 48%;
background: linear-gradient(180deg, #fbfbfb 0%, #f5f5f5 100%);
border-radius: 22px;
border: 1px solid #eeeeee;
padding: 12px 0;
font-size: 14px;
}
.tip-content > view > button:last-child {
background: #fed847;
}
</style>

View File

@@ -1,6 +1,35 @@
<script setup>
import { ref, onMounted, onUnmounted } from "vue";
import Container from "@/components/Container.vue";
import SModal from "@/components/SModal.vue";
import EditOption from "@/components/EditOption.vue";
import PointRecord from "@/components/PointRecord.vue";
const bowType = ref("");
const distance = ref(0);
const bowtargetType = ref("");
const showModal = ref(false);
const selectorIndex = ref(0);
const openSelector = (index) => {
selectorIndex.value = index;
showModal.value = true;
};
const onSelectOption = (itemIndex, value) => {
if (itemIndex === 0) {
bowType.value = value;
} else if (itemIndex === 1) {
distance.value = value;
} else if (itemIndex === 2) {
bowtargetType.value = value;
}
};
const toDetailPage = (record) => {
uni.navigateTo({
url: `/pages/point-book-detail?id=${record.id}`,
});
};
</script>
<template>
@@ -10,7 +39,117 @@ import Container from "@/components/Container.vue";
:whiteBackArrow="false"
title="计分记录"
>
<view class="container">
<view class="selectors">
<view @click="() => openSelector(0)">
<text :style="{ color: bowType ? '#000' : '#999' }">{{
bowType || "请选择"
}}</text>
<image src="../static/arrow-grey.png" mode="widthFix" />
</view>
<view @click="() => openSelector(1)">
<text :style="{ color: bowType ? '#000' : '#999' }">{{
distance ? distance + " 米" : "请选择"
}}</text>
<image src="../static/arrow-grey.png" mode="widthFix" />
</view>
<view @click="() => openSelector(2)">
<text :style="{ color: bowType ? '#000' : '#999' }">{{
bowtargetType || "请选择"
}}</text>
<image src="../static/arrow-grey.png" mode="widthFix" />
</view>
</view>
<view class="point-records">
<view v-for="i in 4" :key="i" @click="toDetailPage">
<PointRecord />
</view>
</view>
<SModal
:show="showModal"
:noBg="true"
:onClose="() => (showModal = false)"
>
<view class="selector">
<button hover-class="none" @click="() => (showModal = false)">
<image src="../static/close-grey.png" mode="widthFix" />
</button>
<EditOption
v-show="selectorIndex === 0"
:itemIndex="0"
:expand="true"
:noArrow="true"
:onSelect="onSelectOption"
/>
<EditOption
v-show="selectorIndex === 1"
:itemIndex="1"
:expand="true"
:noArrow="true"
:onSelect="onSelectOption"
/>
<EditOption
v-show="selectorIndex === 2"
:itemIndex="2"
:expand="true"
:noArrow="true"
:onSelect="onSelectOption"
/>
</view>
</SModal>
</view>
</Container>
</template>
<style scoped></style>
<style scoped>
.container {
width: 100%;
height: 100%;
}
.selectors {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.selectors > view {
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
height: 55px;
border-radius: 12px;
color: #333;
font-size: 13px;
width: 26vw;
}
.selectors > view:last-child {
width: 34vw;
}
.selectors > view > text {
width: calc(100% - 11vw);
text-align: center;
margin-left: 3vw;
}
.selectors > view > image {
width: 5vw;
margin-right: 3vw;
}
.selector {
padding: 10px;
background-color: #fff;
border-radius: 10px;
position: relative;
}
.selector > button {
position: absolute;
top: 0;
right: 0;
}
.selector > button > image {
width: 40px;
}
.point-records {
padding: 15px;
}
</style>