提交 0e39523a 作者: wk

工作台滑动吸顶

父级 24551d7d
......@@ -70,6 +70,7 @@
<style lang="scss">
.navbar-home {
.navbar-content {
position: relative;
top: 0;
......
......@@ -73,6 +73,7 @@
margin-bottom: 16px;
width: 100%;
background: linear-gradient(138.42deg, #59a3fe 0%, #1757ff 100%);
z-index: 999;
.navbar-v-navbar {
display: flex;
......
......@@ -35,10 +35,11 @@
<text class="text">本周人气最佳:{{mostUsed.app_name||"暂无"}}</text>
</view>
</view>
<view class="app-content" :style="{'top':statusBarHeight+250+'px'}">
<view class="menu-content">
<v-tabs :tabs="tabs" :scroll="true" :value="current" @change="tabChange"></v-tabs>
</view>
<titleBar title="欢迎您访问一点通" v-if="isTitleFix"></titleBar>
<view :class="isFix?'sticky-fixed':'menu-content'" :style="{'top':topValue()+'px'}">
<v-tabs :tabs="tabs" :scroll="true" :value="current" @change="tabChange"></v-tabs>
</view>
<view class="app-content" :style="{'top':statusBarHeight+280+'px'}">
<view class="app-group-content">
<view class="app-group-item" v-for="(item,index) in getMenuApps()" :key="index">
<view class="title">{{item.group_name||"其他"}}</view>
......@@ -94,7 +95,10 @@
},
orgName: "",
mostUsed: {},
role: "PM"
role: "PM",
isFix: false,
isTitleFix: false,
scrollTop: 0
}
},
onLoad() {
......@@ -117,8 +121,30 @@
}
this.getMostUsed()
},
onPageScroll(e) {
//#ifdef H5
this.isFix = true
// #endif
// #ifndef H5
if (e.scrollTop > 50) {
this.isTitleFix = true
} else {
this.isTitleFix = false
}
if (this.statusBarHeight + 200 > e.scrollTop) {
this.isFix = false
} else {
this.scrollTop = e.scrollTop
this.isFix = true
}
// #endif
},
methods: {
topValue() {
return this.isFix ? (this.statusBarHeight + 40) : (this.statusBarHeight + 240)
},
getMenuApps() {
console.log("是否吸顶", this.isFix);
var menuApps = this.apps.find(item => item.app_menu == this.current + 1)
if (menuApps) {
return menuApps.list
......@@ -615,16 +641,24 @@
}
.menu-content {
position: absolute;
width: 100%;
}
.sticky-fixed {
width: 100%;
position: fixed;
top: 0;
z-index: 999;
}
.app-content {
position: absolute;
display: flex;
padding-bottom: 85px;
flex-direction: column;
.menu-content {
display: flex;
}
.app-group-content {
display: flex;
flex-direction: column;
......@@ -652,6 +686,7 @@
.item {
display: flex;
margin-top: 20rpx;
flex-direction: column;
align-items: center;
justify-content: center;
......
......@@ -567,8 +567,17 @@
if (result.code == 0) {
getApp().globalData.userInfo = result.data
this.userInfo = result.data
// this.title = "欢迎" + this.userInfo.user.user_name + "访问一点通"
this.role = this.userInfo.identity.code
//如果是项目端 获取当前岗位
//如果是工人 获取工人当前项目
// if (this.role == 'PM') {
// let jobs = this.userInfo.user.job_list
// if (jobs) {
// let currentJob = jobs[0]
// }
// }else{
// }
this.project_id = uni.getStorageSync("project_id")
console.log("当前组织", this.project_id);
if (!this.project_id) {
......
......@@ -6,7 +6,8 @@
<view class="info-content" :style="{top:statusBarHeight+45+'px'}">
<image src="../../static/mine-bg.png" class="image"></image>
<view class="company">{{currentJob.org_name||""}}</view>
<view class="name">{{userInfo.user.user_name||""}} {{currentJob.job_name||""}}</view>
<view class="name">{{userInfo.user.user_name||""}}</view>
<view class="job">{{currentJob.job_name||""}}</view>
<view class="project">{{currentJob.dept_name||""}}</view>
<image src="../../static/avatar-def.png" class="avatar"></image>
</view>
......@@ -250,17 +251,27 @@
font-weight: 500;
font-size: 28rpx;
left: 72rpx;
top: 100rpx;
top: 80rpx;
text-align: center;
color: #333;
}
.name {
position: absolute;
font-weight: 600;
font-size: 28rpx;
left: 72rpx;
top: 140rpx;
text-align: center;
color: #333;
}
.job {
position: absolute;
font-weight: 400;
font-size: 28rpx;
left: 72rpx;
top: 200rpx;
top: 180rpx;
text-align: center;
color: #333;
}
......@@ -271,7 +282,7 @@
font-size: 28rpx;
width: 630rpx;
left: 72rpx;
top: 245rpx;
top: 235rpx;
text-align: left;
color: #333;
display: -webkit-box;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
Please register or to comment