细节修改

This commit is contained in:
kron
2025-11-11 10:56:53 +08:00
parent dfc62c7e3f
commit 6df7986c47
2 changed files with 8 additions and 11 deletions

View File

@@ -73,7 +73,7 @@ const onMeterChange = (e) => {
};
const onSetsChange = (e) => {
if (!e.detail.value) return;
sets.value = Math.min(30, Number(e.detail.value));
sets.value = Math.min(30, Math.max(1, Number(e.detail.value)));
if (!sets.value) return;
if (secondSelectIndex.value !== -1) {
props.onSelect(
@@ -88,7 +88,7 @@ const onSetsChange = (e) => {
};
const onArrowAmountChange = (e) => {
if (!e.detail.value) return;
arrowAmount.value = Math.min(60, Number(e.detail.value));
arrowAmount.value = Math.min(60, Math.max(1, Number(e.detail.value)));
if (!arrowAmount.value) return;
if (selectedIndex.value !== -1) {
props.onSelect(
@@ -153,8 +153,10 @@ const loadConfig = () => {
const formatSetAndAmount = computed(() => {
if (selectedIndex.value === -1 || secondSelectIndex.value === -1)
return itemTexts[props.itemIndex];
if(selectedIndex.value === 99 && !sets.value) return itemTexts[props.itemIndex];
if(secondSelectIndex.value === 99 && !arrowAmount.value) return itemTexts[props.itemIndex];
if (selectedIndex.value === 99 && !sets.value)
return itemTexts[props.itemIndex];
if (secondSelectIndex.value === 99 && !arrowAmount.value)
return itemTexts[props.itemIndex];
return `${selectedIndex.value === 99 ? sets.value : selectedIndex.value}组/${
secondSelectIndex.value === 99
? arrowAmount.value

View File

@@ -23,7 +23,6 @@ const targetId = ref(0);
const targetSrc = ref("");
const arrows = ref([]);
const notes = ref("");
const draftNotes = ref("");
const record = ref({
groups: [],
user: {},
@@ -43,8 +42,6 @@ const closeTip = () => {
};
const saveNote = async () => {
notes.value = draftNotes.value;
draftNotes.value = "";
showTip3.value = false;
if (record.value.id) {
await addNoteAPI(record.value.id, notes.value);
@@ -309,17 +306,15 @@ onShareTimeline(async () => {
</block>
<block v-if="showTip3">
<text>备注</text>
<text v-if="notes">{{ notes }}</text>
<textarea
v-if="!notes"
v-model="draftNotes"
v-model="notes"
maxlength="300"
rows="4"
class="notes-input"
placeholder="写下本次射箭的补充信息与心得"
placeholder-style="color: #ccc;"
/>
<view v-if="!notes">
<view>
<button hover-class="none" @click="showTip3 = false">取消</button>
<button hover-class="none" @click="saveNote">保存备注</button>
</view>