[新增]企业主页,企业活动

This commit is contained in:
zdx
2020-12-28 10:38:29 +08:00
parent d3fa1d743c
commit 3a559141d1
106 changed files with 4587 additions and 164 deletions

View File

@@ -0,0 +1,124 @@
Page({
data: {
type: 1,
page: 1,
has_more: true,
lists: [],
company_id: wx.getStorageSync('company_id'),
},
/**
* @param {type} 1管理 2员工 4 企业风采 5 企业视频
*/
onLoad: function (options) {
switch (options.type) {
case '1':
wx.setNavigationBarTitle({
// title: '企业主页-管理层',
title: '员工列表',
})
this.users();
break;
case '2':
wx.setNavigationBarTitle({
title: '企业主页-员工层',
})
break;
case '4':
wx.setNavigationBarTitle({
title: '企业风采',
})
this.graces();
break;
case '5':
wx.setNavigationBarTitle({
title: '企业视频',
})
this.videos();
break;
default:
break;
}
this.setData({
type: options.type
})
},
// 获取企业风采列表
graces() {
wx.$api.companyModule.graces(this.data.company_id, this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
this.setData({
has_more: res.page.has_more,
page: page + 1,
lists: lists
})
} else {
this.setData({
has_more: res.page.has_more,
lists: lists
})
}
})
},
// 获取企业宣传视频列表
videos() {
wx.$api.companyModule.videos(this.data.company_id, this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
this.setData({
has_more: res.page.has_more,
page: page + 1,
lists: lists
})
} else {
this.setData({
has_more: res.page.has_more,
lists: lists
})
}
})
},
// 获取企业员工页面
users() {
wx.$api.companyModule.users(this.data.company_id, this.data.page).then(res => {
console.log(res);
var lists = this.data.lists.concat(res.data)
if (res.page.has_more) {
this.setData({
has_more: res.page.has_more,
page: page + 1,
lists: lists
})
} else {
this.setData({
has_more: res.page.has_more,
lists: lists
})
}
})
},
// 触底加载更多
onReachBottom() {
console.log('触底')
if (this.data.has_more) {
if (this.data.type == 4) {
this.graces();
} else if (this.data.type == 5) {
this.videos();
} else if (this.data.type == 1 || this.data.type == 2) {
this.users();
}
} else {
wx.showToast({
icon: 'none',
title: '没有更多',
})
}
}
})

View File

@@ -0,0 +1,10 @@
{
"usingComponents": {
"videoInfo": "/components/company/videoInfo/videoInfo",
"fengcaiInfo": "/components/company/fengcaiInfo/fengcaiInfo" ,
"personalInfo": "/components/company/personalInfo/personalInfo"
},
"navigationBarTitleText": "企业视频",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#378fff"
}

View File

@@ -0,0 +1,17 @@
<!-- 企业管理层 企业员工层 -->
<view wx:if='{{type==1 || type==2}}'>
<personalInfo wx:for='{{lists}}' info='{{item}}'></personalInfo>
</view>
<!-- 企业风采 -->
<view wx:if='{{type==4}}'>
<fengcaiInfo wx:for='{{lists}}' info='{{item}}'></fengcaiInfo>
</view>
<!-- 企业视频 -->
<view wx:if='{{type==5}}'>
<videoInfo wx:for='{{lists}}' info='{{item}}'></videoInfo>
</view>
<view class="has_more">{{has_more?'~ 上拉加载更多 ~':'~ 暂无更多数据 ~'}}</view>

View File

@@ -0,0 +1,10 @@
page {
padding-bottom: 30rpx;
}
.has_more {
color: #999;
font-size: 26rpx;
text-align: center;
padding: 30rpx;
}