Browse Source

修改任务页数据

快乐的梦鱼 2 months ago
parent
commit
1119fac612

+ 3 - 0
src/api/auth/UserApi.ts

@@ -133,6 +133,9 @@ export class UserApi extends AppServerRequestModule<DataModel> {
   async refresh() {
     return (await this.post('/ich/inheritor/refresh', {}, '刷新token', undefined, LoginResult)).data as LoginResult;
   }
+  async checkUserAuthed() {
+    return await this.post('/village/village/getVillageList', {}, '检查用户是否登录');
+  }  
 
   
 }

+ 1 - 1
src/components/basic/Image.vue

@@ -22,7 +22,7 @@
     />
     <view v-if="showFailed && isErrorState" class="inner-view error">
       <!-- todo: failed -->
-      <Text color="second" :text="src ? '暂无图片' : '加载失败'" />
+      <Text color="second" :text="src ? '暂无' : '失败'" />
     </view>
     <view v-if="showLoading && isLoadState" class="inner-view loading">
       <ActivityIndicator

+ 2 - 51
src/pages.json

@@ -58,58 +58,9 @@
       }
     },
     {
-      "path": "pages/dig/task/environment",
+      "path": "pages/dig/forms/task",
       "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-环境格局",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/food",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-地道美食",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/mine",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-物产资源",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/summary",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-村落概况",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/building",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-传统建筑",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/trip",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-旅游路线",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/custom",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-民俗文化",
-        "enablePullDownRefresh": false
-      }
-    },
-    {
-      "path": "pages/dig/task/history",
-      "style": {
-        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台-历史文化",
+        "navigationBarTitleText": "乡源·乡村文化资源挖掘平台",
         "enablePullDownRefresh": false
       }
     },

+ 29 - 70
src/pages/dig/details.vue

@@ -38,73 +38,20 @@
     </Touchable>
 
     <FlexCol :gap="20">
-      
       <Alert
         v-if="!authStore.isAdmin && isEmpty"
         type="warning"
         message="您当前没有可完成的任务"
         description="请联系管理员认领可采编栏目"
       />
-
-      <TaskList
-        icon="icon-task-summary"
-        title="村落概况"
-        desc="探索村落的历史渊源与发生轨迹"
-        :enable="canCollect('overview')"
-        @click="navTo('task/summary', nextPageData)"
-      />
-      <TaskList
-        icon="icon-task-history"
-        title="历史文化"
-        desc="传承百年文化遗产和精神财富"
-        @click="navTo('task/history', nextPageData)"
-      />
-      <TaskList
-        v-if="canCollect('ich')"
-        icon="icon-task-custom-1"
-        title="非物质文化遗产项目"
-        desc="维护文化多样性"
-        :enable="canCollect('ich')"
-        @click="goForm('ich', 0, '非物质文化遗产项目')"
-      />
-      <TaskList
-        icon="icon-task-environment"
-        title="环境格局"
-        desc="感受自然人文环境之美"
-        @click="navTo('task/environment', nextPageData)"
-      />
-      <TaskList
-        icon="icon-task-building"
-        title="传统建筑"
-        desc="领略古建筑的独特魅力"
-        @click="navTo('task/building', nextPageData)"
-      />
-      <TaskList
-        icon="icon-task-custom"
-        title="民俗文化"
-        desc="体验民间传统习俗与节庆"
-        :enable="canCollect('folk_culture')"
-        @click="navTo('task/custom', nextPageData)"
-      />
-      <TaskList
-        icon="icon-task-food"
-        title="地道美食"
-        desc="正宗、传统地方特色美食"
-        :enable="canCollect('food_product')"
-        @click="navTo('task/food', nextPageData)"
-      />
       <TaskList
-        icon="icon-task-mine"
-        title="物产资源"
-        desc="特定地域的植物、矿物或工艺品"
-        :enable="canCollect('food_product')"
-        @click="navTo('task/mine', nextPageData)"
-      />
-      <TaskList
-        icon="icon-task-trip"
-        title="旅游路线"
-        desc="体验独特的文化魅力"
-        @click="navTo('task/trip', nextPageData)"
+        v-for="(item,key) in TaskRootDef"
+        :key="key"
+        :icon="item.icon"
+        :title="item.title"
+        :desc="item.desc"
+        :enable="typeof item.enable === 'string' ? canCollect(item.enable) : item.enable"
+        @click="goTask(item)"
       />
     </FlexCol>
     <XBarSpace />
