133 lines
3.4 KiB
Vue
133 lines
3.4 KiB
Vue
<template>
|
|
<view class="policy-all">
|
|
<lwTopnav bgColor="#fff" lwColor="#000" lwTitle="最新政策通知"></lwTopnav>
|
|
<!-- <u-dropdown class="list-sift" borderBottom ref="uDropdown" @open="open" @close="close">
|
|
<u-dropdown-item v-model="parem.districts" title="行政区" :options="districtsList" @change="change"></u-dropdown-item>
|
|
<u-dropdown-item v-model="parem.type" title="分类" :options="typeList"></u-dropdown-item>
|
|
</u-dropdown>
|
|
<view style="height: 20rpx;background-color: #f9f9f9;"></view> -->
|
|
<scroll-view class="result-list" scroll-y @scrolltolower="onreachBottom">
|
|
<u-empty v-if="dataList==null||dataList.length===0" mode="list"></u-empty>
|
|
<view v-else>
|
|
<Dynamics :list="dataList" />
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import lwTopnav from "@/components/lw-topnav/lw-topnav";
|
|
import Dynamics from "@/pages/home/component/dynamics.vue";
|
|
export default {
|
|
components:{
|
|
lwTopnav,Dynamics
|
|
},
|
|
data() {
|
|
return {
|
|
parem: {
|
|
districts: 0, // 行政区
|
|
type: 0, // 政策类型
|
|
},
|
|
districtsList: [{
|
|
label: '全部',
|
|
value: 0,
|
|
},{
|
|
label: '市级',
|
|
value: 1,
|
|
},{
|
|
label: '区级',
|
|
value: 2,
|
|
}],
|
|
typeList: [{
|
|
label: '全部',
|
|
value: 0,
|
|
},{
|
|
label: '人才类',
|
|
value: 1,
|
|
},{
|
|
label: '科技创新类',
|
|
value: 2,
|
|
}],
|
|
dataList:[{
|
|
top: 0,
|
|
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里',
|
|
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>',
|
|
photo: 'static/banner.png',
|
|
view: 597,
|
|
createtime: 1729935783000
|
|
},{
|
|
top: 0,
|
|
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里',
|
|
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>',
|
|
photo: 'static/banner.png',
|
|
view: 597,
|
|
createtime: 1729935783000
|
|
}],
|
|
form:{
|
|
moduleName: uni.getStorageSync('policy').moduleName,
|
|
labelName: uni.getStorageSync('policy').labelName,
|
|
size: 10,
|
|
current: 1
|
|
},
|
|
isFinish: false
|
|
}
|
|
},
|
|
onLoad() {
|
|
uni.setNavigationBarTitle({
|
|
title: '最新政策通知'
|
|
});
|
|
},
|
|
methods: {
|
|
open(index) {
|
|
// 展开某个下来菜单时,先关闭原来的其他菜单的高亮
|
|
// 同时内部会自动给当前展开项进行高亮
|
|
this.$refs.uDropdown.highlight();
|
|
},
|
|
close(index) {
|
|
this.$refs.uDropdown.highlight(index);
|
|
},
|
|
change() {
|
|
|
|
},
|
|
// 获取最新政策列表
|
|
async getDate(){
|
|
let res = await this.$api.getArticleList(this.form);
|
|
if(res?.success){
|
|
const { size, current, total, records } = res.data;
|
|
if(current === 1) this.dataList = records;
|
|
else this.dataList.push(...records);
|
|
this.isFinish = current*size >= total;
|
|
}
|
|
},
|
|
// scroll-view到底部加载更多
|
|
onreachBottom() {
|
|
if(this.isFinish) return;
|
|
this.form.current++;
|
|
this.getDate();
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.policy-all{
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: calc(100vh - 50px);
|
|
}
|
|
.list-sift{
|
|
max-height: 80rpx;
|
|
// overflow: hidden;
|
|
background-color: #fff;
|
|
}
|
|
.result-list{
|
|
view{
|
|
height: 100%;
|
|
margin-top: -30rpx;
|
|
}
|
|
flex: 1;
|
|
padding: 20rpx 25rpx 0rpx;
|
|
background-color: #fff;
|
|
}
|
|
</style> |