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",
//
"style": {
"navigationBarTitleText": "",
//
"enablePullDownRefresh": true,
"navigationBarTitleText": "",
//
"enablePullDownRefresh": true,
"navigationStyle": "custom",
"onReachBottomDistance": 50,
"app-plus": {

View File

@ -1,8 +1,9 @@
<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>
<u-tabs style="position: fixed;width: 100%;" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<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>
<Dynamics :list="dataList" />
</view>
@ -17,34 +18,41 @@
components:{
lwTopnav,Dynamics
},
props:{
moduleList:{
type: Array,
default: []
}
},
data() {
return {
parem: {
districts: 0, //
type: 0, //
},
//
list:[],
//
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
}],
dataList:[
// {
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// },{
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// },
],
form:{
moduleName: uni.getStorageSync('activity').moduleName,
labelName: uni.getStorageSync('activity').labelName,
moduleName: '',
labelName: '',
size: 10,
current: 1
},
current: 0,
isFinish: false
}
},
@ -54,6 +62,27 @@
})
},
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(){
let res = await this.$api.getArticleList(this.form);
@ -69,6 +98,18 @@
if(this.isFinish) return;
this.form.current++;
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">
.activity-list{
height: calc(100vh - 50px - 80rpx);
.result-list{
height: 100%;
min-height: 50vh;
padding: 0;
background-color: #f9f9f9;
margin-top: 85rpx;
// background-color: #f9f9f9;
view{
width: 100%;
padding: 0 25rpx;

View File

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

View File

@ -36,21 +36,23 @@
},
//
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
}],
[
// {
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// },{
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// }
],
[]
],
current: 0,
@ -77,7 +79,7 @@
this.$refs.uTabs.setFinishCurrent(current);
this.current = current;
},
// scroll-view
// scroll-view-index
onreachBottom() {
if(this.isFinish) return;
this.form.current++;

View File

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

View File

@ -22,8 +22,8 @@
</view>
<!-- 智汇谷简介成员单位一览人才留言板 -->
<view class="common-blocks">
<view class="common-left" @click="toShowIntroduce(0)">
<view class="left-top">
<view class="common-left">
<view class="left-top" @click="toShowIntroduce(0)">
<text class="lto">{{ introductionList[0].name }}</text>
<text class="ltt">点击进入{{ introductionList[0].name }}</text>
<view class="see">立即查看</view>
@ -62,6 +62,10 @@
bgColor:{
type: String,
default: 'transparent'
},
moduleList:{
type: Array,
default: []
}
},
data() {
@ -129,31 +133,28 @@
this.swiperList = bannerRes.data;
}
//
let moduleRes = await this.$api.getAllModule();
if(moduleRes.success){
//
let functionLabelRes = await this.$api.getLabel(moduleRes.data[0].id);
let functionLabelRes = await this.$api.getLabel(this.moduleList[0].id);
if(functionLabelRes?.success){
this.functionList = functionLabelRes.data;
this.functionModuleName = moduleRes.data[0].moduleName;
this.functionModuleName = this.moduleList[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){
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){
this.columnList = columnLabelRes.data;
this.columnName = moduleRes.data[2].moduleName;
//
uni.setStorageSync("policy",{moduleName:this.columnName,labelName:this.columnList[1].name});
uni.setStorageSync("activity",{moduleName:this.columnName,labelName:this.columnList[2].name});
this.columnName = this.moduleList[2].moduleName;
// -
// uni.setStorageSync("policy",{moduleName:this.columnName,labelName:this.columnList[1].name});
// uni.setStorageSync("activity",{moduleName:this.columnName,labelName:this.columnList[2].name});
//
let articleRes = await this.$api.getArticleList({
@ -167,7 +168,6 @@
this.dynamicsList = articleRes.data.records;
}
}
}
}catch(e){
}finally{
// this.$emit('changeLoading',false);
@ -190,8 +190,10 @@
//
toShowIntroduce(index){
const title = this.introductionList[index].name;
const moduleName = this.introductionName;
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>
<view>
<view class="u-page">
<Home ref="home" @changeLoading="changeLoading" :bgColor="getBgColor" v-show="current===0" />
<PolicyList ref="policy" style="height: 100vh" v-show="current===1" />
<ActivityList ref="activity" v-show="current===2" />
<view class="u-page upage">
<Home ref="home" :moduleList="moduleList" @changeLoading="changeLoading" :bgColor="getBgColor" v-show="current===0" />
<PolicyList :moduleList="moduleList" ref="policy" style="height: 100vh" v-show="current===1" />
<ActivityList :moduleList="moduleList" ref="activity" v-show="current===2" />
<My ref="my" v-show="current===3" />
</view>
<u-tabbar @change="beforeSwitch" :value="current" activeColor="#94ceff" :list="list"></u-tabbar>
@ -37,7 +37,7 @@
{
iconPath: "grid",
selectedIconPath: "grid-fill",
text: '人才活动',
text: '人才服务',
customIcon: false,
},
{
@ -51,6 +51,7 @@
current: 0,//
topLevel: 0,//
loading: true,//
moduleList: [],
};
},
computed:{
@ -63,6 +64,10 @@
if(level<=1) this.topLevel = level;
else this.topLevel = 1;
},
async onLoad() {
await this.getModule();
this.beforeSwitch(this.current);
},
onShow() {
let index = uni.getStorageSync('pageIndex');
this.current = index?index:0;
@ -71,26 +76,57 @@
onHide(){
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: {
beforeSwitch(index){
//
async getModule(){
//
let moduleRes = await this.$api.getAllModule();
if(moduleRes.success){
this.moduleList = moduleRes.data;
}
},
async beforeSwitch(index){
try{
this.current = index;
this.loading = true;
// this.loading = true;
uni.setNavigationBarTitle({
title: this.list[index].text
});
switch(index){
case 0:
this.$refs['home'].getHomeData();
await this.$refs['home'].getHomeData();
break;
case 1:
this.$refs['policy'].getDate();
await this.$refs['policy'].init();
break;
case 2:
this.$refs['activity'].getDate();
await this.$refs['activity'].init();
break;
case 3:
this.$refs['my'].refresh();
await this.$refs['my'].refresh();
break;
}
}catch(e){
@ -107,4 +143,8 @@
</script>
<style lang="scss" scoped>
.upage{
width: 100%;
height: calc(100% - 50px);
}
</style>

View File

@ -1,14 +1,10 @@
<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>
<view class="activity-list">
<lwTopnav bgColor="#fff" lwColor="#000" :isShow="false" lwTitle="最新政策通知"></lwTopnav>
<u-tabs style="position: fixed;width: 100%;" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
<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>
<Dynamics :list="dataList" />
</view>
</scroll-view>
@ -22,72 +18,70 @@
components:{
lwTopnav,Dynamics
},
props:{
moduleList:{
type: Array,
default: []
}
},
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
}],
//
list:[],
//
dataList:[
// {
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// },{
// top: 0,
// title: '广',
// text: '<p>2024广1.6108</p>',
// photo: 'static/banner.png',
// view: 597,
// createtime: 1729935783000
// },
],
form:{
moduleName: uni.getStorageSync('policy').moduleName,
labelName: uni.getStorageSync('policy').labelName,
moduleName: '',
labelName: '',
size: 10,
current: 1
},
current: 0,
isFinish: false
}
},
onLoad() {
uni.setNavigationBarTitle({
title: '最新政策通知'
});
title: '人才活动'
})
},
methods: {
open(index) {
//
//
this.$refs.uDropdown.highlight();
//
onRefresh(){
this.form = {
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);
},
change() {
//
async init(){
let listLabelRes = await this.$api.getLabel(this.moduleList[3].id);
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(){
@ -104,30 +98,35 @@
if(this.isFinish) return;
this.form.current++;
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>
<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;
}
.activity-list{
.result-list{
min-height: 50vh;
padding: 0;
margin-top: 85rpx;
// background-color: #f9f9f9;
view{
height: 100%;
margin-top: -30rpx;
}
flex: 1;
padding: 20rpx 25rpx 0rpx;
width: 100%;
padding: 0 25rpx;
background-color: #fff;
}
}
}
</style>