登录页面修改

master
zjh19990323 6 years ago
parent 73c93c8a23
commit 0877d8ad68

@ -1,52 +1,52 @@
Page({
formSubmit: function (e) {
wx.request({
url: 'http://localhost:9527/zxlogin/login',
data: {
'userid': e.detail.value.userid,
'userpassword': e.detail.value.userpassword,
},
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
methods: {
method: "POST",
},
success: function (res) {
console.log(res.data);
if (res.data == "111") {
wx.showModal({
title: '登录消息',
content: '密码正确',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
if (res.confirm) {
wx.switchTab({
url: '../shouye/shouye',
})
}
}
})
}
else if (res.data == "100") {
wx.showModal({
title: '登录消息',
content: '密码错误',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
else if (res.data == "001") {
wx.showModal({
title: '登录消息',
content: '用户名不存在',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
},
fail: function (res) {
console.log("失败");
}
})
}
Page({
formSubmit: function (e) {
wx.request({
url: 'http://localhost:9527/zxlogin/login',
data: {
'userid': e.detail.value.userid,
'userpassword': e.detail.value.userpassword,
},
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
methods: {
method: "POST",
},
success: function (res) {
console.log(res.data);
if (res.data == "111") {
wx.showModal({
title: '登录消息',
content: '登录成功',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
if (res.confirm) {
wx.switchTab({
url: '../shouye/shouye',
})
}
}
})
}
else if (res.data == "100") {
wx.showModal({
title: '登录消息',
content: '密码错误',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
else if (res.data == "001") {
wx.showModal({
title: '登录消息',
content: '用户名不存在',
confirmColor: "rgba(253, 153, 65, 1)"
})
}
},
fail: function (res) {
console.log("失败");
}
})
}
})

@ -1,6 +1,3 @@
{
"component": true,
"usingComponents": {}
}

@ -1,15 +1,29 @@
<form bindsubmit="formSubmit" >
<view class="flex-row" style="display: flex;">
<text class="text1" >学号</text>
<input class="inputnumber" maxlength="15" name="userid" placeholder=" 请输入您的学号" type="number" value="{{idTxt}}"/>
</view>
<view class="flex-row" style="display: flex;">
<text class="password" >密码</text></view>
<view class="flex-row" style="display: flex;">
<input class="inputpassword" password="true" name="userpassword" placeholder=" 默认身份证号后六位" type="number"value="{{passwordTxt}}"/>
</view>
<button class="button1" formType="submit" >
登 录</button>
<view class="container">
<view class="login-icon">
<image class="login-img" src="../image/123.jpg"></image>
</view>
<view class="login-from">
<!--账号-->
<view class="inputView">
<label class="loginLab">账号</label>
<input class="inputText" placeholder="请输入账号" bindinput="phoneInput" maxlength="15" name="userid"value="{{idTxt}}" />
</view>
<view class="line"></view>
<!--密码-->
<view class="inputView">
<label class="loginLab">密码</label>
<input class="inputText" name="userpassword" password="true" value="{{passwordTxt}}" placeholder="默认密码身份证后六位" bindinput="passwordInput" />
</view>
<!--按钮-->
<view class="loginBtnView">
<button class="loginBtn" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="login" formType="submit">登录</button>
</view>
</view>
</view>
</form>

@ -1,59 +1,75 @@
/* denglu/denglu.wxss */
page {
background-image: url("http://qty83k.creatby.com/materials/143410/origin/21bbf9caec3fddab4b8304359e2b41bb_origin.jpg"); background-size: 375px 678px;
background-repeat: no-repeat;
}
.button1{
width: 60%;
margin-top: 0rpx;
background-color:rgba(253, 153, 65, 0.67);
color: white;
border-radius: 98rpx;
page{
height: 100%;
}
.container {
height: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-top: 140px;
}
.inputnumber{
width:50%;
background-color: transparent;
height:1.6rem;
font-size: 18px;
margin-left: 15px;
margin-top: 100px;
display: inline;
border-width: 2px;
border-color: rgb(255, 255, 255);
border-style: solid;
color: #ffffff;
}
.inputpassword{
width:50%;
background-color: transparent;
height:1.6rem;
font-size: 18px;
margin-left: 108px;
margin-top: -30px;
border-width: 2px;
border-color: rgb(255, 255, 255);
border-style: solid;
color: #ffffff;
}
.text1{
width: 50px;
font-size: 23px;
color: #ffffff;
margin-left: 43px;
margin-top:100px;
}
.password{width: 50px;
font-size: 23px;
color: #ffffff;
margin-left: 43px;
margin-top:50px;
flex-direction: column;
padding: 0;
box-sizing: border-box;
background-color: #f2f2f2
}
/*登录图片*/
.login-icon{
flex: none;
}
.login-img{
width: 750rpx;
}
}
/*表单内容*/
.login-from {
margin-top: 20px;
flex: auto;
height:100%;
}
.inputView {
background-color: #fff;
line-height: 44px;
}
/*输入框*/
.nameImage, .keyImage {
margin-left: 42px;
width: 14px;
height: 14px
}
.loginLab {
margin: 15px 15px 15px 10px;
color: #545454;
font-size: 14px
}
.inputText {
flex: block;
float: right;
text-align: right;
margin-right: 22px;
margin-top: 11px;
color: #000;
font-size: 14px
}
.line {
width: 100%;
height: 1px;
background-color: #cccccc;
margin-top: 1px;
}
/*按钮*/
.loginBtnView {
width: 100%;
height: auto;
margin-top: 0px;
margin-bottom: 0px;
padding-bottom: 0px;
}
.loginBtn {
width: 80%;
margin-top: 35px;
background-color:rgb(253, 153, 65);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Loading…
Cancel
Save