快乐的梦鱼 2 nedēļas atpakaļ
vecāks
revīzija
64a98ce0fb

+ 7 - 5
src/api/light/LightVillageApi.ts

@@ -10,9 +10,6 @@ export class VillageListItem extends DataModel<VillageListItem> {
       id: { clientSide: 'number', serverSide: 'number', clientSideRequired: true },
       isLight: { clientSide: 'boolean' },
     }
-    this._nameMapperServer = {
-      name: 'villageName',
-    };
     this._convertKeyType = (key, direction) => {
       if (key.endsWith('At'))
         return {
@@ -31,7 +28,6 @@ export class VillageListItem extends DataModel<VillageListItem> {
         this.image = this.images[0]
       }
       this.thumbnail = this.image;
-      this.title = this.villageName
     }
 
   }
@@ -56,7 +52,7 @@ export class VillageListItem extends DataModel<VillageListItem> {
   image = '';
   thumbnail = '';
   images = [] as string[];
-  villageName = '';
+  name = '';
   title = '';
   volunteerName = '';
 }
@@ -134,6 +130,12 @@ export class LightVillageApi extends AppServerRequestModule<DataModel> {
     return transformArrayDataModel<VillageListItem>(VillageListItem, transformSomeToArray(res.requireData().data), `村落`, true);
   }
   
