TalentService-mobile/pages/activity/activityList.vue

91 lines
2.4 KiB
Vue
Raw Normal View History

2024-10-27 00:26:19 +08:00
<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, // 政策类型
},
2024-10-31 21:24:54 +08:00
// 列表
2024-10-27 00:26:19 +08:00
dataList:[{
2024-10-31 21:24:54 +08:00
top: 0,
2024-10-27 00:26:19 +08:00
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里',
2024-10-31 21:24:54 +08:00
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>',
photo: 'static/banner.png',
view: 597,
createtime: 1729935783000
2024-10-27 00:26:19 +08:00
},{
2024-10-31 21:24:54 +08:00
top: 0,
2024-10-27 00:26:19 +08:00
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里',
2024-10-31 21:24:54 +08:00
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
2024-10-27 00:26:19 +08:00
}
},
onLoad() {
uni.setNavigationBarTitle({
title: '人才活动'
})
},
methods: {
2024-10-31 21:24:54 +08:00
// 获取最新政策列表
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;
}
},
2024-10-27 00:26:19 +08:00
// scroll-view到底部加载更多
onreachBottom() {
2024-10-31 21:24:54 +08:00
if(this.isFinish) return;
this.form.current++;
this.getDate();
2024-10-27 00:26:19 +08:00
}
}
}
</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>