产业分类

This commit is contained in:
shijingjing
2022-04-25 13:59:02 +08:00
parent 71adfa71f7
commit 97f5af4be9
5 changed files with 92 additions and 40 deletions

View File

@@ -1,18 +1,22 @@
<template>
<div class="AppInfotainment">
<div class="fiveIndustry">
<div class="fiveIndustry" v-if="list.length">
<div class="title">
<h2>{{ title }}</h2>
<p>实现乡村振兴的物质基础</p>
<h2>{{ parentName }}</h2>
<p v-if="parentName == '产业振兴'">实现乡村振兴的物质基础</p>
<p v-if="parentName == '组织振兴'">保障乡村振兴的政治基础</p>
<p v-if="parentName == '人才振兴'">推动乡村振兴的重要因素</p>
<p v-if="parentName == '文化振兴'">稳固乡村振兴的思想保障</p>
<p v-if="parentName == '生态振兴'">构建乡村振兴的环境基础</p>
</div>
<div class="list">
<div class="item">
<span>产业资讯</span>
<div class="item" v-for="(item,index) in list" :key="index" @click="toNewList(item.id)">
<span>{{ item.categoryName }}</span>
<span><u-icon name="arrow-right"></u-icon></span>
</div>
</div>
</div>
<!-- <AiEmpty description="暂无数据" v-else /> -->
<AiEmpty description="暂无数据" v-else />
</div>
</template>
@@ -22,28 +26,31 @@ export default {
appName: '宣传资讯',
data() {
return {
fiveList: [],
title: '产业振兴',
current: 1,
categoryType: '0',
list: [],
parentName: '产业振兴'
}
},
onShow() {
document.title = this.title
this.getFiveList()
document.title = this.parentName
this.getList()
},
methods: {
getFiveList() {
getList() {
this.$http.post('/app/apppublicitycategory/list',null,{
params: {
categoryType: '0',
parentName: this.parentName,
categoryType: '1',
}
}).then((res)=>{
console.log(res);
this.fiveList = res.data.records
// console.log(res);
this.list = res.data.records
})
},
toNewList(id) {
uni.navigateTo({url: `./newList?id=${id}`})
}
},
}

View File

@@ -46,31 +46,36 @@
isMore: false,
current: 0,
areaId: '',
tabList: [{name: '全部'}, {name: '通知公告'}, {name: '工作动态'},
{name: '惠民政策'}, {name: '中央精神'},{name: '旅游故事'},{name: '特色农产品'}]
tabList: [],
// [{name: '全部'}, {name: '通知公告'}, {name: '工作动态'},
// {name: '惠民政策'}, {name: '中央精神'},{name: '旅游故事'},{name: '特色农产品'}]
parentId: ''
}
},
onLoad (params) {
// this.areaId = params.areaId
// uni.setStorageSync('newTypeIndex', '')
// this.$loading()
// this.getNewsList()
this.areaId = params.areaId
uni.setStorageSync('newTypeIndex', '')
this.getNewsList()
// uni.setNavigationBarTitle({
// title: params.title || '乡村资讯', //页面标题
// })
this.parentId = params.id
},
onShow() {
// if(uni.getStorageSync('newTypeIndex')) {
// this.currIndex = uni.getStorageSync('newTypeIndex')
// this.getListInit()
// }
if(uni.getStorageSync('newTypeIndex')) {
this.currIndex = uni.getStorageSync('newTypeIndex')
this.getListInit()
}
document.title = this.parentName
this.getList()
this.getListInit()
},
methods: {
toSelect() {
// this.$linkTo(`./select?index=${this.currIndex}`)
uni.navigateTo({url: './select'})
// uni.navigateTo(`./select?index=${this.currIndex}`)
uni.navigateTo({url: `./select?parentId=${this.parentId}`})
},
changeTab(index) {
this.currIndex = index
@@ -80,18 +85,35 @@
onConfirm () {
this.isMore = false
this.current = 0
// this.$loading()
this.$nextTick(() => {
this.getNewsList(this.areaId)
})
},
getList() {
this.$http.post('/app/apppublicitycategory/list',null,{
params: {
parentId: this.parentId,
categoryType: '2',
}
}).then((res)=>{
// console.log(res.data.records);
var array = []
res.data.records.map(item=>{
array.push({ name: item.categoryName })
})
this.tabList = array
})
},
toNewList() {
uni.navigateTo({url: `./newList?parentName=${this.parentName}`})
},
getListInit() {
this.isMore = false
this.current = 0
this.newsList = []
// this.$loading()
this.getNewsList()
},
getNewsList() {
@@ -101,12 +123,11 @@
type = ''
}
this.isLoading = true
this.$instance.post(`/app/appnewscenterinfo/listForWxNew?current=${this.current + 1}&type=${type}&size=10&title=${this.title}&areaId=${this.areaId}`, null, {
this.$http.post(`/app/appnewscenterinfo/listForWxNew?current=${this.current + 1}&type=${type}&size=10&title=${this.title}&areaId=${this.areaId}`, null, {
withoutToken: 1
}).then(res => {
if (res.code === 0) {
this.isShowEmpty = true
// this.$hideLoading()
if (this.current === 0) {
this.newsList = []
@@ -130,20 +151,17 @@
this.$nextTick(() => {
this.pageShow = true
})
} else {
// this.$hideLoading()
}
} else {}
}).catch(() => {
// this.$hideLoading()
this.isShowEmpty = true
this.isLoading = false
})
},
toDetail(item) {
if(item.detailType == 6 || item.detailType == 5) { //特色农产品 旅游故事
this.$linkTo(`/subPages/live/products?id=${item.id}&detailType=${item.detailType}`)
uni.navigateTo(`/subPages/live/products?id=${item.id}&detailType=${item.detailType}`)
}else {
this.$linkTo(`/subPages/live/newsDetail?id=${item.id}&areaId=${this.areaId}&type=${this.currIndex}`)
uni.navigateTo(`/subPages/live/newsDetail?id=${item.id}&areaId=${this.areaId}&type=${this.currIndex}`)
}
},
},
@@ -357,4 +375,8 @@
font-size: 28rpx;
}
}
::v-deep .emptyWrap .emptyImg {
margin-top: 40px;
}
</style>

View File

@@ -12,12 +12,15 @@
name: 'page',
data () {
return {
tabList: ['全部', '通知公告', '工作动态', '惠民政策', '中央精神', '旅游故事', '特色农产品'],
tabIndex: 0
tabList: [],
tabIndex: 0,
parentId: ''
}
},
onLoad (option) {
this.tabIndex = option.index
this.tabIndex = option.index,
this.parentId = option.parentId
this.getList()
},
methods: {
@@ -25,7 +28,21 @@
this.tabIndex = index
uni.setStorageSync('newTypeIndex', index)
uni.navigateBack({delta: 1})
}
},
getList() {
this.$http.post('/app/apppublicitycategory/list',null,{
params: {
parentId: this.parentId,
categoryType: '2',
}
}).then((res)=>{
var array = []
res.data.records.map(item=>{
array.push(item.categoryName)
})
this.tabList = array
})
},
},
}
</script>

View File

@@ -365,6 +365,12 @@ export default {
}
},
getResidentList() {
this.$http.post('').then(res => {
})
},
nextStep() {
const rules = this.rules()