diff --git a/src/apps/AppInfotainment/newLIst.vue b/src/apps/AppInfotainment/newLIst.vue index d178e066..41f1da14 100644 --- a/src/apps/AppInfotainment/newLIst.vue +++ b/src/apps/AppInfotainment/newLIst.vue @@ -7,7 +7,7 @@ -
+
-
+

{{ item.title }}

通知公告{{ item.createTime }}

-
+
+
- +
@@ -68,6 +69,8 @@ this.parentName = params.parentName }, onShow() { + document.title = this.parentName + this.getList() if(uni.getStorageSync('newTypeIndex')) { this.currIndex = uni.getStorageSync('newTypeIndex') this.getListInit() @@ -75,8 +78,6 @@ // uni.$on('update',()=>{ // this.getListInit() // }) - document.title = this.parentName - this.getList() this.getListInit() }, @@ -86,8 +87,9 @@ uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`}) }, changeTab(index) { + this.newsList = [] this.currIndex = index - // this.newsList = [] + this.current = 1 this.getListInit() }, @@ -130,13 +132,6 @@ }, // 获取新闻列表 getNewsList() { - // if (this.isMore || this.isLoading) return - // var type = this.currIndex - // if(this.currIndex == 0) { - // type = '' - // } - // this.isLoading = true - this.$http.post(`/app/apppublicityinfo/list?`, null, { params: { current: this.current, @@ -145,35 +140,14 @@ } }).then(res => { console.log(res); + if (res.code === 0) { - this.isShowEmpty = true - - if (this.current === 0) { - this.newsList = [] - } - if (!res.data.records.length) { - this.isMore = true - this.isLoading = false - - this.$nextTick(() => { - this.pageShow = true - }) - - return false - } - const data = res.data.records this.newsList.push(...data) - this.current = this.current - this.isLoading = false - - this.$nextTick(() => { - this.pageShow = true - }) - } else {} - }).catch(() => { - this.isShowEmpty = true - this.isLoading = false + this.current = this.current + } + }).catch((err) => { + console.log(err); }) }, toDetail(item) { @@ -185,9 +159,10 @@ }, }, - // onReachBottom () { - // this.getNewsList(this.areaId) - // } + onReachBottom () { + this.current ++, + this.getNewsList() + } } @@ -254,12 +229,16 @@ margin-top: 30px; font-size: 22px; color: #999999; + span { + margin-right: 15px; + } } } .right { width: 224px; height: 140px; + margin-left: 40px; img { width: 100%; height: 100%;