|
@@ -2,20 +2,13 @@
|
|
<div class="h-full w-full flex flex-col">
|
|
<div class="h-full w-full flex flex-col">
|
|
<div class="flex items-center py-2">
|
|
<div class="flex items-center py-2">
|
|
<i class="el-icon-arrow-left px-2" @click="$router.push('/home')"></i>
|
|
<i class="el-icon-arrow-left px-2" @click="$router.push('/home')"></i>
|
|
- <el-input ref="searchInput" v-model="searchValue" placeholder="请输入搜索关键词"></el-input>
|
|
|
|
|
|
+ <el-input ref="searchInput" v-model="query.characterName" placeholder="请输入搜索关键词" @change="search"></el-input>
|
|
<i class="el-icon-search px-2" @click="search"></i>
|
|
<i class="el-icon-search px-2" @click="search"></i>
|
|
</div>
|
|
</div>
|
|
- <div class="lietRom flex-1 overflow-auto"
|
|
|
|
- v-infinite-scroll="load"
|
|
|
|
- infinite-scroll-disabled="disabled"
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="lietRom flex-1 overflow-auto" v-infinite-scroll="load" infinite-scroll-disabled="disabled">
|
|
<div class="list mt-4">
|
|
<div class="list mt-4">
|
|
- <div
|
|
|
|
- v-for="(item, index) in characterList"
|
|
|
|
- :key="index"
|
|
|
|
- class="box2 relative rounded-lg overflow-hidden shadow-lg cursor-pointer"
|
|
|
|
- @click="toDetail(item)"
|
|
|
|
- >
|
|
|
|
|
|
+ <div v-for="(item, index) in characterList" :key="index"
|
|
|
|
+ class="box2 relative rounded-lg overflow-hidden shadow-lg cursor-pointer" @click="toDetail(item)">
|
|
<div class="w-full overflow-hidden">
|
|
<div class="w-full overflow-hidden">
|
|
<img :src="baseApi + item.picture" class="w-full img" />
|
|
<img :src="baseApi + item.picture" class="w-full img" />
|
|
</div>
|
|
</div>
|
|
@@ -25,7 +18,8 @@
|
|
{{ item.prologue }}
|
|
{{ item.prologue }}
|
|
</p>
|
|
</p>
|
|
<div class="labels flex my-1 flex-wrap">
|
|
<div class="labels flex my-1 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 text-gray-500">
|
|
|
|
|
|
+ <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 text-gray-500">
|
|
<!-- <i class="fas fa-smile text-yellow-400 mr-2"></i> -->
|
|
<!-- <i class="fas fa-smile text-yellow-400 mr-2"></i> -->
|
|
{{ item2 }}
|
|
{{ item2 }}
|
|
</div>
|
|
</div>
|
|
@@ -34,8 +28,8 @@
|
|
<div class="absolute w-full bottom-0 flex items-center justify-between mt-3 px-2 pb-2">
|
|
<div class="absolute w-full bottom-0 flex items-center justify-between mt-3 px-2 pb-2">
|
|
<div></div>
|
|
<div></div>
|
|
<div class="flex items-center box1 text-red-500">
|
|
<div class="flex items-center box1 text-red-500">
|
|
- <v-icon name="fire" scale="1"/>
|
|
|
|
- <span class="ml-1">{{ item.hotCount||0 }}</span>
|
|
|
|
|
|
+ <v-icon name="fire" scale="1" />
|
|
|
|
+ <span class="ml-1">{{ item.hotCount || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -54,17 +48,18 @@ export default {
|
|
return {
|
|
return {
|
|
query: {
|
|
query: {
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- pageNum: 1
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ characterName: ''
|
|
},
|
|
},
|
|
total: 0,
|
|
total: 0,
|
|
loading: false,
|
|
loading: false,
|
|
noMore: true,
|
|
noMore: true,
|
|
characterList: [],
|
|
characterList: [],
|
|
- searchValue: ''
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- disabled () {
|
|
|
|
|
|
+ disabled() {
|
|
return this.loading || this.noMore
|
|
return this.loading || this.noMore
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -73,28 +68,23 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
search() {
|
|
search() {
|
|
- let query = {
|
|
|
|
- characterName: this.searchValue,
|
|
|
|
- }
|
|
|
|
this.characterList = []
|
|
this.characterList = []
|
|
this.query.pageNum = 1
|
|
this.query.pageNum = 1
|
|
- this.noMore = false
|
|
|
|
- this.getCharacterList(query)
|
|
|
|
|
|
+ // this.noMore = false
|
|
|
|
+ if (!this.query.characterName) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.getCharacterList()
|
|
},
|
|
},
|
|
load() {
|
|
load() {
|
|
console.log('加载更多');
|
|
console.log('加载更多');
|
|
this.query.pageNum += 1
|
|
this.query.pageNum += 1
|
|
this.getCharacterList()
|
|
this.getCharacterList()
|
|
},
|
|
},
|
|
- getCharacterList(query) {
|
|
|
|
|
|
+ getCharacterList() {
|
|
this.loading = true
|
|
this.loading = true
|
|
let params = this.query
|
|
let params = this.query
|
|
- if (query) {
|
|
|
|
- params = {
|
|
|
|
- ...params,
|
|
|
|
- ...query
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ console.log(params, 'params');
|
|
characterListApi(params).then(res => {
|
|
characterListApi(params).then(res => {
|
|
// console.log(res, '角色列表');\
|
|
// console.log(res, '角色列表');\
|
|
if (res.rows.length == 0) {
|
|
if (res.rows.length == 0) {
|
|
@@ -108,7 +98,7 @@ export default {
|
|
},
|
|
},
|
|
toDetail(item) {
|
|
toDetail(item) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: '/chat',
|
|
|
|
|
|
+ path: '/chatH5',
|
|
query: {
|
|
query: {
|
|
characterId: item.id
|
|
characterId: item.id
|
|
}
|
|
}
|
|
@@ -127,44 +117,53 @@ export default {
|
|
// width: 68px;
|
|
// width: 68px;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.box2 {
|
|
.box2 {
|
|
- background: #ffffff0f;
|
|
|
|
|
|
+ background: #ffffff0f;
|
|
border: 1px solid #ffffff2e;
|
|
border: 1px solid #ffffff2e;
|
|
height: 380px;
|
|
height: 380px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.box2:hover {
|
|
.box2:hover {
|
|
border: solid 1px var(--bg-color1);
|
|
border: solid 1px var(--bg-color1);
|
|
}
|
|
}
|
|
|
|
+
|
|
.img {
|
|
.img {
|
|
height: 200px;
|
|
height: 200px;
|
|
object-fit: cover;
|
|
object-fit: cover;
|
|
object-position: top;
|
|
object-position: top;
|
|
transition: transform .2s
|
|
transition: transform .2s
|
|
}
|
|
}
|
|
|
|
+
|
|
.img:hover {
|
|
.img:hover {
|
|
transform: scale(1.1);
|
|
transform: scale(1.1);
|
|
}
|
|
}
|
|
|
|
+
|
|
.labels {
|
|
.labels {
|
|
max-height: 56px;
|
|
max-height: 56px;
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
|
|
+
|
|
.prologue {
|
|
.prologue {
|
|
- overflow:hidden;
|
|
|
|
|
|
+ overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-line-clamp: 2;
|
|
display: -webkit-box;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-box-orient: vertical;
|
|
}
|
|
}
|
|
|
|
+
|
|
.list {
|
|
.list {
|
|
display: grid;
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
grid-template-columns: 1fr 1fr;
|
|
/* grid-auto-rows: minmax(280px, 280px); */
|
|
/* grid-auto-rows: minmax(280px, 280px); */
|
|
grid-gap: 10px;
|
|
grid-gap: 10px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.lietRom {
|
|
.lietRom {
|
|
padding: 5px;
|
|
padding: 5px;
|
|
padding-bottom: 60px;
|
|
padding-bottom: 60px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.lietRom::-webkit-scrollbar {
|
|
.lietRom::-webkit-scrollbar {
|
|
display: none;
|
|
display: none;
|
|
}
|
|
}
|