@@ -128,20 +75,23 @@ import TaskList from './components/TaskList.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 { TaskRootDef } from './forms/tasks';
+import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
 
 const { querys } = useLoadQuerys({ 
-  id: 0,  
   name: '',
   points: 0,
   level: 0,
+  villageId: 0,  
   villageVolunteerId: 0,
 });
 
 const authStore = useAuthStore();
 const { canCollect, isEmpty } = useCollectStore();
+const { goForm } = useTaskEntryForm();
 
 const nextPageData = computed(() => ({
-  villageId: querys.value.id,  
+  villageId: querys.value.villageId,  
   villageVolunteerId: querys.value.villageVolunteerId,
 }));
 
@@ -157,13 +107,22 @@ function goCollect() {
   goForm('collect', 1, '随手记')
 }
 
-function goForm(subType: string, subId: number, title: string) {
-  navTo('/pages/dig/forms/list', {
-    villageId: querys.value.id,  
-    villageVolunteerId: querys.value.villageVolunteerId,  
-    subType,
-    subId,
-    subTitle: title,
-  })
+function goTask(item: typeof TaskRootDef[0]) {
+  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,
+      taskName: item.goForm.name,
+    })
+  }
 }
 </script>

src/pages/dig/composeable/TaskEntryForm.ts → src/pages/dig/forms/composeable/TaskEntryForm.ts


+ 1 - 1
src/pages/dig/forms/data/cultural.ts

@@ -7,7 +7,7 @@ import type { UploaderInstance } from "@/components/form/Uploader.vue";
 import type { UploaderFieldProps, UploaderFieldInstance } from "@/components/form/UploaderField.vue";
 import { useAliOssUploadCo } from "@/common/components/upload/AliOssUploadCo";
 import { villageCommonContent } from "./common";
-import { goFormStatic } from "../../composeable/TaskEntryForm";
+import { goFormStatic } from "../composeable/TaskEntryForm";
 import type { ButtonProp } from "@/components/basic/Button.vue";
 import { useCollectStore } from "@/store/collect";
 

+ 45 - 0
src/pages/dig/forms/task.vue

@@ -0,0 +1,45 @@
+<template>
+  <FlexCol v-if="currentTaskDefItem" :padding="30" :gap="10">
+    <Image
+      v-if="currentTaskDefItem.banner"
+      :src="currentTaskDefItem.banner"
+      :radius="20"
+      :width="690"
+      mode="widthFix"
+    />
+    <FlexCol :gap="20">
+      <TaskList
+        v-for="item in currentTaskDefItem.list"
+        :key="item.title"
+        :icon="item.icon"
+        :title="item.title"
+        :desc="item.desc"
+        :enable="!item.enable || canCollect(item.enable)"
+        @click="goForm(...item.goForm)"
+      />
+    </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 FlexCol from '@/components/layout/FlexCol.vue';
+import Image from '@/components/basic/Image.vue';
+import TaskList from '../components/TaskList.vue';
+
+const { goForm } = useTaskEntryForm();
+const { canCollect } = useCollectStore();
+
+const { querys } = useLoadQuerys({ 
+  taskName: '',
+}, ({ taskName }) => {
+  currentTaskDefItem.value = TaskMenuDef[taskName];
+});
+const currentTaskDefItem = ref<TaskMenuDefItem|null>(null);
+
+
+</script>

+ 377 - 0
src/pages/dig/forms/tasks.ts

