|
|
@@ -56,7 +56,7 @@
|
|
|
:city="currentCity"
|
|
|
:lonlat="currentLocation.currentLonlat.value"
|
|
|
@getCurrentLonlat="currentLocation.getCurrentExactLocation"
|
|
|
- @selectVillage="goDetails"
|
|
|
+ @selectVillage="handleGoVillageDetails"
|
|
|
@regionChanged="currentRegion=$event"
|
|
|
>
|
|
|
<NoticeBar
|
|
|
@@ -132,14 +132,14 @@
|
|
|
<HomeTitle title="乡村排名" showMore @moreClicked="navTo('/pages/home/village/rank/village', {
|
|
|
regionId: currentRegion ?? undefined,
|
|
|
})" />
|
|
|
- <VillageRankList :list="villageRankListLoader.content.value ?? []" :jumpToSingle="false" @goDetails="goDetails" />
|
|
|
+ <VillageRankList :list="villageRankListLoader.content.value ?? []" :jumpToSingle="false" @handleGoVillageDetails="handleGoVillageDetails" />
|
|
|
|
|
|
<HomeTitle title="志愿者排名" showMore :lightCount="3" @moreClicked="navTo('/pages/home/village/rank/volunteer', {
|
|
|
regionId: currentRegion ?? undefined,
|
|
|
})" />
|
|
|
<VillageUserRankList
|
|
|
:list="villageUserRankListLoader.content.value ?? []"
|
|
|
- @goDetails="navTo('/pages/home/village/volunteer/detail', { id: $event.id })"
|
|
|
+ @handleGoVillageDetails="navTo('/pages/home/village/volunteer/detail', { id: $event.id })"
|
|
|
/>
|
|
|
|
|
|
<HomeTitle title="精选记忆">
|
|
|
@@ -157,11 +157,28 @@
|
|
|
</Touchable>
|
|
|
</template>
|
|
|
</HomeTitle>
|
|
|
+
|
|
|
+ <SimplePageListLoader :loader="recommendLoader">
|
|
|
+ <MasonryGrid>
|
|
|
+ <MasonryGridItem
|
|
|
+ v-for="(item, i) in recommendLoader.list.value"
|
|
|
+ :key="i"
|
|
|
+ :width="340"
|
|
|
+ >
|
|
|
+ <IndexCommonImageItem
|
|
|
+ :image="item.image"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.content ?? ''"
|
|
|
+ :userName="item.villageVolunteerName ?? ''"
|
|
|
+ :likes="0"
|
|
|
+ :isLike="false"
|
|
|
+ @click="handleGoRecommendDetails(item)"
|
|
|
+ />
|
|
|
+ </MasonryGridItem>
|
|
|
+ </MasonryGrid>
|
|
|
+ </SimplePageListLoader>
|
|
|
+
|
|
|
</FlexCol>
|
|
|
- <OfficialAccountPublishWrap
|
|
|
- topic="亮乡源"
|
|
|
- @publishsuccess="onPublishSuccess"
|
|
|
- />
|
|
|
|
|
|
<Height :height="200" />
|
|
|
|
|
|
@@ -181,7 +198,7 @@
|
|
|
round
|
|
|
size="80vh"
|
|
|
>
|
|
|
- <VillageMyFollow @goDetails="goDetails" />
|
|
|
+ <VillageMyFollow @handleGoVillageDetails="handleGoRecommendDetails" />
|
|
|
</Popup>
|
|
|
|
|
|
<IntroClamTip ref="introClamTipRef" @apply="handleLightVillage" />
|
|
|
@@ -202,6 +219,7 @@ import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
import { ArrayUtils, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
import { toast } from '@/components/utils/DialogAction';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
+import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
|
|
|
import Image from '@/components/basic/Image.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
@@ -221,17 +239,20 @@ import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
|
|
|
import LightVillageApi, { VillageListItem } from '@/api/light/LightVillageApi';
|
|
|
import type { CityItem } from '@/api/map/MapApi';
|
|
|
import Width from '@/components/layout/space/Width.vue';
|
|
|
-import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
|
|
|
+import MasonryGrid from '@/components/layout/masonry/MasonryGrid.vue';
|
|
|
+import MasonryGridItem from '@/components/layout/masonry/MasonryGridItem.vue';
|
|
|
+import IndexCommonImageItem from '@/common/components/parts/IndexCommonImageItem.vue';
|
|
|
import IntroClamTip from './village/dialogs/IntroClamTip.vue';
|
|
|
import MemoryTimeOut from '@/components/composeabe/MemoryTimeOut';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import Icon from '@/components/basic/Icon.vue';
|
|
|
import Text from '@/components/basic/Text.vue';
|
|
|
-import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
|
|
|
import ImageSwiper from '@/common/components/parts/ImageSwiper.vue';
|
|
|
+import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
+import VillageInfoApi, { type CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
|
+import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
|
|
|
|
|
|
const emit = defineEmits(['goVillage']);
|
|
|
-const { onPublishSuccess } = useOfficialAccount();
|
|
|
const authStore = useAuthStore();
|
|
|
const villageStore = useVillageStore();
|
|
|
const themeContext = useTheme();
|
|
|
@@ -305,14 +326,19 @@ const activityLoader = useSimpleDataLoader(async () => {
|
|
|
|
|
|
];
|
|
|
});
|
|
|
-
|
|
|
+const recommendLoader = useSimplePageListLoader(20, async (page, pageSize) => {
|
|
|
+ return await VillageInfoApi.getListForDiscover(page, pageSize);
|
|
|
+}, true);
|
|
|
|
|
|
watch(currentRegion, async (newVal) => {
|
|
|
await villageRankListLoader.reload();
|
|
|
await villageUserRankListLoader.reload();
|
|
|
});
|
|
|
|
|
|
-async function goDetails(item: VillageListItem) {
|
|
|
+function handleGoRecommendDetails(item: CommonInfoModel) {
|
|
|
+ navTo(`/pages/home/discover/details`, { id: item.id });
|
|
|
+}
|
|
|
+async function handleGoVillageDetails(item: VillageListItem) {
|
|
|
showMyFollowPopup.value = false;
|
|
|
const details = await LightVillageApi.getVillageDetails(item.id);
|
|
|
villageStore.setCurrentVillage(details);
|