<template>
|
<view class="login-wrap">
|
<view class="login-wrap-inside">
|
<view class="login-main">
|
<text class="title">金隅太行水泥智慧工会</text>
|
<view class="login-main-inside">
|
<text class="welcom">欢迎登陆!</text>
|
</view>
|
<view class="user-box">
|
<u-form :model="valiFormData" ref="valiFormData">
|
<u-form-item label="账号" prop="loginName">
|
<u-input v-model="valiFormData.loginName" class="uni-input" placeholder="请输入账号"/>
|
</u-form-item>
|
<u-form-item label="密码" prop="password">
|
<view class="login-flex-box">
|
<u-input :password-icon="true" type="password" v-model="valiFormData.password" placeholder="请输入密码"></u-input>
|
</view>
|
</u-form-item>
|
</u-form>
|
<u-button plain hover-class="none" class="dengluBtn" size="mini" open-type="getUserInfo" @getuserinfo="appLoginWx('valiFormData')">绑定</u-button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
valiFormData: {
|
loginName: '',
|
password: '',
|
openid:''
|
},
|
rules: {
|
loginName:[
|
{
|
required: true,
|
message: '账号不能为空',
|
trigger: ['change', 'blur']
|
}
|
],
|
password: [
|
{
|
required: true,
|
min:6,
|
message: '密码长度不能小于6个字符',
|
trigger: ['change', 'blur']
|
}
|
]
|
},
|
showPassword: false,
|
type_text: "text",
|
type_password: "password",
|
psdType:"password"
|
}
|
},
|
onLoad(options) {
|
console.log('options----',options)
|
if(options.openid) {
|
this.valiFormData.openid = options.openid
|
}
|
},
|
onReady() {
|
this.$refs.valiFormData.setRules(this.rules)
|
},
|
methods: {
|
changePassword: function() {
|
this.showPassword = !this.showPassword
|
},
|
appLoginWx(ref) {
|
this.$refs.valiFormData.validate(valid => {
|
if(valid) {
|
console.log(' this.valiFormData.loginName----',this)
|
this.$u.api.loginIndex(this.valiFormData).then(res => {
|
console.log('this.valiFormData----',this.valiFormData)
|
if(res.success) {
|
this.setStore("userInfo",res.obj)
|
uni.switchTab({
|
url: '/pages/learn/learn'
|
});
|
}
|
})
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
|
</style>
|
<style lang="scss" scoped>
|
/deep/ .uni-forms-item {
|
border-bottom: 1px solid #ffffff;
|
}
|
|
/deep/ .uni-forms-item__inner {
|
padding-top: 36rpx;
|
padding-bottom: 22rpx;
|
}
|
/deep/ .u-btn--default{
|
background-color: transparent!important;
|
color: #fff!important;
|
}
|
/deep/ .u-hairline-border:after{
|
border:none!important;
|
}
|
/deep/ .u-size-mini{
|
width: 100%!important;
|
}
|
.login-wrap {
|
width: 100%;
|
height: 100vh;
|
background: $login-bj;
|
background-size: 100% 100%;
|
display: flex;
|
justify-content: center;
|
}
|
.login-flex-box{
|
display: flex;
|
}
|
.login-wrap-inside {
|
width: 60%;
|
display: flex;
|
justify-content: center;
|
|
.login-main {
|
display: flex;
|
flex-direction: column;
|
margin-top: 50%;
|
|
.title {
|
text-align: center;
|
color: #34404e;
|
font-size: 42rpx;
|
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.4);
|
}
|
}
|
}
|
|
.login-main-inside {
|
margin-top: 100rpx;
|
|
.welcom {
|
color: #ff3c2e;
|
font-size: 36rpx;
|
}
|
}
|
|
// /deep/.uni-input-wrapper {
|
// /* #ifndef APP-NVUE */
|
// display: flex;
|
// /* #endif */
|
// padding: 8px 13px;
|
// flex-direction: row;
|
// flex-wrap: nowrap;
|
// }
|
|
.user-box {
|
margin-top: 60rpx;
|
}
|
|
.dengluBtn {
|
background-color: #ff4e00!important;
|
color: #fff;
|
font-size: 30rpx;
|
border-radius: 50rpx;
|
width: 450rpx;
|
height: 74rpx;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
margin-top: 60rpx;
|
}
|
|
|
|
|
</style>
|