diff --git a/src/apis.js b/src/apis.js
index 31add74..16995f0 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -113,11 +113,12 @@ export const startRoomAPI = (number) => {
return request("POST", "/user/room/start", { number });
};
-export const getPractiseResultListAPI = (page = 1, page_size = 10) => {
- return request(
+export const getPractiseResultListAPI = async (page = 1, page_size = 15) => {
+ const reuslt = await request(
"GET",
`/user/practice/list?page=${page}&page_size=${page_size}`
);
+ return reuslt.list;
};
export const matchGameAPI = (match, gameType, teamSize) => {
diff --git a/src/components/Container.vue b/src/components/Container.vue
index 3a32b0c..52cc24a 100644
--- a/src/components/Container.vue
+++ b/src/components/Container.vue
@@ -15,6 +15,10 @@ defineProps({
type: Function,
default: null,
},
+ overflow: {
+ type: String,
+ default: "auto",
+ },
});
const isIos = ref(true);
onMounted(() => {
@@ -29,7 +33,7 @@ onMounted(() => {
@@ -40,11 +44,9 @@ onMounted(() => {
.content {
width: 100vw;
overflow-x: hidden;
- overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
- padding-bottom: 10px;
}
diff --git a/src/components/Header.vue b/src/components/Header.vue
index 4bf3d27..de2c4f3 100644
--- a/src/components/Header.vue
+++ b/src/components/Header.vue
@@ -36,7 +36,7 @@ onMounted(() => {
-
+
diff --git a/src/components/ScrollList.vue b/src/components/ScrollList.vue
new file mode 100644
index 0000000..d60d035
--- /dev/null
+++ b/src/components/ScrollList.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+ 加载中...
+ 我是有底线的
+
+
+
+
diff --git a/src/pages/my-growth.vue b/src/pages/my-growth.vue
index d5c579e..1a217fd 100644
--- a/src/pages/my-growth.vue
+++ b/src/pages/my-growth.vue
@@ -3,6 +3,7 @@ import { onMounted } from "vue";
import Container from "@/components/Container.vue";
import Avatar from "@/components/Avatar.vue";
import BowData from "@/components/BowData.vue";
+import ScrollList from "@/components/ScrollList.vue";
import {
getBattleListAPI,
getPractiseResultListAPI,
@@ -12,32 +13,12 @@ import {
import { ref } from "vue";
const selectedIndex = ref(0);
-const matchPage = ref(1);
const matchList = ref([]);
-const battlePage = ref(1);
const battleList = ref([]);
const practiseList = ref([]);
const showBowData = ref(false);
const arrows = ref([]);
-const handleSelect = async (index) => {
- selectedIndex.value = index;
- if (index === 0 && matchList.value.length === 0) {
- const result = await getBattleListAPI(matchPage.value, 2);
- matchList.value = result;
- matchPage.value += 1;
- }
- if (index === 1 && battleList.value.length === 0) {
- const result = await getBattleListAPI(battlePage.value, 1);
- battleList.value = result;
- battlePage.value += 1;
- }
- if (index === 2 && practiseList.value.length === 0) {
- const result = await getPractiseResultListAPI();
- practiseList.value = result.list;
- }
-};
-
const toMatchDetail = (id) => {
uni.navigateTo({
url: `/pages/match-detail?id=${id}`,
@@ -48,146 +29,157 @@ const getPractiseDetail = async (id) => {
arrows.value = JSON.parse(result.UserPracticeRound.arrows);
showBowData.value = true;
};
-onMounted(async () => {
- const result = await getBattleListAPI(matchPage.value, 2);
- matchList.value = result;
- matchPage.value += 1;
-});
+const onMatchLoading = async (page) => {
+ const result = await getBattleListAPI(page, 2);
+ if (page === 1) {
+ matchList.value = result;
+ } else {
+ matchList.value = matchList.value.concat(result);
+ }
+ return result.length;
+};
+const onBattleLoading = async (page) => {
+ const result = await getBattleListAPI(page, 1);
+ if (page === 1) {
+ battleList.value = result;
+ } else {
+ battleList.value = battleList.value.concat(result);
+ }
+ return result.length;
+};
+const onPractiseLoading = async (page) => {
+ const result = await getPractiseResultListAPI(page);
+ if (page === 1) {
+ practiseList.value = result;
+ } else {
+ practiseList.value = practiseList.value.concat(result);
+ }
+ return result.length;
+};
-
-
-
-
- {{ rankType }}
-
+
+
+ (selectedIndex = index)"
+ >
+ {{ rankType }}
-
+
+
+
toMatchDetail(item.battleId)"
>
- toMatchDetail(item.battleId)"
- >
-
-
-
-
-
- {{ item.bluePlayers[0].name }}
-
-
-
-
-
-
- {{ item.redPlayers[0].name }}
-
-
-
-
-
-
-
- {{ p.name }}
-
-
+
-
-
- toMatchDetail(item.battleId)"
- >
-
-
-
-
- {{ p.name }}
+
+
+
+
+ {{ item.bluePlayers[0].name }}
-
-
-
-
- {{ p.name }}
+
+
+
+
+ {{ item.redPlayers[0].name }}
+
+
+
+
+
+
+ {{ p.name }}
+
+
toMatchDetail(item.battleId)"
>
- getPractiseDetail(item.id)"
- >
- 单组练习 {{ item.createdAt }}
+
+
+
+
+ {{ p.name }}
+
+
+
+
+
+
+ {{ p.name }}
+
+
-
-
+
+
+ getPractiseDetail(item.id)"
+ >
+ 单组练习 {{ item.createdAt }}
+
+
+
+
@@ -209,8 +201,13 @@ onMounted(async () => {
text-align: center;
border-radius: 20px;
}
-.contents > view {
+.contents {
width: 100%;
+ height: calc(100% - 50px);
+}
+.contents > scroll-view {
+ width: 100%;
+ height: 100%;
display: flex;
flex-direction: column;
}