修改列表样式

master
fuxiaochun 2023-08-28 18:06:59 +08:00
parent 34da0ebd61
commit 8c89450977
3 changed files with 25 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -24,12 +24,11 @@
<ul>
<li :key="item.id" v-for="item in recommend" @click="goDetail(item.id)">
<div class="img">
<img :src="item.cover" :alt="item.title">
<img :src="item.cover || errImg" :alt="item.title">
</div>
<div class="rTitle">
<h2><span>[{{ DateFormat(new Date(item.published_at * 1000), 'yyyy.MM.dd') }}]</span> {{ item.title }}</h2>
</div>
<div class="desc">{{ item.description }}</div>
</li>
</ul>
</div>
@ -41,14 +40,14 @@
</template>
<script setup>
import { ref, onBeforeMount, onMounted, onBeforeUnmount } from 'vue';
import { ref, onBeforeMount, onMounted, onBeforeUnmount, computed } from 'vue';
import http from '@/io/http';
import { showToast } from 'vant';
import { useRouter, useRoute } from 'vue-router';
import { DateFormat } from '@/utils/format.js';
import AiAssistantFolat from '@/views/chat/components/ai-assistant-float.vue';
import { useWebsite } from '@/stores/website';
import { computed } from 'vue';
import errImg from '@/assets/images/err_img.gif';
const website = useWebsite();
@ -247,9 +246,12 @@ const goDetail = (id) => {
cursor: pointer;
.img{
width: 100%;
height: 264px;
height: 280px;
background-color: #666;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
img{
object-fit: cover;
display: block;
@ -266,12 +268,17 @@ const goDetail = (id) => {
// justify-content: space-between;
// align-items: center;
h2{
height: 160px;
font-weight: bold;
font-size: 28px;
line-height: 40px;
// margin-right: 10px;
flex: 1;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
span{
font-weight: normal;
padding-right: 5px;

View File

@ -5,12 +5,11 @@
<ul>
<li :key="item.id" v-for="item in dataList" @click="goDetail(item.id)">
<div class="img">
<img :src="item.cover" :alt="item.title">
<img :src="item.cover || errImg" :alt="item.title">
</div>
<div class="title">
<h2><span>[{{ DateFormat(new Date(item.published_at * 1000), 'yyyy.MM.dd') }}]</span> {{ item.title }}</h2>
</div>
<div class="desc">{{ item.description }}</div>
</li>
</ul>
<div class="pageBox" v-if="hasMore">
@ -31,6 +30,7 @@ import http from '@/io/http';
import { showToast } from 'vant';
import { DateFormat } from '@/utils/format.js';
import { useRouter, useRoute } from 'vue-router';
import errImg from '@/assets/images/err_img.gif';
const router = useRouter();
const route = useRoute();
@ -128,9 +128,12 @@ const goDetail = (id) => {
cursor: pointer;
.img{
width: 100%;
height: 264px;
height: 280px;
background-color: #666;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
img{
object-fit: cover;
display: block;
@ -148,12 +151,17 @@ const goDetail = (id) => {
// justify-content: space-between;
// align-items: center;
h2{
// height: 40px;
// height: 160px;
font-weight: bold;
font-size: 28px;
line-height: 40px;
// margin-right: 10px;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 4;
span{
font-weight: normal;
padding-right: 5px;