|
@@ -11,7 +11,7 @@
|
|
|
<FlexRow flexBasis="50%">
|
|
<FlexRow flexBasis="50%">
|
|
|
<Text :fontSize="30" text="已认领:" />
|
|
<Text :fontSize="30" text="已认领:" />
|
|
|
<Width :width="20" />
|
|
<Width :width="20" />
|
|
|
- <Text :fontSize="30" color="primary" :text="querys.name" />
|
|
|
|
|
|
|
+ <Text :fontSize="30" color="primary" :text="decodeURIComponent(querys.name)" />
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
|
<FlexRow flexBasis="50%" align="center">
|
|
<FlexRow flexBasis="50%" align="center">
|
|
|
<Text :fontSize="30" color="text.content" :text="`文化积分: `" />
|
|
<Text :fontSize="30" color="text.content" :text="`文化积分: `" />
|
|
@@ -45,7 +45,7 @@
|
|
|
description="请联系管理员认领可采编栏目"
|
|
description="请联系管理员认领可采编栏目"
|
|
|
/>
|
|
/>
|
|
|
<TaskList
|
|
<TaskList
|
|
|
- v-for="(item,key) in TaskRootDef"
|
|
|
|
|
|
|
+ v-for="(item,key) in taskList.content.value"
|
|
|
:key="key"
|
|
:key="key"
|
|
|
:icon="item.icon"
|
|
:icon="item.icon"
|
|
|
:title="item.title"
|
|
:title="item.title"
|
|
@@ -75,8 +75,10 @@ import TaskList from './components/TaskList.vue';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
import Width from '@/components/layout/space/Width.vue';
|
|
import Width from '@/components/layout/space/Width.vue';
|
|
|
import Alert from '@/components/feedback/Alert.vue';
|
|
import Alert from '@/components/feedback/Alert.vue';
|
|
|
-import { TaskRootDef } from './forms/tasks';
|
|
|
|
|
|
|
+import { TaskRootDef, type TaskRootMenuDefItem } from './forms/tasks';
|
|
|
import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
|
|
import { useTaskEntryForm } from './forms/composeable/TaskEntryForm';
|
|
|
|
|
+import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
|
|
|
|
|
+import VillageApi, { VillageCatalogListItem } from '@/api/inhert/VillageApi';
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
|
name: '',
|
|
name: '',
|
|
@@ -87,13 +89,37 @@ const { querys } = useLoadQuerys({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
-const { canCollect, isEmpty } = useCollectStore();
|
|
|
|
|
|
|
+const { canCollect, getCollectModuleInternalNameById, isEmpty } = useCollectStore();
|
|
|
const { goForm } = useTaskEntryForm();
|
|
const { goForm } = useTaskEntryForm();
|
|
|
|
|
|
|
|
const nextPageData = computed(() => ({
|
|
const nextPageData = computed(() => ({
|
|
|
villageId: querys.value.villageId,
|
|
villageId: querys.value.villageId,
|
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
|
}));
|
|
}));
|
|
|
|
|
+const taskList = useSimpleDataLoader<(TaskRootMenuDefItem & {
|
|
|
|
|
+ catalogItem?: VillageCatalogListItem,
|
|
|
|
|
+})[]>(async () => {
|
|
|
|
|
+ const res = (await VillageApi.getCatalogList(querys.value.villageId))
|
|
|
|
|
+ .filter(item => item.pid == 0)
|
|
|
|
|
+ .map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ collectModuleName: getCollectModuleInternalNameById(item.collectModuleId),
|
|
|
|
|
+ }));
|
|
|
|
|
+
|
|
|
|
|
+ if (res.length === 0)
|
|
|
|
|
+ return TaskRootDef;
|
|
|
|
|
+
|
|
|
|
|
+ return TaskRootDef
|
|
|
|
|
+ .map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ catalogItem: res.find(t => t.collectModuleName == item.name || t.title == item.title)
|
|
|
|
|
+ }))
|
|
|
|
|
+ .filter(item => item.catalogItem)
|
|
|
|
|
+ .map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ title: item.catalogItem?.title || item.title,
|
|
|
|
|
+ }));
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
function goCollect() {
|
|
function goCollect() {
|
|
|
if (!canCollect('collect')) {
|
|
if (!canCollect('collect')) {
|
|
@@ -107,7 +133,9 @@ function goCollect() {
|
|
|
goForm('collect', 1, '随手记')
|
|
goForm('collect', 1, '随手记')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function goTask(item: typeof TaskRootDef[0]) {
|
|
|
|
|
|
|
+function goTask(item: TaskRootMenuDefItem & {
|
|
|
|
|
+ catalogItem?: VillageCatalogListItem,
|
|
|
|
|
+}) {
|
|
|
if (!item.enable) {
|
|
if (!item.enable) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
title: '您当前没有可完成此任务的权限',
|
|
title: '您当前没有可完成此任务的权限',
|
|
@@ -121,6 +149,7 @@ function goTask(item: typeof TaskRootDef[0]) {
|
|
|
} else {
|
|
} else {
|
|
|
navTo('forms/task', {
|
|
navTo('forms/task', {
|
|
|
...nextPageData.value,
|
|
...nextPageData.value,
|
|
|
|
|
+ taskPid: item.catalogItem?.id || 0,
|
|
|
taskName: item.goForm.name,
|
|
taskName: item.goForm.name,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|