|
|
@@ -86,7 +86,6 @@ import { onPullDownRefresh } from '@dcloudio/uni-app';
|
|
|
import { DataDateUtils } from '@imengyu/js-request-transform';
|
|
|
import { useSimplePageListLoader } from '@/components/composeabe/loader/SimplePageListLoader';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
-import { useCollectStore } from '@/store/collect';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { type TaskMenuDefGoForm, type TaskMenuDefItem } from './tasks';
|
|
|
import { useUserTools } from '@/common/composeabe/UserTools';
|
|
|
@@ -106,14 +105,12 @@ import H4 from '@/components/typography/H4.vue';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
import Result from '@/components/feedback/Result.vue';
|
|
|
-import { getVillageInfoForm } from './forms';
|
|
|
+import { CollectableModulesIdMap, getVillageInfoForm } from './forms';
|
|
|
import VillageApi, { type VillageCatalogListItem } from '@/api/inhert/VillageApi';
|
|
|
import Icon from '@/components/basic/Icon.vue';
|
|
|
|
|
|
const subTitle = ref('');
|
|
|
const searchText = ref('');
|
|
|
-const collectStore = useCollectStore();
|
|
|
-const { getCollectModuleInternalNameById } = collectStore;
|
|
|
const { getIsVolunteer, getIsJoinedVillage, volunteerInfo } = useUserTools();
|
|
|
const isJoined = ref(false);
|
|
|
const authStore = useAuthStore();
|
|
|
@@ -128,19 +125,18 @@ const listLoader = useSimplePageListLoader<{
|
|
|
}, {
|
|
|
villageId: number,
|
|
|
villageVolunteerId: number,
|
|
|
- subType: string,
|
|
|
+ collectModuleId: number,
|
|
|
subId: number,
|
|
|
subKey: string,
|
|
|
}>(8, async (page, pageSize, params) => {
|
|
|
if (!params )
|
|
|
throw new Error("未传入参数,当前页面需要参数");
|
|
|
- if (!params.subType)
|
|
|
- throw new Error("params.subType");
|
|
|
+ if (!params.collectModuleId)
|
|
|
+ throw new Error("params.collectModuleId");
|
|
|
if (!params.villageId)
|
|
|
throw new Error("params.villageId");
|
|
|
let res = await VillageInfoApi.getList(
|
|
|
- collectStore.getCollectModuleId(params.subType),
|
|
|
- params.subType,
|
|
|
+ params.collectModuleId,
|
|
|
params.subKey ? params.subId : undefined,
|
|
|
params.subKey,
|
|
|
params.villageId,
|
|
|
@@ -186,7 +182,7 @@ function newData() {
|
|
|
villageId: querys.value.villageId,
|
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
|
catalogId: currentCatalog.value?.id || 0,
|
|
|
- subType: currentLoadData.value.subType,
|
|
|
+ collectModuleId: currentLoadData.value.collectModuleId,
|
|
|
subId: currentLoadData.value.subId,
|
|
|
});
|
|
|
}
|
|
|
@@ -205,7 +201,7 @@ function goDetail(item: { id: number, villageVolunteerId: number }) {
|
|
|
villageId: querys.value.villageId,
|
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
|
catalogId: currentCatalog.value?.id || 0,
|
|
|
- subType: currentLoadData.value.subType,
|
|
|
+ collectModuleId: currentLoadData.value.collectModuleId,
|
|
|
subKey: currentLoadData.value.subKey,
|
|
|
subId: currentLoadData.value.subId,
|
|
|
subTitle: currentLoadData.value.subTitle,
|
|
|
@@ -231,7 +227,7 @@ const currentCatalogList = computed(() => {
|
|
|
});
|
|
|
const currentCatalog = ref<VillageCatalogListItem | null>(null);
|
|
|
const currentLoadData = ref({
|
|
|
- subType: '',
|
|
|
+ collectModuleId: 0,
|
|
|
subId: 0,
|
|
|
subKey: '',
|
|
|
subTitle: '',
|
|
|
@@ -251,32 +247,30 @@ function loadListCatalog(catalog: VillageCatalogListItem) {
|
|
|
return;
|
|
|
currentCatalog.value = catalog;
|
|
|
|
|
|
- const collectModuleInternalName = getCollectModuleInternalNameById(querys.value.collectModuleId);
|
|
|
- if (!collectModuleInternalName) {
|
|
|
+ try {
|
|
|
+ const formDefine = getVillageInfoForm(querys.value.collectModuleId, -1);
|
|
|
+ const goForm = [
|
|
|
+ querys.value.collectModuleId,
|
|
|
+ catalog.typeId ?? -1,
|
|
|
+ formDefine?.[2].typeName,
|
|
|
+ querys.value.collectModuleId === CollectableModulesIdMap['overview'] ? 'common' : undefined,
|
|
|
+ catalog.title,
|
|
|
+ catalog.id
|
|
|
+ ] as TaskMenuDefGoForm;
|
|
|
+
|
|
|
+ currentLoadData.value = {
|
|
|
+ collectModuleId: querys.value.collectModuleId,
|
|
|
+ subId: goForm[1],
|
|
|
+ subKey: goForm[2] || 'type',
|
|
|
+ subTitle: goForm[4] || querys.value.title,
|
|
|
+ catalogId: goForm[5] || 0,
|
|
|
+ villageId: querys.value.villageId,
|
|
|
+ villageVolunteerId: volunteerInfo.value?.id || 0,
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
error.value = '任务不存在';
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- const formDefine = collectModuleInternalName ? getVillageInfoForm(collectModuleInternalName, -1) : undefined;
|
|
|
- const goForm = [
|
|
|
- collectModuleInternalName,
|
|
|
- catalog.typeId ?? -1,
|
|
|
- formDefine?.[2].typeName,
|
|
|
- collectModuleInternalName === 'overview' ? 'common' : undefined,
|
|
|
- catalog.title,
|
|
|
- catalog.id
|
|
|
- ] as TaskMenuDefGoForm;
|
|
|
-
|
|
|
- currentLoadData.value = {
|
|
|
- ...querys.value,
|
|
|
- subType: goForm[0],
|
|
|
- subId: goForm[1],
|
|
|
- subKey: goForm[2] || 'type',
|
|
|
- subTitle: goForm[4] || querys.value.title,
|
|
|
- catalogId: goForm[5] || 0,
|
|
|
- villageId: querys.value.villageId,
|
|
|
- villageVolunteerId: volunteerInfo.value?.id || 0,
|
|
|
- }
|
|
|
listLoader.load(false, currentLoadData.value)
|
|
|
}
|
|
|
|