diff --git a/src/apps/AppInfotainment/AppInfotainment.vue b/src/apps/AppInfotainment/AppInfotainment.vue index 1d69ea21..1bc4d998 100644 --- a/src/apps/AppInfotainment/AppInfotainment.vue +++ b/src/apps/AppInfotainment/AppInfotainment.vue @@ -45,7 +45,6 @@ export default { categoryType: '1', } }).then((res)=>{ - console.log(res); this.list = res.data.records }) }, diff --git a/src/apps/AppInfotainment/newLIst.vue b/src/apps/AppInfotainment/newLIst.vue index f68c2865..d178e066 100644 --- a/src/apps/AppInfotainment/newLIst.vue +++ b/src/apps/AppInfotainment/newLIst.vue @@ -1,15 +1,15 @@ @@ -38,17 +47,17 @@ name: 'newList', data () { return { - currIndex: 0, + currIndex: '0', title: '', isLoading: false, newsList: [], isShowEmpty: false, isMore: false, - current: 0, + current: 1, areaId: '', tabList: [], parentId: '', - parentName: '' + parentName: '', } }, @@ -63,6 +72,9 @@ this.currIndex = uni.getStorageSync('newTypeIndex') this.getListInit() } + // uni.$on('update',()=>{ + // this.getListInit() + // }) document.title = this.parentName this.getList() this.getListInit() @@ -75,12 +87,13 @@ }, changeTab(index) { this.currIndex = index + // this.newsList = [] this.getListInit() }, onConfirm () { this.isMore = false - this.current = 0 + this.current = 1 this.$nextTick(() => { this.getNewsList(this.areaId) @@ -95,34 +108,43 @@ categoryType: '2', } }).then((res)=>{ + // console.log(res,'新闻分类'); var array = [] res.data.records.map(item=>{ - array.push({ name: item.categoryName }) + array.push({ + name: item.categoryName, + id: item.id, + parentId: item.parentId, + }) }) this.tabList = array + console.log(this.tabList[this.currIndex].parentId,'parentId'); }) }, - // toNewList() { - // uni.navigateTo({url: `./newList?parentName=${this.parentName}`}) - // }, - getListInit() { this.isMore = false - this.current = 0 + this.current = 1 this.newsList = [] this.getNewsList() }, + // 获取新闻列表 getNewsList() { - if (this.isMore || this.isLoading) return - var type = this.currIndex - if(this.currIndex == 0) { - type = '' - } - this.isLoading = true - this.$http.post(`/app/appnewscenterinfo/listForWxNew?current=${this.current + 1}&type=${type}&size=10&title=${this.title}&areaId=${this.areaId}`, null, { - withoutToken: 1 + // 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, + moduleId: this.tabList[this.currIndex].parentId, + categoryId: this.tabList[this.currIndex].id, + } }).then(res => { + console.log(res); if (res.code === 0) { this.isShowEmpty = true @@ -142,7 +164,7 @@ const data = res.data.records this.newsList.push(...data) - this.current = this.current + 1 + this.current = this.current this.isLoading = false this.$nextTick(() => { @@ -181,18 +203,69 @@ right: 32rpx; top: 20rpx; } + div { + height: 80px; + line-height: 80px; + font-size: 26px; + transition-duration: 1s; + padding: 0px 30px; + } .tab-item{ color: #666; + position: relative; } .active-item{ color: #3376FD; + font-weight: 600; + } .active-line{ + width: 48px; + height: 4px; + background: #FFF; + position: absolute; + bottom: 14px; + left: 50%; + margin-left: -24px; background-color: #3376FD; } } .news-list{ - padding-top: 20rpx; + background: #FFF; + padding-top: 90px; + box-sizing: border-box; + .item { + padding: 30px 30px 20px 30px; + display: flex; + justify-content: space-between; + border-bottom: 1px solid #DDDDDD; + .left { + h2 { + font-size: 30px; + color: #333333; + font-weight: 600; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:2; + } + p { + margin-top: 30px; + font-size: 22px; + color: #999999; + } + + } + .right { + width: 224px; + height: 140px; + img { + width: 100%; + height: 100%; + } + } + } } .news { min-height: 100vh; diff --git a/src/apps/AppInfotainment/select.vue b/src/apps/AppInfotainment/select.vue index c4e2c402..b10647ef 100644 --- a/src/apps/AppInfotainment/select.vue +++ b/src/apps/AppInfotainment/select.vue @@ -24,12 +24,12 @@ }, methods: { - tabClick(index) { - this.tabIndex = index - uni.setStorageSync('newTypeIndex', index) - uni.navigateBack({delta: 1}) - }, - getList() { + tabClick(index) { + this.tabIndex = index + uni.setStorageSync('newTypeIndex', index) + uni.navigateBack({delta: 1}) + }, + getList() { this.$http.post('/app/apppublicitycategory/list',null,{ params: { parentId: this.parentId,