From fe0b0274603c88154d9037eb05939642e379e098 Mon Sep 17 00:00:00 2001 From: shijingjing <1789544664@qq.com> Date: Mon, 25 Apr 2022 14:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/AppInfotainment/AppInfotainment.vue | 8 +++--- src/apps/AppInfotainment/newLIst.vue | 29 +++++++++----------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/apps/AppInfotainment/AppInfotainment.vue b/src/apps/AppInfotainment/AppInfotainment.vue index 312b09e7..1d69ea21 100644 --- a/src/apps/AppInfotainment/AppInfotainment.vue +++ b/src/apps/AppInfotainment/AppInfotainment.vue @@ -10,7 +10,7 @@

构建乡村振兴的环境基础

-
+
{{ item.categoryName }}
@@ -45,12 +45,12 @@ export default { categoryType: '1', } }).then((res)=>{ - // console.log(res); + console.log(res); this.list = res.data.records }) }, - toNewList(id) { - uni.navigateTo({url: `./newList?id=${id}`}) + toNewList(id,categoryName) { + uni.navigateTo({url: `./newList?id=${id}&parentName=${categoryName}`}) } }, } diff --git a/src/apps/AppInfotainment/newLIst.vue b/src/apps/AppInfotainment/newLIst.vue index f449f1e9..f68c2865 100644 --- a/src/apps/AppInfotainment/newLIst.vue +++ b/src/apps/AppInfotainment/newLIst.vue @@ -47,20 +47,16 @@ current: 0, areaId: '', tabList: [], - // [{name: '全部'}, {name: '通知公告'}, {name: '工作动态'}, - // {name: '惠民政策'}, {name: '中央精神'},{name: '旅游故事'},{name: '特色农产品'}] - parentId: '' + parentId: '', + parentName: '' } }, onLoad (params) { this.areaId = params.areaId - uni.setStorageSync('newTypeIndex', '') this.getNewsList() - // uni.setNavigationBarTitle({ - // title: params.title || '乡村资讯', //页面标题 - // }) this.parentId = params.id + this.parentName = params.parentName }, onShow() { if(uni.getStorageSync('newTypeIndex')) { @@ -73,9 +69,9 @@ }, methods: { + // 查看分类 toSelect() { - // uni.navigateTo(`./select?index=${this.currIndex}`) - uni.navigateTo({url: `./select?parentId=${this.parentId}`}) + uni.navigateTo({url: `./select?parentId=${this.parentId}&index=${this.currIndex}`}) }, changeTab(index) { this.currIndex = index @@ -91,6 +87,7 @@ }) }, + // 获取新闻分类 getList() { this.$http.post('/app/apppublicitycategory/list',null,{ params: { @@ -98,7 +95,6 @@ categoryType: '2', } }).then((res)=>{ - // console.log(res.data.records); var array = [] res.data.records.map(item=>{ array.push({ name: item.categoryName }) @@ -106,9 +102,10 @@ this.tabList = array }) }, - toNewList() { - uni.navigateTo({url: `./newList?parentName=${this.parentName}`}) - }, + + // toNewList() { + // uni.navigateTo({url: `./newList?parentName=${this.parentName}`}) + // }, getListInit() { this.isMore = false @@ -166,9 +163,9 @@ }, }, - onReachBottom () { - this.getNewsList(this.areaId) - } + // onReachBottom () { + // this.getNewsList(this.areaId) + // } }