初始化
This commit is contained in:
60
components/Cn-page/Cn-page.vue
Normal file
60
components/Cn-page/Cn-page.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<view class="Cn-page">
|
||||
<template v-if="showLoginMsk && !login">
|
||||
<navigator :url="tenantId ? '/pages/login/login' : '/pages/login/platform'" hover-class="none" class="page-login-btn">登录</navigator>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="loading" v-if="loading">
|
||||
<zero-loading v-if="loading"></zero-loading>
|
||||
</view>
|
||||
<template v-else>
|
||||
<slot name="body"></slot>
|
||||
</template>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script >
|
||||
export default {
|
||||
name: 'Cn-page',
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showLoginMsk: Boolean,
|
||||
tenantId:''
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
login: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.login = uni.getStorageSync('Authorization')
|
||||
this.tenantId = false
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.Cn-page {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
.page-login-btn {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
height: 80rpx;
|
||||
width: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #449dff;
|
||||
color: #fff;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user