Selaa lähdekoodia

📦 更换贴图显示为官方组件

快乐的梦鱼 1 kuukausi sitten
vanhempi
commit
361eaead09

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 883 - 3177
package-lock.json


+ 23 - 23
package.json

@@ -35,22 +35,22 @@
     "type-check": "vue-tsc --noEmit"
   },
   "dependencies": {
-    "@dcloudio/uni-app": "3.0.0-4070620250821001",
-    "@dcloudio/uni-app-harmony": "3.0.0-4070620250821001",
-    "@dcloudio/uni-app-plus": "3.0.0-4070620250821001",
-    "@dcloudio/uni-components": "3.0.0-4070620250821001",
-    "@dcloudio/uni-h5": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-alipay": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-baidu": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-harmony": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-jd": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-kuaishou": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-lark": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-qq": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-toutiao": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-weixin": "3.0.0-4070620250821001",
-    "@dcloudio/uni-mp-xhs": "3.0.0-4070620250821001",
-    "@dcloudio/uni-quickapp-webview": "3.0.0-4070620250821001",
+    "@dcloudio/uni-app": "3.0.0-5000720260410001",
+    "@dcloudio/uni-app-harmony": "3.0.0-5000720260410001",
+    "@dcloudio/uni-app-plus": "3.0.0-5000720260410001",
+    "@dcloudio/uni-components": "3.0.0-5000720260410001",
+    "@dcloudio/uni-h5": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-alipay": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-baidu": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-harmony": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-jd": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-kuaishou": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-lark": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-qq": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-toutiao": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-weixin": "3.0.0-5000720260410001",
+    "@dcloudio/uni-mp-xhs": "3.0.0-5000720260410001",
+    "@dcloudio/uni-quickapp-webview": "3.0.0-5000720260410001",
     "@imengyu/imengyu-utils": "^0.0.28",
     "@imengyu/js-request-transform": "^0.4.0",
     "async-validator": "^4.2.5",
@@ -58,17 +58,17 @@
     "openai": "^6.35.0",
     "pinia": "^3.0.1",
     "tslib": "^2.8.1",
-    "vue": "3.5.22",
-    "vue-i18n": "9.14.5",
+    "vue": "3.5.34",
+    "vue-i18n": "9.14.4",
     "vue-router": "^4.6.3"
   },
   "devDependencies": {
     "@dcloudio/types": "3.4.28",
-    "@dcloudio/uni-automator": "3.0.0-4080520251106001",
-    "@dcloudio/uni-cli-shared": "3.0.0-4080520251106001",
-    "@dcloudio/uni-stacktracey": "3.0.0-4080520251106001",
-    "@dcloudio/vite-plugin-uni": "3.0.0-4080520251106001",
-    "@vue/runtime-core": "3.5.24",
+    "@dcloudio/uni-automator": "3.0.0-5000720260410001",
+    "@dcloudio/uni-cli-shared": "3.0.0-5000720260410001",
+    "@dcloudio/uni-stacktracey": "3.0.0-5000720260410001",
+    "@dcloudio/vite-plugin-uni": "3.0.0-5000720260410001",
+    "@vue/runtime-core": "3.5.34",
     "@vue/tsconfig": "^0.1.3",
     "sass": "^1.86.0",
     "typescript": "^4.9.4",

+ 47 - 0
src/common/components/OfficialAccountPublishWrap.vue

@@ -0,0 +1,47 @@
+<template>
+  <official-account-publish
+    v-if="show"
+    :topic="topic"
+    :background-color="backgroundColor"
+    :limit="limit"
+    :path="path"
+    :show-related="showRelated"
+    @publishsuccess="emit('publishsuccess', $event)"
+    @publishfail="emit('publishfail', $event)"
+  >
+  </official-account-publish>
+</template>
+
+<script setup lang="ts">
+import { waitTimeOut } from '@imengyu/imengyu-utils';
+import { ref, watch } from 'vue';
+
+const props = withDefaults( defineProps<{
+  topic?: string,
+  backgroundColor?: string,
+  limit?: number,
+  path?: string,
+  showRelated?: boolean,
+}>(), {
+  topic: '亮乡源',
+  limit: 10,
+  backgroundColor: '#fef2e8',
+  showRelated: true,
+});
+
+const show = ref(true);
+const emit = defineEmits<{
+  (e: 'publishsuccess', data: any): void;
+  (e: 'publishfail', data: any): void;
+}>();
+
+async function recreateComponent() {
+  show.value = false;
+  await waitTimeOut(200);
+  show.value = true;
+}
+
+watch(() => props.topic, (newVal) => {
+  recreateComponent();
+});
+</script>

+ 5 - 0
src/components/display/block/ImageBlock3.vue

@@ -11,6 +11,7 @@
       :width="imageWidth"
       :height="imageHeight"
       :radius="imageRadius"
+      :defaultImage="defaultImage"
       mode="aspectFill"
     />
     <FlexView direction="column">
@@ -63,6 +64,10 @@ export interface ImageBlock3Props extends Partial<FlexProps> {
    */
   imageHeight?: string | number;
   /**
+   * 默认图片。
+   */
+  defaultImage?: string;
+  /**
    * 图片的路径。
    */
   src?: string;

+ 0 - 1
src/manifest.json

@@ -64,7 +64,6 @@
             }
         },
         "requiredPrivateInfos" : [ "getLocation", "chooseAddress", "chooseLocation", "choosePoi" ],
