<template>
|
<view class="login-wrap">
|
<pageNav style="width: 100%;">
|
<slot-one>
|
<span class="login-biaoti">唐山市烟草配送客户端</span>
|
</slot-one>
|
</pageNav>
|
<view class="login-wrap-inside">
|
<view class="login-main">
|
<view class="login-bj">
|
<image src="./static/image/login-bj.png" mode="aspectFill"></image>
|
</view>
|
<view class="user-box">
|
<u-form :model="valiFormData" ref="valiFormData">
|
<u-form-item prop="licence">
|
<u-input v-model="valiFormData.licence" class="uni-input" border placeholder="请输入零售许可证号"/>
|
</u-form-item>
|
<u-form-item prop="linker">
|
<u-input v-model="valiFormData.linker" class="uni-input" border placeholder="请输入法人姓名"/>
|
</u-form-item>
|
<!-- <u-form-item prop="phone">
|
<u-input v-model="valiFormData.phone" class="uni-input" border placeholder="请输入手机号码"/>
|
</u-form-item> -->
|
</u-form>
|
<view class="login-btn">
|
<u-button plain hover-class="none" class="dengluBtn" open-type="getUserInfo" @getuserinfo="appLoginWx('valiFormData')">立 即 绑 定</u-button>
|
</view>
|
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
valiFormData: {
|
licence: '',
|
openId:'',
|
linker:'',
|
// phone:''
|
},
|
rules: {
|
licence:[
|
{
|
required: true,
|
message: '零售许可证号不能为空',
|
trigger: ['change', 'blur']
|
}
|
],
|
linker:[
|
{
|
required: true,
|
message: '法人姓名不能为空',
|
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) {
|
if(this.valiFormData.openId.length != 28) {
|
this.$u.toast('openId不正确')
|
return
|
}
|
this.$u.api.bindWx(this.valiFormData).then(res => {
|
if(res.success) {
|
this.$store.commit('login',res.result)
|
// this.$store.commit('setOpenId',res.result.openId)
|
uni.switchTab({
|
url: '/pages/home/home'
|
})
|
}else {
|
this.$u.toast(res.message)
|
}
|
})
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
|
</style>
|
<style lang="scss" scoped>
|
/deep/ .u-btn--default{
|
background-color: transparent!important;
|
color: #fff!important;
|
}
|
/deep/ .u-hairline-border:after{
|
border:none!important;
|
}
|
/deep/ .u-border-bottom:after, .u-border-left:after, .u-border-right:after, .u-border-top-bottom:after, .u-border-top:after, .u-border:after{
|
border-bottom-style:none!important;
|
}
|
.login-wrap {
|
width: 100%;
|
// height: 100vh;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
}
|
.login-biaoti{
|
font-size: 32rpx;
|
color: #FFFFFF;
|
line-height: 88rpx;
|
margin-top: 88rpx;
|
display: inline-block;
|
margin-left: 40rpx;
|
font-weight: Light;
|
letter-spacing: 1rpx;
|
}
|
.login-bj{
|
width: 627rpx;
|
height: 447rpx;
|
margin-top: 40rpx;
|
image{
|
width: 100%;
|
}
|
}
|
.login-btn{
|
display: flex;
|
justify-content: center;
|
}
|
.login-flex-box{
|
display: flex;
|
}
|
.login-wrap-inside {
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
|
.login-main {
|
display: flex;
|
flex-direction: column;
|
margin-top: 20%;
|
|
.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: #1F9F4C;
|
color: #fff;
|
font-size: 30rpx;
|
width: 280rpx;
|
height: 76rpx;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
margin-top: 60rpx;
|
}
|
|
|
|
|
</style>
|