<template>
|
<view class="login-box">
|
<image src="/static/login/login-bg.png" class="headimg" mode="widthFix"></image>
|
<view style="width:100%;height:444rpx;"></view>
|
<view class="box">
|
<view class="font">
|
账号
|
</view>
|
<u-input height='88' v-model="phone" placeholder-style="color:'#98A1B2'" style="margin-top:14rpx;background-color: #F2F4F7;font-size:32rpx;border-radius: 16rpx;" placeholder="请输入账号" type="text" :border="true" />
|
<view class="font" style="margin-top: 32rpx;">
|
密码
|
</view>
|
<u-input height='88' v-model="yzm" placeholder-style="color:'#98A1B2'" placeholder="请输入密码" style="margin-top:14rpx;background-color: #F2F4F7;font-size:32rpx;border-radius: 16rpx;" type="password" :border="true" />
|
<view class="button" @click="loginNoPass">登录</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
loginpass,
|
getLoginUserInfo
|
} from '@/api/index.js'
|
import {
|
encryptPwd
|
} from '@/common/util.js'
|
export default {
|
onLoad(options) {
|
let token = uni.getStorageSync("sessionToken")
|
if (token) {
|
uni.redirectTo({
|
url:'/pages/agent-list/agent-list'
|
})
|
}
|
},
|
data() {
|
return {
|
phone: '',
|
yzm: '123123',
|
}
|
},
|
methods: {
|
loginNoPass() {
|
if (this.phone == '') {
|
uni.showToast({
|
title: '请输入账号',
|
icon: 'none'
|
})
|
return
|
}
|
if (this.yzm == '') {
|
uni.showToast({
|
title: '请输入密码',
|
icon: 'none'
|
})
|
return
|
}
|
loginpass({
|
username: this.phone,
|
password: encryptPwd(this.yzm)
|
}).then(val => {
|
if (val.code == 200) {
|
uni.setStorageSync('sessionToken', val.token),
|
this.getLoginUserInfo()
|
}
|
})
|
},
|
getLoginUserInfo() {
|
getLoginUserInfo().then(val => {
|
this.$u.vuex('userInfo', val.user)
|
uni.redirectTo({
|
url:'/pages/agent-list/agent-list'
|
})
|
})
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
page{
|
width:100%;height:100%;
|
background-color: #F6FBFE;
|
}
|
.login-box{
|
width:100%;height:100%;
|
}
|
.headimg {
|
width: 100%;
|
height:536rpx;
|
position: absolute;
|
left: 0;
|
top: 0;
|
}
|
.box {
|
height: calc(100vh - 444rpx);
|
position: relative;
|
padding: 44rpx 30rpx;
|
background: #fff;
|
box-sizing: border-box;
|
border-radius: 16px 16px 0 0;
|
input{
|
height:88rpx;
|
}
|
}
|
|
.button {
|
height: 100rpx;
|
line-height: 100rpx;
|
flex-shrink: 0;
|
border-radius: 100rpx;
|
background: linear-gradient(272deg, #05B0FC -62.04%, #3C50F9 -5.3%, #0079FE 38.57%, #05B2FC 124.24%), #0AAD60;
|
font-size: 32rpx;
|
color: white;
|
margin-top: 64rpx;
|
text-align: center;
|
}
|
|
.font {
|
color: #475467;
|
font-size: 32rpx;
|
line-height:48rpx;
|
font-weight:500;
|
margin-bottom: 14rpx;
|
}
|
</style>
|