This commit is contained in:
Double-_-Z 2024-11-12 17:34:05 +08:00
parent 9723006ee4
commit e004311129
8 changed files with 260 additions and 178 deletions

View File

@ -7,10 +7,10 @@
"path": "pages/index/index", "path": "pages/index/index",
// //
"style": { "style": {
"navigationBarTitleText": "",
// //
"enablePullDownRefresh": true, "navigationBarTitleText": "",
// //
"enablePullDownRefresh": true,
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 50, "onReachBottomDistance": 50,
"app-plus": { "app-plus": {

View File

@ -1,8 +1,9 @@
<template> <template>
<view class="activity-list"> <view class="activity-list">
<lwTopnav bgColor="#fff" lwColor="#000" :isShow="false" lwTitle="人才活动"></lwTopnav> <lwTopnav bgColor="#fff" lwColor="#000" :isShow="false" lwTitle="人才活动"></lwTopnav>
<scroll-view class="result-list" scroll-y @scrolltolower="onreachBottom"> <u-tabs style="position: fixed;width: 100%;" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<u-empty v-if="dataList==null||dataList.length===0" mode="list"></u-empty> <scroll-view class="result-list" scroll-y>
<u-empty marginTop="200" v-if="dataList==null||dataList.length===0" mode="list"></u-empty>
<view style="margin-top: -30rpx;padding-top: 30rpx;" v-else> <view style="margin-top: -30rpx;padding-top: 30rpx;" v-else>
<Dynamics :list="dataList" /> <Dynamics :list="dataList" />
</view> </view>
@ -17,34 +18,41 @@
components:{ components:{
lwTopnav,Dynamics lwTopnav,Dynamics
}, },
props:{
moduleList:{
type: Array,
default: []
}
},
data() { data() {
return { return {
parem: { //
districts: 0, // list:[],
type: 0, //
},
// //
dataList:[{ dataList:[
top: 0, // {
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里', // top: 0,
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>', // title: '广',
photo: 'static/banner.png', // text: '<p>2024广1.6108</p>',
view: 597, // photo: 'static/banner.png',
createtime: 1729935783000 // view: 597,
},{ // createtime: 1729935783000
top: 0, // },{
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里', // top: 0,
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>', // title: '广',
photo: 'static/banner.png', // text: '<p>2024广1.6108</p>',
view: 597, // photo: 'static/banner.png',
createtime: 1729935783000 // view: 597,
}], // createtime: 1729935783000
// },
],
form:{ form:{
moduleName: uni.getStorageSync('activity').moduleName, moduleName: '',
labelName: uni.getStorageSync('activity').labelName, labelName: '',
size: 10, size: 10,
current: 1 current: 1
}, },
current: 0,
isFinish: false isFinish: false
} }
}, },
@ -54,6 +62,27 @@
}) })
}, },
methods: { methods: {
//
onRefresh(){
this.form = {
moduleName: this.moduleList[4].moduleName,
labelName: this.list[this.current].name,
size: 10,
current: 1
};
this.isFinish = false;
this.getDate();
},
//
async init(){
let listLabelRes = await this.$api.getLabel(this.moduleList[4].id);
if(listLabelRes?.success){
this.list = listLabelRes.data;
}
this.form.moduleName = this.moduleList[4].moduleName;
this.form.labelName = this.list[this.current].name;
this.getDate();
},
// //
async getDate(){ async getDate(){
let res = await this.$api.getArticleList(this.form); let res = await this.$api.getArticleList(this.form);
@ -69,6 +98,18 @@
if(this.isFinish) return; if(this.isFinish) return;
this.form.current++; this.form.current++;
this.getDate(); this.getDate();
},
// tabs
change(index){
this.current = index;
this.form = {
moduleName: this.moduleList[4].moduleName,
labelName: this.list[index].name,
size: 10,
current: 1
};
this.isFinish = false;
this.getDate();
} }
} }
} }
@ -76,11 +117,11 @@
<style scoped lang="scss"> <style scoped lang="scss">
.activity-list{ .activity-list{
height: calc(100vh - 50px - 80rpx);
.result-list{ .result-list{
height: 100%; min-height: 50vh;
padding: 0; padding: 0;
background-color: #f9f9f9; margin-top: 85rpx;
// background-color: #f9f9f9;
view{ view{
width: 100%; width: 100%;
padding: 0 25rpx; padding: 0 25rpx;

View File

@ -59,7 +59,7 @@
padding: 30rpx 40rpx 0; padding: 30rpx 40rpx 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100vh - 140rpx); padding-bottom: 140rpx;
.article-title{ .article-title{
color: #000; color: #000;
font-weight: bold; font-weight: bold;
@ -79,7 +79,7 @@
} }
.share{ .share{
background-color: #fff; background-color: #fff;
position: absolute; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;

View File

@ -36,21 +36,23 @@
}, },
// //
dataList:[ dataList:[
[{ [
top: 0, // {
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里', // top: 0,
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>', // title: '广',
photo: 'static/banner.png', // text: '<p>2024广1.6108</p>',
view: 597, // photo: 'static/banner.png',
createtime: 1729935783000 // view: 597,
},{ // createtime: 1729935783000
top: 0, // },{
title: '本年度广州市积分制入户申请即将开放!你想知道的都在这里', // top: 0,
text: '<p>2024年度广州市积分制入户工作正式启动今年的入户指标为1.6万个10月8日起接受积分制入户申请</p>', // title: '广',
photo: 'static/banner.png', // text: '<p>2024广1.6108</p>',
view: 597, // photo: 'static/banner.png',
createtime: 1729935783000 // view: 597,
}], // createtime: 1729935783000
// }
],
[] []
], ],
current: 0, current: 0,
@ -77,7 +79,7 @@
this.$refs.uTabs.setFinishCurrent(current); this.$refs.uTabs.setFinishCurrent(current);
this.current = current; this.current = current;
}, },
// scroll-view // scroll-view-index
onreachBottom() { onreachBottom() {
if(this.isFinish) return; if(this.isFinish) return;
this.form.current++; this.form.current++;

View File

@ -35,10 +35,8 @@
} }
} }
}, },
onLoad(options) { async onLoad(options) {
uni.setNavigationBarTitle({ if(options.title) await uni.setNavigationBarTitle({title: options.title});
title: options.title
});
this.getArticle(options.moduleName,options.title); this.getArticle(options.moduleName,options.title);
}, },
} }

