Bladeren bron

修改细节问题

快乐的梦鱼 1 maand geleden
bovenliggende
commit
983234d29d

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

@@ -44,7 +44,7 @@ export class VillageListItem extends DataModel<VillageListItem> {
   township = '' as string|null;
   address = '';
   villageVolunteerId = null as number|null;
-  villageId = null as number|null;
+  villageId !:number;
   claimReason = '';
   status = '';
   statusText = '';

+ 1 - 1
src/components/dialog/Dialog.vue

@@ -8,7 +8,7 @@
     <DialogInner 
       ref="dialogInner"
       v-bind="props"
-      :onConfirm="$props.onConfirm""
+      :onConfirm="$props.onConfirm"
       :onCancel="$props.onCancel"
       :confirmCountDownTime="props.confirmCountDown"
       :topSlots="{

+ 2 - 2
src/components/feedback/DropdownMenuItem.vue

@@ -36,8 +36,8 @@
           v-if="canOpen"
           :innerStyle="{
             transform: topContext.direction.value === 'up' ? 
-              (openState ? 'rotate(0deg)' : 'rotate(180deg)') : 
-              (openState ? 'rotate(180deg)' : 'rotate(0deg)'),
+              (openState ? 'rotate(1deg)' : 'rotate(180deg)') : 
+              (openState ? 'rotate(180deg)' : 'rotate(-1deg)'),
             ...textStyle,
           }"
           :size="iconSize"

+ 23 - 6
src/pages/dig/forms/submits.vue

@@ -19,6 +19,11 @@
         ]"
         type="single-check"
       />
+      <DropdownMenuItem 
+        v-model="filterVillage"
+        :options="villageListLoader.content.value || []"
+        type="single-check"
+      />
     </DropdownMenu>
     <Height :height="20" />
     <SimplePageListLoader :loader="listLoader" :noEmpty="true">
@@ -85,9 +90,9 @@ import { ref, watch } from 'vue';
 import { onPullDownRefresh } from '@dcloudio/uni-app';
 import { DataDateUtils } from '@imengyu/js-request-transform';
 import { useSimplePageListLoader } from '@/common/composeabe/SimplePageListLoader';
+import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
 import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
 import { useCollectStore } from '@/store/collect';
-import { useAuthStore } from '@/store/auth';
 import { selectObjectByType } from '@/components/theme/ThemeTools';
 import { navTo } from '@/components/utils/PageAction';
 import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
@@ -106,19 +111,31 @@ import Tag from '@/components/display/Tag.vue';
 import Icon from '@/components/basic/Icon.vue';
 import DropdownMenu from '@/components/feedback/DropdownMenu.vue';
 import DropdownMenuItem from '@/components/feedback/DropdownMenuItem.vue';
+import VillageApi from '@/api/inhert/VillageApi';
+import { waitTimeOut } from '@imengyu/imengyu-utils';
 
 const searchText = ref('');
-const authStore = useAuthStore();
 const collectStore = useCollectStore();
 const filterStatus = ref(-100);
+const filterVillage = ref(0);
 
+const villageListLoader = useSimpleDataLoader(async () => {
+  const res = await VillageApi.getClaimedVallageList()
+  if (filterVillage.value == 0) 
+    filterVillage.value = res[0].villageId;
+  return res.map(item => ({
+    text: item.villageName,
+    value: item.villageId!,
+  }));
+}, true);
 const listLoader = useSimplePageListLoader<CommonInfoModel>(8, async (page, pageSize) => {
+  await waitTimeOut(300);
   let res = await VillageInfoApi.getList(
     undefined,
     '',
     undefined,
     undefined,
-    querys.value.villageId,
+    filterVillage.value,
     querys.value.villageVolunteerId,
     undefined,
     page,
@@ -152,12 +169,12 @@ const { querys } = useLoadQuerys({
   villageId: 0,  
   villageVolunteerId: 0,
 }, async (querys) => {
+  filterVillage.value = querys.villageId || 0;
   listLoader.loadData(querys)
 });
 
-watch(filterStatus, () => {
-  listLoader.loadData(undefined, true);
-})
+watch(filterStatus, () => listLoader.loadData(undefined, true))
+watch(filterVillage, () => listLoader.loadData(undefined, true))
 
 onPullDownRefresh(() => {
   listLoader.loadData(undefined, true);

+ 6 - 1
src/pages/user/index.vue

@@ -25,7 +25,9 @@
     </Touchable>
     <Height :height="50" />
     <CellGroup round>
-      <Cell icon="/static/images/user/icon-edit.png" title="我的投稿" showArrow touchable @click="navTo('/pages/dig/forms/submits', { villageVolunteerId: userInfo?.id })" />
+      <Cell icon="/static/images/user/icon-edit.png" title="我的投稿" showArrow touchable @click="navTo('/pages/dig/forms/submits', { 
+        villageVolunteerId: volunteerInfoLoader.content.value?.id || 0 
+      })" />
       <Cell icon="/static/images/user/icon-profile.png" title="编辑资料" showArrow touchable @click="goUserProfile" />
       <Cell v-if="!isBindWx" icon="wechat" title="绑定微信" showArrow touchable @click="navTo('/pages/dig/sharereg/bind-wx')" />
       <Cell icon="/static/images/user/icon-function.png" title="关于我们" showArrow touchable @click="navTo('/pages/home/about/about')" />
@@ -61,10 +63,13 @@ import Touchable from '@/components/feedback/Touchable.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
 import Text from '@/components/basic/Text.vue';
 import AppCofig from '@/common/config/AppCofig';
+import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
+import VillageApi from '@/api/inhert/VillageApi';
 
 const authStore = useAuthStore();
 const userInfo = computed(() => authStore.userInfo);
 const isBindWx = computed(() => Boolean(userInfo.value?.openId));
+const volunteerInfoLoader = useSimpleDataLoader(async () => await VillageApi.getVolunteerInfo(), true);
 const buildTime = `${__BUILD_TIMESTAMP__}`
 const buildInfo = `${__BUILD_GUID__}`