|
@@ -1,36 +1,30 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 通用列表页 -->
|
|
<!-- 通用列表页 -->
|
|
|
- <view
|
|
|
|
|
- :class="[
|
|
|
|
|
- 'common-list-page d-flex flex-column',
|
|
|
|
|
- hasBg ? 'bg-base p-3' : ''
|
|
|
|
|
- ]"
|
|
|
|
|
|
|
+ <FlexCol
|
|
|
|
|
+ :padding="30"
|
|
|
|
|
+ :backgroundColor="hasBg ? 'background.page' : ''"
|
|
|
>
|
|
>
|
|
|
- <view v-if="tabs" class="top-tab bg-base">
|
|
|
|
|
- <Tabs
|
|
|
|
|
- :tabs="tabs"
|
|
|
|
|
- :width="700"
|
|
|
|
|
- v-model:currentIndex="tabCurrentIndex"
|
|
|
|
|
- :autoScroll="false"
|
|
|
|
|
- @click="handleTabClick"
|
|
|
|
|
- />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <Tabs
|
|
|
|
|
+ v-if="tabs"
|
|
|
|
|
+ :tabs="tabs"
|
|
|
|
|
+ :width="700"
|
|
|
|
|
+ v-model:currentIndex="tabCurrentIndex"
|
|
|
|
|
+ :autoScroll="false"
|
|
|
|
|
+ @click="handleTabClick"
|
|
|
|
|
+ />
|
|
|
<!-- 搜索 -->
|
|
<!-- 搜索 -->
|
|
|
- <view v-if="showSearch" class="d-flex flex-col">
|
|
|
|
|
- <SearchBar
|
|
|
|
|
- v-model="searchValue"
|
|
|
|
|
- :placeholder="`输入关键词搜索${title}`"
|
|
|
|
|
- @search="doSearch"
|
|
|
|
|
- @cancel="doSearch"
|
|
|
|
|
- />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <SearchBar
|
|
|
|
|
+ v-if="showSearch"
|
|
|
|
|
+ v-model="searchValue"
|
|
|
|
|
+ :placeholder="`输入关键词搜索${title}`"
|
|
|
|
|
+ @search="doSearch"
|
|
|
|
|
+ @cancel="doSearch"
|
|
|
|
|
+ />
|
|
|
<!-- 下拉框 -->
|
|
<!-- 下拉框 -->
|
|
|
- <view
|
|
|
|
|
|
|
+ <FlexRow
|
|
|
v-if="dropDownNames.length > 0"
|
|
v-if="dropDownNames.length > 0"
|
|
|
- class="d-flex flex-row justify-between align-center mt-2"
|
|
|
|
|
- :class="[
|
|
|
|
|
- dropDownVisibleCount >= 3 ? 'justify-around' : ('justify-between')
|
|
|
|
|
- ]"
|
|
|
|
|
|
|
+ :justify="dropDownVisibleCount >= 3 ? 'space-around' : 'space-between'"
|
|
|
|
|
+ align="center"
|
|
|
>
|
|
>
|
|
|
<template v-for="(drop, k) in dropDownNames" :key="k" >
|
|
<template v-for="(drop, k) in dropDownNames" :key="k" >
|
|
|
<SimpleDropDownPicker
|
|
<SimpleDropDownPicker
|
|
@@ -41,34 +35,29 @@
|
|
|
@update:modelValue="(v) => handleChangeDropDownValue(k, v)"
|
|
@update:modelValue="(v) => handleChangeDropDownValue(k, v)"
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
- <view
|
|
|
|
|
- v-if="(showTotal && dropDownVisibleCount < 3)"
|
|
|
|
|
- class="d-flex flex-row align-center mt-3 size-s color-primary text-bold"
|
|
|
|
|
- >
|
|
|
|
|
- <text>总共有 {{ listLoader.total }} 个</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view
|
|
|
|
|
- v-if="(dropDownVisibleCount >= 3 || dropDownVisibleCount == 0)"
|
|
|
|
|
- class="d-flex flex-row justify-center align-center mt-3 size-s color-primary text-bold"
|
|
|
|
|
- >
|
|
|
|
|
- <text>总共有 {{ listLoader.total }} 个</text>
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <FlexRow v-if="(showTotal && dropDownVisibleCount < 3)" center>
|
|
|
|
|
+ <Text bold color="primary" :text="`总共有 ${ listLoader.total.value } 个`" />
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
+ <FlexRow v-if="(dropDownVisibleCount >= 3 || dropDownVisibleCount == 0)" center :padding="20">
|
|
|
|
|
+ <Text bold color="primary" :text="`总共有 ${ listLoader.total.value } 个`" />
|
|
|
|
|
+ </FlexRow>
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
|
- <view class="position-relative d-flex flex-row flex-wrap justify-between align-stretch mt-3">
|
|
|
|
|
- <view
|
|
|
|
|
|
|
+ <FlexRow
|
|
|
|
|
+ position="relative"
|
|
|
|
|
+ wrap justify="space-between" align="stretch"
|
|
|
|
|
+ >
|
|
|
|
|
+ <FlexCol
|
|
|
v-for="(item, i) in listLoader.list.value"
|
|
v-for="(item, i) in listLoader.list.value"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
- :class="[
|
|
|
|
|
- 'position-relative d-flex flex-grow-1',
|
|
|
|
|
- itemType.endsWith('-2') ? 'width-1-2' : 'w-100'
|
|
|
|
|
- ]"
|
|
|
|
|
|
|
+ :flexGrow="1"
|
|
|
|
|
+ :width="itemType.endsWith('-2') ? '50%' : '100%'"
|
|
|
>
|
|
>
|
|
|
<Box2LineLargeImageUserShadow
|
|
<Box2LineLargeImageUserShadow
|
|
|
v-if="itemType.startsWith('image-large')"
|
|
v-if="itemType.startsWith('image-large')"
|
|
|
- class="w-100"
|
|
|
|
|
- titleColor="title-text"
|
|
|
|
|
|
|
+ :width="100"
|
|
|
|
|
+ titleColor="black"
|
|
|
:classNames="getItemClass(i)"
|
|
:classNames="getItemClass(i)"
|
|
|
:image="getImage(item)"
|
|
:image="getImage(item)"
|
|
|
:titleBox="item.titleBox"
|
|
:titleBox="item.titleBox"
|
|
@@ -80,8 +69,8 @@
|
|
|
/>
|
|
/>
|
|
|
<Box2LineImageRightShadow
|
|
<Box2LineImageRightShadow
|
|
|
v-else-if="itemType.startsWith('article-common')"
|
|
v-else-if="itemType.startsWith('article-common')"
|
|
|
- class="w-100"
|
|
|
|
|
- titleColor="title-text"
|
|
|
|
|
|
|
+ :width="100"
|
|
|
|
|
+ titleColor="black"
|
|
|
:titleBox="item.titleBox"
|
|
:titleBox="item.titleBox"
|
|
|
:classNames="getItemClass(i)"
|
|
:classNames="getItemClass(i)"
|
|
|
:image="getImage(item)"
|
|
:image="getImage(item)"
|
|
@@ -94,10 +83,10 @@
|
|
|
/>
|
|
/>
|
|
|
<Box2LineImageRightShadow
|
|
<Box2LineImageRightShadow
|
|
|
v-else-if="itemType.startsWith('article-character')"
|
|
v-else-if="itemType.startsWith('article-character')"
|
|
|
- class="w-100"
|
|
|
|
|
|
|
+ :width="100"
|
|
|
:classNames="getItemClass(i)"
|
|
:classNames="getItemClass(i)"
|
|
|
:image="getImage(item)"
|
|
:image="getImage(item)"
|
|
|
- titleColor="title-text"
|
|
|
|
|
|
|
+ titleColor="black"
|
|
|
:title="item.title"
|
|
:title="item.title"
|
|
|
:titleBox="item.titleBox"
|
|
:titleBox="item.titleBox"
|
|
|
:tags="item.bottomTags || item.keywords"
|
|
:tags="item.bottomTags || item.keywords"
|
|
@@ -106,11 +95,11 @@
|
|
|
@click="goDetails(item, item.id)"
|
|
@click="goDetails(item, item.id)"
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-if="itemType.endsWith('-2') && listLoader.list.value.length % 2 != 0" class="width-1-2" />
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ </FlexCol>
|
|
|
|
|
+ <view v-if="itemType.endsWith('-2') && listLoader.list.value.length % 2 != 0" style="width:50%;" />
|
|
|
|
|
+ </FlexRow>
|
|
|
<SimplePageListLoader :loader="listLoader" />
|
|
<SimplePageListLoader :loader="listLoader" />
|
|
|
- </view>
|
|
|
|
|
|
|
+ </FlexCol>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -124,6 +113,9 @@ import SimpleDropDownPicker, { type SimpleDropDownPickerItem } from '@/common/co
|
|
|
import AppCofig from '@/common/config/AppCofig';
|
|
import AppCofig from '@/common/config/AppCofig';
|
|
|
import Tabs from '@/components/nav/Tabs.vue';
|
|
import Tabs from '@/components/nav/Tabs.vue';
|
|
|
import SearchBar from '@/components/form/SearchBar.vue';
|
|
import SearchBar from '@/components/form/SearchBar.vue';
|
|
|
|
|
+import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
|
|
+import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
|
|
+import Text from '@/components/basic/Text.vue';
|
|
|
|
|
|
|
|
function getImage(item: any) {
|
|
function getImage(item: any) {
|
|
|
return item.thumbnail || item.image || AppCofig.defaultImage
|
|
return item.thumbnail || item.image || AppCofig.defaultImage
|
|
@@ -356,10 +348,4 @@ onMounted(() => {
|
|
|
if (props.loadMounted)
|
|
if (props.loadMounted)
|
|
|
listLoader.loadData(undefined, true);
|
|
listLoader.loadData(undefined, true);
|
|
|
});
|
|
});
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-<style lang="scss">
|
|
|
|
|
-.common-list-page {
|
|
|
|
|
- min-height: 100vh;
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+</script>
|