diff --git a/src/views/news/index.vue b/src/views/news/index.vue index 578bed68..79f6c204 100644 --- a/src/views/news/index.vue +++ b/src/views/news/index.vue @@ -7,21 +7,48 @@ placeholder @click-left="onClickLeft" /> - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -35,8 +62,14 @@ export default { loading: false, //是否滚动到底部 finished: false, + //是否显示加载 + secondLoading: false, + //是否滚动到底部 + secondFinished: false, //新闻集合 newList:[], + //交易规则集合 + secondList:[], //查询参数 queryParams: { pageNum: 1, @@ -44,6 +77,13 @@ export default { deptId:100, number:2 }, + //交易规则查询参数 + querySecondParams: { + deptId:100, + pageNum:1, + pageSize:10, + number:9 + }, }; }, created() {}, @@ -70,6 +110,28 @@ export default { this.loading = false; }); }, + getSecondList(){ + this.loading = true; + newList(this.querySecondParams).then(response => { + console.log(response); + for (var i = 0; i < response.rows.length; i++) { + this.secondList.push(response.rows[i]); + var imgStrs = response.rows[i].content.match(//gi) + if (imgStrs != null && imgStrs != '') { + console.log(imgStrs[0].length-2) + console.log(imgStrs[0]) + this.secondList[i].img = imgStrs[0].substr(10,(imgStrs[0].length-12)); + } + } + console.log(this.secondList) + if(this.secondList.length >= response.total){ + this.secondFinished = true; + return; + } + this.querySecondParams.pageNum += 1 ; + this.secondLoading = false; + }); + }, }, };