@@ -0,0 +1,377 @@
+export type TaskMenuDefItem = {
+  banner: string;
+  list: {
+    title: string;
+    desc: string;
+    icon: string;
+    enable: string;
+    goForm: TaskMenuDefGoForm;
+  }[];
+}
+export type TaskMenuDefGoForm = [string, number, string|undefined, string|undefined, string|undefined];
+
+export const TaskRootDef : {
+  title: string;
+  desc: string;
+  icon: string;
+  enable: string|boolean;
+  goForm: {
+    title: string;
+    name: string;
+  }|TaskMenuDefGoForm
+}[] = [
+  {
+    title: '村落概况',
+    desc: '探索村落的历史渊源与发生轨迹',
+    icon: 'icon-task-summary',
+    enable: 'overview',
+    goForm: {
+      title: '村落概况',
+      name: 'overview',
+    }
+  },
+  {
+    title: '历史文化',
+    desc: '传承百年文化遗产和精神财富',
+    icon: 'icon-task-history',
+    enable: true,
+    goForm: {
+      title: '历史文化',
+      name: 'history',
+    }
+  },
+  {
+    title: '非物质文化遗产项目',
+    desc: '维护文化多样性',
+    icon: 'icon-task-custom-1',
+    enable: 'ich',
+    goForm: [ 'ich', 0, undefined, undefined, '非物质文化遗产项目' ],
+  },
+  {
+    title: '环境格局',
+    desc: '感受自然人文环境之美',
+    icon: 'icon-task-environment',
+    enable: 'environment',
+    goForm: {
+      title: '环境格局',
+      name: 'environment',
+    }
+  },
+  {
+    title: '传统建筑',
+    desc: '领略古建筑的独特魅力',
+    icon: 'icon-task-building',
+    enable: true,
+    goForm: {
+      title: '传统建筑',
+      name: 'building',
+    }
+  },
+  {
+    title: '民俗文化',
+    desc: '体验民间传统习俗与节庆',
+    icon: 'icon-task-custom',
+    enable: 'folk_culture',
+    goForm: {
+      title: '民俗文化',
+      name: 'custom',
+    }
+  },
+  {
+    title: '地道美食',
+    desc: '正宗、传统地方特色美食',
+    icon: 'icon-task-food',
+    enable: 'food_product',
+    goForm: {
+      title: '地道美食',
+      name: 'food',
+    }
+  },
+  {
+    title: '物产资源',
+    desc: '特定地域的植物、矿物或工艺品',
+    icon: 'icon-task-mine',
+    enable: 'food_product',
+    goForm: {
+      title: '物产资源',
+      name: 'product',
+    }
+  },
+  {
+    title: '旅游路线',
+    desc: '体验独特的文化魅力',
+    icon: 'icon-task-trip',
+    enable: true,
+    goForm: {
+      title: '旅游路线',
+      name: 'trip',
+    }
+  }
+]
+
+export const TaskMenuDef : Record<string, TaskMenuDefItem> = {
+  'building': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_building.jpg',
+    list: [
+      {
+        title: '建筑分布',
+        desc: '村落内传统建筑分布情况',
+        icon: 'icon-task-building-1',
+        enable: 'distribution',
+        goForm: [ 'distribution', 0, undefined, undefined, '建筑分布' ],
+      },
+      {
+        title: '文物建筑',
+        desc: '历史、艺术、科学价值',
+        icon: 'icon-task-building-2',
+        enable: 'building',
+        goForm: [ 'building', 1, 'nature', undefined, '文物建筑' ],
+      },
+      {
+        title: '历史建筑',
+        desc: '重大历史事件记录',
+        icon: 'icon-task-building-3',
+        enable: 'building',
+        goForm: [ 'building', 2, 'nature', undefined, '历史建筑' ],
+      },
+      {
+        title: '重要传统建筑',
+        desc: '重要传统建筑的信息',
+        icon: 'icon-task-building-4',
+        enable: 'building',
+        goForm: [ 'building', 3, 'nature', undefined, '重要传统建筑' ],
+      },
+    ],
+  },
+  'custom': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_custom.jpg',
+    list: [
+      {
+        title: '节庆活动',
+        desc: '欢庆与传承并重的文化盛宴',
+        icon: 'icon-task-custom-2',
+        enable: 'folk_culture',
+        goForm: [ 'folk_culture', 1, 'folk_culture_type', undefined, '节庆活动' ],
+      },
+      {
+        title: '祭祀崇礼',
+        desc: '对先贤与自然的崇高致敬',
+        icon: 'icon-task-custom-3',
+        enable: 'folk_culture',
+        goForm: [ 'folk_culture', 2, 'folk_culture_type', undefined, '祭祀崇礼' ],
+      },
+      {
+        title: '婚丧嫁娶',
+        desc: '生命礼赞与文化传承的双重奏鸣',
+        icon: 'icon-task-custom-4',
+        enable: 'folk_culture',
+        goForm: [ 'folk_culture', 3, 'folk_culture_type', undefined, '婚丧嫁娶' ],
+      },
+      {
+        title: '地方方言',
+        desc: '历史沉淀的语言瑰宝',
+        icon: 'icon-task-custom-5',
+        enable: 'folk_culture',
+        goForm: [ 'folk_culture', 4, 'folk_culture_type', undefined, '地方方言' ],
+      },
+      {
+        title: '特色文化',
+        desc: '民族精神的鲜明烙印',
+        icon: 'icon-task-custom-6',
+        enable: 'folk_culture',
+        goForm: [ 'folk_culture', 5, 'folk_culture_type', undefined, '特色文化' ],
+      },
+    ],
+  },
+  'environment': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_environment.jpg',
+    list: [
+      {
+        title: '自然环境',
+        desc: '村落建立与发展历程',
+        icon: 'icon-task-environment-1',
+        enable: 'environment',
+        goForm: [ 'environment', 0, undefined, undefined, '自然环境' ],
+      },
+      {
+        title: '文物古迹',
+        desc: '重要历史文献资料',
+        icon: 'icon-task-environment-5',
+        enable: 'relic',
+        goForm: [ 'relic', 0, undefined, undefined, '文物古迹' ],
+      },
+      {
+        title: '历史环境要素',
+        desc: '村民口述历史记录',
+        icon: 'icon-task-environment-6',
+        enable: 'element',
+        goForm: [ 'element', 0, undefined, undefined, '历史环境要素' ],
+      },
+    ],
+  },
+  'food': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_food.jpg',
+    list: [
+      {
+        title: '农副产品',
+        desc: '乡村繁荣的多元支柱',
+        icon: 'icon-task-food-1',
+        enable: 'food_product',
+        goForm: [ 'food_product', 1, undefined, undefined, '农副产品' ],
+      },
+      {
+        title: '特色美食',
+        desc: '给味蕾探索带来无限惊喜',
+        icon: 'icon-task-food-2',
+        enable: 'food_product',
+        goForm: [ 'food_product', 3, undefined, undefined, '特色美食' ],
+      },
+    ],
+  },
+  'history': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_history.jpg',
+    list: [
+      {
+        title: '建村历史',
+        desc: '村落建立与发展历程',
+        icon: 'icon-task-history-1',
+        enable: 'cultural',
+        goForm: [ 'cultural', 1, undefined, undefined, '建村历史' ],
+      },
+      {
+        title: '历史人物',
+        desc: '重要历史人物事迹',
+        icon: 'icon-task-history-2',
+        enable: 'cultural',
+        goForm: [ 'figure', 0, undefined, undefined, '历史人物' ],
+      },
+      {
+        title: '历史事件',
+        desc: '重大历史事件记录',
+        icon: 'icon-task-history-3',
+        enable: 'cultural',
+        goForm: [ 'cultural', 2, undefined, undefined, '历史事件' ],
+      },
+      {
+        title: '掌故轶事',
+        desc: '民间传说与历史故事',
+        icon: 'icon-task-history-4',
+        enable: 'story',
+        goForm: [ 'story', 0, undefined, undefined, '掌故轶事' ],
+      },
+      {
+        title: '历史文献',
+        desc: '重要历史文献资料',
+        icon: 'icon-task-history-5',
+        enable: 'cultural',
+        goForm: [ 'cultural', 3, undefined, undefined, '历史文献' ],
+      },
+      {
+        title: '口述历史',
+        desc: '村民口述历史记录',
+        icon: 'icon-task-history-6',
+        enable: 'cultural',
+        goForm: [ 'cultural', 4, undefined, undefined, '口述历史' ],
+      },
+    ],
+  },
+  'product': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_mine.jpg',
+    list: [
+      {
+        title: '商业集市',
+        desc: '文化交流的开放窗口',
+        icon: 'icon-task-mine-1',
+        enable: 'food_product',
+        goForm: [ 'food_product', 4, undefined, undefined, '商业集市' ],
+      },
+      {
+        title: '服装服饰',
+        desc: '艺术与功能交织的时尚篇章',
+        icon: 'icon-task-mine-2',
+        enable: 'food_product',
+        goForm: [ 'food_product', 5, undefined, undefined, '服装服饰' ],
+      },
+      {
+        title: '运输工具',
+        desc: '历史的运输工具',
+        icon: 'icon-task-mine-2',
+        enable: 'food_product',
+        goForm: [ 'food_product', 6, undefined, undefined, '运输工具' ],
+      },
+    ],
+  },
+  'overview': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_summary.jpg',
+    list: [
+      {
+        title: '行政区划',
+        desc: '村落行政区域划分及变迁',
+        icon: 'icon-task-summary-1',
+        enable: 'overview',
+        goForm: [ 'overview', 1, undefined, 'common', '行政区划' ],
+      },
+      {
+        title: '村落综述',
+        desc: '村落整体概况介绍',
+        icon: 'icon-task-summary-5',
+        enable: 'overview',
+        goForm: [ 'overview', 5, undefined, 'common', '村落综述' ],
+      },
+      {
+        title: '地理信息',
+        desc: '地理位置和自然环境特征',
+        icon: 'icon-task-summary-2',
+        enable: 'overview',
+        goForm: [ 'overview', 2, undefined, 'common', '地理信息' ],
+      },
+      {
+        title: '建设与保护',
+        desc: '村落发展与文化遗产保护',
+        icon: 'icon-task-summary-3',
+        enable: 'overview',
+        goForm: [ 'overview', 3, undefined, 'common', '建设与保护' ],
+      },
+      {
+        title: '人口与经济',
+        desc: '人口与经济情况',
+        icon: 'icon-task-summary-4',
+        enable: 'overview',
+        goForm: [ 'overview', 4, undefined, 'common', '人口与经济' ],
+      },
+    ],
+  },
+  'trip': {
+    banner: 'https://mn.wenlvti.net/app_static/xiangan/banner_dig_trip.jpg',
+    list: [
+      {
+        title: '旅游导览',
+        desc: '',
+        icon: 'icon-task-trip-3',
+        enable: 'travel_guide',
+        goForm: [ 'travel_guide', 0, undefined, undefined, '旅游导览' ],
+      },
+      {
+        title: '游览路线',
+        desc: '',
+        icon: 'icon-task-trip-1',
+        enable: 'route',
+        goForm: [ 'route', 1, undefined, undefined, '游览路线' ],
+      },
+      {
+        title: '活动时间',
+        desc: '',
+        icon: 'icon-task-trip-2',
+        enable: 'route',
+        goForm: [ 'route', 2, undefined, undefined, '活动时间' ],
+      },
+      {
+        title: '路线特色',
+        desc: '',
+        icon: 'icon-task-trip-4',
+        enable: 'route',
+        goForm: [ 'route', 3, undefined, undefined, '路线特色' ],
+      },
+    ],
+  },
+}

