BUG修改

This commit is contained in:
kron
2025-11-05 13:38:37 +08:00
parent ecdf4a76f4
commit 2e9d257faa
8 changed files with 74 additions and 46 deletions

View File

@@ -72,13 +72,14 @@ const onMeterChange = (e) => {
props.onSelect(props.itemIndex, e.detail.value); props.onSelect(props.itemIndex, e.detail.value);
}; };
const onSetsChange = (e) => { const onSetsChange = (e) => {
sets.value = e.detail.value; if (!e.detail.value) return;
sets.value = Math.min(30, Number(e.detail.value));
if (!sets.value) return; if (!sets.value) return;
if (secondSelectIndex.value !== -1) { if (secondSelectIndex.value !== -1) {
props.onSelect( props.onSelect(
props.itemIndex, props.itemIndex,
`${sets.value}/${ `${sets.value}/${
secondSelectIndex === 99 secondSelectIndex.value === 99
? arrowAmount.value ? arrowAmount.value
: groupArrows[secondSelectIndex.value] : groupArrows[secondSelectIndex.value]
}` }`
@@ -86,7 +87,8 @@ const onSetsChange = (e) => {
} }
}; };
const onArrowAmountChange = (e) => { const onArrowAmountChange = (e) => {
arrowAmount.value = e.detail.value; if (!e.detail.value) return;
arrowAmount.value = Math.min(60, Number(e.detail.value));
if (!arrowAmount.value) return; if (!arrowAmount.value) return;
if (selectedIndex.value !== -1) { if (selectedIndex.value !== -1) {
props.onSelect( props.onSelect(
@@ -178,22 +180,21 @@ onMounted(async () => {
}" }"
> >
<view @click="() => onExpand(itemIndex, !expand)"> <view @click="() => onExpand(itemIndex, !expand)">
<text :style="{ opacity: expand ? 1 : 0 }">{{ <view></view>
itemIndex !== 3 ? itemTexts[itemIndex] : "选择组"
}}</text>
<block> <block>
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 0">{{ <text v-if="expand" :style="{ color: '#999', fontWeight: 'normal' }">{{
itemIndex !== 3 ? itemTexts[itemIndex] : "选择组"
}}</text>
<text v-if="!expand && itemIndex === 0">{{
value || itemTexts[itemIndex] value || itemTexts[itemIndex]
}}</text> }}</text>
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 1">{{ <text v-if="!expand && itemIndex === 1">{{
value && value > 0 ? value + "米" : itemTexts[itemIndex] value && value > 0 ? value + "米" : itemTexts[itemIndex]
}}</text> }}</text>
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 2">{{ <text v-if="!expand && itemIndex === 2">{{
value || itemTexts[itemIndex] value || itemTexts[itemIndex]
}}</text> }}</text>
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 3">{{ <text v-if="!expand && itemIndex === 3">{{ formatSetAndAmount }}</text>
formatSetAndAmount
}}</text>
</block> </block>
<button hover-class="none"> <button hover-class="none">
<image <image
@@ -235,10 +236,12 @@ onMounted(async () => {
}" }"
> >
<input <input
v-model="meter"
type="number"
placeholder="自定义" placeholder="自定义"
placeholder-style="color: #DDDDDD" placeholder-style="color: #DDDDDD"
@focus="() => (selectedIndex = 9)" @focus="() => (selectedIndex = 9)"
@change="onMeterChange" @blur="onMeterChange"
/> />
<text></text> <text></text>
</view> </view>
@@ -275,17 +278,23 @@ onMounted(async () => {
}" }"
> >
<input <input
placeholder="自定义" placeholder="1 ~ 30"
type="number" type="number"
placeholder-style="color: #DDDDDD" placeholder-style="color: #DDDDDD"
v-model="sets"
@focus="() => (selectedIndex = 99)" @focus="() => (selectedIndex = 99)"
@change="onSetsChange" @blur="onSetsChange"
/> />
<text></text> <text></text>
</view> </view>
</view> </view>
<view <view
:style="{ marginTop: '5px', marginBottom: '10px', color: '#999999' }" :style="{
marginTop: '5px',
marginBottom: '10px',
color: '#999999',
textAlign: 'center',
}"
>选择每组的箭数</view >选择每组的箭数</view
> >
<view class="amount-items"> <view class="amount-items">
@@ -306,11 +315,13 @@ onMounted(async () => {
}" }"
> >
<input <input
placeholder="自定义" placeholder="1 ~ 60"
type="number" type="number"
placeholder-style="color: #DDDDDD" placeholder-style="color: #DDDDDD"
v-model="arrowAmount"
maxlength="99"
@focus="() => (secondSelectIndex = 99)" @focus="() => (secondSelectIndex = 99)"
@change="onArrowAmountChange" @blur="onArrowAmountChange"
/> />
<text></text> <text></text>
</view> </view>
@@ -337,9 +348,8 @@ onMounted(async () => {
justify-content: space-between; justify-content: space-between;
height: 50px; height: 50px;
} }
.container > view:first-child > text:first-child { .container > view:first-child > view:first-child {
width: 85px; width: 85px;
color: #999999;
} }
.container > view:first-child > text:nth-child(2) { .container > view:first-child > text:nth-child(2) {
font-weight: 500; font-weight: 500;

View File

@@ -76,6 +76,9 @@ onMounted(() => {
currentPage.route === "pages/point-book-detail" currentPage.route === "pages/point-book-detail"
) { ) {
pointBook.value = uni.getStorageSync("point-book"); pointBook.value = uni.getStorageSync("point-book");
if (!pointBook.value) {
pointBook.value = uni.getStorageSync("last-point-book");
}
} }
if ( if (
currentPage.route === "pages/team-battle" || currentPage.route === "pages/team-battle" ||

View File

@@ -19,6 +19,19 @@ const targetOptions = ref({});
const canSwipe = computed(() => typeof props.onRemove === "function"); const canSwipe = computed(() => typeof props.onRemove === "function");
const toDetailPage = () => { const toDetailPage = () => {
const config = uni.getStorageSync("point-book-config");
const bowType = config.bowOption.find(
(item) => item.id === props.data.bowType
);
const bowtargetType = config.targetOption.find(
(item) => item.id === props.data.targetType
);
uni.setStorageSync("point-book", {
bowType,
bowtargetType,
distance: props.data.distance,
amountGroup: props.data.groups,
});
uni.navigateTo({ uni.navigateTo({
url: `/pages/point-book-detail?id=${props.data.id}`, url: `/pages/point-book-detail?id=${props.data.id}`,
}); });

View File

@@ -43,7 +43,7 @@ const toEditPage = () => {
bowtargetType.value && bowtargetType.value &&
amountGroup.value amountGroup.value
) { ) {
uni.setStorageSync("point-book", { uni.setStorageSync("last-point-book", {
bowType: bowType.value, bowType: bowType.value,
distance: distance.value, distance: distance.value,
bowtargetType: bowtargetType.value, bowtargetType: bowtargetType.value,
@@ -67,7 +67,7 @@ const toEditPage = () => {
// } // }
// }); // });
onMounted(async () => { onMounted(async () => {
const pointBook = uni.getStorageSync("point-book"); const pointBook = uni.getStorageSync("last-point-book");
if (pointBook) { if (pointBook) {
bowType.value = pointBook.bowType; bowType.value = pointBook.bowType;
distance.value = pointBook.distance; distance.value = pointBook.distance;

View File

@@ -230,7 +230,7 @@ const targetTypeName = computed(() => {
<block v-if="showTip"> <block v-if="showTip">
<text>落点稳定性说明</text> <text>落点稳定性说明</text>
<text <text
>通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text >通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
> >
</block> </block>
<block v-if="showTip2"> <block v-if="showTip2">
@@ -347,7 +347,7 @@ const targetTypeName = computed(() => {
} }
.tip-content { .tip-content {
width: 100%; width: 100%;
padding: 25px; padding: 50rpx 44rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
color: #000; color: #000;
@@ -367,7 +367,7 @@ const targetTypeName = computed(() => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 20rpx; padding: 20rpx;
padding-top: 30rpx; padding-top: 40rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
@@ -376,9 +376,10 @@ const targetTypeName = computed(() => {
justify-content: center; justify-content: center;
} }
.ring-text-groups > view > view:first-child:nth-last-child(2) { .ring-text-groups > view > view:first-child:nth-last-child(2) {
margin-left: 20rpx; margin: 0 30rpx;
width: 90rpx; width: 90rpx;
text-align: center; text-align: center;
justify-content: flex-end;
font-size: 20rpx; font-size: 20rpx;
display: flex; display: flex;
color: #999; color: #999;
@@ -391,21 +392,23 @@ const targetTypeName = computed(() => {
> view:first-child:nth-last-child(2) > view:first-child:nth-last-child(2)
> text:nth-child(2) { > text:nth-child(2) {
font-size: 40rpx; font-size: 40rpx;
/* min-width: 45rpx; */
color: #666; color: #666;
margin-right: 6rpx; margin-right: 6rpx;
margin-top: -5rpx; margin-top: -5rpx;
} }
.ring-text-groups > view > view:last-child { .ring-text-groups > view > view:last-child {
flex: 1; width: 80%;
display: grid; display: flex;
grid-template-columns: repeat(6, auto); flex-wrap: wrap;
grid-gap: 10rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.ring-text-groups > view > view:last-child > text { .ring-text-groups > view > view:last-child > text {
width: 1fr; width: 16.6%;
text-align: center; text-align: center;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-weight: 500;
font-size: 26rpx;
} }
.notes-input { .notes-input {
width: calc(100% - 40rpx); width: calc(100% - 40rpx);

View File

@@ -93,7 +93,7 @@ const shareImage = async () => {
onLoad(async (options) => { onLoad(async (options) => {
if (options.id) { if (options.id) {
const result = await getPointBookDetailAPI(options.id || 195); const result = await getPointBookDetailAPI(options.id || 209);
record.value = result; record.value = result;
notes.value = result.remark || ""; notes.value = result.remark || "";
const config = uni.getStorageSync("point-book-config"); const config = uni.getStorageSync("point-book-config");
@@ -259,9 +259,6 @@ onShareTimeline(async () => {
(selectedIndex === 0 && index !== 0) || (selectedIndex === 0 && index !== 0) ||
(selectedIndex !== 0 && index === selectedIndex) (selectedIndex !== 0 && index === selectedIndex)
" "
:style="{
marginLeft: selectedIndex === 0 && index !== 0 ? '20rpx' : '0',
}"
> >
<text <text
v-for="(arrow, index2) in item.list" v-for="(arrow, index2) in item.list"
@@ -304,7 +301,7 @@ onShareTimeline(async () => {
<block v-if="showTip"> <block v-if="showTip">
<text>落点稳定性说明</text> <text>落点稳定性说明</text>
<text <text
>通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text >通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
> >
</block> </block>
<block v-if="showTip2"> <block v-if="showTip2">
@@ -440,7 +437,7 @@ onShareTimeline(async () => {
} }
.tip-content { .tip-content {
width: 100%; width: 100%;
padding: 25px; padding: 50rpx 44rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
color: #000; color: #000;
@@ -488,7 +485,7 @@ onShareTimeline(async () => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 20rpx; padding: 20rpx;
padding-top: 30rpx; padding-top: 40rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
@@ -497,9 +494,10 @@ onShareTimeline(async () => {
justify-content: center; justify-content: center;
} }
.ring-text-groups > view > view:first-child:nth-last-child(2) { .ring-text-groups > view > view:first-child:nth-last-child(2) {
margin-left: 20rpx; margin: 0 30rpx;
width: 90rpx; width: 90rpx;
text-align: center; text-align: center;
justify-content: flex-end;
font-size: 20rpx; font-size: 20rpx;
display: flex; display: flex;
color: #999; color: #999;
@@ -512,19 +510,19 @@ onShareTimeline(async () => {
> view:first-child:nth-last-child(2) > view:first-child:nth-last-child(2)
> text:nth-child(2) { > text:nth-child(2) {
font-size: 40rpx; font-size: 40rpx;
/* min-width: 45rpx; */
color: #666; color: #666;
margin-right: 6rpx; margin-right: 6rpx;
margin-top: -5rpx; margin-top: -5rpx;
} }
.ring-text-groups > view > view:last-child { .ring-text-groups > view > view:last-child {
flex: 1; width: 80%;
display: grid; display: flex;
grid-template-columns: repeat(6, auto); flex-wrap: wrap;
grid-gap: 10rpx;
margin-bottom: 30rpx; margin-bottom: 30rpx;
} }
.ring-text-groups > view > view:last-child > text { .ring-text-groups > view > view:last-child > text {
width: 1fr; width: 16.6%;
text-align: center; text-align: center;
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-weight: 500; font-weight: 500;

View File

@@ -44,7 +44,7 @@ const onSubmit = async () => {
currentGroup.value++; currentGroup.value++;
currentArrow.value = 0; currentArrow.value = 0;
} else { } else {
const pointBook = uni.getStorageSync("point-book"); const pointBook = uni.getStorageSync("last-point-book");
const res = await savePointBookAPI( const res = await savePointBookAPI(
pointBook.bowType.id, pointBook.bowType.id,
pointBook.distance, pointBook.distance,
@@ -75,7 +75,7 @@ const onEditDone = (arrow) => {
}; };
onMounted(() => { onMounted(() => {
const pointBook = uni.getStorageSync("point-book"); const pointBook = uni.getStorageSync("last-point-book");
if (pointBook.bowtargetType) { if (pointBook.bowtargetType) {
bowtarget.value = pointBook.bowtargetType; bowtarget.value = pointBook.bowtargetType;
if (bowtarget.value.id > 3) { if (bowtarget.value.id > 3) {

View File

@@ -150,6 +150,7 @@ watch(
); );
onShow(async () => { onShow(async () => {
uni.removeStorageSync("point-book");
if (user.value.id) loadData(); if (user.value.id) loadData();
}); });