|
@@ -1,31 +1,31 @@
|
|
|
<template>
|
|
|
<div class="home bg-gray-900 comBg">
|
|
|
- <Header @search="searchChange" :searchName="searchName" />
|
|
|
- <div class="min-h-screen text-white">
|
|
|
- <div class="container mx-auto py-3">
|
|
|
+ <HeaderH5 @search="searchChange" :searchName="searchName" />
|
|
|
+ <div class="min-h-screen text-white px-4">
|
|
|
+ <div class="container mx-auto py-2">
|
|
|
<div class="flex mb-3">
|
|
|
<div class="flex space-x-4">
|
|
|
- <button class="px-3 py-2 rounded topActive">这是h5</button>
|
|
|
- <button class="bg-gray-800 px-3 py-2 rounded">趋势</button>
|
|
|
- <button class="bg-gray-800 px-3 py-2 rounded">最新</button>
|
|
|
+ <button class="px-3 py-2 rounded topActive fontH5">这是h5</button>
|
|
|
+ <button class="bg-gray-800 px-3 py-2 rounded fontH5">趋势</button>
|
|
|
+ <button class="bg-gray-800 px-3 py-2 rounded fontH5">最新</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="flex flex-grow mb-3 items-center">
|
|
|
+ <div class="flex flex-wrap flex-grow mb-3 items-center">
|
|
|
<input
|
|
|
type="text"
|
|
|
placeholder="搜索标签"
|
|
|
- class="searchInput mr-2 px-3 py-2 rounded w-1/4 focus:border-blue-300 focus:outline-none focus:ring"
|
|
|
+ class="searchInput fontH5 w-full mr-2 px-3 py-2 mb-1 rounded focus:border-blue-300 focus:outline-none "
|
|
|
/>
|
|
|
<div
|
|
|
v-for="(item, index) in selectLabelObj"
|
|
|
:key="index"
|
|
|
- class="px-3 py-1 mx-1 rounded flex items-center cursor-pointer buttonBg1"
|
|
|
+ class="fontH5 px-3 py-1 mx-1 rounded flex items-center cursor-pointer buttonBg1"
|
|
|
@click="clickLabel(item)"
|
|
|
>
|
|
|
{{ item.labelName }}
|
|
|
<i class="fas el-icon-close text-white"></i>
|
|
|
</div>
|
|
|
- <el-button v-show="selectLabelObj.length > 0" class="textButton" type="text" @click="clearSelectLabel">移除所有</el-button>
|
|
|
+ <el-button v-show="selectLabelObj.length > 0" class="textButton mx-1" type="text" @click="clearSelectLabel">移除所有</el-button>
|
|
|
</div>
|
|
|
<div class="flex flex-wrap">
|
|
|
<div
|
|
@@ -33,45 +33,48 @@
|
|
|
:key="index"
|
|
|
:class="[
|
|
|
selectLabel.indexOf(item.id) != -1 ? 'buttonBg1' : 'labelButton',
|
|
|
- 'labelButton px-3 py-1 mx-1 mb-1 rounded flex items-center cursor-pointer'
|
|
|
+ 'fontH5 labelButton px-3 py-1 mx-1 mb-1 rounded flex items-center cursor-pointer'
|
|
|
]"
|
|
|
@click="clickLabel(item)"
|
|
|
>
|
|
|
<i class="fas fa-fire text-yellow-500 mr-2"></i>
|
|
|
{{ item.labelName }}({{item.num}})
|
|
|
</div>
|
|
|
- <div v-show="labelData.length > 8 && labelLength == 8" @click="labelLength = labelData.length" class="labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
+ <div v-show="labelData.length > 8 && labelLength == 8" @click="labelLength = labelData.length" class="fontH5 labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
....
|
|
|
</div>
|
|
|
- <div v-show="labelData.length > 8 && labelLength == 8" @click="labelLength = labelData.length" class="labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
+ <div v-show="labelData.length > 8 && labelLength == 8" @click="labelLength = labelData.length" class="fontH5 labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
显示更多
|
|
|
</div>
|
|
|
- <div v-show="labelData.length > 8 && labelLength > 8" @click="labelLength = 8" class="labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
+ <div v-show="labelData.length > 8 && labelLength > 8" @click="labelLength = 8" class="fontH5 labelButton px-3 py-1 mx-1 mb-1 rounded cursor-pointer">
|
|
|
隐藏
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="grid grid-cols-5 gap-4 mt-4">
|
|
|
+ <div class="mt-4">
|
|
|
<div
|
|
|
v-for="(item, index) in characterList"
|
|
|
:key="index"
|
|
|
class="box2 rounded-lg overflow-hidden shadow-lg cursor-pointer"
|
|
|
@click="toDetail(item)"
|
|
|
>
|
|
|
- <img v-if="item.id != 4" :src="url[index % 4]" class="w-full img" />
|
|
|
- <img v-if="item.id == 4" src="https://fallfor.ai/public/img/uploads/11/img_1715399022390_00024-654400262.jpg" class="w-full img" />
|
|
|
- <div class="p-3">
|
|
|
- <h3 class="text-lg font-bold">{{ item.characterName }}</h3>
|
|
|
- <p class="text-sm">
|
|
|
- {{ item.prologue }}
|
|
|
- </p>
|
|
|
+
|
|
|
+ <div class="p-3 flex justify-between">
|
|
|
+ <img :src="baseApi + item.picture" class="w-24 h-24 img" />
|
|
|
+ <div class="ml-3 flex-1">
|
|
|
+ <h3 class="text-lg font-bold">{{ item.characterName }}</h3>
|
|
|
+ <p class="text-sm">
|
|
|
+ {{ item.prologue }}
|
|
|
+ </p>
|
|
|
|
|
|
- <div class="flex my-2 flex-wrap">
|
|
|
- <div v-for="(item2, index2) in item.labelArr" :key="index2" class="m-0.5 tag px-2 py-1 rounded flex items-center text-xs">
|
|
|
- <!-- <i class="fas fa-smile text-yellow-400 mr-2"></i> -->
|
|
|
- {{ item2 }}
|
|
|
+ <div class="flex my-2 flex-wrap labels">
|
|
|
+ <div v-for="(item2, index2) in item.labelArr" :key="index2" class="m-0.5 tag px-2 py-1 rounded flex items-center text-xs">
|
|
|
+ <!-- <i class="fas fa-smile text-yellow-400 mr-2"></i> -->
|
|
|
+ {{ item2 }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="flex items-center justify-between mt-3 px-3 pb-3">
|
|
|
<div class="flex items-center box1">
|
|
@@ -96,7 +99,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Header from "@/views/homeComponents/Header.vue"
|
|
|
+import HeaderH5 from "@/views/homeComponents/HeaderH5.vue"
|
|
|
import { labelListApi, characterListApi } from "@/api/home.js"
|
|
|
// 引入需要的图标
|
|
|
import 'vue-awesome/icons/heart'
|
|
@@ -106,7 +109,7 @@ import 'vue-awesome/icons/star'
|
|
|
export default {
|
|
|
name: "HomeH5",
|
|
|
components: {
|
|
|
- Header
|
|
|
+ HeaderH5
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -253,7 +256,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
p {
|
|
|
- margin-top: 10px;
|
|
|
+ margin-top: 2px;
|
|
|
|
|
|
b {
|
|
|
font-weight: 700;
|
|
@@ -274,7 +277,7 @@ export default {
|
|
|
}
|
|
|
.textButton {
|
|
|
color: #eee;
|
|
|
- margin-left: 5px;
|
|
|
+ // margin-left: 5px;
|
|
|
}
|
|
|
.textButton:hover {
|
|
|
color: #9333ea;
|
|
@@ -313,4 +316,8 @@ export default {
|
|
|
object-fit: cover;
|
|
|
object-position: top;
|
|
|
}
|
|
|
+.labels {
|
|
|
+ max-height: 84px;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
</style>
|