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

@@ -11,12 +11,16 @@ const props = defineProps({
}, },
onExpand: { onExpand: {
type: Function, type: Function,
default: null, default: () => {},
}, },
onSelect: { onSelect: {
type: Function, type: Function,
default: () => {}, default: () => {},
}, },
noArrow: {
type: Boolean,
default: false,
},
}); });
const bowTypes = [ const bowTypes = [
{ {
@@ -95,7 +99,13 @@ const onMeterChange = (e) => {
</script> </script>
<template> <template>
<view class="container" :style="{ maxHeight: expand ? '500px' : '50px' }"> <view
class="container"
:style="{
maxHeight: expand ? '500px' : '50px',
marginTop: noArrow ? '0' : '10px',
}"
>
<view @click="() => onExpand(itemIndex, !expand)"> <view @click="() => onExpand(itemIndex, !expand)">
<text :style="{ opacity: expand ? 1 : 0 }">{{ <text :style="{ opacity: expand ? 1 : 0 }">{{
itemIndex !== 3 ? itemTexts[itemIndex] : "选择组" itemIndex !== 3 ? itemTexts[itemIndex] : "选择组"
@@ -126,6 +136,7 @@ const onMeterChange = (e) => {
</block> </block>
<button hover-class="none"> <button hover-class="none">
<image <image
v-if="!noArrow"
src="../static/arrow-grey.png" src="../static/arrow-grey.png"
mode="widthFix" mode="widthFix"
:style="{ transform: expand ? 'rotateX(180deg)' : 'rotateX(0deg)' }" :style="{ transform: expand ? 'rotateX(180deg)' : 'rotateX(0deg)' }"
@@ -218,9 +229,8 @@ const onMeterChange = (e) => {
<style scoped> <style scoped>
.container { .container {
width: calc(100vw - 40px); width: calc(100% - 20px);
background-color: #fff; background-color: #fff;
margin-top: 10px;
border-radius: 10px; border-radius: 10px;
padding: 0 10px; padding: 0 10px;
font-size: 14px; font-size: 14px;

View File

@@ -0,0 +1,89 @@
<script setup>
const props = defineProps({
signin: {
type: Function,
default: () => {},
},
});
</script>
<template>
<view class="container">
<view>
<view class="labels">
<text>反曲弓</text>
<text>5 </text>
<text>40 全环靶</text>
</view>
<view>
<text>2025-07-10 14:00:00</text>
</view>
</view>
<view>
<image src="../static/bow-target.png" mode="widthFix" />
<view class="aroow-amount">
<text></text>
<text>36</text>
<text></text>
</view>
</view>
</view>
</template>
<style scoped>
.container {
background-color: #fff;
border-radius: 15px;
display: flex;
margin-bottom: 15px;
height: 24vw;
}
.container > view {
position: relative;
margin-left: 15px;
}
.container > view:first-child {
width: calc(100% - 5vw);
}
.container > view:first-child > view {
width: 100%;
height: 50%;
display: flex;
align-items: center;
}
.labels {
align-items: flex-end !important;
}
.labels > text {
font-size: 12px;
color: #333333;
border: 1px solid #eee;
margin-right: 10px;
border-radius: 10px;
padding: 5px 10px;
}
.container > view:last-child {
margin-right: 1vw;
}
.container > view:last-child > image {
width: 24vw;
}
.aroow-amount {
position: absolute;
background-color: #0009;
border-radius: 10px;
color: #fffc;
font-size: 12px;
line-height: 22px;
width: 60px;
display: flex;
justify-content: center;
top: calc(50% - 11px);
left: calc(50% - 30px);
}
.aroow-amount > text:nth-child(2) {
color: #fff;
font-size: 14px;
margin: 0 3px;
}
</style>

View File

@@ -9,32 +9,50 @@ const props = defineProps({
type: Function, type: Function,
default: () => {}, default: () => {},
}, },
noBg: {
type: Boolean,
default: false,
},
}); });
const showContainer = ref(false);
const showContent = ref(false); const showContent = ref(false);
watch( watch(
() => props.show, () => props.show,
(newValue) => { (newValue) => {
setTimeout(() => { if (newValue) {
showContent.value = newValue; showContainer.value = true;
}, 100); setTimeout(() => {
} showContent.value = true;
}, 100);
} else {
showContent.value = false;
setTimeout(() => {
showContainer.value = false;
}, 100);
}
},
{}
); );
const closeModal = () => {
showContent.value = false;
setTimeout(() => {
props.onClose();
}, 300);
};
</script> </script>
<template> <template>
<view class="container" v-if="show" :style="{ opacity: show ? 1 : 0 }"> <view
class="container"
v-if="showContainer"
:style="{ opacity: show ? 1 : 0 }"
@click="onClose"
>
<view <view
class="modal-content" class="modal-content"
:style="{ transform: `translateY(${showContent ? '0%' : '100%'})` }" :style="{ transform: `translateY(${showContent ? '0%' : '100%'})`, height: !noBg ? '260px' : 'auto' }"
@click.stop=""
> >
<image src="../static/modal-content-bg.png" mode="widthFix" /> <image
<view class="close-btn" @click="closeModal"> v-if="!noBg"
src="../static/modal-content-bg.png"
mode="widthFix"
/>
<view class="close-btn" @click="onClose">
<image src="../static/close-yellow.png" mode="widthFix" /> <image src="../static/close-yellow.png" mode="widthFix" />
</view> </view>
<slot></slot> <slot></slot>
@@ -60,7 +78,6 @@ const closeModal = () => {
} }
.modal-content { .modal-content {
width: 100%; width: 100%;
height: 260px;
transform: translateY(100%); transform: translateY(100%);
transition: all 0.3s ease; transition: all 0.3s ease;
position: relative; position: relative;

View File

@@ -0,0 +1,66 @@
<script setup>
import IconButton from "./IconButton.vue";
const props = defineProps({
show: {
type: Boolean,
default: false,
},
onClose: {
type: Function,
default: null,
},
height: {
type: Number,
default: 100,
},
});
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
<view class="scale-in">
<image src="../static/point-book-tip-bg.png" mode="widthFix" />
<slot />
</view>
<IconButton
v-if="!!onClose"
src="../static/close-white-outline.png"
:width="30"
:onClick="onClose"
/>
</view>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 999;
}
.container > view:first-child {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 75vw;
margin-bottom: 15px;
border-radius: 20px;
overflow: hidden;
background: #fff;
}
.container > view:first-child > image {
position: absolute;
width: 100%;
z-index: -1;
top: 0;
}
</style>

View File

@@ -3,6 +3,9 @@
{ {
"path": "pages/point-book-create" "path": "pages/point-book-create"
}, },
{
"path": "pages/point-book-edit"
},
{ {
"path": "pages/index" "path": "pages/index"
}, },

View File

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

View File

@@ -1,9 +1,203 @@
<script setup> <script setup>
import { ref, onMounted, onUnmounted } from "vue"; 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> </script>
<template> <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> </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> <script setup>
import { ref, onMounted, onUnmounted } from "vue"; import { ref, onMounted, onUnmounted } from "vue";
import Container from "@/components/Container.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> </script>
<template> <template>
@@ -10,7 +39,117 @@ import Container from "@/components/Container.vue";
:whiteBackArrow="false" :whiteBackArrow="false"
title="计分记录" 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> </Container>
</template> </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>

BIN
src/static/close-grey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
src/static/s-triangle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B