|
@@ -206,7 +206,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { onBeforeMount, onMounted, ref, watch } from 'vue';
|
|
|
|
|
|
|
+import { onMounted, ref, watch } from 'vue';
|
|
|
import { useTheme } from '@/components/theme/ThemeDefine';
|
|
import { useTheme } from '@/components/theme/ThemeDefine';
|
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
import { useStorageVar } from '@/components/composeabe/StorageVar';
|
|
import { useStorageVar } from '@/components/composeabe/StorageVar';
|
|
@@ -215,8 +215,10 @@ import { useGetCurrentLocation } from './composeabe/GetCurrentLocation';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useRequireLogin } from '@/common/composeabe/RequireLogin';
|
|
import { useRequireLogin } from '@/common/composeabe/RequireLogin';
|
|
|
import { useUserTools } from '@/common/composeabe/UserTools';
|
|
import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
-import { ArrayUtils, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
|
|
-import { toast } from '@/components/utils/DialogAction';
|
|
|
|
|
|
|
+import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
|
|
+import { useGetNotice } from './village/composeabe/GetNotice';
|
|
|
|
|
+import { waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
|
|
+import { toast, loading, hideLoading } from '@/components/utils/DialogAction';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
|
|
import { injectAppConfiguration } from '@/api/system/useAppConfiguration';
|
|
|
import Image from '@/components/basic/Image.vue';
|
|
import Image from '@/components/basic/Image.vue';
|
|
@@ -231,30 +233,20 @@ import VillageUserRankList from './components/VillageUserRankList.vue';
|
|
|
import Popup from '@/components/dialog/Popup.vue';
|
|
import Popup from '@/components/dialog/Popup.vue';
|
|
|
import CitySelect from './components/CitySelect.vue';
|
|
import CitySelect from './components/CitySelect.vue';
|
|
|
import VillageMyFollow from './components/VillageMyFollow.vue';
|
|
import VillageMyFollow from './components/VillageMyFollow.vue';
|
|
|
-import MapApi from '@/api/map/MapApi';
|
|
|
|
|
import LightMap from './components/LightMap.vue';
|
|
import LightMap from './components/LightMap.vue';
|
|
|
import NoticeBar from '@/components/display/NoticeBar.vue';
|
|
import NoticeBar from '@/components/display/NoticeBar.vue';
|
|
|
import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
|
|
import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
|
|
|
import LightVillageApi, { VillageListItem } from '@/api/light/LightVillageApi';
|
|
import LightVillageApi, { VillageListItem } from '@/api/light/LightVillageApi';
|
|
|
-import type { RegionItem } from '@/api/map/RegionApi';
|
|
|
|
|
import Width from '@/components/layout/space/Width.vue';
|
|
import Width from '@/components/layout/space/Width.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 IndexCommonImageItem from '@/common/components/parts/IndexCommonImageItem.vue';
|
|
|
import IntroClamTip from './village/dialogs/IntroClamTip.vue';
|
|
import IntroClamTip from './village/dialogs/IntroClamTip.vue';
|
|
|
import MemoryTimeOut from '@/components/composeabe/MemoryTimeOut';
|
|
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 ImageSwiper from '@/common/components/parts/ImageSwiper.vue';
|
|
import ImageSwiper from '@/common/components/parts/ImageSwiper.vue';
|
|
|
-import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
|
|
import VillageInfoApi, { type CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
import VillageInfoApi, { type CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
|
import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
|
|
import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
|
|
|
import PostIndex from './village/dialogs/PostIndex.vue';
|
|
import PostIndex from './village/dialogs/PostIndex.vue';
|
|
|
-import TreeApi from '@/api/light/TreeApi';
|
|
|
|
|
-import { SimpleTimer } from '@/components/utils/Timer';
|
|
|
|
|
-import { useGetNotice } from './village/composeabe/GetNotice';
|
|
|
|
|
import FrameButton from '@/common/components/FrameButton.vue';
|
|
import FrameButton from '@/common/components/FrameButton.vue';
|
|
|
|
|
+import type { RegionItem } from '@/api/map/RegionApi';
|
|
|
|
|
|
|
|
const emit = defineEmits(['goVillage','goDig']);
|
|
const emit = defineEmits(['goVillage','goDig']);
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
@@ -381,6 +373,8 @@ function handleSearch() {
|
|
|
|
|
|
|
|
async function loadInfo() {
|
|
async function loadInfo() {
|
|
|
|
|
|
|
|
|
|
+ loading('载入数据中');
|
|
|
|
|
+
|
|
|
//如果不是志愿者,则显示认领村庄提示
|
|
//如果不是志愿者,则显示认领村庄提示
|
|
|
const isVolunteer = await getIsVolunteer();
|
|
const isVolunteer = await getIsVolunteer();
|
|
|
if (!isVolunteer) {
|
|
if (!isVolunteer) {
|
|
@@ -402,11 +396,15 @@ async function loadInfo() {
|
|
|
console.error(error);
|
|
console.error(error);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (villageStore.myFollowVillages.length > 0) {
|
|
|
|
|
- const currentVillage = villageStore.loadCurrentVillage();
|
|
|
|
|
- const id = (villageStore.myFollowVillages.find(p => p.id === currentVillage) as VillageListItem || villageStore.myFollowVillages[0]).id;
|
|
|
|
|
- const res = await LightVillageApi.getVillageDetails(id)
|
|
|
|
|
- villageStore.setCurrentVillage(res);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (villageStore.myFollowVillages.length > 0) {
|
|
|
|
|
+ const currentVillage = villageStore.loadCurrentVillage();
|
|
|
|
|
+ const id = (villageStore.myFollowVillages.find(p => p.id === currentVillage) as VillageListItem || villageStore.myFollowVillages[0]).id;
|
|
|
|
|
+ const res = await LightVillageApi.getVillageDetails(id)
|
|
|
|
|
+ villageStore.setCurrentVillage(res);
|
|
|
|
|
+ }
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ hideLoading();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|