91 lines
2.4 KiB
Vue
91 lines
2.4 KiB
Vue
<template>
|
|
<view class="activity-list">
|
|
<lwTopnav bgColor="#fff" lwColor="#000" :isShow="false" lwTitle="人才活动"></lwTopnav>
|
|
<scroll-view class="result-list" scroll-y @scrolltolower="onreachBottom">
|
|
<u-empty v-if="dataList==null||dataList.length===0" mode="list"></u-empty>
|
|
<view style="margin-top: -30rpx;padding-top: 30rpx;" 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, // 政策类型
|
|
},
|
|
// 列表
|
|
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('activity').moduleName,
|
|
labelName: uni.getStorageSync('activity').labelName,
|
|
size: 10,
|
|
current: 1
|
|
},
|
|
isFinish: false
|
|
}
|
|
},
|
|
onLoad() {
|
|
uni.setNavigationBarTitle({
|
|
title: '人才活动'
|
|
})
|
|
},
|
|
methods: {
|
|
// 获取最新政策列表
|
|
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">
|
|
.activity-list{
|
|
height: calc(100vh - 50px - 80rpx);
|
|
.result-list{
|
|
height: 100%;
|
|
padding: 0;
|
|
background-color: #f9f9f9;
|
|
view{
|
|
width: 100%;
|
|
padding: 0 25rpx;
|
|
background-color: #fff;
|
|
}
|
|
}
|
|
}
|
|
</style> |