<template>
|
<view>
|
<!-- 自定义导航栏 -->
|
<view class="custom-navbar">
|
<view class="navbar-content">
|
<text class="navbar-title">主页面</text>
|
</view>
|
</view>
|
<view class="page-content" :style="{ paddingTop: navbarHeight + 'px' }">
|
<view class="navBtn" @click="toReview()">
|
<u-image radius="16px" width="140rpx" height="140rpx" :show-loading="true" :src="reviewIcon" mode="aspectFill">
|
</u-image>
|
<view class="cardTit">
|
项目审批
|
</view>
|
</view>
|
<view class="navBtn" @click="toEducate()">
|
<u-image radius="16px" width="140rpx" height="140rpx" :show-loading="true" :src="educateIcon" mode="aspectFill">
|
</u-image>
|
<view class="cardTit">
|
安全教育
|
</view>
|
</view>
|
<view class="loginBtn">
|
<u-button @click="loginOut" type="primary" text="退出登录" shape="circle"></u-button>
|
</view>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import VUE_APP_BASE_URL from 'common/constant.js'
|
import {loginOut} from "../../api"
|
import reviewIcon from '../../static/review.png'
|
import educateIcon from '../../static/educate.png'
|
export default {
|
components: {},
|
data() {
|
return {
|
navbarHeight: 0,
|
reviewIcon: reviewIcon,
|
educateIcon: educateIcon
|
}
|
|
},
|
onLoad() {
|
this.getNavbarHeight()
|
},
|
onShow() {
|
|
},
|
created() {
|
|
},
|
mounted() {
|
|
},
|
methods: {
|
getNavbarHeight() {
|
const systemInfo = uni.getSystemInfoSync()
|
const statusBarHeight = systemInfo.statusBarHeight
|
const navbarHeight = 44
|
this.navbarHeight = statusBarHeight + navbarHeight
|
},
|
toReview() {
|
uni.navigateTo({
|
url: '/pages/review/index'
|
})
|
},
|
|
toEducate() {
|
uni.switchTab({
|
url: '/pages/tabBar/firstPage/firstPage'
|
})
|
},
|
loginOut(){
|
uni.showModal({
|
title: '提示',
|
content: '是否确认退出该账号?',
|
success: async function (res) {
|
if (res.confirm) {
|
loginOut().then(res=>{
|
if(res.code == 200){
|
uni.showToast({
|
title: '账户已退出',
|
duration: 800
|
})
|
setTimeout(()=>{
|
uni.clearStorageSync();
|
uni.clearStorage();
|
uni.navigateTo({
|
url: '/pages/index/index'
|
})
|
},800)
|
}
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.custom-navbar {
|
position: fixed;
|
top: 0;
|
left: 0;
|
right: 0;
|
z-index: 999;
|
background: #ffffff;
|
|
.navbar-content {
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
height: 44px;
|
padding-top: var(--status-bar-height);
|
}
|
|
.navbar-title {
|
font-size: 16px;
|
font-weight: bold;
|
color: #333;
|
}
|
|
}
|
.page-content {
|
min-height: 100vh;
|
box-sizing: border-box;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
padding: 0 15px;
|
.navBtn{
|
width: 100%;
|
padding: 15px 30px;
|
box-sizing: border-box;
|
margin-top: 15px;
|
background: #fff;
|
border-radius: 20rpx;
|
display: flex;
|
align-items: center;
|
box-shadow: 0 10rpx 20rpx rgba(0,0,0,.05);
|
transition: box-shadow .15s ease !important;
|
|
&:active{
|
box-shadow: none;
|
}
|
|
.cardTit{
|
font-size: 36rpx;
|
font-weight: bold;
|
margin-left: 30px;
|
}
|
|
}
|
.loginBtn{
|
width: 100%;
|
position: fixed;
|
bottom: 90px;
|
|
::v-deep .u-button{
|
width: 80%;
|
}
|
}
|
}
|
</style>
|