+  async getVillageDetails(id: number) {
+    const res = await this.get<VillageListItem>('/village/village/getInfo', '村社详情', {
+      id: id,
+    }, VillageListItem);
+    return res.requireData();
+  }
 
   async getIpAddress() {
     const res = await this.get<{

+ 8 - 1
src/components/basic/ImageButton.vue

@@ -1,5 +1,10 @@
 <template>
-  <Touchable :activeOpacity="activeOpacity" @click="emit('click')">
+  <Touchable 
+    :activeOpacity="activeOpacity" 
+    :touchable="touchable"
+    position="relative" 
+    @click="emit('click')"
+  >
     <Image v-bind="props" />
     <slot />
   </Touchable>
@@ -12,8 +17,10 @@ import Image from './Image.vue';
 
 const props = withDefaults(defineProps<ImageProps & {
   activeOpacity?: number;
+  touchable?: boolean;
 }>(), {
   activeOpacity: 0.7,
+  touchable: true,
 });
 
 const emit = defineEmits(['click']);

+ 7 - 0
src/pages.json

@@ -60,6 +60,13 @@
       }
     },
     {
+      "path": "pages/home/village/index",
+      "style": {
+        "navigationBarTitleText": "村社详情",
+        "enablePullDownRefresh": false
+      }
+    },
+    {
       "path": "pages/home/village/rank/volunteer",
       "style": {
         "navigationBarTitleText": "志愿者排名",

+ 12 - 14
src/pages/dig/components/CollectModuleList.vue

@@ -1,5 +1,5 @@
 <template>
-  <FlexCol>
+  <FlexCol gap="gap.md">
     <Image
       v-if="currentTaskBanner"
       :src="currentTaskBanner"
@@ -7,19 +7,17 @@
       :width="690"
       mode="widthFix"
     />
-    <FlexCol :gap="20">
-      <TaskList
-        v-for="item in currentTaskDefItems"
-        :key="item.title"
-        :icon="item.icon"
-        :title="item.title"
-        :desc="item.desc"
-        :extra="item.extra"
-        :goButtonText="isView ? '查看' : '去完成'"
-        :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
-        @click="handleClick(item)"
-      />
-    </FlexCol>
+    <TaskList
+      v-for="item in currentTaskDefItems"
+      :key="item.title"
+      :icon="item.icon"
+      :title="item.title"
+      :desc="item.desc"
+      :extra="item.extra"
+      :goButtonText="isView ? '查看' : '去完成'"
+      :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
+      @click="handleClick(item)"
+    />
   </FlexCol>
 </template>
 

+ 42 - 33
src/pages/dig/components/TaskList.vue

@@ -1,7 +1,9 @@
 <script setup lang="ts">
 import Button from '@/components/basic/Button.vue';
 import Icon from '@/components/basic/Icon.vue';
+import ImageButton from '@/components/basic/ImageButton.vue';
 import Text from '@/components/basic/Text.vue';
+import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
 import Touchable from '@/components/feedback/Touchable.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
@@ -42,38 +44,45 @@ defineProps({
 </script>
 
 <template>
-  <Touchable 
-    :padding="25" 
-    radius="radius.md" 
-    :touchable="button && enable"
-    direction="row"
-    backgroundColor="white" 
-    justify="space-between" 
-    align="center"
-    @click="$emit('click')"
+  <BackgroundBox
+    backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxMid.png"
+    :backgroundCutBorder="[10,10,10,10]"
+    :backgroundCutBorderSize="[10,10,10,10]"
   >
-    <FlexRow align="center">
-      <FlexCol center radius="50%" backgroundColor="#efefef" :padding="20">
-        <Icon :icon="icon || 'help-filling'" color="primary" type="material" :size="50" />
-      </FlexCol>
-      <Width :width="20" />
-      <FlexCol class="info">
-        <Text class="title" :fontSize="36" color="text.title" :text="title" />
-        <Height :height="10" />
-        <Text class="desc" :fontSize="24" color="text.second" :text="desc" />
-      </FlexCol>
-    </FlexRow>
-    <FlexRow align="center" :flexShrink="0" :gap="15">
-      <Text v-if="extra" class="extra" :fontSize="24" color="text.second" :text="extra" />
-      <Button v-if="button" 
-        type="primary" 
-        shape="round" 
-        size="small" 
-        :radius="40" 
-        :touchable="enable"
-        @click="$emit('click')"
-        :text="enable ? goButtonText : '未开放'"
-      />  
-    </FlexRow>
-  </Touchable>
+    <Touchable 
+      :padding="25" 
+      :touchable="button && enable"
+      direction="row"
+      justify="space-between" 
+      align="center"
+      @click="$emit('click')"
+    >
+      <FlexRow align="center">
+        <FlexCol center radius="50%" backgroundColor="#efefef" :padding="20">
+          <Icon :icon="icon || 'help-filling'" color="primary" type="material" :size="50" />
+        </FlexCol>
+        <Width :width="20" />
+        <FlexCol class="info">
+          <Text class="title" :fontSize="36" color="text.title" :text="title" />
+          <Height :height="10" />
+          <Text class="desc" :fontSize="24" color="text.second" :text="desc" />
+        </FlexCol>
+      </FlexRow>
+      <FlexRow align="center" :flexShrink="0" :gap="15">
+        <Text v-if="extra" class="extra" :fontSize="24" color="text.second" :text="extra" />
+        <ImageButton 
+          v-if="button" 
+          src="https://xy.wenlvti.net/app_static/images/village/BoxButton.png"
+          :touchable="enable"
+          :width="110"
+          :height="60"
+          @click="$emit('click')"
+        >  
+          <FlexCol position="absolute" inset="0" center>
+            <Text :text="enable ? goButtonText : '未开放'" fontConfig="contentText" color="white" />
+          </FlexCol>
+        </ImageButton>
+      </FlexRow>
+    </Touchable>
+  </BackgroundBox>
 </template>

+ 2 - 5
src/pages/home/components/VillageMyFollow.vue

@@ -9,7 +9,7 @@
             :key="i"
             backgroundColor="transparent"
             :src="item.image"
-            :title="item.villageName"
+            :title="item.name"
             :desc="item.address"
             :imageRadius="15"
             :imageWidth="200"
@@ -24,16 +24,13 @@
 
 <script setup lang="ts">
 import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
-import { useVillageStore } from '@/store/village';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import HomeTitle from '@/common/components/parts/HomeTitle.vue';
 import ImageBlock3 from '@/components/display/block/ImageBlock3.vue';
 import FollowVillageApi from '@/api/light/FollowVillageApi';
 import SimplePageListLoader from '@/components/loader/SimplePageListLoader.vue';
-import type { VillageListItem } from '@/api/inhert/VillageApi';
 import RequireLogin from '@/common/components/RequireLogin.vue';
-
-const villageStore = useVillageStore();
+import type { VillageListItem } from '@/api/light/LightVillageApi';
 
 const emit = defineEmits<{
   (e: 'goDetails', item: VillageListItem): void;

+ 32 - 4
src/pages/home/components/VillageRankList.vue

@@ -1,14 +1,16 @@
 <template>
   <Empty v-if="list.length === 0" description="暂无排名数据" />
   <FlexRow :gap="20">
-    <FlexCol 
+    <Touchable 
       v-for="(item) in list" 
-      :key="item.title" 
+      :key="item.id" 
       :width="item.rank == 1 ? '40%' : '28.5%'" 
       position="relative" 
       justify="space-between"
       radius="radius.md"
       overflow="hidden"
+      direction="column"
+      @click="handleGoDetails(item)"
     >
       <Image :src="item.image" width="100%" :height="280" mode="aspectFill" radius="radius.md" />
       <FlexRow
@@ -40,40 +42,66 @@
       >
         <Text v-if="item.rank > 1" fontConfig="h4" :text="item.rank" color="white" />
       </FlexCol>
-    </FlexCol>
+    </Touchable>
   </FlexRow>
 </template>
 
 <script setup lang="ts">
+import LightVillageApi from '@/api/light/LightVillageApi';
 import Image from '@/components/basic/Image.vue';
 import Text from '@/components/basic/Text.vue';
 import Empty from '@/components/feedback/Empty.vue';
+import Touchable from '@/components/feedback/Touchable.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
+import { navTo } from '@/components/utils/PageAction';
+import { useVillageStore } from '@/store/village';
+import { waitTimeOut } from '@imengyu/imengyu-utils';
 
-withDefaults(defineProps<{
+const props = withDefaults(defineProps<{
   list?: {
+    id: number;
     image: string;
     title: string;
     rank: number;
   }[];
+  jumpToSingle?: boolean;
 }>(), {
+  jumpToSingle: true,
   list: () => [
     {
+      id: 1,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest1.png',
       title: '乡村1',
       rank: 1,
     },
     {
+      id: 2,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest2.png',
       title: '乡村2',
       rank: 2,
     },
     {
+      id: 3,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest3.png',
       title: '乡村3',
       rank: 3,
     },
   ],
 });
+
+const emit = defineEmits([ 'goDetails' ]);
+
+const villageStore = useVillageStore();
+
+async function handleGoDetails(item: { id: number }) {
+  const details = await LightVillageApi.getVillageDetails(item.id);
+  if (props.jumpToSingle) {
+    villageStore.setCurrentVillage(details);
+    await waitTimeOut(100);
+    navTo('/pages/home/village/index');
+  } else {
+    emit('goDetails', details);
+  }
+}
 </script>

+ 5 - 1
src/pages/home/components/VillageUserRankList.vue

@@ -4,7 +4,7 @@
     <FlexCol 
       v-for="(item) in list" 
       position="relative" 
-      :key="item.title" 
+      :key="item.id" 
       :width="item.rank == 1 ? '35%' : '32.5%'" 
       :height="item.rank == 1 ? 380 : 320"
       :innerStyle="{
@@ -47,6 +47,7 @@ const scoreColors = [
 
 withDefaults(defineProps<{
   list?: {
+    id: number;
     image: string;
     title: string;
     rank: number;
@@ -55,18 +56,21 @@ withDefaults(defineProps<{
 }>(), {
   list: () => [
     {
+      id: 2,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest2.png',
       title: '用户2',
       rank: 2,
       score: 90,
     },
     {
+      id: 1,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest1.png',
       title: '用户1',
       rank: 1,
       score: 100,
     },
     {
+      id: 3,
       image: 'https://mncdn.wenlvti.net/app_static/minnan/images/test/ImageTest3.png',
       title: '用户3',
       rank: 3,

+ 7 - 6
src/pages/home/index.vue

@@ -98,7 +98,7 @@
     <HomeTitle title="乡村排名" showMore @moreClicked="navTo('/pages/home/village/rank/village', {
       regionId: currentRegion ?? undefined,
     })" />
-    <VillageRankList :list="villageRankListLoader.content.value ?? []" />
+    <VillageRankList :list="villageRankListLoader.content.value ?? []" :jumpToSingle="false" @goDetails="goDetails" />
 
     <HomeTitle title="志愿者排名" showMore :lightCount="3" @moreClicked="navTo('/pages/home/village/rank/volunteer', {
       regionId: currentRegion ?? undefined,
@@ -156,7 +156,7 @@ 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 } from '@imengyu/imengyu-utils';
+import { ArrayUtils, waitTimeOut } from '@imengyu/imengyu-utils';
 import { toast } from '@/components/utils/DialogAction';
 import { navTo } from '@/components/utils/PageAction';
 import Image from '@/components/basic/Image.vue';
@@ -180,9 +180,8 @@ import LightMap from './components/LightMap.vue';
 import NoticeBar from '@/components/display/NoticeBar.vue';
 import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
 import FollowVillageApi from '@/api/light/FollowVillageApi';
-import LightVillageApi from '@/api/light/LightVillageApi';
+import LightVillageApi, { VillageListItem } from '@/api/light/LightVillageApi';
 import type { CityItem } from '@/api/map/MapApi';
-import type { VillageListItem } from '@/api/inhert/VillageApi';
 
 const emit = defineEmits(['goVillage']);
 
@@ -249,9 +248,11 @@ watch(currentRegion, async (newVal) => {
   await villageUserRankListLoader.reload();
 });
 
-function goDetails(item: VillageListItem) {
+async function goDetails(item: VillageListItem) {
   showMyFollowPopup.value = false;
-  villageStore.setCurrentVillage(item);
+  const details = await LightVillageApi.getVillageDetails(item.id);
+  villageStore.setCurrentVillage(details);
+  await waitTimeOut(100);
   emit('goVillage')
 }
 function goMessageDetails(item: any) {

+ 3 - 0
src/pages/home/post/post.vue

@@ -0,0 +1,3 @@
+<template>
+  
+</template>

+ 19 - 5
src/pages/home/village/index.vue

@@ -1,10 +1,10 @@
 <template>
-  <FlexCol position="absolute" :left="0" :top="0">
+  <FlexCol v-if="showSwitch" position="absolute" :left="0" :top="0">
     <StatusBarSpace />
-    <Button 
+    <Button
       @click="showMyFollowPopup = true"
       icon="https://xy.wenlvti.net/app_static/images/home/IconSwitch.png"
-      :text="villageStore.currentVillage?.villageName || '未选择村庄'"
+      :text="villageStore.currentVillage?.name || '未选择村庄'"
       type="custom"
       color="transparent"
     />
@@ -35,7 +35,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
+import { onMounted, ref } from 'vue';
 import { useVillageStore } from '@/store/village';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import Height from '@/components/layout/space/Height.vue';
@@ -49,12 +49,26 @@ import Button from '@/components/basic/Button.vue';
 import Popup from '@/components/dialog/Popup.vue';
 import VillageMyFollow from '../components/VillageMyFollow.vue';
 import Empty from '@/components/feedback/Empty.vue';
-import type { VillageListItem } from '@/api/inhert/VillageApi';
+import type { VillageListItem } from '@/api/light/LightVillageApi';
 
 const tab = ref('card');
 const villageStore = useVillageStore();
 const showMyFollowPopup = ref(false);
 
+const props = withDefaults(defineProps<{
+  showSwitch?: boolean;
+}>(), {
+  showSwitch: false,
+});
+
+onMounted(() => {
+  if (!props.showSwitch) {
+    uni.setNavigationBarTitle({
+      title: villageStore.currentVillage?.name || '未选择村庄',
+    });
+  }
+});
+
 function onSelectVillage(village: VillageListItem) {
   villageStore.setCurrentVillage(village);
   showMyFollowPopup.value = false;

+ 20 - 10
src/pages/home/village/introd/card.vue

@@ -154,14 +154,14 @@
       GridItemPaddingVertical: 8,
     }">
       <Grid :borderGrid="false" :mainAxisCount="4">
-        <GridItem title="村庄概况" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIntrod.png" touchable />
-        <GridItem title="自然风光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeEnvirounment.png" touchable />
-        <GridItem title="历史沿革" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHistory.png" touchable />
-        <GridItem title="特色产业" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeIndustry.png" touchable />
-        <GridItem title="文艺活动" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeActivity.png" touchable />
-        <GridItem title="非遗展示" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeShow.png" touchable />
-        <GridItem title="民俗风采" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeFolkloreVibe.png" touchable />
-        <GridItem title="文化志愿者" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeVolunteer.png" touchable />
+        <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/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/IconLargeVolunteer.png" touchable @click="toast('TODO')" />
       </Grid>
     </ProvideVar>
 
@@ -239,8 +239,10 @@ import { navTo } from '@/components/utils/PageAction';
 const villageStore = useVillageStore();
 const villageInfoLoader = useSimpleDataLoader(async () => {
   const village = villageStore.currentVillage;
+  console.log('villageInfoLoader', village);
+  
   return {
-    title: village?.villageName || '',
+    title: village?.name || '',
     desc: village?.desc || '',
     address: village?.address,
     applyCount: village?.applyCount || 0,
@@ -259,7 +261,7 @@ watch(() => villageStore.currentVillage, () => {
   villageInfoLoader.reload();
   recommendLoader.reload();
   villageUserRankListLoader.reload();
-});
+}, { immediate: true });
 
 const rankActiveTag = ref('乡源果');
 const listActiveTag = ref('广场');
@@ -378,4 +380,12 @@ const recommendLoader = useSimpleDataLoader(async () => {
     },
   ];
 });
+
+function handleGoCollect(taskName: string) {
+  navTo('/pages/dig/forms/task', {
+    villageId: villageStore.currentVillage?.id ?? undefined,
+    taskName: taskName,
+    taskPid: -1,
+  });
+}
 </script>

+ 56 - 38
src/pages/home/village/rank/village.vue

@@ -1,50 +1,55 @@
 <template>
   <FlexCol gap="gap.lg" padding="space.md">
+
     <BackgroundBox
       v-for="(item, index) in villageRankListLoader.content.value"
       :key="item.id"
       backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxLong.png"
       :backgroundCutBorder="[10,10,10,10]"
       :backgroundCutBorderSize="[10,10,10,10]"
-      :padding="[25,25]"
-      direction="row"
-      justify="space-between"
-      align="center"
-      gap="gap.md"
     >
-      <FlexRow align="center" gap="gap.lg">
-        <BackgroundBox
-          backgroundImage="https://xy.wenlvti.net/app_static/images/village/ImageBlessingCount.png"
-          width="60rpx"
-          height="60rpx"
-          center
-        >
-          <Text :text="index + 1" fontConfig="h4" color="white" />
-        </BackgroundBox>
-        <Image 
-          :src="item.image" 
-          width="170rpx"
-          height="120rpx"
-          mode="aspectFill"
-          radius="radius.md"
-        />
-        <Text :text="item.title" fontConfig="contentText" />
-      </FlexRow>
-      <FlexRow center gap="gap.md">
-        <BackgroundBox
-          backgroundImage="https://xy.wenlvti.net/app_static/images/village/TagNormal.png"
-          :backgroundCutBorder="[10,10,10,10]"
-          :backgroundCutBorderSize="[10,10,10,10]"
-          :padding="[15,10]"
-          center
-          direction="row"
-          gap="gap.md"
-          width="100"
-        >
-          <Image src="https://xy.wenlvti.net/app_static/images/village/IconLight.png" width="30rpx" height="30rpx" mode="aspectFill" />
-          <Text :text="item.points" fontConfig="contentText" />
-        </BackgroundBox>
-      </FlexRow>
+      <Touchable
+        direction="row"
+        justify="space-between"
+        align="center"
+        gap="gap.md"
+        :padding="[25,25]"
+        @click="handleGoDetails(item)"
+      >
+        <FlexRow align="center" gap="gap.lg">
+          <BackgroundBox
+            backgroundImage="https://xy.wenlvti.net/app_static/images/village/ImageBlessingCount.png"
+            width="60rpx"
+            height="60rpx"
+            center
+          >
+            <Text :text="index + 1" fontConfig="h4" color="white" />
+          </BackgroundBox>
+          <Image 
+            :src="item.image" 
+            width="170rpx"
+            height="120rpx"
+            mode="aspectFill"
+            radius="radius.md"
+          />
+          <Text :text="item.title" fontConfig="contentText" />
+        </FlexRow>
+        <FlexRow center gap="gap.md">
+          <BackgroundBox
+            backgroundImage="https://xy.wenlvti.net/app_static/images/village/TagNormal.png"
+            :backgroundCutBorder="[10,10,10,10]"
+            :backgroundCutBorderSize="[10,10,10,10]"
+            :padding="[15,10]"
+            center
+            direction="row"
+            gap="gap.md"
+            width="100"
+          >
+            <Image src="https://xy.wenlvti.net/app_static/images/village/IconLight.png" width="30rpx" height="30rpx" mode="aspectFill" />
+            <Text :text="item.points" fontConfig="contentText" />
+          </BackgroundBox>
+        </FlexRow>
+      </Touchable>
     </BackgroundBox>
   </FlexCol>
 </template>
@@ -52,12 +57,16 @@
 <script setup lang="ts">
 import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
 import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
+import { useVillageStore } from '@/store/village';
+import { navTo } from '@/components/utils/PageAction';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import LightVillageApi from '@/api/light/LightVillageApi';
 import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
 import Text from '@/components/basic/Text.vue';
 import Image from '@/components/basic/Image.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
+import Touchable from '@/components/feedback/Touchable.vue';
+import { waitTimeOut } from '@imengyu/imengyu-utils';
 
 const { querys } = useLoadQuerys({
   regionId: 0,
@@ -78,4 +87,13 @@ const villageRankListLoader = useSimpleDataLoader(async () => {
     points: item.points,
   }));
 });
+
+const villageStore = useVillageStore();
+
+async function handleGoDetails(item: { id: number }) {
+  const details = await LightVillageApi.getVillageDetails(item.id);
+  villageStore.setCurrentVillage(details);
+  await waitTimeOut(100);
+  navTo('/pages/home/village/index');
+}
 </script>

+ 1 - 1
src/pages/index.vue

@@ -15,7 +15,7 @@
         align="left"
       />
       <HomeIndex v-if="tabIndex === 0" @goVillage="tabIndex = 1" />
-      <VillageIndex v-else-if="tabIndex === 1" />
+      <VillageIndex v-else-if="tabIndex === 1" showSwitch />
       <DigIndex v-else-if="tabIndex === 2" />
       <DiscoverIndex v-else-if="tabIndex === 3" />
       <UserIndex v-else-if="tabIndex === 4" @goSubmit="tabIndex = 2" />

+ 1 - 1
src/store/village.ts

@@ -1,6 +1,6 @@
 import { ref } from 'vue'
 import { defineStore } from 'pinia'
-import VillageApi, { VillageListItem } from '@/api/inhert/VillageApi';
+import type { VillageListItem } from '@/api/light/LightVillageApi';
 
 /** 
  * 村庄各页面共享 数据