ソースを参照

📦 补充占位符页面

快乐的梦鱼 1 ヶ月 前
コミット
5fa5c51448

+ 14 - 0
src/pages.json

@@ -112,6 +112,20 @@
       }
     },
     {
+      "path": "pages/home/village/honor/index",
+      "style": {
+        "navigationBarTitleText": "乡源荣光",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/home/village/gov/index",
+      "style": {
+        "navigationBarTitleText": "政贤连心",
+        "navigationStyle": "custom"
+      }
+    },
+    {
       "path": "pages/article/details",
       "style": {
         "navigationBarTitleText": "新闻详情"

+ 29 - 30
src/pages/home/village/goods/index.vue

@@ -4,37 +4,36 @@
       <SearchBar v-model:value="searchValue" :innerStyle="{ width: '440rpx' }" />
       <FrameButton text="开通微信小店" size="small" />
     </FlexRow>
-    <Construction text="测试数据,暂无接口">
-      <FlexRow wrap justify="space-around" gap="gap.sm">
-        <BackgroundBox 
-          v-for="good in goodsLoader.content.value" :key="good.id"
-          backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxMid.png"
-          :backgroundCutBorder="32"
-          :backgroundCutBorderSize="36"
-          :padding="24"
-          :innerStyle="{
-            width: 'calc(50% - 50rpx)',
-          }"
-        >
-          <Touchable direction="column" gap="gap.lg" @click="handleGoodDetail(good)">
-            <Image 
-              :src="good.image"
-              :radius="20"
-              width="100%"
-              height="300rpx"
-              mode="aspectFill"
+    <Construction text="现在是测试数据,暂无接口" />
+    <FlexRow wrap justify="space-around" gap="gap.sm">
+      <BackgroundBox 
+        v-for="good in goodsLoader.content.value" :key="good.id"
+        backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxMid.png"
+        :backgroundCutBorder="32"
+        :backgroundCutBorderSize="36"
+        :padding="24"
+        :innerStyle="{
+          width: 'calc(50% - 50rpx)',
+        }"
+      >
+        <Touchable direction="column" gap="gap.lg" @click="handleGoodDetail(good)">
+          <Image 
+            :src="good.image"
+            :radius="20"
+            width="100%"
+            height="300rpx"
+            mode="aspectFill"
+          />
+          <FlexRow align="center" gap="gap.md">
+            <Avatar 
+              :src="good.avatar"
+              :size="40"
             />
-            <FlexRow align="center" gap="gap.md">
-              <Avatar 
-                :src="good.avatar"
-                :size="40"
-              />
-              <Text :text="`发布人: ${good.userName}`" fontConfig="contentText" />
-            </FlexRow>
-          </Touchable>
-        </BackgroundBox>
-      </FlexRow>
-    </Construction>
+            <Text :text="`发布人: ${good.userName}`" fontConfig="contentText" />
+          </FlexRow>
+        </Touchable>
+      </BackgroundBox>
+    </FlexRow>
   </FlexCol>
 </template>
 

+ 23 - 0
src/pages/home/village/gov/index.vue

@@ -0,0 +1,23 @@
+<template>
+  <CommonTopBanner title="政贤连心">
+    <Construction
+      text="等待设计《政贤连心》页面"
+    />
+  </CommonTopBanner>
+</template>
+
+<script setup lang="ts">  
+import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
+import { useVillageStore } from '@/store/village';
+import Construction from '@/common/components/Construction.vue';
+import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
+
+const villageStore = useVillageStore();
+const recommendLoader = useSimpleDataLoader(async () => {
+  if (!villageStore.currentRegion)
+    return [];
+
+
+  return [];
+});
+</script>

+ 23 - 0
src/pages/home/village/honor/index.vue

@@ -0,0 +1,23 @@
+<template>
+  <CommonTopBanner title="乡源荣光">
+    <Construction
+      text="等待设计《乡源荣光》页面"
+    />
+  </CommonTopBanner>
+</template>
+
+<script setup lang="ts">  
+import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
+import { useVillageStore } from '@/store/village';
+import Construction from '@/common/components/Construction.vue';
+import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
+
+const villageStore = useVillageStore();
+const recommendLoader = useSimpleDataLoader(async () => {
+  if (!villageStore.currentRegion)
+    return [];
+
+
+  return [];
+});
+</script>

+ 9 - 38
src/pages/home/village/introd/card.vue

@@ -56,42 +56,12 @@
       </Construction>
       
       <!-- 图片 -->
-      <Construction text="暂无接口">
-        <FlexRow v-if="villageInfoLoader.content.value" justify="space-between">
-          <Image 
-            v-for="index of 3" 
-            :key="index" 
-            :src="villageInfoLoader.content.value.images[index - 1]" 
-            radius="radius.md"
-            :width="200"
-            :height="140"
-            mode="aspectFill"
-            defaultImage=""
-            touchable
-          >
-            <template #empty>
-              <Touchable 
-                direction="column" 
-                position="absolute" 
-                inset="0" 
-                center
-                backgroundColor="background.primary"
-              >
-                <Icon name="add" size="fontSize.md" />
-                <Text text="上传封面" fontConfig="secondText" />
-              </Touchable>
-            </template>
-            <FlexCol 
-              v-if="index === 3 && villageInfoLoader.content.value.images.length > 3" 
-              position="absolute" inset="0" 
-              center 
-              backgroundColor="mask.default"
-            >
-              <Text :text="`+${villageInfoLoader.content.value.images.length - 3}`" fontSize="fontSize.lg" color="white" />
-            </FlexCol>
-          </Image>
-        </FlexRow>
-      </Construction>
+      <VillageGallery
+        v-if="villageInfoLoader.content.value"
+        :villageId="villageStore.currentVillage?.id ?? 0" 
+        :images="villageInfoLoader.content.value.images" 
+        @update:images="villageInfoLoader.reload()"
+      />
 
       <!-- 地址 -->
       <FlexRow align="center" gap="gap.sm">
@@ -210,10 +180,10 @@
       GridItemPaddingVertical: 8,
     }">
       <Grid :borderGrid="false" :mainAxisCount="4">
