移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

116 lines
2.3 KiB

<template>
<view class="container">
<u--image
src="/static/favicon.png"
width="180px"
height="80px"
mode="aspectFit"
:fade="true"
duration="450"
></u--image>
<text class="title">智慧生态</text>
</view>
</template>
<script>
export default {
name: 'Login',
data() {
return {
invateId: ''
}
},
onLoad(res) {
if (res.invateId) {
this.invateId = res.invateId
}
this.init()
},
methods: {
init() {
uni.login({
success: res => {
const data = {
type: 34,
code: res.code,
state: 'default',
userType: this.getUserType()
}
console.log('Login', data)
// 系统登录
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
}
})
},
getUserType() {
// 企业邀请
if (this.invateId) return 2
// if (this.type == 'internal') return 3
// return 1
return 3
},
loginSuccess() {
this.$store.dispatch('GetInfo').then(res => {
console.log('loginSuccess', res.data)
this.handlerNavigateTo(res.data.user)
})
},
handlerNavigateTo(user) {
// 邀请企业
if (this.invateId) {
uni.navigateTo({
url: `/sub/enterprise/edit?invateId=${this.invateId}`
})
return
}
// 审核中
if (user.audit == 1) {
uni.navigateTo({
url: '/sub/common/waiting'
})
return
}
// 审核通过
if (user.audit == 2) {
uni.switchTab({
url: '/pages/index'
})
return
}
// 局内用户首次登录
uni.navigateTo({
url: '/sub/owner/edit'
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
flex-flow: column nowrap;
gap: 20px;
background: linear-gradient(180deg, #02815b 0%, #114636 100%);
.icon {
width: 40vw;
filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.12));
}
.title {
color: #fff;
text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.12);
font-size: 30px;
font-weight: 400;
letter-spacing: 2px;
}
}
</style>