a1300399510@qq.com 提交于 2023/04/03 -15:00:02
This commit is contained in:
parent
44a2782936
commit
37bb89495c
@ -12,7 +12,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 结果数量 -->
|
||||
<div class="numberResults flexacenter">大约找到 <div class="number">{{ total }}</div> 条结果</div>
|
||||
<div class="numberResults flexacenter">大约找到 <div class="number">{{ count }}</div> 条结果</div>
|
||||
|
||||
<div class="result-box flexacenter">
|
||||
<div class="result-item flexflex" v-for="(item, index) in list" :key="index">
|
||||
@ -61,7 +61,7 @@
|
||||
</div>
|
||||
|
||||
<div class="paging flexcenter">
|
||||
<el-pagination small background layout="prev, pager, next" :total="1000">
|
||||
<el-pagination small background layout="prev, pager, next" @current-change="currentXhange" :current-page.sync="page" :page-size="limit" :total="count">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
@ -75,10 +75,9 @@ export default {
|
||||
return {
|
||||
kw: "",
|
||||
count: 0,
|
||||
limit: 50,
|
||||
limit: 20,
|
||||
nextpage: true,
|
||||
page: 0,
|
||||
total: 0,
|
||||
page: 20,
|
||||
list: []
|
||||
|
||||
}
|
||||
@ -104,15 +103,17 @@ export default {
|
||||
|
||||
// 获取搜索结果数据
|
||||
getSearchResult() {
|
||||
this.page = this.page + 1
|
||||
this.$http.post("/api/search", {
|
||||
keyword: this.kw,
|
||||
page: this.page
|
||||
// keyword: "helsinki",
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}).then(res => {
|
||||
console.log(res, "res");
|
||||
let data = res.data
|
||||
this.list = data.data
|
||||
this.total = data.total
|
||||
this.nextpage = data.nextpage
|
||||
this.count = data.count
|
||||
|
||||
})
|
||||
},
|
||||
@ -123,6 +124,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding-top: 1.3rem;
|
||||
padding-bottom: 1.3rem;
|
||||
|
||||
.search-input-box {
|
||||
margin-left: .32rem;
|
||||
@ -261,11 +263,13 @@ export default {
|
||||
.icon-look {
|
||||
width: .4267rem;
|
||||
height: .18rem;
|
||||
margin-right: .16rem;
|
||||
}
|
||||
|
||||
.icon-msg {
|
||||
width: .32rem;
|
||||
height: .28rem;
|
||||
margin-right: .16rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user