-        <GridItem title="乡源荣光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHornor.png" touchable @click="toast('暂未开放,敬请期待!')" />
+        <GridItem title="乡源荣光" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeHornor.png" touchable @click="navTo('/pages/home/village/honor/index')" />
         <GridItem title="乡源好物" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeGoods.png" touchable @click="navTo('/pages/home/village/goods/index')" />
         <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 @click="toast('暂未开放,敬请期待!')" />
+        <!-- <GridItem title="政贤连心" icon="https://xy.wenlvti.net/app_static/images/village/IconGovAffairs.png" touchable @click="navTo('/pages/home/village/gov/index')" /> -->
         <GridItem title="互动游戏" icon="https://xy.wenlvti.net/app_static/images/village/IconLargeGame.png" touchable @click="navTo('/pages/home/village/games/index')" />
       </Grid>
     </ProvideVar>
@@ -282,6 +252,7 @@ import Construction from '@/common/components/Construction.vue';
 import OfficialAccountPublishWrap from '@/common/components/OfficialAccountPublishWrap.vue';
 import ApplyGoodsDialog from '../dialogs/ApplyGoodsDialog.vue';
 import JoinDialog from '../dialogs/JoinDialog.vue';
+import VillageGallery from '../components/VillageGallery.vue';
 
 const authStore = useAuthStore();
 const { getIsVolunteer } = useUserTools();

+ 2 - 0
src/pages/home/village/volunteer/detail.vue

@@ -1,6 +1,7 @@
 <template>
   <CommonTopBanner title="志愿者详情">
     <SimplePageContentLoader :loader="infoLoader">
+      <Construction text="现在是接口缺少部分数据" />
       <FlexCol v-if="infoLoader.content.value" gap="gap.md" padding="padding.md">
         <BackgroundBox 
           backgroundImage="https://xy.wenlvti.net/app_static/images/village/BoxLarge.png"
@@ -100,6 +101,7 @@ import Divider from '@/components/display/Divider.vue';
 import { computed } from 'vue';
 import HomeTitle from '@/common/components/parts/HomeTitle.vue';
 import Width from '@/components/layout/space/Width.vue';
+import Construction from '@/common/components/Construction.vue';
 
 const { querys } = useLoadQuerys({
   id: 0,

+ 4 - 2
src/store/village.ts

@@ -2,6 +2,7 @@ import { ref } from 'vue'
 import { defineStore } from 'pinia'
 import type { VillageListItem } from '@/api/light/LightVillageApi';
 import FollowVillageApi from '@/api/light/FollowVillageApi';
+import LightVillageApi from '@/api/light/LightVillageApi';
 
 /** 
  * 村庄各页面共享 数据
@@ -14,8 +15,9 @@ export const useVillageStore = defineStore('village', () => {
   const myFollowVillages = ref<VillageListItem[]>([]);
   const myJoinedVillages = ref<VillageListItem[]>([]);
 
-  function setCurrentVillage(village: VillageListItem) {
-    currentVillage.value = village;
+  async function setCurrentVillage(village: VillageListItem) {
+    currentVillage.value = await LightVillageApi.getVillageDetails(village.id);
+    console.log('currentVillage', currentVillage.value);
     uni.setStorageSync('currentVillage', village.id);
   }
   function loadCurrentVillage() {