|
@@ -1,9 +1,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<CommonTopBanner title="乡源人数">
|
|
<CommonTopBanner title="乡源人数">
|
|
|
- <SimplePageContentLoader :loader="villageUserRankListLoader">
|
|
|
|
|
|
|
+ <SimplePageListLoader :loader="villageUserRankListLoader">
|
|
|
<FlexCol gap="gap.lg" padding="space.md">
|
|
<FlexCol gap="gap.lg" padding="space.md">
|
|
|
<Touchable
|
|
<Touchable
|
|
|
- v-for="(item, index) in villageUserRankListLoader.content.value"
|
|
|
|
|
|
|
+ v-for="(item, index) in villageUserRankListLoader.list.value"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
direction="column"
|
|
direction="column"
|
|
|
@click="goDetails(item)"
|
|
@click="goDetails(item)"
|
|
@@ -27,7 +27,7 @@
|
|
|
mode="aspectFill"
|
|
mode="aspectFill"
|
|
|
radius="radius.md"
|
|
radius="radius.md"
|
|
|
/>
|
|
/>
|
|
|
- <Text :text="item.title" fontConfig="contentText" />
|
|
|
|
|
|
|
+ <Text :text="item.name" fontConfig="contentText" />
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
|
<FlexRow center gap="gap.md">
|
|
<FlexRow center gap="gap.md">
|
|
|
<Tag v-if="item.isAdmin" text="管理员" size="small" />
|
|
<Tag v-if="item.isAdmin" text="管理员" size="small" />
|
|
@@ -42,18 +42,18 @@
|
|
|
width="100"
|
|
width="100"
|
|
|
>
|
|
>
|
|
|
<Image src="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" width="30rpx" height="30rpx" mode="aspectFill" />
|
|
<Image src="https://xy.wenlvti.net/app_static/images/village/IconFruit.png" width="30rpx" height="30rpx" mode="aspectFill" />
|
|
|
- <Text :text="item.score" fontConfig="contentText" />
|
|
|
|
|
|
|
+ <Text :text="item.points" fontConfig="contentText" />
|
|
|
</BackgroundBox>
|
|
</BackgroundBox>
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
|
</BackgroundBox>
|
|
</BackgroundBox>
|
|
|
</Touchable>
|
|
</Touchable>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
- </SimplePageContentLoader>
|
|
|
|
|
|
|
+ </SimplePageListLoader>
|
|
|
</CommonTopBanner>
|
|
</CommonTopBanner>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
|
|
|
|
+import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
@@ -66,7 +66,7 @@ import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
|
|
import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
|
|
|
import VillageApi from '@/api/inhert/VillageApi';
|
|
import VillageApi from '@/api/inhert/VillageApi';
|
|
|
-import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
|
|
|
|
|
|
|
+import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
|
villageId: 0,
|
|
villageId: 0,
|
|
@@ -74,16 +74,8 @@ const { querys } = useLoadQuerys({
|
|
|
villageUserRankListLoader.reload();
|
|
villageUserRankListLoader.reload();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const villageUserRankListLoader = useSimpleDataLoader(async () => {
|
|
|
|
|
- const res = (await VillageApi.getVillageVolunteerList(querys.value.villageId))
|
|
|
|
|
- .map((item, i) => ({
|
|
|
|
|
- id: item.id,
|
|
|
|
|
- image: item.image ?? '',
|
|
|
|
|
- title: item.name,
|
|
|
|
|
- score: item.points,
|
|
|
|
|
- isAdmin: item.type === 'admin',
|
|
|
|
|
- }));
|
|
|
|
|
- return res
|
|
|
|
|
|
|
+const villageUserRankListLoader = useSimplePageListLoader(20, async (page, pageSize) => {
|
|
|
|
|
+ return (await VillageApi.getVillageVolunteerList(page, pageSize, querys.value.villageId))
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function goDetails(item: {
|
|
function goDetails(item: {
|