|
|
@@ -1,152 +1,153 @@
|
|
|
<template>
|
|
|
- <FlexCol :gap="20" :padding="30" :innerStyle="{
|
|
|
- marginTop: '-130px',
|
|
|
- backgroundImage: 'url(https://xy.wenlvti.net/app_static/images/home/BannerHomeNew.png)',
|
|
|
- backgroundSize: '100% auto',
|
|
|
- backgroundRepeat: 'no-repeat',
|
|
|
- backgroundPosition: 'top center',
|
|
|
- backgroundColor: themeContext.resolveThemeColor('background.primary'),
|
|
|
- }">
|
|
|
- <FlexCol position="absolute" :left="0" :top="0" :right="0">
|
|
|
- <StatusBarSpace />
|
|
|
- <FlexRow justify="space-between" align="center">
|
|
|
- <Button
|
|
|
- @click="showCityPopup = true"
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/home/IconSwitch.png"
|
|
|
- :text="currentCity"
|
|
|
- type="custom"
|
|
|
- color="transparent"
|
|
|
- />
|
|
|
- <Image
|
|
|
- src="https://xy.wenlvti.net/app_static/images/home/BannerHomeTitle.png"
|
|
|
- :width="140"
|
|
|
- :height="75"
|
|
|
+ <FlexCol>
|
|
|
+ <FlexCol :gap="20" :padding="30" :innerStyle="{
|
|
|
+ marginTop: '-130px',
|
|
|
+ backgroundImage: 'url(https://xy.wenlvti.net/app_static/images/home/BannerHomeNew.png)',
|
|
|
+ backgroundSize: '100% auto',
|
|
|
+ backgroundRepeat: 'no-repeat',
|
|
|
+ backgroundPosition: 'top center',
|
|
|
+ backgroundColor: themeContext.resolveThemeColor('background.primary'),
|
|
|
+ }">
|
|
|
+ <FlexCol position="absolute" :left="0" :top="0" :right="0">
|
|
|
+ <StatusBarSpace />
|
|
|
+ <FlexRow justify="space-between" align="center">
|
|
|
+ <Button
|
|
|
+ @click="showCityPopup = true"
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/home/IconSwitch.png"
|
|
|
+ :text="currentCity"
|
|
|
+ type="custom"
|
|
|
+ color="transparent"
|
|
|
+ />
|
|
|
+ <Image
|
|
|
+ src="https://xy.wenlvti.net/app_static/images/home/BannerHomeTitle.png"
|
|
|
+ :width="140"
|
|
|
+ :height="75"
|
|
|
+ />
|
|
|
+ <Width :width="150" />
|
|
|
+ </FlexRow>
|
|
|
+ </FlexCol>
|
|
|
+ <Height height="150px" />
|
|
|
+ <FlexCol :gap="20" align="center">
|
|
|
+ <FlexRow justify="space-between" align="center" width="100%">
|
|
|
+ <SearchBar v-model="searchKeywords" placeholder="搜索" :innerStyle="{
|
|
|
+ backgroundColor: 'white',
|
|
|
+ borderRadius: '20rpx',
|
|
|
+ borderWidth: '1px',
|
|
|
+ borderStyle: 'solid',
|
|
|
+ borderColor: themeContext.resolveThemeColor('primary'),
|
|
|
+ width: '490rpx',
|
|
|
+ }" />
|
|
|
+ <Button icon="ai-thinking" @click="handleGoAI" text="问AI" />
|
|
|
+ </FlexRow>
|
|
|
+ <Image
|
|
|
+ src="https://xy.wenlvti.net/app_static/images/home/BannerIndex.png"
|
|
|
+ width="700rpx"
|
|
|
+ height="200px"
|
|
|
+ mode="aspectFit"
|
|
|
+ :innerStyle="{
|
|
|
+ border: '2px solid #fff',
|
|
|
+ borderRadius: '20rpx',
|
|
|
+ clipPath: 'ellipse(100% 90% at 50% 0%)'
|
|
|
+ }"
|
|
|
/>
|
|
|
- <Width :width="150" />
|
|
|
- </FlexRow>
|
|
|
- </FlexCol>
|
|
|
- <Height height="150px" />
|
|
|
- <FlexCol :gap="20" align="center">
|
|
|
- <FlexRow justify="space-between" align="center" width="100%">
|
|
|
- <SearchBar v-model="searchKeywords" placeholder="搜索" :innerStyle="{
|
|
|
- backgroundColor: 'white',
|
|
|
- borderRadius: '20rpx',
|
|
|
- borderWidth: '1px',
|
|
|
- borderStyle: 'solid',
|
|
|
- borderColor: themeContext.resolveThemeColor('primary'),
|
|
|
- width: '490rpx',
|
|
|
- }" />
|
|
|
- <Button icon="ai-thinking" @click="handleGoAI" text="问AI" />
|
|
|
- </FlexRow>
|
|
|
- <Image
|
|
|
- src="https://xy.wenlvti.net/app_static/images/home/BannerIndex.png"
|
|
|
- width="700rpx"
|
|
|
- height="200px"
|
|
|
- mode="aspectFit"
|
|
|
- :innerStyle="{
|
|
|
- border: '2px solid #fff',
|
|
|
- borderRadius: '20rpx',
|
|
|
- clipPath: 'ellipse(100% 90% at 50% 0%)'
|
|
|
- }"
|
|
|
- />
|
|
|
- </FlexCol>
|
|
|
-
|
|
|
- <LightMap
|
|
|
- small
|
|
|
- :city="currentCity"
|
|
|
- :lonlat="currentLocation.currentLonlat.value"
|
|
|
- @getCurrentLonlat="currentLocation.getCurrentExactLocation"
|
|
|
- @selectVillage="goDetails"
|
|
|
- @regionChanged="currentRegion=$event"
|
|
|
- >
|
|
|
- <NoticeBar
|
|
|
- v-if="currentNoticeContent"
|
|
|
- :content="currentNoticeContent"
|
|
|
- :innerStyle="{
|
|
|
- position: 'absolute',
|
|
|
- top: '20rpx',
|
|
|
- left: '20rpx',
|
|
|
- right: '20rpx',
|
|
|
- zIndex: 100,
|
|
|
- borderRadius: '30rpx',
|
|
|
- }"
|
|
|
- :textStyle="{
|
|
|
- fontSize: '26rpx',
|
|
|
- }"
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/home/IconLightActive.png"
|
|
|
- :iconProps="{
|
|
|
- size: 34,
|
|
|
- }"
|
|
|
- textColor="#C9211F"
|
|
|
- backgroundColor="#D9492E10"
|
|
|
- />
|
|
|
- </LightMap>
|
|
|
+ </FlexCol>
|
|
|
|
|
|
- <FlexRow justify="space-between" :padding="[10, 16]" gap="gap.md">
|
|
|
- <Button
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/home/IconSwitch.png"
|
|
|
- radius="radius.lg"
|
|
|
- :padding="[10, 30]"
|
|
|
- @click="showCityPopup = true"
|
|
|
- >
|
|
|
- 切换城市
|
|
|
- </Button>
|
|
|
- <Button
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/home/IconFollow.png"
|
|
|
- radius="radius.lg" :padding="[10, 30]"
|
|
|
- @click="showMyFollowPopup = true"
|
|
|
+ <LightMap
|
|
|
+ small
|
|
|
+ :city="currentCity"
|
|
|
+ :lonlat="currentLocation.currentLonlat.value"
|
|
|
+ @getCurrentLonlat="currentLocation.getCurrentExactLocation"
|
|
|
+ @selectVillage="goDetails"
|
|
|
+ @regionChanged="currentRegion=$event"
|
|
|
>
|
|
|
- 我的关注
|
|
|
- </Button>
|
|
|
- <Button
|
|
|
- icon="https://xy.wenlvti.net/app_static/images/home/IconLight.png"
|
|
|
- radius="radius.lg" :padding="[10, 30]"
|
|
|
- @click="requireLogin(async () => navTo('/pages/home/light/submit-map', { city: currentCity }), '登录后才能点亮村社哦!')"
|
|
|
- >
|
|
|
- 点亮村社
|
|
|
- </Button>
|
|
|
- </FlexRow>
|
|
|
+ <NoticeBar
|
|
|
+ v-if="currentNoticeContent"
|
|
|
+ :content="currentNoticeContent"
|
|
|
+ :innerStyle="{
|
|
|
+ position: 'absolute',
|
|
|
+ top: '20rpx',
|
|
|
+ left: '20rpx',
|
|
|
+ right: '20rpx',
|
|
|
+ zIndex: 100,
|
|
|
+ borderRadius: '30rpx',
|
|
|
+ }"
|
|
|
+ :textStyle="{
|
|
|
+ fontSize: '26rpx',
|
|
|
+ }"
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/home/IconLightActive.png"
|
|
|
+ :iconProps="{
|
|
|
+ size: 34,
|
|
|
+ }"
|
|
|
+ textColor="#C9211F"
|
|
|
+ backgroundColor="#D9492E10"
|
|
|
+ />
|
|
|
+ </LightMap>
|
|
|
|
|
|
- <!-- <HomeTitle title="最新动态" />
|
|
|
- <Construction text="测试数据,没有接口!">
|
|
|
- <FlexCol gap="gap.lg">
|
|
|
- <FlexRow
|
|
|
- v-for="item in activityLoader.content.value" :key="item.id"
|
|
|
- backgroundColor="background.tertiary"
|
|
|
- radius="radius.md"
|
|
|
- :padding="[20, 30]"
|
|
|
- gap="gap.lg"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <Avatar
|
|
|
- :url="item.head"
|
|
|
- :size="80"
|
|
|
- :round="false"
|
|
|
- :radius="10"
|
|
|
- />
|
|
|
- <Text :text="item.content" fontConfig="contentText" :innerStyle="{ flex: 1 }" />
|
|
|
- </FlexRow>
|
|
|
- </FlexCol>
|
|
|
- </Construction> -->
|
|
|
+ <FlexRow justify="space-between" :padding="[10, 16]" gap="gap.md">
|
|
|
+ <Button
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/home/IconSwitch.png"
|
|
|
+ radius="radius.lg"
|
|
|
+ :padding="[10, 30]"
|
|
|
+ @click="showCityPopup = true"
|
|
|
+ >
|
|
|
+ 切换城市
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/home/IconFollow.png"
|
|
|
+ radius="radius.lg" :padding="[10, 30]"
|
|
|
+ @click="showMyFollowPopup = true"
|
|
|
+ >
|
|
|
+ 我的关注
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ icon="https://xy.wenlvti.net/app_static/images/home/IconLight.png"
|
|
|
+ radius="radius.lg" :padding="[10, 30]"
|
|
|
+ @click="requireLogin(async () => navTo('/pages/home/light/submit-map', { city: currentCity }), '登录后才能点亮村社哦!')"
|
|
|
+ >
|
|
|
+ 点亮村社
|
|
|
+ </Button>
|
|
|
+ </FlexRow>
|
|
|
+
|
|
|
+ <!-- <HomeTitle title="最新动态" />
|
|
|
+ <Construction text="测试数据,没有接口!">
|
|
|
+ <FlexCol gap="gap.lg">
|
|
|
+ <FlexRow
|
|
|
+ v-for="item in activityLoader.content.value" :key="item.id"
|
|
|
+ backgroundColor="background.tertiary"
|
|
|
+ radius="radius.md"
|
|
|
+ :padding="[20, 30]"
|
|
|
+ gap="gap.lg"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <Avatar
|
|
|
+ :url="item.head"
|
|
|
+ :size="80"
|
|
|
+ :round="false"
|
|
|
+ :radius="10"
|
|
|
+ />
|
|
|
+ <Text :text="item.content" fontConfig="contentText" :innerStyle="{ flex: 1 }" />
|
|
|
+ </FlexRow>
|
|
|
+ </FlexCol>
|
|
|
+ </Construction> -->
|
|
|
|
|
|
- <HomeTitle title="乡村排名" showMore @moreClicked="navTo('/pages/home/village/rank/village', {
|
|
|
- regionId: currentRegion ?? undefined,
|
|
|
- })" />
|
|
|
- <VillageRankList :list="villageRankListLoader.content.value ?? []" :jumpToSingle="false" @goDetails="goDetails" />
|
|
|
+ <HomeTitle title="乡村排名" showMore @moreClicked="navTo('/pages/home/village/rank/village', {
|
|
|
+ regionId: currentRegion ?? undefined,
|
|
|
+ })" />
|
|
|
+ <VillageRankList :list="villageRankListLoader.content.value ?? []" :jumpToSingle="false" @goDetails="goDetails" />
|
|
|
|
|
|
- <HomeTitle title="志愿者排名" showMore :lightCount="3" @moreClicked="navTo('/pages/home/village/rank/volunteer', {
|
|
|
- regionId: currentRegion ?? undefined,
|
|
|
- })" />
|
|
|
- <VillageUserRankList :list="villageUserRankListLoader.content.value ?? []" />
|
|
|
+ <HomeTitle title="志愿者排名" showMore :lightCount="3" @moreClicked="navTo('/pages/home/village/rank/volunteer', {
|
|
|
+ regionId: currentRegion ?? undefined,
|
|
|
+ })" />
|
|
|
+ <VillageUserRankList :list="villageUserRankListLoader.content.value ?? []" />
|
|
|
|
|
|
- <HomeTitle title="精选记忆" />
|
|
|
- <official-account-publish
|
|
|
+ <HomeTitle title="精选记忆" />
|
|
|
+ </FlexCol>
|
|
|
+ <OfficialAccountPublishWrap
|
|
|
topic="亮乡源"
|
|
|
@publishsuccess="onPublishSuccess"
|
|
|
- >
|
|
|
- </official-account-publish>
|
|
|
+ />
|
|
|
|
|
|
- <Height :height="150" />
|
|
|
+ <Height :height="200" />
|
|
|
|
|
|
<Popup
|
|
|
v-model:show="showCityPopup"
|
|
|
@@ -176,7 +177,6 @@ import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLo
|
|
|
import { useStorageVar } from '@/components/composeabe/StorageVar';
|
|
|
import { useVillageStore } from '@/store/village';
|
|
|
import { useGetCurrentLocation } from './composeabe/GetCurrentLocation';
|
|
|
-import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
import { ArrayUtils, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
import { toast } from '@/components/utils/DialogAction';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
@@ -189,9 +189,6 @@ import Button from '@/components/basic/Button.vue';
|
|
|
import HomeTitle from '@/common/components/parts/HomeTitle.vue';
|
|
|
import VillageRankList from './components/VillageRankList.vue';
|
|
|
import VillageUserRankList from './components/VillageUserRankList.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 Popup from '@/components/dialog/Popup.vue';
|
|
|
import CitySelect from './components/CitySelect.vue';
|
|
|
import VillageMyFollow from './components/VillageMyFollow.vue';
|
|
|
@@ -211,6 +208,7 @@ import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
|
import Construction from '@/common/components/Construction.vue';
|
|
|
import Width from '@/components/layout/space/Width.vue';
|
|
|
import { useOfficialAccount } from './composeabe/OfficialAccount';
|
|
|
+import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
|
|
|
|
|
|
const emit = defineEmits(['goVillage']);
|
|
|
const { onPublishSuccess } = useOfficialAccount();
|
|
|
@@ -260,7 +258,6 @@ const villageUserRankListLoader = useSimpleDataLoader(async () => {
|
|
|
|
|
|
return res
|
|
|
});
|
|
|
-const recommendLoader = useSimplePageListLoader(20, async (page, pageSize, params) => await LightVillageApi.getMessages(page, pageSize), true);
|
|
|
|
|
|
const activityLoader = useSimpleDataLoader(async () => {
|
|
|
return [
|
|
|
@@ -286,6 +283,8 @@ const activityLoader = useSimpleDataLoader(async () => {
|
|
|
];
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+
|
|
|
watch(currentRegion, async (newVal) => {
|
|
|
await villageRankListLoader.reload();
|
|
|
await villageUserRankListLoader.reload();
|
|
|
@@ -298,11 +297,6 @@ async function goDetails(item: VillageListItem) {
|
|
|
await waitTimeOut(100);
|
|
|
emit('goVillage')
|
|
|
}
|
|
|
-function goMessageDetails(item: any) {
|
|
|
- navTo('/pages/home/post/detail', {
|
|
|
- id: item.id,
|
|
|
- });
|
|
|
-}
|
|
|
async function handleChangedCity(city: string) {
|
|
|
currentCity.value = city;
|
|
|
try {
|
|
|
@@ -329,14 +323,13 @@ function handleGoAI() {
|
|
|
}
|
|
|
|
|
|
async function loadInfo() {
|
|
|
- const res = await FollowVillageApi.getFollowVillageList({ page: 1, pageSize: 200 });
|
|
|
- villageStore.setMyFollowVillages(res.list);
|
|
|
- if (res.list.length > 0) {
|
|
|
+ await villageStore.loadMyFollowVillages();
|
|
|
+ if (villageStore.myFollowVillages.length > 0) {
|
|
|
const currentVillage = villageStore.loadCurrentVillage();
|
|
|
if (currentVillage) {
|
|
|
- villageStore.setCurrentVillage(res.list.find(p => p.id === currentVillage) as VillageListItem || res.list[0]);
|
|
|
+ villageStore.setCurrentVillage(villageStore.myFollowVillages.find(p => p.id === currentVillage) as VillageListItem || villageStore.myFollowVillages[0]);
|
|
|
} else {
|
|
|
- villageStore.setCurrentVillage(res.list[0]);
|
|
|
+ villageStore.setCurrentVillage(villageStore.myFollowVillages[0] as VillageListItem);
|
|
|
}
|
|
|
}
|
|
|
}
|