BUG修改
This commit is contained in:
@@ -72,13 +72,14 @@ const onMeterChange = (e) => {
|
||||
props.onSelect(props.itemIndex, e.detail.value);
|
||||
};
|
||||
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 (secondSelectIndex.value !== -1) {
|
||||
props.onSelect(
|
||||
props.itemIndex,
|
||||
`${sets.value}/${
|
||||
secondSelectIndex === 99
|
||||
secondSelectIndex.value === 99
|
||||
? arrowAmount.value
|
||||
: groupArrows[secondSelectIndex.value]
|
||||
}`
|
||||
@@ -86,7 +87,8 @@ const onSetsChange = (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 (selectedIndex.value !== -1) {
|
||||
props.onSelect(
|
||||
@@ -178,22 +180,21 @@ onMounted(async () => {
|
||||
}"
|
||||
>
|
||||
<view @click="() => onExpand(itemIndex, !expand)">
|
||||
<text :style="{ opacity: expand ? 1 : 0 }">{{
|
||||
itemIndex !== 3 ? itemTexts[itemIndex] : "选择组"
|
||||
}}</text>
|
||||
<view></view>
|
||||
<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]
|
||||
}}</text>
|
||||
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 1">{{
|
||||
<text v-if="!expand && itemIndex === 1">{{
|
||||
value && value > 0 ? value + "米" : itemTexts[itemIndex]
|
||||
}}</text>
|
||||
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 2">{{
|
||||
<text v-if="!expand && itemIndex === 2">{{
|
||||
value || itemTexts[itemIndex]
|
||||
}}</text>
|
||||
<text :style="{ opacity: expand ? 0 : 1 }" v-if="itemIndex === 3">{{
|
||||
formatSetAndAmount
|
||||
}}</text>
|
||||
<text v-if="!expand && itemIndex === 3">{{ formatSetAndAmount }}</text>
|
||||
</block>
|
||||
<button hover-class="none">
|
||||
<image
|
||||
@@ -235,10 +236,12 @@ onMounted(async () => {
|
||||
}"
|
||||
>
|
||||
<input
|
||||
v-model="meter"
|
||||
type="number"
|
||||
placeholder="自定义"
|
||||
placeholder-style="color: #DDDDDD"
|
||||
@focus="() => (selectedIndex = 9)"
|
||||
@change="onMeterChange"
|
||||
@blur="onMeterChange"
|
||||
/>
|
||||
<text>米</text>
|
||||
</view>
|
||||
@@ -275,17 +278,23 @@ onMounted(async () => {
|
||||
}"
|
||||
>
|
||||
<input
|
||||
placeholder="自定义"
|
||||
placeholder="1 ~ 30"
|
||||
type="number"
|
||||
placeholder-style="color: #DDDDDD"
|
||||
v-model="sets"
|
||||
@focus="() => (selectedIndex = 99)"
|
||||
@change="onSetsChange"
|
||||
@blur="onSetsChange"
|
||||
/>
|
||||
<text>组</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
:style="{ marginTop: '5px', marginBottom: '10px', color: '#999999' }"
|
||||
:style="{
|
||||
marginTop: '5px',
|
||||
marginBottom: '10px',
|
||||
color: '#999999',
|
||||
textAlign: 'center',
|
||||
}"
|
||||
>选择每组的箭数</view
|
||||
>
|
||||
<view class="amount-items">
|
||||
@@ -306,11 +315,13 @@ onMounted(async () => {
|
||||
}"
|
||||
>
|
||||
<input
|
||||
placeholder="自定义"
|
||||
placeholder="1 ~ 60"
|
||||
type="number"
|
||||
placeholder-style="color: #DDDDDD"
|
||||
v-model="arrowAmount"
|
||||
maxlength="99"
|
||||
@focus="() => (secondSelectIndex = 99)"
|
||||
@change="onArrowAmountChange"
|
||||
@blur="onArrowAmountChange"
|
||||
/>
|
||||
<text>箭</text>
|
||||
</view>
|
||||
@@ -337,9 +348,8 @@ onMounted(async () => {
|
||||
justify-content: space-between;
|
||||
height: 50px;
|
||||
}
|
||||
.container > view:first-child > text:first-child {
|
||||
.container > view:first-child > view:first-child {
|
||||
width: 85px;
|
||||
color: #999999;
|
||||
}
|
||||
.container > view:first-child > text:nth-child(2) {
|
||||
font-weight: 500;
|
||||
|
||||
@@ -76,6 +76,9 @@ onMounted(() => {
|
||||
currentPage.route === "pages/point-book-detail"
|
||||
) {
|
||||
pointBook.value = uni.getStorageSync("point-book");
|
||||
if (!pointBook.value) {
|
||||
pointBook.value = uni.getStorageSync("last-point-book");
|
||||
}
|
||||
}
|
||||
if (
|
||||
currentPage.route === "pages/team-battle" ||
|
||||
|
||||
@@ -19,6 +19,19 @@ const targetOptions = ref({});
|
||||
const canSwipe = computed(() => typeof props.onRemove === "function");
|
||||
|
||||
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({
|
||||
url: `/pages/point-book-detail?id=${props.data.id}`,
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ const toEditPage = () => {
|
||||
bowtargetType.value &&
|
||||
amountGroup.value
|
||||
) {
|
||||
uni.setStorageSync("point-book", {
|
||||
uni.setStorageSync("last-point-book", {
|
||||
bowType: bowType.value,
|
||||
distance: distance.value,
|
||||
bowtargetType: bowtargetType.value,
|
||||
@@ -67,7 +67,7 @@ const toEditPage = () => {
|
||||
// }
|
||||
// });
|
||||
onMounted(async () => {
|
||||
const pointBook = uni.getStorageSync("point-book");
|
||||
const pointBook = uni.getStorageSync("last-point-book");
|
||||
if (pointBook) {
|
||||
bowType.value = pointBook.bowType;
|
||||
distance.value = pointBook.distance;
|
||||
|
||||
@@ -230,7 +230,7 @@ const targetTypeName = computed(() => {
|
||||
<block v-if="showTip">
|
||||
<text>落点稳定性说明</text>
|
||||
<text
|
||||
>通过计算每支箭与其他箭的平均距离衡一量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
|
||||
>通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
|
||||
>
|
||||
</block>
|
||||
<block v-if="showTip2">
|
||||
@@ -347,7 +347,7 @@ const targetTypeName = computed(() => {
|
||||
}
|
||||
.tip-content {
|
||||
width: 100%;
|
||||
padding: 25px;
|
||||
padding: 50rpx 44rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #000;
|
||||
@@ -367,7 +367,7 @@ const targetTypeName = computed(() => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20rpx;
|
||||
padding-top: 30rpx;
|
||||
padding-top: 40rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
@@ -376,9 +376,10 @@ const targetTypeName = computed(() => {
|
||||
justify-content: center;
|
||||
}
|
||||
.ring-text-groups > view > view:first-child:nth-last-child(2) {
|
||||
margin-left: 20rpx;
|
||||
margin: 0 30rpx;
|
||||
width: 90rpx;
|
||||
text-align: center;
|
||||
justify-content: flex-end;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
color: #999;
|
||||
@@ -391,21 +392,23 @@ const targetTypeName = computed(() => {
|
||||
> view:first-child:nth-last-child(2)
|
||||
> text:nth-child(2) {
|
||||
font-size: 40rpx;
|
||||
/* min-width: 45rpx; */
|
||||
color: #666;
|
||||
margin-right: 6rpx;
|
||||
margin-top: -5rpx;
|
||||
}
|
||||
.ring-text-groups > view > view:last-child {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, auto);
|
||||
grid-gap: 10rpx;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.ring-text-groups > view > view:last-child > text {
|
||||
width: 1fr;
|
||||
width: 16.6%;
|
||||
text-align: center;
|
||||
margin-bottom: 10rpx;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
.notes-input {
|
||||
width: calc(100% - 40rpx);
|
||||
|
||||
@@ -93,7 +93,7 @@ const shareImage = async () => {
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.id) {
|
||||
const result = await getPointBookDetailAPI(options.id || 195);
|
||||
const result = await getPointBookDetailAPI(options.id || 209);
|
||||
record.value = result;
|
||||
notes.value = result.remark || "";
|
||||
const config = uni.getStorageSync("point-book-config");
|
||||
@@ -259,9 +259,6 @@ onShareTimeline(async () => {
|
||||
(selectedIndex === 0 && index !== 0) ||
|
||||
(selectedIndex !== 0 && index === selectedIndex)
|
||||
"
|
||||
:style="{
|
||||
marginLeft: selectedIndex === 0 && index !== 0 ? '20rpx' : '0',
|
||||
}"
|
||||
>
|
||||
<text
|
||||
v-for="(arrow, index2) in item.list"
|
||||
@@ -304,7 +301,7 @@ onShareTimeline(async () => {
|
||||
<block v-if="showTip">
|
||||
<text>落点稳定性说明</text>
|
||||
<text
|
||||
>通过计算每支箭与其他箭的平均距离衡一量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
|
||||
>通过计算每支箭与其他箭的平均距离衡量射箭的稳定性,数字越小则说明射箭越稳定。该数据只能在用户标记落点的情况下生成。</text
|
||||
>
|
||||
</block>
|
||||
<block v-if="showTip2">
|
||||
@@ -440,7 +437,7 @@ onShareTimeline(async () => {
|
||||
}
|
||||
.tip-content {
|
||||
width: 100%;
|
||||
padding: 25px;
|
||||
padding: 50rpx 44rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #000;
|
||||
@@ -488,7 +485,7 @@ onShareTimeline(async () => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20rpx;
|
||||
padding-top: 30rpx;
|
||||
padding-top: 40rpx;
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
@@ -497,9 +494,10 @@ onShareTimeline(async () => {
|
||||
justify-content: center;
|
||||
}
|
||||
.ring-text-groups > view > view:first-child:nth-last-child(2) {
|
||||
margin-left: 20rpx;
|
||||
margin: 0 30rpx;
|
||||
width: 90rpx;
|
||||
text-align: center;
|
||||
justify-content: flex-end;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
color: #999;
|
||||
@@ -512,19 +510,19 @@ onShareTimeline(async () => {
|
||||
> view:first-child:nth-last-child(2)
|
||||
> text:nth-child(2) {
|
||||
font-size: 40rpx;
|
||||
/* min-width: 45rpx; */
|
||||
color: #666;
|
||||
margin-right: 6rpx;
|
||||
margin-top: -5rpx;
|
||||
}
|
||||
.ring-text-groups > view > view:last-child {
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, auto);
|
||||
grid-gap: 10rpx;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.ring-text-groups > view > view:last-child > text {
|
||||
width: 1fr;
|
||||
width: 16.6%;
|
||||
text-align: center;
|
||||
margin-bottom: 10rpx;
|
||||
font-weight: 500;
|
||||
|
||||
@@ -44,7 +44,7 @@ const onSubmit = async () => {
|
||||
currentGroup.value++;
|
||||
currentArrow.value = 0;
|
||||
} else {
|
||||
const pointBook = uni.getStorageSync("point-book");
|
||||
const pointBook = uni.getStorageSync("last-point-book");
|
||||
const res = await savePointBookAPI(
|
||||
pointBook.bowType.id,
|
||||
pointBook.distance,
|
||||
@@ -75,7 +75,7 @@ const onEditDone = (arrow) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
const pointBook = uni.getStorageSync("point-book");
|
||||
const pointBook = uni.getStorageSync("last-point-book");
|
||||
if (pointBook.bowtargetType) {
|
||||
bowtarget.value = pointBook.bowtargetType;
|
||||
if (bowtarget.value.id > 3) {
|
||||
|
||||
@@ -150,6 +150,7 @@ watch(
|
||||
);
|
||||
|
||||
onShow(async () => {
|
||||
uni.removeStorageSync("point-book");
|
||||
if (user.value.id) loadData();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user