接口调试完毕
This commit is contained in:
@@ -7,15 +7,20 @@ import PointRecord from "@/components/PointRecord.vue";
|
||||
import ScrollList from "@/components/ScrollList.vue";
|
||||
import { getPointBookListAPI } from "@/apis";
|
||||
|
||||
const bowType = ref("");
|
||||
const bowType = ref({});
|
||||
const distance = ref(0);
|
||||
const bowtargetType = ref("");
|
||||
const bowtargetType = ref({});
|
||||
const showModal = ref(false);
|
||||
const selectorIndex = ref(0);
|
||||
const list = ref([]);
|
||||
|
||||
const onListLoading = async (page) => {
|
||||
const result = await getPointBookListAPI(page, 1);
|
||||
const result = await getPointBookListAPI(
|
||||
page,
|
||||
bowType.value.id,
|
||||
distance.value,
|
||||
bowtargetType.value.id
|
||||
);
|
||||
if (page === 1) {
|
||||
list.value = result;
|
||||
} else {
|
||||
@@ -31,12 +36,14 @@ const openSelector = (index) => {
|
||||
|
||||
const onSelectOption = (itemIndex, value) => {
|
||||
if (itemIndex === 0) {
|
||||
bowType.value = value;
|
||||
bowType.value = value.name === bowType.value.name ? {} : value;
|
||||
} else if (itemIndex === 1) {
|
||||
distance.value = value;
|
||||
distance.value = value === distance.value ? 0 : value;
|
||||
} else if (itemIndex === 2) {
|
||||
bowtargetType.value = value;
|
||||
bowtargetType.value = value.name === bowtargetType.value.name ? {} : value;
|
||||
}
|
||||
showModal.value = false;
|
||||
onListLoading(1);
|
||||
};
|
||||
const toDetailPage = (id) => {
|
||||
uni.navigateTo({
|
||||
@@ -55,32 +62,32 @@ const toDetailPage = (id) => {
|
||||
<view class="container">
|
||||
<view class="selectors">
|
||||
<view @click="() => openSelector(0)">
|
||||
<text :style="{ color: bowType ? '#000' : '#999' }">{{
|
||||
bowType || "请选择"
|
||||
<text :style="{ color: bowType.name ? '#000' : '#999' }">{{
|
||||
bowType.name || "请选择"
|
||||
}}</text>
|
||||
<image src="../static/arrow-grey.png" mode="widthFix" />
|
||||
</view>
|
||||
<view @click="() => openSelector(1)">
|
||||
<text :style="{ color: bowType ? '#000' : '#999' }">{{
|
||||
<text :style="{ color: distance ? '#000' : '#999' }">{{
|
||||
distance ? distance + " 米" : "请选择"
|
||||
}}</text>
|
||||
<image src="../static/arrow-grey.png" mode="widthFix" />
|
||||
</view>
|
||||
<view @click="() => openSelector(2)">
|
||||
<text :style="{ color: bowType ? '#000' : '#999' }">{{
|
||||
bowtargetType || "请选择"
|
||||
<text :style="{ color: bowtargetType.name ? '#000' : '#999' }">{{
|
||||
bowtargetType.name || "请选择"
|
||||
}}</text>
|
||||
<image src="../static/arrow-grey.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="point-records">
|
||||
<ScrollList :onLoading="onMatchLoading">
|
||||
<ScrollList :onLoading="onListLoading">
|
||||
<view
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="() => toDetailPage(item.id)"
|
||||
>
|
||||
<PointRecord />
|
||||
<PointRecord :data="item" />
|
||||
</view>
|
||||
</ScrollList>
|
||||
</view>
|
||||
@@ -99,6 +106,7 @@ const toDetailPage = (id) => {
|
||||
:expand="true"
|
||||
:noArrow="true"
|
||||
:onSelect="onSelectOption"
|
||||
:value="bowType.name"
|
||||
/>
|
||||
<EditOption
|
||||
v-show="selectorIndex === 1"
|
||||
@@ -106,6 +114,7 @@ const toDetailPage = (id) => {
|
||||
:expand="true"
|
||||
:noArrow="true"
|
||||
:onSelect="onSelectOption"
|
||||
:value="distance + ''"
|
||||
/>
|
||||
<EditOption
|
||||
v-show="selectorIndex === 2"
|
||||
@@ -113,6 +122,7 @@ const toDetailPage = (id) => {
|
||||
:expand="true"
|
||||
:noArrow="true"
|
||||
:onSelect="onSelectOption"
|
||||
:value="bowtargetType.name"
|
||||
/>
|
||||
</view>
|
||||
</SModal>
|
||||
@@ -170,5 +180,6 @@ const toDetailPage = (id) => {
|
||||
}
|
||||
.point-records {
|
||||
padding: 15px;
|
||||
height: calc(100% - 30px);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user