View File

@ -22,8 +22,8 @@
</view> </view>
<!-- 智汇谷简介成员单位一览人才留言板 --> <!-- 智汇谷简介成员单位一览人才留言板 -->
<view class="common-blocks"> <view class="common-blocks">
<view class="common-left" @click="toShowIntroduce(0)"> <view class="common-left">
<view class="left-top"> <view class="left-top" @click="toShowIntroduce(0)">
<text class="lto">{{ introductionList[0].name }}</text> <text class="lto">{{ introductionList[0].name }}</text>
<text class="ltt">点击进入{{ introductionList[0].name }}</text> <text class="ltt">点击进入{{ introductionList[0].name }}</text>
<view class="see">立即查看</view> <view class="see">立即查看</view>
@ -62,6 +62,10 @@
bgColor:{ bgColor:{
type: String, type: String,
default: 'transparent' default: 'transparent'
},
moduleList:{
type: Array,
default: []
} }
}, },
data() { data() {
@ -129,43 +133,39 @@
this.swiperList = bannerRes.data; this.swiperList = bannerRes.data;
} }
// //
let moduleRes = await this.$api.getAllModule(); let functionLabelRes = await this.$api.getLabel(this.moduleList[0].id);
if(moduleRes.success){ if(functionLabelRes?.success){
// this.functionList = functionLabelRes.data;
let functionLabelRes = await this.$api.getLabel(moduleRes.data[0].id); this.functionModuleName = this.moduleList[0].moduleName;
if(functionLabelRes?.success){ }
this.functionList = functionLabelRes.data;
this.functionModuleName = moduleRes.data[0].moduleName;
}
// //
let introductionLabelRes = await this.$api.getLabel(moduleRes.data[1].id); let introductionLabelRes = await this.$api.getLabel(this.moduleList[1].id);
if(introductionLabelRes?.success){ if(introductionLabelRes?.success){
this.introductionList = introductionLabelRes.data; this.introductionList = introductionLabelRes.data;
this.introductionName = moduleRes.data[1].moduleName; this.introductionName = this.moduleList[1].moduleName;
} }
// //
let columnLabelRes = await this.$api.getLabel(moduleRes.data[2].id); let columnLabelRes = await this.$api.getLabel(this.moduleList[2].id);
if(columnLabelRes?.success){ if(columnLabelRes?.success){
this.columnList = columnLabelRes.data; this.columnList = columnLabelRes.data;
this.columnName = moduleRes.data[2].moduleName; this.columnName = this.moduleList[2].moduleName;
// // -
uni.setStorageSync("policy",{moduleName:this.columnName,labelName:this.columnList[1].name}); // uni.setStorageSync("policy",{moduleName:this.columnName,labelName:this.columnList[1].name});
uni.setStorageSync("activity",{moduleName:this.columnName,labelName:this.columnList[2].name}); // uni.setStorageSync("activity",{moduleName:this.columnName,labelName:this.columnList[2].name});
// //
let articleRes = await this.$api.getArticleList({ let articleRes = await this.$api.getArticleList({
labelName: this.columnList[0].name, labelName: this.columnList[0].name,
moduleName: this.columnName, moduleName: this.columnName,
size: 10, size: 10,
current: 1, current: 1,
}); });
console.log(articleRes) console.log(articleRes)
if(articleRes?.success){ if(articleRes?.success){
this.dynamicsList = articleRes.data.records; this.dynamicsList = articleRes.data.records;
}
} }
} }
}catch(e){ }catch(e){
@ -190,8 +190,10 @@
// //
toShowIntroduce(index){ toShowIntroduce(index){
const title = this.introductionList[index].name;
const moduleName = this.introductionName;
uni.navigateTo({ uni.navigateTo({
url: `/pages/article/richDetail?title=${this.introductionList[index].name}&moduleName=${this.introductionName}` url: `/pages/article/richDetail?title=${title}&moduleName=${moduleName}`
}) })
}, },

View File

@ -1,9 +1,9 @@
<template> <template>
<view> <view>
<view class="u-page"> <view class="u-page upage">
<Home ref="home" @changeLoading="changeLoading" :bgColor="getBgColor" v-show="current===0" /> <Home ref="home" :moduleList="moduleList" @changeLoading="changeLoading" :bgColor="getBgColor" v-show="current===0" />
<PolicyList ref="policy" style="height: 100vh" v-show="current===1" /> <PolicyList :moduleList="moduleList" ref="policy" style="height: 100vh" v-show="current===1" />
<ActivityList ref="activity" v-show="current===2" /> <ActivityList :moduleList="moduleList" ref="activity" v-show="current===2" />
<My ref="my" v-show="current===3" /> <My ref="my" v-show="current===3" />
</view> </view>
<u-tabbar @change="beforeSwitch" :value="current" activeColor="#94ceff" :list="list"></u-tabbar> <u-tabbar @change="beforeSwitch" :value="current" activeColor="#94ceff" :list="list"></u-tabbar>
@ -37,7 +37,7 @@
{ {
iconPath: "grid", iconPath: "grid",
selectedIconPath: "grid-fill", selectedIconPath: "grid-fill",
text: '人才活动', text: '人才服务',
customIcon: false, customIcon: false,
}, },
{ {
@ -51,6 +51,7 @@
current: 0,// current: 0,//
topLevel: 0,// topLevel: 0,//
loading: true,// loading: true,//
moduleList: [],
}; };
}, },
computed:{ computed:{
@ -63,6 +64,10 @@
if(level<=1) this.topLevel = level; if(level<=1) this.topLevel = level;
else this.topLevel = 1; else this.topLevel = 1;
}, },
async onLoad() {
await this.getModule();
this.beforeSwitch(this.current);
},
onShow() { onShow() {
let index = uni.getStorageSync('pageIndex'); let index = uni.getStorageSync('pageIndex');
this.current = index?index:0; this.current = index?index:0;
@ -71,26 +76,57 @@
onHide(){ onHide(){
uni.setStorageSync('pageIndex',this.current); uni.setStorageSync('pageIndex',this.current);
}, },
//
onPullDownRefresh() {
try{
if(this.current === 0){
this.$refs['home'].getHomeData();
} else if(this.current === 1){
this.$refs['policy'].onRefresh();
} else if(this.current === 2){
this.$refs['activity'].onRefresh();
}
}catch(e){}
finally{
uni.stopPullDownRefresh();
}
},
//
onReachBottom() {
if(this.current === 1){
this.$refs['policy'].onreachBottom();
} else if(this.current === 2){
this.$refs['activity'].onreachBottom();
}
},
methods: { methods: {
beforeSwitch(index){ //
async getModule(){
//
let moduleRes = await this.$api.getAllModule();
if(moduleRes.success){
this.moduleList = moduleRes.data;
}
},
async beforeSwitch(index){
try{ try{
this.current = index; this.current = index;
this.loading = true; // this.loading = true;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.list[index].text title: this.list[index].text
}); });
switch(index){ switch(index){
case 0: case 0:
this.$refs['home'].getHomeData(); await this.$refs['home'].getHomeData();
break; break;
case 1: case 1:
this.$refs['policy'].getDate(); await this.$refs['policy'].init();
break; break;
case 2: case 2:
this.$refs['activity'].getDate(); await this.$refs['activity'].init();
break; break;
case 3: case 3:
this.$refs['my'].refresh(); await this.$refs['my'].refresh();
break; break;
} }
}catch(e){ }catch(e){
@ -107,4 +143,8 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.upage{
width: 100%;
height: calc(100% - 50px);
}
</style> </style>

View File

@ -1,14 +1,10 @@
<template> <template>
<view class="policy-all"> <view class="activity-list">
<lwTopnav bgColor="#fff" lwColor="#000" lwTitle="最新政策通知"></lwTopnav> <lwTopnav bgColor="#fff" lwColor="#000" :isShow="false" lwTitle="最新政策通知"></lwTopnav>
<!-- <u-dropdown class="list-sift" borderBottom ref="uDropdown" @open="open" @close="close"> <u-tabs style="position: fixed;width: 100%;" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<u-dropdown-item v-model="parem.districts" title="行政区" :options="districtsList" @change="change"></u-dropdown-item> <scroll-view class="result-list" scroll-y>
<u-dropdown-item v-model="parem.type" title="分类" :options="typeList"></u-dropdown-item> <u-empty marginTop="200" v-if="dataList==null||dataList.length===0" mode="list"></u-empty>
</u-dropdown> <view style="margin-top: -30rpx;padding-top: 30rpx;" v-else>
<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" /> <Dynamics :list="dataList" />
</view> </view>
</scroll-view> </scroll-view>
@ -22,72 +18,70 @@
components:{ components:{
lwTopnav,Dynamics lwTopnav,Dynamics
}, },
props:{
moduleList:{
type: Array,
default: []
}
},
data() { data() {
return { return {
parem: { //
districts: 0, // list:[],
type: 0, // //
}, dataList:[
districtsList: [{ // {
label: '全部', // top: 0,
value: 0, // title: '广',
},{ // text: '<p>2024广1.6108</p>',
label: '市级', // photo: 'static/banner.png',
value: 1, // view: 597,
},{ // createtime: 1729935783000
label: '区级', // },{
value: 2, // top: 0,
}], // title: '广',
typeList: [{ // text: '<p>2024广1.6108</p>',
label: '全部', // photo: 'static/banner.png',
value: 0, // view: 597,
},{ // createtime: 1729935783000
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:{ form:{
moduleName: uni.getStorageSync('policy').moduleName, moduleName: '',
labelName: uni.getStorageSync('policy').labelName, labelName: '',
size: 10, size: 10,
current: 1 current: 1
}, },
current: 0,
isFinish: false isFinish: false
} }
}, },
onLoad() { onLoad() {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '最新政策通知' title: '人才活动'
}); })
}, },
methods: { methods: {
open(index) { //
// onRefresh(){
// this.form = {
this.$refs.uDropdown.highlight(); moduleName: this.moduleList[3].moduleName,
labelName: this.list[this.current].name,
size: 10,
current: 1
};
this.isFinish = false;
this.getDate();
}, },
close(index) { //
this.$refs.uDropdown.highlight(index); async init(){
}, let listLabelRes = await this.$api.getLabel(this.moduleList[3].id);
change() { if(listLabelRes?.success){
this.list = listLabelRes.data;
}
this.form.moduleName = this.moduleList[3].moduleName;
this.form.labelName = this.list[this.current].name;
this.getDate();
}, },
// //
async getDate(){ async getDate(){
@ -104,30 +98,35 @@
if(this.isFinish) return; if(this.isFinish) return;
this.form.current++; this.form.current++;
this.getDate(); this.getDate();
},
// tabs
change(index){
this.current = index;
this.form = {
moduleName: this.moduleList[3].moduleName,
labelName: this.list[index].name,
size: 10,
current: 1
};
this.isFinish = false;
this.getDate();
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.policy-all{ .activity-list{
overflow: hidden; .result-list{
display: flex; min-height: 50vh;
flex-direction: column; padding: 0;
height: calc(100vh - 50px); margin-top: 85rpx;
} // background-color: #f9f9f9;
.list-sift{ view{
max-height: 80rpx; width: 100%;
// overflow: hidden; padding: 0 25rpx;
background-color: #fff; background-color: #fff;
} }
.result-list{
view{
height: 100%;
margin-top: -30rpx;
} }
flex: 1;
padding: 20rpx 25rpx 0rpx;
background-color: #fff;
} }
</style> </style>