+
+ {{ item.message }}
@@ -32,19 +32,19 @@
-
+
-
匿名用户
+
{{ item.author }}
-
1552
+
{{ item.views }}
-
12
+
{{ item.replies }}
@@ -73,7 +73,14 @@ export default {
name: "SearchResult",
data() {
return {
- kw: ""
+ kw: "",
+ count: 0,
+ limit: 50,
+ nextpage: true,
+ page: 0,
+ total: 0,
+ list: []
+
}
},
components: {
@@ -82,6 +89,8 @@ export default {
mounted() {
this.kw = this.$route.query.kw
+
+ this.getSearchResult()
},
@@ -92,6 +101,21 @@ export default {
if (this.$route.params.page > 1) this.$router.go(-1)
else this.$router.push('/recommend')
},
+
+ // 获取搜索结果数据
+ getSearchResult() {
+ this.$http.post("/api/search", {
+ keyword: this.kw,
+ page: this.page
+ }).then(res => {
+ console.log(res, "res");
+ let data = res.data
+ this.list = data.data
+ this.total = data.total
+ this.nextpage = data.nextpage
+
+ })
+ },
},
}
@@ -197,6 +221,7 @@ export default {
line-height: .52rem;
font-size: .3rem;
color: #7f7f7f;
+ height: 1.04rem;
}
.reply-visible {
@@ -206,6 +231,7 @@ export default {
}
.result-info {
+ align-items: self-end;
justify-content: space-between;