+
{{ 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)
+ // }
}