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