Bladeren bron

增加随手记

快乐的梦鱼 2 dagen geleden
bovenliggende
commit
bf4ea27ed7

+ 1 - 0
src/App.vue

@@ -36,6 +36,7 @@ onLaunch(async () => {
 configTheme((theme) => {
   theme.colorConfigs.default.primary = '#ff8719';
   theme.colorConfigs.pressed.primary = '#b86212';
+  theme.colorConfigs.background.primary = '#ffe8d2';
   return theme;
 });
 </script>

+ 1 - 1
src/api/inhert/VillageApi.ts

@@ -108,7 +108,7 @@ export class VolunteerInfo extends DataModel<VolunteerInfo> {
   typeText = '';
   sexText = '';
   statusText = '';
-  collectModule = [];
+  collectModule = [] as string[];
   collectModuleText = '';
 }
 

+ 1 - 1
src/common/components/form/RichTextEditor.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="d-flex flex-col">
-    <view class="richtext-preview-box">
+    <view class="richtext-preview-box" @click="edit">
       <Parse v-if="modelValue" :content="modelValue" containerStyle="max-height:400px" />
       <text v-else>{{placeholder}}</text>
     </view>

+ 20 - 0
src/pages/dig/details.vue

@@ -15,6 +15,21 @@
         <view class="value">{{ querys.points }}</view>
       </view>
     </view>
+    <Touchable 
+      direction="column" 
+      touchable 
+      :radius="20"
+      :margin="[30,0]"
+      :padding="30"
+      align="center"
+      backgroundColor="background.primary"
+      @click="goForm('collect', 1, '随手记')"
+    >
+      <Icon icon="edit-filling" color="primary" :size="100" />
+      <Height :height="20" />
+      <Text :fontSize="34">写随手记</Text>
+      <Text :fontSize="22" color="gray">写随手记,记录下村庄文化发现和思考,自动分类</Text>
+    </Touchable>
     <view class="task-list">
       <view v-if="canCollect('village')" class="item">
         <text class="iconfont icon-task-summary"></text>
@@ -131,6 +146,11 @@ import { computed } from 'vue';
 import { useAuthStore } from '@/store/auth';
 import { useCollectStore } from '@/store/collect';
 import { navTo } from '@/components/utils/PageAction';
+import FlexCol from '@/components/layout/FlexCol.vue';
+import Icon from '@/components/basic/Icon.vue';
+import Text from '@/components/basic/Text.vue';
+import Touchable from '@/components/feedback/Touchable.vue';
+import Height from '@/components/layout/space/Height.vue';
 
 const { querys } = useLoadQuerys({ 
   id: 0,  

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

@@ -2580,6 +2580,83 @@ const villageInfoForm : Record<string, Record<number, SingleForm>> = {
     [5]: villageInfoFoodProductsForm,
     [6]: villageInfoFoodProductsForm,
   },
+  'collect': {
+    [1]: [CommonInfoModel, () => ({
+      items: [
+        {
+          label: '标题',
+          name: 'name',
+          type: 'text',
+          defaultValue: '',
+          params: {
+            placeholder: '请输入标题',
+          } as FieldProps,
+          rules: [{
+            required: true,
+            message: '请输入标题',
+          }]
+        },
+        {
+          label: '组图',
+          name: 'images',
+          type: 'uploader',
+          defaultValue: '',
+          params: {
+            upload: useAliOssUploadCo('xiangyuan/note'),
+            maxFileSize: 1024 * 1024 * 10,
+            maxUploadCount: 10,
+          } as UploaderFieldProps,
+          rules: []
+        },
+        {
+          label: '视频',
+          name: 'video',
+          type: 'uploader',
+          defaultValue: '',
+          params: {
+            upload: useAliOssUploadCo('xiangyuan/note'),
+            maxFileSize: 1024 * 1024 * 100,
+            maxUploadCount: 1,
+          } as UploaderFieldProps,
+          rules: []
+        },
+        {
+          label: '关键字',
+          name: 'keywords',
+          type: 'text',
+          defaultValue: '',
+          params: {
+            placeholder: '请输入关键字,多个关键字用逗号分隔',
+          } as FieldProps,
+          rules: []
+        },
+        {
+          label: '描述',
+          name: 'desc',
+          type: 'textarea',
+          defaultValue: '',
+          params: {
+            placeholder: '请输入描述',
+            maxLength: 200,
+            showWordLimit: true,
+          } as FieldProps,
+          rules: []
+        },
+        {
+          label: '内容',
+          name: 'content',
+          type: 'richtext',
+          defaultValue: '',
+          params: {
+            placeholder: '请输入内容',
+            maxLength: 2000,
+            showWordLimit: true,
+          } as FieldProps,
+          rules: []
+        }
+      ]
+    })]
+  },
 }
 
 export function getVillageInfoForm(subType: string, subId: number) {

+ 1 - 1
src/pages/dig/forms/list.vue

@@ -10,7 +10,7 @@
       <Button type="primary" @click="newData">+ 新增</Button>
     </FlexRow>
     <Height :height="20" />
-    <FlexCol>
+    <FlexCol :gap="20">
       <Touchable 
         v-for="item in listLoader.list.value"
         :key="item.id" 

+ 5 - 6
src/pages/dig/index.vue

@@ -66,6 +66,10 @@
 </template>
 
 <script setup lang="ts">
+import { navTo } from '@/components/utils/PageAction';
+import { useAuthStore } from '@/store/auth';
+import { useCollectStore } from '@/store/collect';
+import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import VillageApi, { VillageListItem } from '@/api/inhert/VillageApi';
 import RequireLogin from '@/common/components/RequireLogin.vue';
 import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
@@ -76,12 +80,7 @@ import FlexCol from '@/components/layout/FlexCol.vue';
 import FlexRow from '@/components/layout/FlexRow.vue';
 import Width from '@/components/layout/space/Width.vue';
 import H3 from '@/components/typography/H3.vue';
-import { navTo } from '@/components/utils/PageAction';
-import { useAuthStore } from '@/store/auth';
-import { useCollectStore } from '@/store/collect';
-import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import Text from '@/components/basic/Text.vue';
-import Icon from '@/components/basic/Icon.vue';
 import Height from '@/components/layout/space/Height.vue';
 
 const authStore = useAuthStore();
@@ -89,7 +88,7 @@ const collectStore = useCollectStore();
 const villageListLoader = useSimpleDataLoader(async () => await VillageApi.getClaimedVallageList(), true);
 const volunteerInfoLoader = useSimpleDataLoader(async () =>{
   const res = await VillageApi.getVolunteerInfo();
-  const collectableModules = (volunteerInfoLoader.content.value?.collectModule as string)?.split(',') || [];
+  const collectableModules = volunteerInfoLoader.content.value?.collectModule || [];
   collectStore.setCollectableModules(collectableModules);
   return res;
 }, true);