diff --git a/src/apps/AppInfotainment/newLIst.vue b/src/apps/AppInfotainment/newLIst.vue index a5d8b0ac..c9ba5f7e 100644 --- a/src/apps/AppInfotainment/newLIst.vue +++ b/src/apps/AppInfotainment/newLIst.vue @@ -53,7 +53,6 @@ isLoading: false, newsList: [], isShowEmpty: false, - isMore: false, current: 1, areaId: '', tabList: [], @@ -63,18 +62,18 @@ }, onLoad (params) { - this.getNewsList() this.parentId = params.id this.parentName = params.parentName }, onShow() { document.title = this.parentName this.getList() - if(uni.getStorageSync('newTypeIndex')) { - this.currIndex = uni.getStorageSync('newTypeIndex') - this.getListInit() - } this.getListInit() + uni.$on('update', (tabIndex)=>{ + this.currIndex = tabIndex + this.getListInit() + }) + // this.getListInit() }, methods: { @@ -82,6 +81,7 @@ toSelect() { uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`}) }, + // 切换tab栏 changeTab(index) { this.newsList = [] this.currIndex = index @@ -89,14 +89,12 @@ this.getListInit() }, - onConfirm () { - this.isMore = false - this.current = 1 - - this.$nextTick(() => { - this.getNewsList(this.areaId) - }) - }, + // onConfirm () { + // this.current = 1 + // this.$nextTick(() => { + // this.getNewsList(this.areaId) + // }) + // }, // 获取新闻分类 getList() { @@ -115,12 +113,10 @@ }) }) this.tabList = array - // console.log(this.tabList[this.currIndex].parentId,'parentId'); }) }, getListInit() { - this.isMore = false this.current = 1 this.newsList = [] this.getNewsList() @@ -135,12 +131,11 @@ } }).then(res => { if (res.code === 0) { - const data = res.data.records - this.newsList.push(...data) - this.current = this.current + this.newsList = this.current == 1 ? [...res.data.records] : [...this.newsList, ...res.data.records] } }) }, + // 查详情 toDetail(id) { uni.navigateTo({url: `./newsDetail?id=${id}`}) }, diff --git a/src/apps/AppInfotainment/newsDetail.vue b/src/apps/AppInfotainment/newsDetail.vue index 7363a675..148335b0 100644 --- a/src/apps/AppInfotainment/newsDetail.vue +++ b/src/apps/AppInfotainment/newsDetail.vue @@ -742,7 +742,9 @@ width: 96px; height: 96px; } - + div { + align-self: center; + } } } diff --git a/src/apps/AppInfotainment/select.vue b/src/apps/AppInfotainment/select.vue index b10647ef..75589dc9 100644 --- a/src/apps/AppInfotainment/select.vue +++ b/src/apps/AppInfotainment/select.vue @@ -26,7 +26,8 @@ methods: { tabClick(index) { this.tabIndex = index - uni.setStorageSync('newTypeIndex', index) + // uni.setStorageSync('newTypeIndex', index) + uni.$emit('update',this.tabIndex) uni.navigateBack({delta: 1}) }, getList() {