+ 1 - 1
src/pages/dig/index.vue

@@ -103,8 +103,8 @@ const rankListLoader = useSimpleDataLoader(async () => await VillageApi.getVolun
 
 function goSubmitDigPage(item: VillageListItem) {
   navTo('./dig/details', { 
-    id: item.villageId,
     name: item.villageName,
+    villageId: item.villageId,
     villageVolunteerId: item.villageVolunteerId,
     points: volunteerInfoLoader.content.value?.points,
     level: volunteerInfoLoader.content.value?.level,

+ 0 - 51
src/pages/dig/task/building.vue

@@ -1,51 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="10">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_building.jpg"
-      :radius="20"
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-building-1"
-        title="建筑分布"
-        desc="村落内传统建筑分布情况"
-        :enable="canCollect('distribution')"
-        @click="goForm('distribution', 0, undefined, undefined, '建筑分布')"
-      />
-      <TaskList
-        icon="icon-task-building-2"
-        title="文物建筑"
-        desc="历史、艺术、科学价值"
-        :enable="canCollect('building')"
-        @click="goForm('building', 1, 'nature', undefined, '文物建筑')"
-      />
-      <TaskList
-        icon="icon-task-building-3"
-        title="历史建筑"
-        desc="重大历史事件记录"
-        :enable="canCollect('building')"
-        @click="goForm('building', 2, 'nature', undefined, '历史建筑')"
-      />
-      <TaskList
-        icon="icon-task-building-4"
-        title="重要传统建筑"
-        desc="重要传统建筑的信息"
-        :enable="canCollect('building')"
-        @click="goForm('building', 3, 'nature', undefined, '重要传统建筑')"
-      />
-    </FlexCol>
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-
-const { goForm } = useTaskEntryForm();
-const { canCollect } = useCollectStore();
-</script>

+ 0 - 53
src/pages/dig/task/custom.vue

@@ -1,53 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="10">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_custom.jpg"
-      :radius="20"
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-custom-2"
-        title="节庆活动"
-        desc="欢庆与传承并重的文化盛宴"
-        @click="goForm('folk_culture', 1, 'folk_culture_type', undefined, '节庆活动')"
-      />
-      <TaskList
-        icon="icon-task-custom-3"
-        title="祭祀崇礼"
-        desc="对先贤与自然的崇高致敬"
-        @click="goForm('folk_culture', 2, 'folk_culture_type', undefined, '祭祀崇礼')"
-      />
-      <TaskList
-        icon="icon-task-custom-4"
-        title="婚丧嫁娶"
-        desc="生命礼赞与文化传承的双重奏鸣"
-        @click="goForm('folk_culture', 3, 'folk_culture_type', undefined, '婚丧嫁娶')"
-      />
-      <TaskList
-        icon="icon-task-custom-5"
-        title="地方方言"
-        desc="历史沉淀的语言瑰宝"
-        @click="goForm('folk_culture', 4, 'folk_culture_type', undefined, '地方方言')"
-      />
-      <TaskList
-        icon="icon-task-custom-6"
-        title="特色文化"
-        desc="民族精神的鲜明烙印"
-        @click="goForm('folk_culture', 5, 'folk_culture_type', undefined, '特色文化')"
-      />
-    </FlexCol>
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-
-const { goForm } = useTaskEntryForm();
-const { canCollect } = useCollectStore();
-</script>

+ 0 - 46
src/pages/dig/task/environment.vue

@@ -1,46 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_environment.jpg"
-      :radius="20"
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-environment-1"
-        title="自然环境"
-        desc="村落建立与发展历程"
-        @click="goForm('environment', 0, undefined, undefined, '自然环境')"
-      />
-      <TaskList
-        v-if="canCollect('relic')"
-        icon="icon-task-environment-5"
-        title="文物古迹"
-        desc="重要历史文献资料"
-        @click="goForm('relic', 0, undefined, undefined, '文物古迹')"
-      />
-      <TaskList
-        v-if="canCollect('element')"
-        icon="icon-task-environment-6"
-        title="历史环境要素"
-        desc="村民口述历史记录"
-        @click="goForm('element', 0, undefined, undefined, '历史环境要素')"
-      />
-    </FlexCol>
-    <XBarSpace />
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-import XBarSpace from '@/components/layout/space/XBarSpace.vue';
-
-const { goForm } = useTaskEntryForm();
-const { canCollect } = useCollectStore();
-</script>
-

+ 0 - 36
src/pages/dig/task/food.vue

@@ -1,36 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_food.jpg"
-      :radius="20"
-      round
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-food-1"
-        title="农副产品"
-        desc="乡村繁荣的多元支柱"
-        @click="goForm('food_product', 1, undefined, undefined, '农副产品')"
-      />
-      <TaskList
-        icon="icon-task-food-2"
-        title="特色美食"
-        desc="给味蕾探索带来无限惊喜"
-        @click="goForm('food_product', 3, undefined, undefined, '特色美食')"
-      />
-    </FlexCol>
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-
-const { canCollect } = useCollectStore();
-const { goForm } = useTaskEntryForm();
-</script>

+ 0 - 67
src/pages/dig/task/history.vue

@@ -1,67 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_history.jpg"
-      :radius="20"
-      round
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-history-1"
-        title="建村历史"
-        desc="村落建立与发展历程"
-        :enable="canCollect('cultural')"
-        @click="goForm('cultural', 1, undefined, undefined, '建村历史')"
-      />
-      <TaskList
-        icon="icon-task-history-2"
-        title="历史人物"
-        desc="重要历史人物事迹"
-        :enable="canCollect('cultural')"
-        @click="goForm('figure', 0, undefined, undefined, '历史人物')"
-      />
-      <TaskList
-        icon="icon-task-history-3"
-        title="历史事件"
-        desc="重大历史事件记录"
-        :enable="canCollect('cultural')"
-        @click="goForm('cultural', 2, undefined, undefined, '历史事件')"
-      />
-      <TaskList
-        icon="icon-task-history-4"
-        title="掌故轶事"
-        desc="民间传说与历史故事"
-        :enable="canCollect('story')"
-        @click="goForm('story', 0, undefined, undefined, '掌故轶事')"
-      />
-      <TaskList
-        icon="icon-task-history-5"
-        title="历史文献"
-        desc="重要历史文献资料"
-        :enable="canCollect('cultural')"
-        @click="goForm('cultural', 3, undefined, undefined, '历史文献')"
-      />
-      <TaskList
-        icon="icon-task-history-6"
-        title="口述历史"
-        desc="村民口述历史记录"
-        :enable="canCollect('cultural')"
-        @click="goForm('cultural', 4, undefined, undefined, '口述历史')"
-      />
-    </FlexCol>
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-
-const { canCollect } = useCollectStore();
-const { goForm } = useTaskEntryForm();
-</script>
-

+ 0 - 42
src/pages/dig/task/mine.vue

@@ -1,42 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_mine.jpg"
-      :radius="20"
-      round
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-mine-1"
-        title="商业集市"
-        desc="文化交流的开放窗口"
-        @click="goForm('food_product', 4, undefined, undefined, '商业集市')"
-      />
-      <TaskList
-        icon="icon-task-mine-2"
-        title="服装服饰"
-        desc="艺术与功能交织的时尚篇章"
-        @click="goForm('food_product', 5, undefined, undefined, '服装服饰')"
-      />
-      <TaskList
-        icon="icon-task-mine-2"
-        title="运输工具"
-        desc="历史的运输工具"
-        @click="goForm('food_product', 6, undefined, undefined, '运输工具')"
-      />
-    </FlexCol>
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-
-const { canCollect } = useCollectStore();
-const { goForm } = useTaskEntryForm();
-</script>

+ 0 - 60
src/pages/dig/task/summary.vue

@@ -1,60 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_summary.jpg"
-      :radius="20"
-      round
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-summary-1"
-        title="行政区划"
-        desc="村落行政区域划分及变迁"
-        @click="goForm(1, '行政区划')"
-      />
-      <TaskList
-        icon="icon-task-summary-5"
-        title="村落综述"
-        desc="村落整体概况介绍"
-        @click="goForm(5, '村落综述')"
-      />
-      <TaskList
-        icon="icon-task-summary-2"
-        title="地理信息"
-        desc="地理位置和自然环境特征"
-        @click="goForm(2, '地理信息')"
-      />
-      <TaskList
-        icon="icon-task-summary-3"
-        title="建设与保护"
-        desc="村落发展与文化遗产保护"
-        @click="goForm(3, '建设与保护')"
-      />
-      <TaskList
-        icon="icon-task-summary-4"
-        title="人口与经济"
-        desc="人口与经济情况"
-        @click="goForm(4, '人口与经济')"
-      />
-    </FlexCol>
-    <XBarSpace />
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-import XBarSpace from '@/components/layout/space/XBarSpace.vue';
-
-const { canCollect } = useCollectStore();
-const t = useTaskEntryForm();
-
-function goForm(subId: number, title: string) {
-  t.goForm('overview', subId, undefined, 'common', title);
-}
-</script>

+ 0 - 50
src/pages/dig/task/trip.vue

@@ -1,50 +0,0 @@
-<template>
-  <FlexCol :padding="30" :gap="20">
-    <Image
-      src="https://mn.wenlvti.net/app_static/xiangan/banner_dig_trip.jpg"
-      :radius="20"
-      round
-      mode="widthFix"
-      :width="690"
-    />
-    <FlexCol :gap="20">
-      <TaskList
-        icon="icon-task-trip-3"
-        title="旅游导览"
-        :enable="canCollect('travel_guide')"
-        @click="goForm('travel_guide', 0, undefined, undefined, '旅游导览')"
-      />
-      <TaskList
-        icon="icon-task-trip-1"
-        title="游览路线"
-        :enable="canCollect('route')"
-        @click="goForm('route', 1, undefined, undefined, '游览路线')"
-      />
-      <TaskList
-        icon="icon-task-trip-2"
-        title="活动时间"
-        :enable="canCollect('route')"
-        @click="goForm('route', 2, undefined, undefined, '活动时间')"
-      />
-      <TaskList
-        icon="icon-task-trip-4"
-        title="路线特色"
-        :enable="canCollect('route')"
-        @click="goForm('route', 3, undefined, undefined, '路线特色')"
-      />
-    </FlexCol>
-    <XBarSpace />
-  </FlexCol>
-</template>
-
-<script setup lang="ts">
-import { useCollectStore } from '@/store/collect';
-import { useTaskEntryForm } from '../composeable/TaskEntryForm';
-import FlexCol from '@/components/layout/FlexCol.vue';
-import Image from '@/components/basic/Image.vue';
-import TaskList from '../components/TaskList.vue';
-import XBarSpace from '@/components/layout/space/XBarSpace.vue';
-
-const { canCollect } = useCollectStore(); 
-const { goForm } = useTaskEntryForm();
-</script>

+ 9 - 8
src/pages/user/index.vue

@@ -14,10 +14,12 @@
         class="avatar" 
         width="100rpx"
         height="100rpx"
+        :showFailed="false"
         round
       />
-      <H4>{{ userInfo?.nickname || '请登录' }}</H4>
-      <H4>{{ userInfo?.mobile }}</H4>
+      <H4 v-if="userInfo">{{ userInfo.nickname }}</H4>
+      <H4 v-else text="请登录" />
+      <H4 v-if="userInfo">{{ userInfo.mobile }}</H4>
     </Touchable>
     <Height :height="50" />
     <CellGroup round>
@@ -33,17 +35,14 @@
 <script setup lang="ts">
 import { useAuthStore } from '@/store/auth';
 import { computed } from 'vue';
+import { confirm } from '@/components/utils/DialogAction';
+import { navTo } from '@/components/utils/PageAction';
 import UserHead from '@/static/images/user/avatar.png';
 import CellGroup from '@/components/basic/CellGroup.vue';
 import Cell from '@/components/basic/Cell.vue';
-import FlexRow from '@/components/layout/FlexRow.vue';
 import Image from '@/components/basic/Image.vue';
-import Icon from '@/components/basic/Icon.vue';
 import H4 from '@/components/typography/H4.vue';
-import Width from '@/components/layout/space/Width.vue';
 import Height from '@/components/layout/space/Height.vue';
-import { confirm } from '@/components/utils/DialogAction';
-import { navTo } from '@/components/utils/PageAction';
 import Touchable from '@/components/feedback/Touchable.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 
@@ -57,8 +56,10 @@ function doLogout() {
   confirm({
     content: '您确定要退出登录吗?',
   }).then((res) => {
-    if (res)
+    if (res) {
       authStore.logout();
+      uni.reLaunch({ url: '/pages/user/login' });
+    }
   });
 }
 </script>

+ 2 - 0
src/store/auth.ts

@@ -23,6 +23,8 @@ export const useAuthStore = defineStore('auth', {
         this.userInfo = authInfo.userInfo;
         this.loginType = authInfo.loginType;
         setToken(this.token);
+        //检查登录是否过期
+        await UserApi.checkUserAuthed();
         return true;
       } catch (error) {
         this.token = '';