|
@@ -65,13 +65,10 @@
|
|
|
<span>举报</span>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- {{ item.name }}
|
|
|
- </el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="twoPage">
|
|
|
- <page :total="total" position="right" @query="searchinfo"></page>
|
|
|
+ <page :total="total" :limit="limit" position="right" @query="search"></page>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="twoInput">
|
|
|
<el-col :span="3" class="left"> </el-col>
|
|
@@ -109,8 +106,7 @@ export default {
|
|
|
total: 0,
|
|
|
form: {},
|
|
|
inputInfo: '',
|
|
|
- limit: 3,
|
|
|
- pageSize: 3,
|
|
|
+ limit: 10,
|
|
|
}),
|
|
|
created() {
|
|
|
this.search();
|
|
@@ -128,23 +124,24 @@ export default {
|
|
|
methods: {
|
|
|
...news(['fetch']),
|
|
|
...comment({ commentquery: 'query', commentCreate: 'create', commentUpdate: 'update' }),
|
|
|
- async search() {
|
|
|
+ async searchinfo() {
|
|
|
const res = await this.fetch(this.id);
|
|
|
this.$set(this, `detail`, res.data);
|
|
|
},
|
|
|
- async searchinfo({ skip = 0, limit = 3, newsid = this.id } = { skip: 0, limit: 3 }) {
|
|
|
+ async search({ skip = 0, limit = this.limit, newsid = this.id } = { skip: 0, limit: this.limit }) {
|
|
|
let res = await this.commentquery({ skip, limit, newsid });
|
|
|
+ console.log(res);
|
|
|
this.$set(this, `list`, res.data);
|
|
|
this.$set(this, `total`, res.total);
|
|
|
},
|
|
|
async submit() {
|
|
|
this.form.newsid = this.id;
|
|
|
this.form.uid = this.user.uid;
|
|
|
- this.form.name = this.user.name;
|
|
|
let data = this.form;
|
|
|
let res = await this.commentCreate(data);
|
|
|
- this.$checkRes(res, '发布成功', '请输入内容');
|
|
|
- this.searchinfo();
|
|
|
+ console.log(res);
|
|
|
+ // this.$checkRes(res, '评论成功', '评论失败');
|
|
|
+ // this.search();
|
|
|
},
|
|
|
},
|
|
|
filters: {
|