|
|
@@ -106,46 +106,44 @@
|
|
|
}"
|
|
|
/>
|
|
|
|
|
|
- <Construction text="没有接口,数据不正确">
|
|
|
- <FlexRow justify="space-between" align="center">
|
|
|
- <FlexRow center gap="gap.lg" flexBasis="50%">
|
|
|
- <Text text="村社排名" fontConfig="contentText" />
|
|
|
- <Text text="No." fontConfig="lightTitle" />
|
|
|
- <Text :text="villageInfoLoader.content.value?.rankText" fontConfig="primaryTitle" />
|
|
|
- </FlexRow>
|
|
|
- <FlexRow center gap="gap.lg" flexBasis="50%">
|
|
|
- <Text text="村社等级" fontConfig="contentText" />
|
|
|
- <Text :text="villageInfoLoader.content.value?.levelText" fontConfig="primaryTitle" />
|
|
|
- </FlexRow>
|
|
|
+ <FlexRow justify="space-between" align="center">
|
|
|
+ <FlexRow center gap="gap.lg" flexBasis="50%">
|
|
|
+ <Text text="村社排名" fontConfig="contentText" />
|
|
|
+ <Text text="No." fontConfig="lightTitle" />
|
|
|
+ <Text :text="villageInfoLoader.content.value?.rankText" fontConfig="primaryTitle" />
|
|
|
</FlexRow>
|
|
|
-
|
|
|
- <FlexRow backgroundColor="background.tertiary" radius="radius.md" :padding="[30, 20]">
|
|
|
- <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
- <Text text="乡源光" fontConfig="secondText" />
|
|
|
- <Text :text="villageInfoLoader.content.value?.light" fontConfig="importantTitle" />
|
|
|
- </FlexCol>
|
|
|
- <Divider type="vertical" />
|
|
|
- <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
- <Text text="乡源人数" fontConfig="contentText" />
|
|
|
- <Text :text="villageInfoLoader.content.value?.memberCount" fontConfig="importantTitle" />
|
|
|
- </FlexCol>
|
|
|
- <Divider type="vertical" />
|
|
|
- <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
- <Text text="关注人数" fontConfig="contentText" />
|
|
|
- <Text :text="villageInfoLoader.content.value?.followerCount" fontConfig="importantTitle" />
|
|
|
- </FlexCol>
|
|
|
- <Divider type="vertical" />
|
|
|
- <Button
|
|
|
- :padding="0"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- textColor="text.title"
|
|
|
- text="新手上路"
|
|
|
- rightIcon="arrow-right"
|
|
|
- @click="handleGoNew()"
|
|
|
- />
|
|
|
+ <FlexRow center gap="gap.lg" flexBasis="50%">
|
|
|
+ <Text text="村社等级" fontConfig="contentText" />
|
|
|
+ <Text :text="villageInfoLoader.content.value?.levelText" fontConfig="primaryTitle" />
|
|
|
</FlexRow>
|
|
|
- </Construction>
|
|
|
+ </FlexRow>
|
|
|
+
|
|
|
+ <FlexRow backgroundColor="background.tertiary" radius="radius.md" :padding="[30, 20]">
|
|
|
+ <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
+ <Text text="乡源光" fontConfig="secondText" />
|
|
|
+ <Text :text="villageInfoLoader.content.value?.light" fontConfig="importantTitle" />
|
|
|
+ </FlexCol>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
+ <Text text="乡源人数" fontConfig="contentText" />
|
|
|
+ <Text :text="villageInfoLoader.content.value?.memberCount" fontConfig="importantTitle" />
|
|
|
+ </FlexCol>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <FlexCol center gap="gap.sm" flexBasis="25%">
|
|
|
+ <Text text="关注人数" fontConfig="contentText" />
|
|
|
+ <Text :text="villageInfoLoader.content.value?.followerCount" fontConfig="importantTitle" />
|
|
|
+ </FlexCol>
|
|
|
+ <Divider type="vertical" />
|
|
|
+ <Button
|
|
|
+ :padding="0"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ textColor="text.title"
|
|
|
+ text="新手上路"
|
|
|
+ rightIcon="arrow-right"
|
|
|
+ @click="handleGoNew()"
|
|
|
+ />
|
|
|
+ </FlexRow>
|
|
|
</BackgroundBox>
|
|
|
|
|
|
<!-- 排行榜 -->
|
|
|
@@ -185,14 +183,14 @@
|
|
|
GridItemPaddingVertical: 8,
|
|
|
}">
|
|
|
<Grid :borderGrid="false" :mainAxisCount="4">
|
|
|
- <GridItem title="村庄概况" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIntrod.png" touchable @click="handleGoCollect('overview')" />
|
|
|
- <GridItem title="自然风光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeEnvirounment.png" touchable @click="handleGoCollect('environment')" />
|
|
|
- <GridItem title="历史沿革" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" touchable @click="handleGoCollect('history')" />
|
|
|
+ <GridItem title="村社概况" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIntrod.png" touchable @click="handleGoCollect('overview')" />
|
|
|
+ <GridItem title="自然风光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeEnvirounment.png" touchable @click="handleGoCollect('environment', '自然环境')" />
|
|
|
+ <GridItem title="历史沿革" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" touchable @click="handleGoCollect('history', '建村历史')" />
|
|
|
<GridItem title="特色产业" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIndustry.png" touchable @click="handleGoCollect('product')" />
|
|
|
- <GridItem title="文艺活动" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeActivity.png" touchable @click="handleGoCollect('trip')" />
|
|
|
+ <GridItem title="文艺活动" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeActivity.png" touchable @click="handleGoCollect('custom')" />
|
|
|
<GridItem title="非遗展示" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeShow.png" touchable @click="handleGoCollect('ich')" />
|
|
|
<GridItem title="民俗风采" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeFolkloreVibe.png" touchable @click="handleGoCollect('custom')" />
|
|
|
- <GridItem title="乡贤故事" icon="https://xy.wenlvti.net/app_static/images/village/IconGoods.png" touchable @click="toast('TODO')" />
|
|
|
+ <GridItem title="乡贤故事" icon="https://xy.wenlvti.net/app_static/images/village/IconGoods.png" touchable @click="handleGoCollect('history', '历史人物')" />
|
|
|
</Grid>
|
|
|
</ProvideVar>
|
|
|
|
|
|
@@ -207,7 +205,7 @@
|
|
|
<Grid :borderGrid="false" :mainAxisCount="4">
|
|
|
<GridItem title="乡源荣光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHornor.png" touchable />
|
|
|
<GridItem title="乡源好物" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeGoods.png" touchable />
|
|
|
- <GridItem title="乡源树" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeTree.png" touchable />
|
|
|
+ <GridItem title="乡源树" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeTree.png" touchable @click="emit('goTree')" />
|
|
|
<GridItem title="政贤连心" icon="https://xy.wenlvti.net/app_static/images/village/IconGovAffairs.png" touchable />
|
|
|
<GridItem title="互动游戏" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeGame.png" touchable />
|
|
|
</Grid>
|
|
|
@@ -233,25 +231,11 @@
|
|
|
</template>
|
|
|
</HomeTitle>
|
|
|
<RoundTags v-model:active="listActiveTag" :tags="['广场', '老味道', '老手艺', '老物件', '老故事']" />
|
|
|
- <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.nickName ?? ''"
|
|
|
- :likes="item.likeCount"
|
|
|
- :isLike="false"
|
|
|
- @click="handleGoPost(item.id)"
|
|
|
- />
|
|
|
- </MasonryGridItem>
|
|
|
- </MasonryGrid>
|
|
|
- </SimplePageListLoader>
|
|
|
+ <official-account-publish
|
|
|
+ :topic="recommendTagName"
|
|
|
+ @publishsuccess="onPublishSuccess"
|
|
|
+ >
|
|
|
+ </official-account-publish>
|
|
|
|
|
|
</FlexCol>
|
|
|
|
|
|
@@ -259,7 +243,8 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { computed, ref, watch } from 'vue';
|
|
|
-import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
+import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
+import { useOfficialAccount } from '../../composeabe/OfficialAccount';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
import { useVillageStore } from '@/store/village';
|
|
|
@@ -285,41 +270,42 @@ import BackgroundImageButton from '@/components/basic/BackgroundImageButton.vue'
|
|
|
import ProvideVar from '@/components/theme/ProvideVar.vue';
|
|
|
import Grid from '@/components/layout/grid/Grid.vue';
|
|
|
import GridItem from '@/components/layout/grid/GridItem.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 FollowVillageApi from '@/api/light/FollowVillageApi';
|
|
|
import LightVillageApi from '@/api/light/LightVillageApi';
|
|
|
-import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
|
|
|
import Construction from '@/common/components/Construction.vue';
|
|
|
-import VillageApi from '@/api/inhert/VillageApi';
|
|
|
-import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
|
const { getIsVolunteer } = useUserTools();
|
|
|
const { requireLogin } = useReqireLogin();
|
|
|
-const villageStore = useVillageStore();
|
|
|
+const { onPublishSuccess } = useOfficialAccount();
|
|
|
const { isFollowed, onFollow, onUnFollow } = useFollow();
|
|
|
+const villageStore = useVillageStore();
|
|
|
+const { getIsJoinedVillage } = useUserTools();
|
|
|
+const isJoined = ref(false);
|
|
|
const villageInfoLoader = useSimpleDataLoader(async () => {
|
|
|
const village = villageStore.currentVillage;
|
|
|
- console.log(village);
|
|
|
+ if (village)
|
|
|
+ isJoined.value = await getIsJoinedVillage(village.id);
|
|
|
return {
|
|
|
title: village?.name || '',
|
|
|
desc: village?.desc || '',
|
|
|
address: village?.address,
|
|
|
applyCount: village?.applyCount || 0,
|
|
|
sizeText: village?.sizeText || 0,
|
|
|
- levelText: village?.levelText as string || '',
|
|
|
- rankText: village?.rankText as string || '',
|
|
|
+ levelText: village?.level.toString() || '',
|
|
|
+ rankText: village?.rank.toString() || '',
|
|
|
light: village?.light as number || 0,
|
|
|
- memberCount: village?.memberCount as number || 0,
|
|
|
- followerCount: village?.followerCount as number || 0,
|
|
|
+ memberCount: village?.volunteerCount as number || 0,
|
|
|
+ followerCount: village?.followCount as number || 0,
|
|
|
images: village?.images || [],
|
|
|
longitude: village?.longitude as number || 0,
|
|
|
latitude: village?.latitude as number || 0,
|
|
|
};
|
|
|
});
|
|
|
|
|
|
+const emit = defineEmits<{
|
|
|
+ (e: 'goTree'): void;
|
|
|
+}>();
|
|
|
+
|
|
|
const rankActiveTag = ref('乡源果');
|
|
|
const listActiveTag = ref('广场');
|
|
|
|
|
|
@@ -348,29 +334,10 @@ watch(rankActiveTag, () => {
|
|
|
villageUserRankListLoader.reload();
|
|
|
});
|
|
|
|
|
|
-const meIsVolunteer = ref(false);
|
|
|
-const myJoinedVillagesLoader = useSimpleDataLoader(async () => {
|
|
|
- try {
|
|
|
- meIsVolunteer.value = await getIsVolunteer();
|
|
|
- if (!meIsVolunteer.value)
|
|
|
- return [];
|
|
|
- return await VillageApi.getClaimedVallageList();
|
|
|
- } catch (error) {
|
|
|
- return [];
|
|
|
- }
|
|
|
-});
|
|
|
-const isJoined = computed(() => {
|
|
|
- return myJoinedVillagesLoader.content.value?.some(p => p.id === villageStore.currentVillage?.id) ?? false;
|
|
|
-});
|
|
|
|
|
|
-const recommendLoader = useSimplePageListLoader(20, async (page, pageSize) => {
|
|
|
- return await LightVillageApi.getMessages(page, pageSize, {
|
|
|
- villageId: villageStore.currentVillage?.id ?? undefined,
|
|
|
- keywords: listActiveTag.value,
|
|
|
- });
|
|
|
-});
|
|
|
-watch(listActiveTag, () => {
|
|
|
- recommendLoader.reload();
|
|
|
+
|
|
|
+const recommendTagName = computed(() => {
|
|
|
+ return '亮乡源·' + villageInfoLoader.content.value?.title + '·' + listActiveTag.value;
|
|
|
});
|
|
|
|
|
|
function handleGoJoin() {
|
|
|
@@ -425,7 +392,6 @@ function handleGoPost(id: number) {
|
|
|
|
|
|
watch(() => villageStore.currentVillage, () => {
|
|
|
villageInfoLoader.reload();
|
|
|
- recommendLoader.reload();
|
|
|
villageUserRankListLoader.reload();
|
|
|
}, { immediate: true });
|
|
|
</script>
|