Преглед на файлове

📦 按要求优化点亮为加入;原点亮为志愿者表单,移除不需要的表单项目

快乐的梦鱼 преди 1 месец
родител
ревизия
2fe8415db3

+ 2 - 9
src/pages.json

@@ -46,9 +46,9 @@
       }
     },
     {
-      "path": "pages/home/light/submit",
+      "path": "pages/home/light/submit-volunteer",
       "style": {
-        "navigationBarTitleText": "点亮村社",
+        "navigationBarTitleText": "成为志愿者",
         "navigationStyle": "custom",
         "enablePullDownRefresh": false
       }
@@ -207,13 +207,6 @@
       }
     },
     {
-      "path": "pages/home/discover/list",
-      "style": {
-        "navigationBarTitleText": "发现利比亚",
-        "enablePullDownRefresh": true
-      }
-    },
-    {
       "path": "pages/home/discover/details",
       "style": {
         "navigationBarTitleText": "发现详情页",

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

@@ -117,7 +117,7 @@ function goCollect() {
 }
 
 function goJoin() {
-  navTo('/pages/home/light/submit', {
+  navTo('/pages/home/light/submit-volunteer', {
     villageId: querys.value.villageId,
   });
 }

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

@@ -195,7 +195,7 @@ function search() {
   listLoader.reload();
 }
 function goJoin() {
-  navTo('/pages/home/light/submit', {
+  navTo('/pages/home/light/submit-volunteer', {
     villageId: querys.value.villageId,
   });
 }

+ 2 - 21
src/pages/home/components/LightMap.vue

@@ -62,20 +62,6 @@
       @update:modelValue="onSelectedRegion"
       :columns="regionLoader.content.value" 
     />
-    <FlexCol
-      v-if="isDev"
-      :innerStyle="{
-        position: 'absolute',
-        bottom: '20rpx',
-        left: '20rpx',
-        zIndex: 100,
-        borderRadius: '10rpx',
-        backgroundColor: '#ffffff',
-      }"
-    >
-      <Text :text="`${lonlat?.longitude}`" :fontSize="20" />
-      <Text :text="`${lonlat?.latitude}`" :fontSize="20" />
-    </FlexCol>
     <NButton 
       :innerStyle="{
         position: 'absolute',
@@ -119,6 +105,7 @@ const emit = defineEmits([
   'update:lonlat',
   'selectVillage',
   'regionChanged',
+  'lightVillage',
 ]);
 const ready = ref(false);
 const hasResItems = ref(false);
@@ -251,13 +238,7 @@ function onMarkerTap(e: any) {
     emit('update:isLightMode', false);
     const village = villageData.get(e.markerId);
     if (village) {
-      console.log('village', village);
-      
-      navTo('/pages/home/light/submit', {
-        villageId: village.id,
-        unit: (village.city as string) + (village.district as string) + (village.township as string),
-        regionId: village.region,
-      });
+      emit('lightVillage', village);
       return;
     }
   }

+ 2 - 2
src/pages/home/light/form/claim.ts

@@ -42,7 +42,7 @@ export function getClaimVillageForm(options: {
             additionalProps: { placeholder: '请输入真实姓名' },
             rules: [{ required: true, message: '请输入真实姓名' }],
           },
-          {
+          /* {
             label: '认领类型',
             name: 'type',
             type: 'radio-value',
@@ -55,7 +55,7 @@ export function getClaimVillageForm(options: {
               ],
             } as RadioValueProps,
             rules: [{ required: true, message: '请选择认领类型' }],
-          },
+          }, */
           {
             label: '性别',
             name: 'sex',

+ 5 - 5
src/pages/home/light/form/volunteer.ts

@@ -26,7 +26,7 @@ export function getVolunteerForm(options: {
         type: 'flat-simple',
         show: { callback: () => !options.noPassword },
         children: [
-          { 
+          /* { 
             label: '登录账号', name: 'username', type: 'text',
             additionalProps: { 
               placeholder: '您可以设置一个登录账号方便登录,英文和数字组合',
@@ -44,7 +44,7 @@ export function getVolunteerForm(options: {
             } as FieldProps,
             rules: [{ required: true, message: '请输入密码' }],
             show: { callback: () => options.isNew.value || options.onlyPassword === true },
-          },
+          }, 
           {
             label: '确认密码',
             name: 'passwordRepeat',
@@ -63,7 +63,7 @@ export function getVolunteerForm(options: {
               }
             ] as RuleItem[],
             show: { callback: () => options.isNew.value || options.onlyPassword === true },
-          },
+          },*/
         ]
       },
       {
@@ -110,7 +110,7 @@ export function getVolunteerForm(options: {
               upload: useAliOssUploadCo('xiangyuan/volunteer/images')
             } as UploaderFieldProps,
           },
-          {
+          /* {
             label: '类型', name: 'type', type: 'radio-value',
             defaultValue: 'volunteer',
             additionalProps: {
@@ -120,7 +120,7 @@ export function getVolunteerForm(options: {
               ]
             } as RadioValueProps,
             rules: [{ required: true, message: '请选择类型' }],
-          },
+          }, */
           {
             label: '身份', name: 'residentStatus', type: 'radio-value',
             defaultValue: 2,

+ 21 - 0
src/pages/home/light/submit-map.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import { ref } from 'vue';
 import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
 import { useGetCurrentLocation } from '../composeabe/GetCurrentLocation';
 import AppCofig from '@/common/config/AppCofig';
@@ -10,6 +11,8 @@ import FlexRow from '@/components/layout/FlexRow.vue';
 import Text from '@/components/basic/Text.vue';
 import Image from '@/components/basic/Image.vue';
 import BoxMid from '@/common/components/box/BoxMid.vue';
+import JoinDialog from '../village/dialogs/JoinDialog.vue';
+import { backAndCallOnPageBack } from '@/components/utils/PageAction';
 
 const { querys } = useLoadQuerys({
   latitude: AppCofig.defaultLonLat[1],
@@ -23,6 +26,18 @@ const currentLocation = useGetCurrentLocation({
   onCityChanged: (city) => {},
 });
 
+const joinDialog = ref<InstanceType<typeof JoinDialog>>();
+const joinCurrentVillageId = ref(0);
+
+function handleLightVillage(villageId: number) {
+  joinCurrentVillageId.value = villageId;
+  joinDialog.value?.show();
+}
+function handleJoinFinish() { 
+  backAndCallOnPageBack('goVillage', { id: joinCurrentVillageId.value });
+  joinCurrentVillageId.value = 0;
+}
+
 </script>
 
 <template>
@@ -41,11 +56,17 @@ const currentLocation = useGetCurrentLocation({
       </BoxMid>
     </FlexRow>
   </FlexCol>
+  <JoinDialog
+    ref="joinDialog" 
+    :villageId="joinCurrentVillageId"
+    @finish="handleJoinFinish"
+  />
   <LightMap 
     full
     :city="querys.city"
     :lonlat="currentLocation.currentLonlat.value"
     :isLightMode="true" 
+    @lightVillage="handleLightVillage"
     @getCurrentLonlat="currentLocation.getCurrentExactLocation"
   />
 </template>

+ 1 - 1
src/pages/home/light/submit.vue

@@ -1,5 +1,5 @@
 <template>
-  <CommonTopBanner title="点亮村社">
+  <CommonTopBanner title="成为志愿者">
     <ProvideVar :vars="{
       FieldBackgroundColor: 'transparent',
     }">

+ 1 - 1
src/pages/home/village/goods/index.vue

@@ -78,7 +78,7 @@ const goodsLoader = useSimplePageListLoader(20, async (page, pageSize, params) =
 const searchValue = ref('');
 
 function handleJoin() {
-  navTo('/pages/home/light/submit', {
+  navTo('/pages/home/light/submit-volunteer', {
     villageId: querys.value.villageId,
   });
 }

+ 5 - 7
src/pages/home/village/index.vue

@@ -78,6 +78,8 @@ import { computed, onMounted, ref, watch } from 'vue';
 import { useVillageStore } from '@/store/village';
 import { useFollow } from './composeabe/Follow';
 import { navTo } from '@/components/utils/PageAction';
+import { isDevEnv } from '@/common/config/AppCofig';
+import { waitTimeOut } from '@imengyu/imengyu-utils';
 import type { VillageListItem } from '@/api/light/LightVillageApi';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import Height from '@/components/layout/space/Height.vue';
@@ -95,15 +97,14 @@ import VillageMyFollow from '../components/VillageMyFollow.vue';
 import HomeLargeTitle from '@/common/components/parts/HomeLargeTitle.vue';
 import Around from './recommed/around.vue';
 import FrameButton from '@/common/components/FrameButton.vue';
-import { isDevEnv } from '@/common/config/AppCofig';
-import { waitTimeOut } from '@imengyu/imengyu-utils';
 import JoinDialog from './dialogs/JoinDialog.vue';
 
 const topTab = ref<'village' | 'around'>('village');
 const tab = ref('card');
 const villageStore = useVillageStore();
-const showMyFollowPopup = ref(false);
 const { isFollowed, onFollow, onUnFollow } = useFollow();
+
+const showMyFollowPopup = ref(false);
 const joinDialog = ref<InstanceType<typeof JoinDialog>>();
 
 const props = withDefaults(defineProps<{
@@ -111,15 +112,12 @@ const props = withDefaults(defineProps<{
 }>(), {
   showSwitch: false,
 });
-
 const isLight = computed(() => {
   return villageStore.currentVillage?.isLight ?? false;
 });
 
 function handleLight() {
-  navTo('/pages/home/light/submit', {
-    villageId: villageStore.currentVillage?.id || 0,
-  });
+  joinDialog.value?.show();
 }
 
 function onSelectVillage(village: VillageListItem) {