快乐的梦鱼 2 månader sedan
förälder
incheckning
6fc6cbe24e

+ 2 - 2
src/api/RequestModules.ts

@@ -49,12 +49,12 @@ function requestInceptor(url: string, req: RequestOptions) {
   if (req.method == 'GET') {
     //追加GET参数
     url = appendGetUrlParams(url, 'main_body_id', ApiCofig.mainBodyId);
-    url = appendGetUrlParams(url, 'platform', ApiCofig.platformId);
+    //url = appendGetUrlParams(url, 'platform', ApiCofig.platformId);
     if (append_main_body_user_id)
       url = appendGetUrlParams(url, 'main_body_user_id', main_body_user_id);
   } else {
     req.data = appendPostParams(req.data,'main_body_id', ApiCofig.mainBodyId);
-    req.data = appendPostParams(req.data,'platform', ApiCofig.platformId);
+    //req.data = appendPostParams(req.data,'platform', ApiCofig.platformId);
     
     if (append_main_body_user_id)
       req.data = appendPostParams(req.data,'main_body_user_id', main_body_user_id);

+ 5 - 2
src/api/inhert/VillageApi.ts

@@ -141,10 +141,12 @@ export class VillageCatalogListItem extends DataModel<VillageCatalogListItem> {
     this.setNameMapperCase('Camel', 'Snake');
     this._convertTable = {
       id: { clientSide: 'number', serverSide: 'number', clientSideRequired: true },
-      haschild: { clientSide: 'boolean', serverSide: 'number' },
     }
     this._nameMapperServer = {
     };
+    this._afterSolveServer = () => {
+      this.haschild = (this.childlist as any[]).length > 0;
+    }
     this._convertKeyType = (key, direction) => {
       if (key.endsWith('At'))
         return {
@@ -193,9 +195,10 @@ export class VillageApi extends AppServerRequestModule<DataModel> {
       ...data
     }, '认领村落')) ;
   }
-  async getVallageList(level?: number) {
+  async getVallageList(level?: number, status?: number) {
     return (this.get('/village/village/getList', '村落列表', {
       history_level: level,
+      status,
     })) 
       .then(res => transformArrayDataModel<VillageListItem>(VillageListItem, transformSomeToArray(res.data2), `村落`, true))
       .catch(e => { throw e });

+ 2 - 2
src/common/config/ApiCofig.ts

@@ -3,8 +3,8 @@
  * 说明:后端接口配置
  */
 export default {
-  serverDev: 'https://mn.wenlvti.net/api',
-  serverProd: 'https://mn.wenlvti.net/api',
+  serverDev: 'https://xy.wenlvti.net/api',
+  serverProd: 'https://xy.wenlvti.net/api',
   amapServerKey: '8fd09264c33678141f609588c432df0e',
   mainBodyId: 2,
   platformId: 330,

+ 4 - 3
src/components/basic/Icon.vue

@@ -38,10 +38,10 @@
   />
   <!-- #endif -->
 
-  <image
+  <WrappedImage
     v-else-if="iconData.type == 'image'"
-    :style="style"
-    :class="innerClass"
+    :innerStyle="style"
+    :innerClass="innerClass"
     :src="iconData.value"
   />
 </template>
@@ -50,6 +50,7 @@
 import { computed } from 'vue';
 import { IconUtils, type IconItem } from './IconUtils';
 import { useTheme } from '../theme/ThemeDefine';
+import WrappedImage from './Image.vue';
 
 export interface IconProps {
   /**

+ 28 - 3
src/components/basic/Image.vue

@@ -1,5 +1,6 @@
 <template>
   <view 
+    :id="id"
     class="nana-image-wrapper"
     :style="style"
     :class="innerClass"
@@ -22,8 +23,8 @@
       @error="isErrorState = true; isLoadState = false"
     />
     <view v-if="showFailed && isErrorState && !failedImage" class="inner-view error">
-      <!-- todo: failed -->
-      <Text color="second" :text="src ? '暂无图片' : '加载失败'" />
+      <Icon icon="warning" color="text.second" :size="32" />
+      <Text v-if="realWidth > 50" color="text.second" :text="src ? '加载失败' : '暂无图片'" :fontSize="22" />
     </view>
     <view v-if="showLoading && isLoadState" class="inner-view loading">
       <ActivityIndicator
@@ -35,10 +36,12 @@
 </template>
 
 <script setup lang="ts">
-import { computed, onMounted, ref, watch } from 'vue';
+import { computed, getCurrentInstance, nextTick, onMounted, ref, watch } from 'vue';
 import { propGetThemeVar, useTheme } from '../theme/ThemeDefine';
 import ActivityIndicator from './ActivityIndicator.vue';
 import Text from './Text.vue';
+import Icon from './Icon.vue';
+import { RandomUtils } from '@imengyu/imengyu-utils';
 
 export interface ImageProps {
   /**
@@ -102,6 +105,8 @@ export interface ImageProps {
   innerClass?: string,
 }
 
+const id = 'img' + RandomUtils.genNonDuplicateID(20);
+
 defineOptions({
   options: {
     virtualHost: true
@@ -126,6 +131,7 @@ const emit = defineEmits([ 'click' ]);
 const isErrorState = ref(false);
 const isLoadState = ref(true);
 const themeContext = useTheme();
+const instance = getCurrentInstance();
 
 const style = computed(() => {
   const o : Record<string, any> = {
@@ -138,6 +144,7 @@ const style = computed(() => {
   }
   return o;
 });
+const realWidth = ref(0);
 
 function handleClick() {
   if (props.clickPreview) {
@@ -157,6 +164,18 @@ function loadSrcState() {
     isLoadState.value = false;
   }
 }
+function measureImage() {
+  uni.createSelectorQuery()
+    .in(instance)
+    .select('#' + id)
+    .boundingClientRect((rect) => {
+      if (rect) {
+        realWidth.value = (rect as UniApp.NodeInfo).width || 0;
+        console.log('realWidth', realWidth.value);
+        
+      }
+    }).exec();
+}
 
 watch(() => props.src, (newVal, oldVal) => {
   if (newVal) {
@@ -164,10 +183,16 @@ watch(() => props.src, (newVal, oldVal) => {
     isLoadState.value = false;
   } else
     isErrorState.value = false;
+  nextTick(() => {
+    measureImage();
+  });
 })
 
 onMounted(() => {
   loadSrcState();
+  nextTick(() => {
+    measureImage();
+  })
 })
 </script>
 

+ 3 - 2
src/components/dynamic/wrappers/PickerLonlat.vue

@@ -2,7 +2,7 @@
   <Button
     type="primary"
     size="small"
-    :text="props.modelValue ? `${FormatUtils.formatCoordinates(props.modelValue[1], props.modelValue[0])}` : '请选择经纬度'"
+    :text="props.modelValue ? `${FormatUtils.formatCoordinates(props.modelValue[0], props.modelValue[1])}` : '请选择经纬度'"
     @click="openPicker"
   />
 </template>
@@ -16,7 +16,7 @@ const props = defineProps<PickerLonlatProps & {
   modelValue: number[],
 }>()
 
-const emit = defineEmits(['update:modelValue']);
+const emit = defineEmits(['update:modelValue', 'change']);
 
 function openPicker() {
   if (props.disabled)
@@ -26,6 +26,7 @@ function openPicker() {
     longitude: props.modelValue?.[1] || props.defaultLongLat?.[1],
     success: (res) => {
       console.log(res);
+      emit('change', [res.latitude, res.longitude]);
       emit('update:modelValue', [res.latitude, res.longitude]);
     },
   });

+ 1 - 0
src/components/utils/DialogAction.ts

@@ -29,6 +29,7 @@ function alert(option: {
   uni.showModal({
     title: option.title,
     content: option.content,
+    showCancel: false,
   })
 };
 /**

+ 141 - 0
src/pages/dig/components/CollectModuleList.vue

@@ -0,0 +1,141 @@
+<template>
+  <FlexCol>
+    <Image
+      v-if="currentTaskBanner"
+      :src="currentTaskBanner"
+      :radius="20"
+      :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"
+        :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
+        @click="handleClick(item)"
+      />
+    </FlexCol>
+  </FlexCol>
+</template>
+
+<script setup lang="ts">
+import { onMounted, ref, watch } from 'vue';
+import { useCollectStore } from '@/store/collect';
+import { useTaskEntryForm } from '../forms/composeable/TaskEntryForm';
+import { TaskMenuDef, type TaskMenuDefGoForm, type TaskMenuDefItem } from '../forms/tasks';
+import { alert } from '@/components/utils/DialogAction';
+import { getVillageInfoForm } from '../forms/forms';
+import { navTo } from '@/components/utils/PageAction';
+import { TaskRootDef } from '../forms/tasks';
+import FlexCol from '@/components/layout/FlexCol.vue';
+import Image from '@/components/basic/Image.vue';
+import TaskList from '../components/TaskList.vue';
+import VillageApi from '@/api/inhert/VillageApi';
+
+const { goForm } = useTaskEntryForm();
+const { canCollect, getCollectModuleInternalNameById } = useCollectStore();
+
+const props = defineProps<{
+  villageId: number,
+  villageVolunteerId: number,
+  taskName: string,
+  taskTitle: string,
+  taskPid: number,
+}>();
+
+async function loadList() {
+  const { villageId, taskName, taskPid } = props;
+  if (taskName) {
+    currentTaskDefItems.value = TaskMenuDef[taskName].list.concat();
+    currentTaskBanner.value = TaskMenuDef[taskName].banner;
+  } else {
+    currentTaskDefItems.value = TaskRootDef
+  }
+  if (taskPid >= 0) {
+    const res = (await VillageApi.getCatalogList(villageId, taskPid));
+    if (res.length === 0)
+      return;
+    currentTaskDefItems.value = res
+      .map(item => {
+        try {
+          const collectModuleInternalName = getCollectModuleInternalNameById(item.collectModuleId);
+          if (!collectModuleInternalName && item.collectModuleId)
+            throw new Error('不存在定义的表单数据');
+          const formDefine = collectModuleInternalName ? getVillageInfoForm(collectModuleInternalName, -1) : undefined;
+          return {
+            ...item,
+            enable: true,
+            catalogItem: item,
+            goForm: collectModuleInternalName ? [ 
+              collectModuleInternalName, 
+              -1, 
+              formDefine?.[2].typeName, 
+              collectModuleInternalName === 'overview' ? 'common' : undefined,
+              item.title 
+            ] as TaskMenuDefGoForm : undefined,
+            onClick: () => {
+              if (item.haschild) {
+                navTo('/pages/dig/forms/task', {
+                  ...props,
+                  taskName: '',
+                  taskTitle: item.title,
+                  taskPid: item.id,
+                })
+              } else {
+                alert({
+                  title: item.title,
+                  content: '不存在定义的表单数据',
+                })
+              }
+            }
+          }
+        } catch (e) {
+          return {
+            ...item,
+            desc: '' + e,
+            enable: false,
+          }
+        }
+      });
+  }
+}
+
+watch(() => props.taskPid, loadList);
+onMounted(loadList);
+
+const currentTaskDefItems = ref<TaskMenuDefItem[]>([]);
+const currentTaskBanner = ref('');
+const handleClick = (item: TaskMenuDefItem) => {
+  
+  if (!item.enable) {
+    uni.showToast({
+      title: '您没有完成任务的权限,如需要请联系管理员',
+      icon: 'none',
+      duration: 2000
+    });
+    return;
+  }
+  if (item.goForm instanceof Array) {
+    goForm(...item.goForm);
+    return;
+  }
+  else if (item.goForm) {
+    navTo('/pages/dig/forms/task', {
+      ...props,
+      taskName: item.goForm.name,
+      taskTitle: item.title,
+      taskPid: (item as any).id,
+    })
+    return;
+  }
+  if (item.onClick) {
+    item.onClick();
+  }
+}
+
+
+
+</script>

+ 1 - 1
src/pages/dig/components/TaskList.vue

@@ -36,7 +36,7 @@ defineProps({
   <FlexRow :padding="25" backgroundColor="white" :radius="20" justify="space-between" align="center">
     <FlexRow align="center">
       <FlexCol center radius="50%" backgroundColor="#efefef" :padding="20">
-        <Icon :icon="icon" color="primary" type="material" :size="50" />
+        <Icon :icon="icon || 'help-filling'" color="primary" type="material" :size="50" />
       </FlexCol>
       <Width :width="20" />
       <FlexCol class="info">

+ 7 - 59
src/pages/dig/details.vue

@@ -44,14 +44,12 @@
         message="您当前没有可完成的任务"
         description="请联系管理员认领可采编栏目"
       />
-      <TaskList
-        v-for="(item,key) in taskList.content.value"
-        :key="key"
-        :icon="item.icon"
-        :title="item.title"
-        :desc="item.desc"
-        :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
-        @click="goTask(item)"
+      <CollectModuleList
+        :villageId="querys.villageId"
+        :villageVolunteerId="querys.villageVolunteerId"
+        :taskName="''"
+        :taskTitle="''"
+        :taskPid="0"
       />
     </FlexCol>
     <XBarSpace />
@@ -60,13 +58,9 @@
 
 <script setup lang="ts">
 import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
-import { computed } from 'vue';
 import { useAuthStore } from '@/store/auth';
 import { useCollectStore } from '@/store/collect';
-import { TaskRootDef, type TaskRootMenuDefItem } from './forms/tasks';
 import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
-import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
-import { navTo } from '@/components/utils/PageAction';
 import Icon from '@/components/basic/Icon.vue';
 import Text from '@/components/basic/Text.vue';
 import Touchable from '@/components/feedback/Touchable.vue';
@@ -74,11 +68,10 @@ import Height from '@/components/layout/space/Height.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import Image from '@/components/basic/Image.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
-import TaskList from './components/TaskList.vue';
+import CollectModuleList from './components/CollectModuleList.vue';
 import XBarSpace from '@/components/layout/space/XBarSpace.vue';
 import Width from '@/components/layout/space/Width.vue';
 import Alert from '@/components/feedback/Alert.vue';
-import VillageApi, { VillageCatalogListItem } from '@/api/inhert/VillageApi';
 
 const { querys } = useLoadQuerys({ 
   name: '',
@@ -92,29 +85,6 @@ const authStore = useAuthStore();
 const { canCollect, isEmpty } = useCollectStore();
 const { goForm } = useTaskEntryForm();
 
-const nextPageData = computed(() => ({
-  villageId: querys.value.villageId,  
-  villageVolunteerId: querys.value.villageVolunteerId,
-}));
-const taskList = useSimpleDataLoader<(TaskRootMenuDefItem & {
-  catalogItem?: VillageCatalogListItem,
-})[]>(async () => {
-  const res = (await VillageApi.getCatalogList(querys.value.villageId))
-    .filter(item => item.pid == 0);
-  if (res.length === 0)
-    return TaskRootDef;
-  return res
-    .map(item => ({
-      ...item,
-      enable: true,
-      catalogItem: item,
-      goForm: { 
-        title: item.title, 
-        name: 'force' 
-      },
-    } as TaskRootMenuDefItem));
-});
-
 function goCollect() {
   if (!canCollect('collect')) {
     uni.showToast({
@@ -126,26 +96,4 @@ function goCollect() {
   }
   goForm('collect', 1, '随手记')
 }
-
-function goTask(item: TaskRootMenuDefItem & {
-  catalogItem?: VillageCatalogListItem,
-}) {
-  if (!item.enable) {
-    uni.showToast({
-      title: '您当前没有可完成此任务的权限',
-      icon: 'none',
-      duration: 2000
-    });
-    return;
-  }
-  if (item.goForm instanceof Array) {
-    goForm(...item.goForm)
-  } else {
-    navTo('forms/task', {
-      ...nextPageData.value,
-      taskPid: item.catalogItem?.id || 0,
-      taskName: item.goForm.name,
-    })
-  }
-}
 </script>

+ 67 - 0
src/pages/dig/forms/data/spots.ts

@@ -0,0 +1,67 @@
+import { VillageEnvInfo } from "@/api/inhert/VillageInfoApi";
+import { villageCommonContent } from "./common";
+import type { FieldProps } from "@/components/form/Field.vue";
+import type { SingleForm } from "../forms";
+import MapApi from "@/api/map/MapApi";
+
+export const villageInfoSpotsFormItems : SingleForm = [VillageEnvInfo, (form) => ({
+  formItems: [
+    ...villageCommonContent(form, {
+      title: '风景名胜',
+      showContent: true,
+      showTitle: true,
+    }).formItems,
+    {
+      label: '地理信息',
+      name: 'baseInfo',
+      type: 'flat-group',
+      childrenColProps: {
+        span: 24,
+      },
+      children: [
+        { 
+          label: '经纬度', 
+          name: 'lonlat', 
+          type: 'select-lonlat', 
+          defaultValue: '',
+          additionalProps: {
+            onChange(val: [number, number]) {
+              if (form.value.getValueByPath('address'))
+                return;
+              MapApi.regeoAddress(val[0], val[1]).then(res => {
+                form.value.setValueByPath('address', res);
+              });
+            },
+          },
+          formProps: { showRightArrow: true } as FieldProps,
+        }, 
+        {
+          label: '地址',
+          name: 'address',
+          type: 'text',
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入地址',
+          },
+          rules: []
+        },
+        {
+          label: '方位',
+          name: 'orientation',
+          type: 'text',
+          rules: []
+        },
+        {
+          label: '相对距离',
+          name: 'distance',
+          type: 'text',
+          defaultValue: '',
+          additionalProps: {
+            placeholder: '请输入相对距离',
+          },
+          rules: []
+        },
+      ]
+    },
+  ]
+}), { title: '风景名胜', typeName: '', }]

+ 24 - 0
src/pages/dig/forms/forms.ts

@@ -16,6 +16,7 @@ import { villageInfoRouteForm, villageInfoTravelGuideForm } from "./data/travel"
 import { villageInfoSpeakerForm } from "./data/specker";
 import { ichFormItems } from "./data/ich";
 import type { PickerIdFieldProps } from "@/components/dynamic/wrappers/PickerIdField";
+import { villageInfoSpotsFormItems } from "./data/spots";
 
 export type SingleForm = [NewDataModel, (formRef: Ref<IDynamicFormRef>) => IDynamicFormOptions, {
   title: string,
@@ -25,12 +26,35 @@ export type SingleForm = [NewDataModel, (formRef: Ref<IDynamicFormRef>) => IDyna
 }]
 export type GroupForm = Record<number, SingleForm>
 
+export const CollectableModulesNameMapping : Record<string, string> = {
+  'overview': '村落概况',
+  'distribution': '建筑分布',
+  'building': '传统建筑',
+  'folk_culture': '民俗文化',
+  'food_product': '美食物产',
+  'route': '旅游路线',
+  'travel_guide': '旅游导览',
+  'element': '环境要素',
+  'environment': '环境格局',
+  'relic': '文物古迹',
+  'cultural': '历史文化',
+  'figure': '历史人物',
+  'ich': '非遗',
+  'story': '掌故轶事',
+  'spots': '风景名胜',
+  'speaker': '口述者',
+  'collect': '随手记',
+}
+
 const villageInfoForm : Record<string, GroupForm> = {
   'overview': villageInfoOverviewForm,
   'cultural': villageInfoCulture,
   'story': {
     [0]: villageInfoStoryFormItems
   },
+  'spots': {
+    [0]: villageInfoSpotsFormItems,
+  },
   'speaker': {
     [1]: villageInfoSpeakerForm,
   },

+ 11 - 95
src/pages/dig/forms/task.vue

@@ -1,109 +1,25 @@
 <template>
-  <FlexCol v-if="currentTaskDefItem" :padding="30" :gap="10">
-    <Image
-      v-if="currentTaskDefItem.banner"
-      :src="currentTaskDefItem.banner"
-      :radius="20"
-      :width="690"
-      mode="widthFix"
+  <FlexCol :padding="30" :gap="20">
+    <CollectModuleList
+      :villageId="querys.villageId"
+      :villageVolunteerId="querys.villageVolunteerId"
+      :taskName="querys.taskName"
+      :taskTitle="querys.taskTitle"
+      :taskPid="querys.taskPid"
     />
-    <FlexCol :gap="20">
-      <TaskList
-        v-for="item in currentTaskDefItem.list"
-        :key="item.title"
-        :icon="item.icon"
-        :title="item.title"
-        :desc="item.desc"
-        :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
-        @click="handleClick(item)"
-      />
-    </FlexCol>
   </FlexCol>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from './composeable/TaskEntryForm';
 import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
-import { TaskMenuDef, type TaskMenuDefItem } from './tasks';
+import CollectModuleList from '../components/CollectModuleList.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-import VillageApi from '@/api/inhert/VillageApi';
-import { alert } from '@/components/utils/DialogAction';
-import { getVillageInfoForm } from './forms';
-import { navTo } from '@/components/utils/PageAction';
 
-const { goForm } = useTaskEntryForm();
-const { canCollect, getCollectModuleInternalNameById } = useCollectStore();
-
-useLoadQuerys({ 
+const { querys } = useLoadQuerys({ 
   villageId: 0,
+  villageVolunteerId: 0,
   taskName: '',
+  taskTitle: '',
   taskPid: 0,
-}, async (querys) => {
-  const { villageId, taskName, taskPid } = querys;
-  currentTaskDefItem.value = { ...TaskMenuDef[taskName] };
-  if (taskPid) {
-    const res = (await VillageApi.getCatalogList(villageId, taskPid));
-    if (res.length === 0)
-      return;
-    currentTaskDefItem.value.list = res
-      .map(item => {
-        try {
-          const collectModuleInternalName = getCollectModuleInternalNameById(item.collectModuleId);
-          if (!collectModuleInternalName && item.collectModuleId)
-            throw new Error('不存在定义的表单数据');
-          const formDefine = collectModuleInternalName ? getVillageInfoForm(collectModuleInternalName, -1) : undefined;
-          return {
-            ...item,
-            enable: true,
-            catalogItem: item,
-            goForm: collectModuleInternalName ? [ 
-              collectModuleInternalName, 
-              -1, 
-              formDefine?.[2].typeName, 
-              collectModuleInternalName === 'overview' ? 'common' : undefined,
-              item.title 
-            ] : undefined,
-            onClick: () => {
-              if (item.haschild) {
-                navTo('./task', {
-                  ...querys,
-                  taskName: item.title,
-                  taskPid: item.id,
-                })
-              } else {
-                alert({
-                  title: item.title,
-                  content: '不存在定义的表单数据',
-                })
-              }
-            }
-          }
-        } catch (e) {
-          return {
-            ...item,
-            desc: '' + e,
-            enable: false,
-          }
-        }
-      });
-  }
 });
-
-const currentTaskDefItem = ref<TaskMenuDefItem|null>(null);
-const handleClick = (item: TaskMenuDefItem['list'][0]) => {
-  if (item.goForm) {
-    goForm(...item.goForm);
-    return;
-  }
-  if (item.onClick) {
-    item.onClick();
-  }
-}
-
-
-
 </script>

+ 9 - 15
src/pages/dig/forms/tasks.ts

@@ -1,28 +1,22 @@
-export type TaskMenuDefItem = {
+export type TaskMenuDefGroup = {
   banner: string;
-  list: {
-    title: string;
-    desc: string;
-    icon: string;
-    enable: string|boolean;
-    goForm?: TaskMenuDefGoForm;
-    onClick?: () => void;
-  }[];
+  list: TaskMenuDefItem[];
 }
 export type TaskMenuDefGoForm = [string, number, string|undefined, string|undefined, string|undefined];
-export type TaskRootMenuDefItem = {
+export type TaskMenuDefItem = {
   title: string;
   desc: string;
   icon: string;
   enable: string|boolean;
-  name: string;
-  goForm: {
+  name?: string;
+  goForm?: {
     title: string;
     name: string;
-  }|TaskMenuDefGoForm
+  }|TaskMenuDefGoForm;
+  onClick?: () => void;
 }
 
-export const TaskRootDef : TaskRootMenuDefItem[] = [
+export const TaskRootDef : TaskMenuDefItem[] = [
   {
     title: '村落概况',
     desc: '探索村落的历史渊源与发生轨迹',
@@ -121,7 +115,7 @@ export const TaskRootDef : TaskRootMenuDefItem[] = [
   }
 ]
 
-export const TaskMenuDef : Record<string, TaskMenuDefItem> = {
+export const TaskMenuDef : Record<string, TaskMenuDefGroup> = {
   'building': {
     banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_building.jpg',
     list: [

+ 7 - 0
src/pages/dig/sharereg/share-reg-link.vue

@@ -0,0 +1,7 @@
+<template>
+
+</template>
+
+<script setup lang="ts">
+
+</script>

+ 7 - 0
src/pages/dig/sharereg/share-reg-page.vue

@@ -0,0 +1,7 @@
+<template>
+
+</template>
+
+<script setup lang="ts">
+
+</script>

+ 4 - 5
src/pages/home/index.vue

@@ -12,7 +12,7 @@
         ]"
       />
     </FlexCol>
-    <Box title="传统村落分布" icon="/static/images/home/icon-pin-distance.png">
+    <Box title="村社分布" icon="/static/images/home/icon-pin-distance.png">
       <map 
         id="prevMap"
         map-id="prevMap"
@@ -101,13 +101,12 @@ import FlexRow from '@/components/layout/FlexRow.vue';
 import Height from '@/components/layout/space/Height.vue';
 import Width from '@/components/layout/space/Width.vue';
 import { navTo } from '@/components/utils/PageAction';
-import { RandomUtils } from '@imengyu/imengyu-utils';
 import { getCurrentInstance } from 'vue';
 
 const instance = getCurrentInstance();
 const mapCtx = uni.createMapContext('prevMap', instance);
 const mapLoader = useSimpleDataLoader(async () => {
-  const res = (await VillageApi.getVallageList()).map((p, i) => ({
+  const res = (await VillageApi.getVallageList(undefined, 1)).map((p, i) => ({
     ...p,
     id: p.id ?? i,
     title: p.villageName,
@@ -144,8 +143,8 @@ function goVillageDetails(e: any) {
 }
 
 const recommendLoader = useSimpleDataLoader(async () => {
-  const category = (await CommonContent.getCategoryList(151)).find(p => p.title == '省级');
-  return (await VillageApi.getVallageList(/* category?.id */));
+  //const category = (await CommonContent.getCategoryList(151)).find(p => p.title == '省级');
+  return (await VillageApi.getVallageList(undefined, 1));
 });
 
 const discoverLoader = useSimpleDataLoader(async () => {

+ 1 - 26
src/store/collect.ts

@@ -1,37 +1,15 @@
 import { computed, ref } from 'vue'
 import { defineStore } from 'pinia'
 import { useAuthStore } from './auth';
+import { CollectableModulesNameMapping } from '@/pages/dig/forms/forms';
 import VillageApi from '@/api/inhert/VillageApi';
 
-const CollectableModulesNameMapping : Record<string, string> = {
-  'overview': '村落概况',
-  'distribution': '建筑分布',
-  'building': '传统建筑',
-  'folk_culture': '民俗文化',
-  'food_product': '美食物产',
-  'route': '旅游路线',
-  'travel_guide': '旅游导览',
-  'element': '环境要素',
-  'environment': '环境格局',
-  'relic': '文物古迹',
-  'cultural': '历史文化',
-  'figure': '历史人物',
-  'ich': '非遗',
-  'story': '掌故轶事',
-  'village': '风景名胜',
-  'speaker': '口述者',
-  'collect': '随手记',
-}
-
 export const useCollectStore = defineStore('collect', () => {
   const collectableModules = ref(new Map<string, number>());
   const authStore = useAuthStore();
 
-
   function setCollectableModules(modules: Map<string, number>) {
     collectableModules.value = modules;
-    console.log(modules);
-    
   }
   function canCollect(module: string) {
     if (authStore.isAdmin)
@@ -41,11 +19,8 @@ export const useCollectStore = defineStore('collect', () => {
     return collectableModules.value.has(module);
   }
   function getCollectModuleId(module: string) {
-    console.log('getCollectModuleId', module, collectableModules.value);
-    
     if (collectableModules.value.has(CollectableModulesNameMapping[module]))
       return collectableModules.value.get(CollectableModulesNameMapping[module]);
-
     return collectableModules.value.get(module);
   }
   function getCollectModuleInternalNameById(id: number) {