소스 검색

📦 按要求修改魅力乡源栏目显示列表

快乐的梦鱼 1 주 전
부모
커밋
49ab4bbc0e

+ 1 - 1
src/common/components/FrameButton.vue

@@ -12,7 +12,7 @@
     @click="emit('click')"
   >
     <ActivityIndicator v-if="loading" :size="size === 'large' ? 36 : 28" :color="primary ? 'white' : 'text.content'" />
-    <Text :text="text" fontConfig="lightTitle" :fontSize="size === 'large' ? 36 : 28" :color="primary ? 'white' : 'text.content'" />
+    <Text :text="text" :wrap="false" fontConfig="lightTitle" :fontSize="size === 'large' ? 36 : 28" :color="primary ? 'white' : 'text.content'" />
   </BackgroundImageButton>
 </template>
 

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

@@ -137,6 +137,11 @@ defineProps({
 defineEmits([	
   "click"	
 ])
+defineOptions({
+  options: {
+    virtualHost: true,
+  },
+})
 </script>
 
 <style lang="scss">

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

@@ -119,4 +119,9 @@ const props = withDefaults(defineProps<ImageBlock2Props>(), {
 defineEmits([	
   "click"	
 ])
+defineOptions({
+  options: {
+    virtualHost: true,
+  },
+})
 </script>

+ 11 - 1
src/components/display/block/ImageBlock3.vue

@@ -3,7 +3,11 @@
     touchable
     v-bind="props"
     :flexShrink="0"
-    :innerStyle="{ borderRadius: theme.resolveThemeSize(radius), overflow: 'hidden', }"
+    :innerStyle="{ 
+      borderRadius: theme.resolveThemeSize(radius), 
+      overflow: 'hidden', 
+      ...props.innerStyle
+    }"
     @click="$emit('click')"
   >
     <Image 
@@ -117,4 +121,10 @@ const props = withDefaults(defineProps<ImageBlock3Props>(), {
 defineEmits([	
   "click"	
 ])
+
+defineOptions({
+  options: {
+    virtualHost: true,
+  },
+})
 </script>

+ 8 - 0
src/pages.json

@@ -409,6 +409,14 @@
             "navigationBarTitleText": "绑定微信",
             "enablePullDownRefresh": false
           }
+        },
+        {
+          "path": "about/goving",
+          "style": {
+            "navigationBarTitleText": "挖掘审核",
+            "navigationStyle": "custom",
+            "enablePullDownRefresh": false
+          }
         }
       ]
     },

+ 23 - 0
src/pages/dig/about/goving.vue

@@ -0,0 +1,23 @@
+<script setup lang="ts">
+import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
+import FlexCol from '@/components/layout/FlexCol.vue';
+import Image from '@/components/basic/Image.vue';
+import Text from '@/components/basic/Text.vue';
+import Height from '@/components/layout/space/Height.vue';
+import Button from '@/components/basic/Button.vue';
+import { navTo } from '@/components/utils/PageAction';
+
+</script>
+
+<template>
+  <CommonTopBanner title="挖掘审核">
+    <FlexCol :padding="[80,20]" :gap="10" center>
+      <Image src="https://mn.wenlvti.net/app_static/xiangyuan/images/home/UnOpenIcon.png" width="300" mode="widthFix" />
+      <Text textAlign="center">你挖掘的史料未经过专家审核,无法展示</Text>
+      <Height :size="20" />
+      <Button size="large" type="primary" @click="navTo('/pages/home/about/contract')">
+        联系客服开通专家审核
+      </Button>
+    </FlexCol>
+  </CommonTopBanner>
+</template>

+ 19 - 72
src/pages/dig/forms/list-ordinary.vue

@@ -65,6 +65,7 @@
                   <Text :size="23">{{ item.desc }}</Text>
                 </FlexCol>
               </Touchable>
+              <FrameButton text="待审核" size="small" @click="navTo('/pages/dig/about/goving')" />
             </BackgroundBox>
           </FlexCol>
           <template #empty>
@@ -109,6 +110,7 @@ import CommonTopBanner from '@/common/components/CommonTopBanner.vue';
 import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
 import Width from '@/components/layout/space/Width.vue';
 import PrimaryButton from '@/common/components/PrimaryButton.vue';
+import FrameButton from '@/common/components/FrameButton.vue';
 
 const subTitle = ref('');
 const searchText = ref('');
@@ -135,38 +137,19 @@ const listLoader = useSimplePageListLoader<{
     throw new Error("params.collectModuleId");
   if (!params.villageId)
     throw new Error("params.villageId");
-  let res = [] as CommonInfoModel[];
-  let total = 0;
+  const info = (await VillageInfoApi.getList({
+    collectModuleId: params.collectModuleId,
+    subId: params.subKey ? params.subId : undefined,
+    subKey: params.subKey,
+    villageId: params.villageId,
+    catalogId: currentCatalog.value?.id || 0,
+    page,
+    pageSize,
+    keywords: searchText.value,
+  }));
+  const res = info.list;
+  const total = info.total;
 
-  if (params.collectModuleId === CollectableModulesIdMap['overview']) {
-    //村社概览特殊处理
-    const info = await VillageInfoApi.getInfoByVillageId(params.villageId);
-    const overviewId = info.myOverviewId || info.overviewId;
-    if (overviewId) {
-      res = page === 1 ? [
-        new CommonInfoModel().setSelfValues({
-          id: info.myOverviewId || info.overviewId || 0,
-          title: info.title,
-          image: info.image,
-          villageVolunteerId: volunteerInfo.value?.id || 0,
-        }),
-      ] : [];
-      total = 1;
-    }
-  } else {
-    const info = (await VillageInfoApi.getList({
-      collectModuleId: params.collectModuleId,
-      subId: params.subKey ? params.subId : undefined,
-      subKey: params.subKey,
-      villageId: params.villageId,
-      catalogId: currentCatalog.value?.id || 0,
-      page,
-      pageSize,
-      keywords: searchText.value,
-    }));
-    res = info.list;
-    total = info.total;
-  }
   const list = res.map((item) => {
     return {
       id: item.id,
@@ -174,7 +157,7 @@ const listLoader = useSimplePageListLoader<{
       title: item.title,
       villageVolunteerId: item.villageVolunteerId,
       desc: DataDateUtils.formatDate(item.updatedAt, 'YYYY-MM-dd') + (
-        authStore.isAdmin ? (' 投稿人:' + item.villageVolunteerName) : ''
+        (' 投稿人:' + item.villageVolunteerName)
       )
     }
   })
@@ -209,46 +192,10 @@ function newData() {
   });
 }
 function goDetail(item: { id: number, villageVolunteerId: number }) {
-
-  let goToFormDisplay = false;
-  let canEdit = false;
-
-  if (!authStore.isAdmin 
-    && (!canCollect.value || item.villageVolunteerId !== volunteerInfo.value?.id)
-  ) {
-    //非当前村社志愿者或者不是自己提交的文章,只能查看详情
-    //村社概览表单特殊处理
-    if ([
-      CollectableModulesIdMap['overview'],
-      CollectableModulesIdMap['environment'], 
-      CollectableModulesIdMap['distribution'],
-      CollectableModulesIdMap['ich'],
-      CollectableModulesIdMap['relic'],
-      CollectableModulesIdMap['folkCulture'],
-      CollectableModulesIdMap['building'],
-    ].includes(currentLoadData.value.collectModuleId)) {
-      goToFormDisplay = true;
-    }
-  } else {
-    goToFormDisplay = true;
-    canEdit = true;
-  }
-
-  if (goToFormDisplay) {
-    navTo('common', {
-      id: item.id,
-      villageId: querys.value.villageId,
-      villageVolunteerId: volunteerInfo.value?.id || 0,
-      catalogId: currentCatalog.value?.id || 0,
-      collectModuleId: currentLoadData.value.collectModuleId,
-      isView: !canEdit,
-    });
-  } else {
-    navTo('/pages/home/discover/details', {
-      villageId: querys.value.villageId,
-      id: item.id,
-    });
-  }
+  navTo('/pages/home/discover/details', {
+    villageId: querys.value.villageId,
+    id: item.id,
+  });
 }
 function search() {
   listLoader.reload();

+ 23 - 12
src/pages/home/discover/details.vue

@@ -48,32 +48,40 @@
                 <Text color="text.second" :size="28">{{ DataDateUtils.formatDate(loader.content.value.publishAt, 'YYYY-MM-dd') }}</Text>
               </FlexRow>
             </FlexCol>
-            <Touchable align="center" gap="gap.md" @click="handleGoUserDetails">
-              <Avatar
-                :src="loader.content.value.villageVolunteerAvatar"
-                width="50"
-                height="50"
-                radius="radius.md"
-              />
-              <Text class="size-ll color-title-text">{{ loader.content.value.villageVolunteerName }}</Text>
-            </Touchable>
           </FlexRow>
-          <FlexCol :padding="[0,30,30,30]">
+          <FlexRow :padding="[0,30,30,30]" gap="gap.md">
             <ImageBlock3
               :src="loader.content.value.image"
               :imageWidth="100"
               :imageHeight="100"
+              :innerStyle="{ 
+                flex: '1 1 100%',
+                width: '100%',
+              }"
               radius="radius.md"
               :title="loader.content.value.villageName"
               :desc="`${loader.content.value.villageProvince}${loader.content.value.villageCity}`"
               @click="handleGoVillageDetails(loader.content.value.villageId)"
             />
-          </FlexCol>
+            <Touchable align="center" gap="gap.md" @click="handleGoUserDetails">
+              <Avatar
+                :src="loader.content.value.villageVolunteerAvatar"
+                width="50"
+                height="50"
+                radius="radius.md"
+              />
+              <Text class="size-ll color-title-text" :wrap="false" :maxWidth="100">{{ loader.content.value.villageVolunteerName }}</Text>
+            </Touchable>
+          </FlexRow>
           <FlexCol :padding="30">
             <Parse
               v-if="loader.content.value.content"
               :content="loader.content.value.content"
             />
+            <Parse
+              v-if="loader.content.value.overview"
+              :content="(loader.content.value.overview as string)"
+            />
             <Text v-if="emptyContent">暂无简介</Text>
           </FlexCol>
           
@@ -124,7 +132,10 @@ import StatusBarSpace from "@/components/layout/space/StatusBarSpace.vue";
 import NavBar from "@/components/nav/NavBar.vue";
 
 const { onPreviewImage } = useSwiperImagePreview(() => loader.content.value?.images || []);
-const emptyContent = computed(() => (loader.content.value?.content || '').trim() === '');
+const emptyContent = computed(() => 
+  (loader.content.value?.content || '').trim() === ''
+  && (loader.content.value?.overview as string || '').trim() === ''
+);
 
 const loader = useSimpleDataLoader(async () => {
   const res = await VillageInfoApi.getInfoForDiscover(querys.value.id);

+ 4 - 4
src/pages/home/village/volunteer/detail.vue

@@ -118,24 +118,24 @@ const infoGrids = computed(() => {
       label: '累计发文',
       unit: '/篇',
       logo: 'https://xy.wenlvti.net/app_static/images/home/volunteer/IconPosts.png',
-      value: infoLoader.content.value?.collectCount as number || 0,
+      value: infoLoader.content.value?.collectCount as number || '0',
     },
     {
       label: '文化积分',
       unit: '/分',
-      value: infoLoader.content.value?.points as number || 0,
+      value: infoLoader.content.value?.points as number || '0',
       logo: 'https://xy.wenlvti.net/app_static/images/home/volunteer/IconLikes.png',
     },
     {
       label: '乡源果累计',
       unit: '/个',
-      value: infoLoader.content.value?.fruittotal as number || 0,
+      value: infoLoader.content.value?.fruittotal as number || '0',
       logo: 'https://xy.wenlvti.net/app_static/images/home/volunteer/IconFruts.png',
     },
     {
       label: '已关注村社',
       unit: '/个',
-      value: infoLoader.content.value?.followVillageCount || 0,
+      value: infoLoader.content.value?.followVillageCount || '0',
       logo: 'https://xy.wenlvti.net/app_static/images/home/volunteer/IconFollows.png',
     },
   ];