|
@@ -15,28 +15,48 @@
|
|
|
<Touchable
|
|
<Touchable
|
|
|
v-for="item in listLoader.list.value"
|
|
v-for="item in listLoader.list.value"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
- :gap="20"
|
|
|
|
|
:padding="[15,20]"
|
|
:padding="[15,20]"
|
|
|
:radius="15"
|
|
:radius="15"
|
|
|
|
|
+ justify="space-between"
|
|
|
align="center"
|
|
align="center"
|
|
|
backgroundColor="white"
|
|
backgroundColor="white"
|
|
|
direction="row"
|
|
direction="row"
|
|
|
touchable
|
|
touchable
|
|
|
- @click="goDetail(item.id)"
|
|
|
|
|
|
|
+ @click="goDetail(item)"
|
|
|
>
|
|
>
|
|
|
- <Image
|
|
|
|
|
- :src="item.image"
|
|
|
|
|
- :showFailed="false"
|
|
|
|
|
- :width="100"
|
|
|
|
|
- :height="100"
|
|
|
|
|
- :radius="10"
|
|
|
|
|
- mode="aspectFill"
|
|
|
|
|
- round
|
|
|
|
|
- />
|
|
|
|
|
- <FlexCol>
|
|
|
|
|
- <H4 :size="36">{{ item.title }}</H4>
|
|
|
|
|
- <Text :size="23">{{ item.desc }}</Text>
|
|
|
|
|
- </FlexCol>
|
|
|
|
|
|
|
+ <FlexRow align="center" :gap="20">
|
|
|
|
|
+ <Image
|
|
|
|
|
+ :src="item.image"
|
|
|
|
|
+ :showFailed="false"
|
|
|
|
|
+ :width="150"
|
|
|
|
|
+ :height="150"
|
|
|
|
|
+ :radius="10"
|
|
|
|
|
+ mode="aspectFill"
|
|
|
|
|
+ round
|
|
|
|
|
+ />
|
|
|
|
|
+ <FlexCol>
|
|
|
|
|
+ <H4 :size="36">{{ item.title }}</H4>
|
|
|
|
|
+ <Height :height="10" />
|
|
|
|
|
+ <Text :size="23" :text="`栏目: ${item.catalogName}`" />
|
|
|
|
|
+ <Text :size="23" :text="`时间: ${DataDateUtils.formatDate(item.updatedAt, 'YYYY-MM-dd')}`" />
|
|
|
|
|
+ <FlexRow align="center">
|
|
|
|
|
+ <Text :size="23" :text="`状态:`" />
|
|
|
|
|
+ <Tag
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :text="(item.statusText as string)"
|
|
|
|
|
+ :type="selectObjectByType(item.status as string, '0', {
|
|
|
|
|
+ '-1': 'danger',
|
|
|
|
|
+ '0': 'default',
|
|
|
|
|
+ '1': 'warning',
|
|
|
|
|
+ '2': 'primary',
|
|
|
|
|
+ '3': 'primary',
|
|
|
|
|
+ '4': 'success',
|
|
|
|
|
+ })"
|
|
|
|
|
+ />
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ </FlexCol>
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ <Icon icon="arrow-right-bold" color="primary" :size="36" />
|
|
|
</Touchable>
|
|
</Touchable>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
</SimplePageListLoader>
|
|
</SimplePageListLoader>
|
|
@@ -52,9 +72,10 @@ import { useSimplePageListLoader } from '@/common/composeabe/SimplePageListLoade
|
|
|
import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
|
|
|
import { useCollectStore } from '@/store/collect';
|
|
import { useCollectStore } from '@/store/collect';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
|
|
+import { selectObjectByType } from '@/components/theme/ThemeTools';
|
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
import { navTo } from '@/components/utils/PageAction';
|
|
|
import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
|
|
import SimplePageListLoader from '@/common/components/SimplePageListLoader.vue';
|
|
|
-import VillageInfoApi from '@/api/inhert/VillageInfoApi';
|
|
|
|
|
|
|
+import VillageInfoApi, { CommonInfoModel } from '@/api/inhert/VillageInfoApi';
|
|
|
import Image from '@/components/basic/Image.vue';
|
|
import Image from '@/components/basic/Image.vue';
|
|
|
import Empty from '@/components/feedback/Empty.vue';
|
|
import Empty from '@/components/feedback/Empty.vue';
|
|
|
import SearchBar from '@/components/form/SearchBar.vue';
|
|
import SearchBar from '@/components/form/SearchBar.vue';
|
|
@@ -64,54 +85,43 @@ import Height from '@/components/layout/space/Height.vue';
|
|
|
import H4 from '@/components/typography/H4.vue';
|
|
import H4 from '@/components/typography/H4.vue';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
import XBarSpace from '@/components/layout/space/XBarSpace.vue';
|
|
|
|
|
+import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
|
|
+import Tag from '@/components/display/Tag.vue';
|
|
|
|
|
+import Icon from '@/components/basic/Icon.vue';
|
|
|
|
|
|
|
|
const searchText = ref('');
|
|
const searchText = ref('');
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
|
|
+const collectStore = useCollectStore();
|
|
|
|
|
|
|
|
-const listLoader = useSimplePageListLoader<{
|
|
|
|
|
- id: number,
|
|
|
|
|
- image: string,
|
|
|
|
|
- title: string,
|
|
|
|
|
- desc: string
|
|
|
|
|
-}, {
|
|
|
|
|
- villageId: number,
|
|
|
|
|
- villageVolunteerId: number,
|
|
|
|
|
-}>(8, async (page, pageSize, params) => {
|
|
|
|
|
- if (!params )
|
|
|
|
|
- throw new Error("未传入参数,当前页面需要参数");
|
|
|
|
|
|
|
+const listLoader = useSimplePageListLoader<CommonInfoModel>(8, async (page, pageSize) => {
|
|
|
let res = await VillageInfoApi.getList(
|
|
let res = await VillageInfoApi.getList(
|
|
|
undefined,
|
|
undefined,
|
|
|
'',
|
|
'',
|
|
|
undefined,
|
|
undefined,
|
|
|
undefined,
|
|
undefined,
|
|
|
- params.villageId,
|
|
|
|
|
- params.villageVolunteerId,
|
|
|
|
|
|
|
+ querys.value.villageId,
|
|
|
|
|
+ querys.value.villageVolunteerId,
|
|
|
undefined,
|
|
undefined,
|
|
|
page,
|
|
page,
|
|
|
pageSize,
|
|
pageSize,
|
|
|
)
|
|
)
|
|
|
if (searchText.value)
|
|
if (searchText.value)
|
|
|
res = res.filter((p) => p.title.includes(searchText.value));
|
|
res = res.filter((p) => p.title.includes(searchText.value));
|
|
|
- const list = res.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- id: item.id,
|
|
|
|
|
- image: item.image,
|
|
|
|
|
- title: item.title,
|
|
|
|
|
- desc: DataDateUtils.formatDate(item.updatedAt, 'YYYY-MM-dd') + (
|
|
|
|
|
- authStore.isAdmin ? (' 投稿人:' + item.villageVolunteerName) : ''
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
return {
|
|
return {
|
|
|
- list: list,
|
|
|
|
|
- total: list.length,
|
|
|
|
|
|
|
+ list: res,
|
|
|
|
|
+ total: res.length,
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
-function goDetail(id: number) {
|
|
|
|
|
|
|
+function goDetail(item: CommonInfoModel) {
|
|
|
navTo('common', {
|
|
navTo('common', {
|
|
|
- id,
|
|
|
|
|
|
|
+ id: item.id,
|
|
|
villageId: querys.value.villageId,
|
|
villageId: querys.value.villageId,
|
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
villageVolunteerId: querys.value.villageVolunteerId,
|
|
|
|
|
+ catalogId: item.catalogId,
|
|
|
|
|
+ subType: collectStore.getCollectModuleInternalNameById(item.collectModuleId),
|
|
|
|
|
+ subKey: '',
|
|
|
|
|
+ subId: -1,
|
|
|
|
|
+ subTitle: item.catalogName,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
function search() {
|
|
function search() {
|