2023-09-08 14:52:40 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="content bgfff">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
|
<view class="box">
|
|
|
|
|
|
<list :isAddress="type" :list="newsList" v-if="newsList.length"></list>
|
|
|
|
|
|
<view class="nolist" style="margin-top: 15px;" v-if="!newsList.length">
|
|
|
|
|
|
<image src="@/static/none.png"></image>
|
|
|
|
|
|
<text>暂无数据</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import {
|
|
|
|
|
|
mapState
|
|
|
|
|
|
} from "vuex";
|
|
|
|
|
|
import list from "@/components/newsList.vue"
|
|
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
type: 1, //1资讯列表,4活动列表,6党建专栏
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
lastPage: 1,
|
|
|
|
|
|
newsList: [],
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(["InfoList"]),
|
|
|
|
|
|
},
|
|
|
|
|
|
components: {
|
|
|
|
|
|
list,
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
this.type = options.type
|
2023-09-15 14:26:04 +08:00
|
|
|
|
// uni.setNavigationBarTitle({
|
|
|
|
|
|
// title: this.type == 1 ? "资讯列表" : this.type == 4 ? '活动列表' : '党建专栏'
|
|
|
|
|
|
// });
|
2023-09-08 14:52:40 +08:00
|
|
|
|
this.handleInfoList(that.page)
|
|
|
|
|
|
},
|
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
console.log("this.lastPage", this.lastPage)
|
|
|
|
|
|
if (!this.lastPage || this.page >= this.lastPage) {
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
title: '没有更多数据!',
|
|
|
|
|
|
icon: 'none'
|
|
|
|
|
|
})
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
this.page++
|
|
|
|
|
|
this.handleInfoList(that.page)
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
handleInfoList(searchValue, page) {
|
|
|
|
|
|
let that = this
|
|
|
|
|
|
let account = {
|
|
|
|
|
|
pageNo: page,
|
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
}
|
|
|
|
|
|
let https = this.type == 1 ? that.$model.getinfolist(account) : this.type == 4 ? that.$model
|
|
|
|
|
|
.getCampaignList(account) : that.$model.getPartyList(account)
|
|
|
|
|
|
return https.then((res) => {
|
|
|
|
|
|
// console.log("资讯列表", res)
|
|
|
|
|
|
if (res.code != 0) return
|
|
|
|
|
|
that.newsList = this.newsList.concat(res.data.rows)
|
|
|
|
|
|
that.lastPage = res.data.totalpage
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
.box {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.marginTop {
|
|
|
|
|
|
margin-top: 85px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabbar {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
margin-top: 75px;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
|
|
|
|
|
|
view {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
padding: 0 25px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.active {
|
|
|
|
|
|
color: $blue;
|
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
border-bottom: 2px solid $blue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tabbar::before {
|
|
|
|
|
|
content: "";
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 50%;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
width: 1px;
|
|
|
|
|
|
background-color: #dfdfdf;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|