-        "nativeTags": [ "official-account-publish" ],
         "plugins": {
           "WechatSI": {
             "version": "0.3.6", 

+ 18 - 25
src/pages/home/components/VillageMyFollow.vue

@@ -1,43 +1,36 @@
 <template>
   <FlexCol padding="space.md">
     <HomeTitle title="我的关注" />
-    <RequireLogin unLoginMessage="登录后查看我的关注村社" @loginSuccess="myFollowLoader.reload()">
-      <SimplePageListLoader :loader="myFollowLoader">
-        <FlexCol gap="gap.md">
-          <ImageBlock3
-            v-for="(item, i) in myFollowLoader.list.value"
-            :key="i"
-            backgroundColor="transparent"
-            :src="item.image"
-            defaultImage="https://xy.wenlvti.net/app_static/images/village/PlaceholderVillage.png"
-            :title="item.name"
-            :desc="item.address"
-            :imageRadius="15"
-            :imageWidth="200"
-            :imageHeight="140"
-            @click="emit('goDetails', item)"
-          />
-        </FlexCol>
-      </SimplePageListLoader>
+    <RequireLogin unLoginMessage="登录后查看我的关注村社" @loginSuccess="villageStore.loadMyFollowVillages()">
+      <FlexCol gap="gap.md">
+        <ImageBlock3
+          v-for="(item, i) in villageStore.myFollowVillages"
+          :key="i"
+          backgroundColor="transparent"
+          :src="item.image"
+          defaultImage="https://xy.wenlvti.net/app_static/images/village/PlaceholderVillage.jpg"
+          :title="item.name"
+          :desc="item.address"
+          :imageRadius="15"
+          :imageWidth="200"
+          :imageHeight="140"
+          @click="emit('goDetails', item as VillageListItem)"
+        />
+      </FlexCol>
     </RequireLogin>
   </FlexCol>
 </template>
 
 <script setup lang="ts">
-import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
 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 RequireLogin from '@/common/components/RequireLogin.vue';
 import type { VillageListItem } from '@/api/light/LightVillageApi';
+import { useVillageStore } from '@/store/village';
 
 const emit = defineEmits<{
   (e: 'goDetails', item: VillageListItem): void;
 }>();
-
-const myFollowLoader = useSimplePageListLoader(20, async (page, pageSize) => {
-  return (await FollowVillageApi.getFollowVillageList({ page: page, pageSize: pageSize }));
-});
+const villageStore = useVillageStore();
 </script>

+ 146 - 153
src/pages/home/index.vue

@@ -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);
     }
   }
 }

+ 2 - 9
src/pages/home/village/goods/detail.vue

@@ -46,25 +46,18 @@
 </template>
 
 <script setup lang="ts">
-import Construction from '@/common/components/Construction.vue';
-import FrameButton from '@/common/components/FrameButton.vue';
+import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
+import { toast } from '@/components/utils/DialogAction';
 import Image from '@/components/basic/Image.vue';
 import ImageButton from '@/components/basic/ImageButton.vue';
 import Text from '@/components/basic/Text.vue';
-import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
 import Avatar from '@/components/display/Avatar.vue';
 import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
 import Divider from '@/components/display/Divider.vue';
-import Touchable from '@/components/feedback/Touchable.vue';
-import SearchBar from '@/components/form/SearchBar.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Height from '@/components/layout/space/Height.vue';
 import SimplePageContentLoader from '@/components/loader/SimplePageContentLoader.vue';
