计分本配置接口接入
This commit is contained in:
@@ -12,17 +12,20 @@ const amount = ref(0);
|
||||
const currentGroup = ref(1);
|
||||
const currentArrow = ref(0);
|
||||
const arrowGroups = ref({});
|
||||
const ringColors = [
|
||||
"#FADB80",
|
||||
"#FADB80",
|
||||
"#FADB80",
|
||||
"#F97E81",
|
||||
"#F97E81",
|
||||
"#7AC7FF",
|
||||
"#7AC7FF",
|
||||
"#9B9B9B",
|
||||
"#9B9B9B",
|
||||
];
|
||||
const bowtarget = ref({});
|
||||
const ringTypes = ref([
|
||||
{ ring: "X", color: "#FADB80" },
|
||||
{ ring: "10", color: "#FADB80" },
|
||||
{ ring: "9", color: "#FADB80" },
|
||||
{ ring: "8", color: "#F97E81" },
|
||||
{ ring: "7", color: "#F97E81" },
|
||||
{ ring: "6", color: "#7AC7FF" },
|
||||
{ ring: "5", color: "#7AC7FF" },
|
||||
{ ring: "4", color: "#9B9B9B" },
|
||||
{ ring: "3", color: "#9B9B9B" },
|
||||
{ ring: "2", color: "#d8d8d8" },
|
||||
{ ring: "1", color: "#d8d8d8" },
|
||||
]);
|
||||
|
||||
const onEdit = (arrows) => {
|
||||
arrowGroups.value[currentGroup.value][currentArrow.value] = { ring };
|
||||
@@ -61,6 +64,15 @@ const onEditDone = (arrow) => {
|
||||
|
||||
onMounted(() => {
|
||||
const pointBook = uni.getStorageSync("point-book");
|
||||
if (pointBook.bowtargetType) {
|
||||
bowtarget.value = pointBook.bowtargetType;
|
||||
if (bowtarget.value.id > 3) {
|
||||
ringTypes.value = ringTypes.value.slice(0, 6);
|
||||
if (bowtarget.value.id > 8) {
|
||||
ringTypes.value = ringTypes.value.slice(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pointBook.amountGroup) {
|
||||
groups.value = Number(pointBook.amountGroup.split("/")[0]);
|
||||
amount.value = Number(pointBook.amountGroup.split("/")[1]);
|
||||
@@ -82,6 +94,8 @@ onMounted(() => {
|
||||
<BowTargetEdit
|
||||
:onChange="onEditDone"
|
||||
:arrows="arrowGroups[currentGroup]"
|
||||
:id="bowtarget.id"
|
||||
:src="bowtarget.icon"
|
||||
/>
|
||||
<view class="title-bar">
|
||||
<view>
|
||||
@@ -114,15 +128,18 @@ onMounted(() => {
|
||||
</view>
|
||||
<text>输入分值的情况下,系统不提供落点稳定性分</text>
|
||||
<view class="bow-rings">
|
||||
<view @click="() => onClickRing('X')">X</view>
|
||||
<view
|
||||
v-for="i in 10"
|
||||
:key="i"
|
||||
@click="() => onClickRing(11 - i)"
|
||||
:style="{ backgroundColor: ringColors[i] || '#d8d8d8' }"
|
||||
>{{ 11 - i }}</view
|
||||
v-for="(item, index) in ringTypes"
|
||||
:key="index"
|
||||
@click="() => onClickRing(item.ring)"
|
||||
:style="{ backgroundColor: item.color }"
|
||||
>{{ item.ring }}</view
|
||||
>
|
||||
<view
|
||||
:style="{ backgroundColor: '#d8d8d8' }"
|
||||
@click="() => onClickRing('M')"
|
||||
>M</view
|
||||
>
|
||||
<view @click="() => onClickRing('M')">M</view>
|
||||
</view>
|
||||
<ScreenHint2 :show="showTip">
|
||||
<view class="tip-content">
|
||||
@@ -188,9 +205,6 @@ onMounted(() => {
|
||||
color: #fff;
|
||||
background-color: #d8d8d8;
|
||||
}
|
||||
.bow-rings > view:first-child {
|
||||
background-color: #fadb80;
|
||||
}
|
||||
.tip-content {
|
||||
width: 100%;
|
||||
padding: 25px;
|
||||
|
||||
Reference in New Issue
Block a user