提交 0e39523a 作者: wk

工作台滑动吸顶

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