-import { toast } from '@/components/utils/DialogAction';
-import { navTo } from '@/components/utils/PageAction';
-import { ref } from 'vue';
-
 const goodLoader = useSimpleDataLoader(async () => {
   return {
     id: 1,

+ 9 - 7
src/pages/home/village/index.vue

@@ -46,31 +46,33 @@
       <Height :height="150" />
     </FlexCol>
     <Around v-else />
+    <Height :height="200" />
+
   </CommonRoot>
 </template>
 
 <script setup lang="ts">
 import { computed, onMounted, ref } from 'vue';
 import { useVillageStore } from '@/store/village';
+import { useFollow } from './composeabe/Follow';
+import { navTo } from '@/components/utils/PageAction';
+import type { VillageListItem } from '@/api/light/LightVillageApi';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import Height from '@/components/layout/space/Height.vue';
 import Image from '@/components/basic/Image.vue';
-import HomeLargeTitle from '@/common/components/parts/HomeLargeTitle.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Card from './introd/card.vue';
 import Tree from './introd/tree.vue';
 import StatusBarSpace from '@/components/layout/space/StatusBarSpace.vue';
 import Button from '@/components/basic/Button.vue';
 import Popup from '@/components/dialog/Popup.vue';
-import VillageMyFollow from '../components/VillageMyFollow.vue';
-import type { VillageListItem } from '@/api/light/LightVillageApi';
-import Around from './recommed/around.vue';
 import Text from '@/components/basic/Text.vue';
-import FrameButton from '@/common/components/FrameButton.vue';
 import CommonRoot from '@/components/dialog/CommonRoot.vue';
-import { navTo } from '@/components/utils/PageAction';
-import { useFollow } from './composeabe/Follow';
 import Width from '@/components/layout/space/Width.vue';
+import VillageMyFollow from '../components/VillageMyFollow.vue';
+import HomeLargeTitle from '@/common/components/parts/HomeLargeTitle.vue';
+import Around from './recommed/around.vue';
+import FrameButton from '@/common/components/FrameButton.vue';
 
 const tab = ref('card');
 const villageStore = useVillageStore();

+ 5 - 6
src/pages/home/village/introd/card.vue

@@ -231,13 +231,11 @@
       </template>
     </HomeTitle>
     <RoundTags v-model:active="listActiveTag" :tags="['广场', '老味道', '老手艺', '老物件', '老故事']" />
-    <official-account-publish
-      :topic="recommendTagName" 
-      @publishsuccess="onPublishSuccess"
-    >
-    </official-account-publish>
-
   </FlexCol>
+  <OfficialAccountPublishWrap
+    :topic="recommendTagName" 
+    @publishsuccess="onPublishSuccess"
+  />
 
 </template>
 
@@ -272,6 +270,7 @@ import Grid from '@/components/layout/grid/Grid.vue';
 import GridItem from '@/components/layout/grid/GridItem.vue';
 import LightVillageApi from '@/api/light/LightVillageApi';
 import Construction from '@/common/components/Construction.vue';
+import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
 
 const authStore = useAuthStore();
 const { getIsVolunteer } = useUserTools();

+ 5 - 3
src/store/village.ts

@@ -1,6 +1,7 @@
 import { ref } from 'vue'
 import { defineStore } from 'pinia'
 import type { VillageListItem } from '@/api/light/LightVillageApi';
+import FollowVillageApi from '@/api/light/FollowVillageApi';
 
 /** 
  * 村庄各页面共享 数据
@@ -26,8 +27,9 @@ export const useVillageStore = defineStore('village', () => {
   function setCurrentRegion(region: string) {
     currentRegion.value = region;
   }
-  function setMyFollowVillages(villages: VillageListItem[]) {
-    myFollowVillages.value = villages;
+  async function loadMyFollowVillages() {
+    const villages = await FollowVillageApi.getFollowVillageList();
+    myFollowVillages.value = villages.list;
   }
   function setMyJoinedVillages(villages: VillageListItem[]) {
     myJoinedVillages.value = villages;
@@ -43,7 +45,7 @@ export const useVillageStore = defineStore('village', () => {
     setCurrentVillage,
     setCurrentLonlat,
     setCurrentRegion,
-    setMyFollowVillages,
+    loadMyFollowVillages,
     setMyJoinedVillages,
   }
 })