diff --git a/src/apis.js b/src/apis.js
index 7e105fd..e47e3d0 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -510,3 +510,11 @@ export const laserCloseAPI = async () => {
export const getDeviceBatteryAPI = async () => {
return request("GET", "/user/device/battery");
};
+
+export const addNoteAPI = async (id, remark) => {
+ return request("POST", "/user/score/sheet/remark", { id, remark });
+};
+
+export const removePointRecord = async (id) => {
+ return request("DELETE", `/user/score/sheet/delete?id=${id}`);
+};
diff --git a/src/audioManager.js b/src/audioManager.js
index ca72ac2..1d3d051 100644
--- a/src/audioManager.js
+++ b/src/audioManager.js
@@ -215,6 +215,8 @@ class AudioManager {
// 播放指定音频
play(key) {
+ const pages = getCurrentPages();
+ if (pages.length <= 1) return;
// 如果有正在播放的音频,先停止
if (this.currentPlayingKey) {
this.stop(this.currentPlayingKey);
@@ -222,6 +224,7 @@ class AudioManager {
const audio = this.audioMap.get(key);
if (audio) {
+ console.log("播放音频:", key);
audio.play();
this.currentPlayingKey = key;
} else {
diff --git a/src/components/EditOption.vue b/src/components/EditOption.vue
index 58aabaa..e21f9bf 100644
--- a/src/components/EditOption.vue
+++ b/src/components/EditOption.vue
@@ -63,6 +63,30 @@ const onMeterChange = (e) => {
meter.value = e.detail.value;
props.onSelect(props.itemIndex, e.detail.value);
};
+const sets = ref(null);
+const onSetsChange = (e) => {
+ sets.value = e.detail.value;
+ if (!sets.value) return;
+ if (arrowAmount.value || groupArrows[secondSelectIndex.value]) {
+ props.onSelect(
+ props.itemIndex,
+ `${e.detail.value}/${
+ arrowAmount.value || groupArrows[secondSelectIndex.value]
+ }`
+ );
+ }
+};
+const arrowAmount = ref("");
+const onArrowAmountChange = (e) => {
+ arrowAmount.value = e.detail.value;
+ if (!arrowAmount.value) return;
+ if (sets.value || selectedIndex.value !== -1) {
+ props.onSelect(
+ props.itemIndex,
+ `${sets.value || selectedIndex.value}/${e.detail.value}`
+ );
+ }
+};
watch(
() => props.value,
(newValue) => {
@@ -219,7 +243,7 @@ onMounted(async () => {
+ (selectedIndex = 5)"
+ @change="onSetsChange"
+ />
+ 组
+
{
{{ item }}
箭
+
+ (secondSelectIndex = 4)"
+ @change="onArrowAmountChange"
+ />
+ 箭
+
@@ -352,4 +406,12 @@ onMounted(async () => {
width: 100%;
text-align: center;
}
+.amount-items > view:last-child {
+ grid-column: 1 / -1;
+ width: 100%;
+}
+.amount-items > view:last-child > input {
+ width: 85%;
+ text-align: center;
+}
diff --git a/src/components/PointRecord.vue b/src/components/PointRecord.vue
index 0df8e8d..3f4bb37 100644
--- a/src/components/PointRecord.vue
+++ b/src/components/PointRecord.vue
@@ -6,6 +6,10 @@ const props = defineProps({
type: Object,
default: () => {},
},
+ longPress: {
+ type: Function,
+ default: () => {},
+ },
});
const bowOptions = ref({});
const targetOptions = ref({});
@@ -28,7 +32,7 @@ onMounted(() => {
-
+
@@ -54,9 +58,9 @@ onMounted(() => {
- 共
- {{ data.arrows * data.groups }}
- 箭
+ {{ data.actualTotalRing }}
+ /
+ {{ data.totalRing }}
@@ -124,19 +128,18 @@ onMounted(() => {
.arrow-amount {
position: absolute;
background-color: #0009;
- border-radius: 10px;
+ border-radius: 12px;
color: #fffc;
- font-size: 12px;
- line-height: 22px;
- width: 60px;
+ font-size: 24rpx;
+ line-height: 26px;
+ width: 64px;
display: flex;
justify-content: center;
- top: calc(50% - 13px);
- left: calc(50% - 30px);
+ top: calc(50% - 15px);
+ left: calc(50% - 32px);
}
-.arrow-amount > text:nth-child(2) {
+.arrow-amount > text:nth-child(1) {
+ font-size: 30rpx;
color: #fff;
- font-size: 14px;
- margin: 0 3px;
}
diff --git a/src/components/RingBarChart.vue b/src/components/RingBarChart.vue
index 401af63..cc2eb15 100644
--- a/src/components/RingBarChart.vue
+++ b/src/components/RingBarChart.vue
@@ -61,6 +61,7 @@ const ringText = (ring) => {
{{ b && b.ring !== undefined ? b.ring : "" }}
+ 环值
@@ -70,9 +71,18 @@ const ringText = (ring) => {
display: flex;
flex-direction: column;
justify-content: flex-end;
+ position: relative;
+}
+.container > text {
+ position: absolute;
+ bottom: 2rpx;
+ left: 0;
+ font-size: 18rpx;
+ color: #999999;
}
.container > view {
- padding: 0 10rpx;
+ padding-left: 40rpx;
+ padding-right: 10rpx;
}
.container > view:first-child {
display: flex;
@@ -93,14 +103,15 @@ const ringText = (ring) => {
transition: all 0.3s ease;
height: 0;
}
-.container > view:last-child {
+.container > view:nth-child(2) {
display: grid;
grid-template-columns: repeat(12, 1fr);
border-top: 1rpx solid #333;
font-size: 22rpx;
color: #333333;
+ padding-top: 2rpx;
}
-.container > view:last-child > text {
+.container > view:nth-child(2) > text {
text-align: center;
}
diff --git a/src/pages/point-book-detail.vue b/src/pages/point-book-detail.vue
index 6dfecc3..26620a2 100644
--- a/src/pages/point-book-detail.vue
+++ b/src/pages/point-book-detail.vue
@@ -7,25 +7,40 @@ import ScreenHint2 from "@/components/ScreenHint2.vue";
import SButton from "@/components/SButton.vue";
import RingBarChart from "@/components/RingBarChart.vue";
-import { getPointBookDetailAPI } from "@/apis";
+import { getPointBookDetailAPI, addNoteAPI } from "@/apis";
const selectedIndex = ref(0);
const showTip = ref(false);
const showTip2 = ref(false);
+const showTip3 = ref(false);
const groups = ref([]);
const data = ref({});
const targetId = ref(0);
const targetSrc = ref("");
const arrows = ref([]);
+const notes = ref("");
+const draftNotes = ref("");
+const recordId = ref("");
const openTip = (index) => {
if (index === 1) showTip.value = true;
else if (index === 2) showTip2.value = true;
+ else if (index === 3) showTip3.value = true;
};
const closeTip = () => {
showTip.value = false;
showTip2.value = false;
+ showTip3.value = false;
+};
+
+const saveNote = async () => {
+ notes.value = draftNotes.value;
+ draftNotes.value = "";
+ showTip3.value = false;
+ if (recordId.value) {
+ await addNoteAPI(recordId.value, notes.value);
+ }
};
const onSelect = (index) => {
@@ -54,6 +69,8 @@ const ringRates = computed(() => {
onLoad(async (options) => {
if (options.id) {
const result = await getPointBookDetailAPI(options.id || 164);
+ recordId.value = result.id;
+ notes.value = result.remark || "";
const config = uni.getStorageSync("point-book-config");
config.targetOption.some((item) => {
if (item.id === result.targetType) {
@@ -132,6 +149,10 @@ onLoad(async (options) => {
总环数
{{ data.userTotalRing }}/{{ data.totalRing }}
+
@@ -168,14 +189,21 @@ onLoad(async (options) => {
- {{
- `第${index}组`
- }}
+
+ {{ index }}:
+ {{
+ item.list.reduce((acc, cur) => acc + cur.ring, 0)
+ }}
+ 环
+
{
}"
>
{{
- arrow.ring === 0
- ? "X"
- : arrow.ring === -1
- ? "M"
- : arrow.ring + "环"
+ arrow.ring === 0 ? "X" : arrow.ring === -1 ? "M" : arrow.ring
}}
@@ -200,7 +224,10 @@ onLoad(async (options) => {
关闭
-
+
落点稳定性说明
@@ -212,6 +239,22 @@ onLoad(async (options) => {
落点分布说明
展示用户某次练习中射箭的点位
+
+ 笔记
+ {{ notes }}
+
+
+
+
+
+
@@ -265,7 +308,8 @@ onLoad(async (options) => {
column-gap: 3vw;
margin: 10rpx 30rpx;
}
-.detail-data > view {
+.detail-data > view,
+.detail-data > button {
border-radius: 10px;
background-color: #fff;
margin-bottom: 20rpx;
@@ -283,6 +327,18 @@ onLoad(async (options) => {
font-weight: 500;
color: #000;
}
+.detail-data > button {
+ display: flex;
+ align-items: center;
+ font-size: 26rpx;
+ color: #999999;
+}
+.detail-data > button > image {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 10rpx;
+ margin-left: 20rpx;
+}
.question-mark {
width: 28rpx;
height: 28rpx;
@@ -326,6 +382,33 @@ onLoad(async (options) => {
margin-top: 20px;
opacity: 0.8;
}
+.tip-content > view {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.tip-content > view > input {
+ width: 80%;
+ height: 44px;
+ border-radius: 22px;
+ border: 1px solid #eeeeee;
+ padding: 0 12px;
+ font-size: 14px;
+ color: #000;
+}
+.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;
+ color: #000;
+}
+.tip-content > view > button:last-child {
+ background: #fed847;
+}
.ring-text-groups {
display: flex;
flex-direction: column;
@@ -338,22 +421,43 @@ onLoad(async (options) => {
display: flex;
justify-content: center;
}
-.ring-text-groups > view > text {
+.ring-text-groups > view > view:first-child:nth-last-child(2) {
width: 82rpx;
text-align: center;
- font-size: 27rpx;
+ font-size: 20rpx;
+ display: flex;
+ color: #999;
}
-.ring-text-groups > view > view {
+.ring-text-groups > view > view:first-child:nth-last-child(2) > text {
+ line-height: 30rpx;
+}
+.ring-text-groups
+ > view
+ > view:first-child:nth-last-child(2)
+ > text:nth-child(2) {
+ font-size: 40rpx;
+ color: #666;
+ margin-right: 6rpx;
+}
+.ring-text-groups > view > view:last-child {
flex: 1;
display: grid;
grid-template-columns: repeat(6, auto);
grid-gap: 10rpx;
margin-bottom: 30rpx;
- margin-left: 20rpx;
}
-.ring-text-groups > view > view > text {
+.ring-text-groups > view > view:last-child > text {
width: 1fr;
text-align: center;
margin-bottom: 10rpx;
}
+.notes-input {
+ width: calc(100% - 40rpx);
+ margin: 25rpx 0;
+ border: 1px solid #eee;
+ border-radius: 5px;
+ padding: 5px;
+ color: #000;
+ padding: 20rpx;
+}
diff --git a/src/pages/point-book-list.vue b/src/pages/point-book-list.vue
index 50aafdb..2a4b301 100644
--- a/src/pages/point-book-list.vue
+++ b/src/pages/point-book-list.vue
@@ -5,14 +5,17 @@ import SModal from "@/components/SModal.vue";
import EditOption from "@/components/EditOption.vue";
import PointRecord from "@/components/PointRecord.vue";
import ScrollList from "@/components/ScrollList.vue";
-import { getPointBookListAPI } from "@/apis";
+import ScreenHint2 from "@/components/ScreenHint2.vue";
+import { getPointBookListAPI, removePointRecord } from "@/apis";
+const showTip = ref(false);
const bowType = ref({});
const distance = ref(0);
const bowtargetType = ref({});
const showModal = ref(false);
const selectorIndex = ref(0);
const list = ref([]);
+const removeId = ref("");
const onListLoading = async (page) => {
const result = await getPointBookListAPI(
@@ -34,6 +37,22 @@ const openSelector = (index) => {
showModal.value = true;
};
+const onLongPress = (item) => {
+ removeId.value = item.id;
+ showTip.value = true;
+};
+
+const confirmRemove = async () => {
+ try {
+ showTip.value = false;
+ await removePointRecord(removeId.value);
+ list.value = list.value.filter((it) => it.id !== removeId.value);
+ uni.showToast({ title: "已删除", icon: "none" });
+ } catch (e) {
+ uni.showToast({ title: "删除失败,请重试", icon: "none" });
+ }
+};
+
const onSelectOption = (itemIndex, value) => {
if (itemIndex === 0) {
bowType.value = value.name === bowType.value.name ? {} : value;
@@ -78,7 +97,7 @@ const onSelectOption = (itemIndex, value) => {
-
+
暂无数据
@@ -119,6 +138,15 @@ const onSelectOption = (itemIndex, value) => {
/>
+
+
+ 确认删除该记录吗
+
+
+
+
+
+
@@ -186,4 +214,34 @@ const onSelectOption = (itemIndex, value) => {
color: #999999;
font-size: 14px;
}
+.tip-content {
+ width: 100%;
+ padding: 25px;
+ display: flex;
+ flex-direction: column;
+ color: #000;
+}
+.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;
+ color: #000;
+}
+.tip-content > view > button:last-child {
+ background: #fed847;
+}
diff --git a/src/static/edit.png b/src/static/edit.png
new file mode 100644
index 0000000..f583708
Binary files /dev/null and b/src/static/edit.png differ