细节完善
This commit is contained in:
@@ -238,6 +238,7 @@ onMounted(async () => {
|
|||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-btn {
|
.edit-btn {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
|
import { onShow } from "@dcloudio/uni-app";
|
||||||
import Container from "@/components/Container.vue";
|
import Container from "@/components/Container.vue";
|
||||||
import EditOption from "@/components/EditOption.vue";
|
import EditOption from "@/components/EditOption.vue";
|
||||||
import SButton from "@/components/SButton.vue";
|
import SButton from "@/components/SButton.vue";
|
||||||
import { getPractiseDataAPI } from "@/apis";
|
import { getPractiseDataAPI } from "@/apis";
|
||||||
|
|
||||||
const clickable = ref(false);
|
const expandIndex = ref(0);
|
||||||
const expandIndex = ref(-1);
|
|
||||||
const bowType = ref({});
|
const bowType = ref({});
|
||||||
const distance = ref(0);
|
const distance = ref(0);
|
||||||
const bowtargetType = ref("");
|
const bowtargetType = ref("");
|
||||||
@@ -35,6 +35,8 @@ const onSelect = (itemIndex, value) => {
|
|||||||
else if (itemIndex === 1) distance.value = value;
|
else if (itemIndex === 1) distance.value = value;
|
||||||
else if (itemIndex === 2) bowtargetType.value = value;
|
else if (itemIndex === 2) bowtargetType.value = value;
|
||||||
else if (itemIndex === 3) amountGroup.value = value;
|
else if (itemIndex === 3) amountGroup.value = value;
|
||||||
|
};
|
||||||
|
const toEditPage = () => {
|
||||||
if (
|
if (
|
||||||
bowType.value &&
|
bowType.value &&
|
||||||
distance.value &&
|
distance.value &&
|
||||||
@@ -47,15 +49,23 @@ const onSelect = (itemIndex, value) => {
|
|||||||
bowtargetType: bowtargetType.value,
|
bowtargetType: bowtargetType.value,
|
||||||
amountGroup: amountGroup.value,
|
amountGroup: amountGroup.value,
|
||||||
});
|
});
|
||||||
clickable.value = true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const toEditPage = () => {
|
|
||||||
expandIndex.value = -1;
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/point-book-edit",
|
url: "/pages/point-book-edit",
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请完善信息",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
onShow(async () => {
|
||||||
|
const result = await getPractiseDataAPI();
|
||||||
|
if (result) {
|
||||||
|
days.value = result.total_day || 0;
|
||||||
|
arrows.value = result.total_arrow || 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const pointBook = uni.getStorageSync("point-book");
|
const pointBook = uni.getStorageSync("point-book");
|
||||||
if (pointBook) {
|
if (pointBook) {
|
||||||
@@ -63,11 +73,6 @@ onMounted(async () => {
|
|||||||
distance.value = pointBook.distance;
|
distance.value = pointBook.distance;
|
||||||
bowtargetType.value = pointBook.bowtargetType;
|
bowtargetType.value = pointBook.bowtargetType;
|
||||||
}
|
}
|
||||||
const result = await getPractiseDataAPI();
|
|
||||||
if (result) {
|
|
||||||
days.value = result.total_day || 0;
|
|
||||||
arrows.value = result.total_arrow || 0;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -130,15 +135,7 @@ onMounted(async () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view :style="{ marginBottom: '20px' }">
|
<view :style="{ marginBottom: '20px' }">
|
||||||
<SButton
|
<SButton :rounded="50" :onClick="toEditPage">开始计分</SButton>
|
||||||
:rounded="50"
|
|
||||||
:disabled="!clickable"
|
|
||||||
:onClick="toEditPage"
|
|
||||||
disabledColor="#DDDDDD"
|
|
||||||
:color="clickable ? '#000' : '#fff'"
|
|
||||||
>
|
|
||||||
开始计分
|
|
||||||
</SButton>
|
|
||||||
<view class="see-more" @click="toListPage">
|
<view class="see-more" @click="toListPage">
|
||||||
<text>历史计分记录</text>
|
<text>历史计分记录</text>
|
||||||
<image src="../static/enter-arrow-blue.png" mode="widthFix" />
|
<image src="../static/enter-arrow-blue.png" mode="widthFix" />
|
||||||
|
|||||||
Reference in New Issue
Block a user