修改登录界面

master
Allen 6 years ago
parent b9642a387c
commit a0dc9c2f4f

@ -18,7 +18,7 @@ Page({
if (res.data == "111") {
wx.showModal({
title: '登录消息',
content: '密码正确',
content: '登录成功',
confirmColor: "rgba(253, 153, 65, 1)",
success: function (res) {
if (res.confirm) {

@ -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 class="container">
<view class="login-icon">
<image class="login-img" src="../images/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" size="{{primarySize}}" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="login" formType="submit">登录</button>
</view>
</view>
</view>
<button class="button1" formType="submit" >
登 录</button>
</form>

@ -1,59 +1,74 @@
/* 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: #cccccc;
font-size: 14px
}
.line {
width: 100%;
height: 1px;
background-color: #cccccc;
margin-top: 1px;
}
/*按钮*/
.loginBtnView {
width: 100%;
height: auto;
background-color: rgb(253,253,65);
margin-top: 0px;
margin-bottom: 0px;
padding-bottom: 0px;
}
.loginBtn {
width: 80%;
margin-top: 35px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

@ -20,17 +20,17 @@ public class LoginController {
@Autowired@Qualifier("LoginServiceImpl")
private LoginService loginService;
@RequestMapping("/login")
public void login(int userid, int userpassword,
public void login(int s_id, int s_password,
HttpServletRequest request, HttpServletResponse response) throws IOException {
UserPO userPO=this.loginService.FindByUserid(userid);
UserPO userPO=this.loginService.FindByUserid(s_id);
response.setContentType("text/html;charset=utf-8");
/* 设置响应头允许ajax跨域访问 */
response.setHeader("Access-Control-Allow-Origin", "*");
/* 星号表示所有的异域请求都可以接受, */
response.setHeader("Access-Control-Allow-Methods", "GET,POST");
System.out.println(userid);
System.out.println(s_id);
if(userPO!=null)
if(userpassword==userPO.getUserpassword())
if(s_password==userPO.getUserpassword())
{
System.out.println("密码正确");
Writer out = response.getWriter();

@ -3,7 +3,7 @@ package domain;
import java.io.Serializable;
public class UserPO implements Serializable{
private int userid;
private int s_id;
private int userpassword;
private String username;
public int getUserid() {

@ -6,7 +6,7 @@ import domain.UserPO;
@Repository("UserDAO")
public interface UserDAO {
public UserPO FindByUserid(int userid);
public UserPO FindByUserid(int s_id);
}

@ -4,5 +4,5 @@ import domain.UserPO;
public interface LoginService{
public UserPO FindByUserid(int userid);
public UserPO FindByUserid(int s_id);
}

@ -15,8 +15,8 @@ public class LoginServiceImpl implements LoginService{
private UserDAO userDAO;
public UserPO FindByUserid(int userid){
return this.userDAO.FindByUserid(userid);
public UserPO FindByUserid(int s_id){
return this.userDAO.FindByUserid(s_id);
}
}

Loading…
Cancel
Save