Przeglądaj źródła

【提交内容】:场景演示

wangyj18 9 lat temu
rodzic
commit
96bc5f105d

BIN
display-server/web/biz/img/scene/login_success.png


+ 12 - 25
display-server/web/biz/js/scene/Login.js

@ -1,11 +1,13 @@
1 1
require(["wmTabbar","common","mobile","util"], function(WmTabbar,Common,Mobile) {
2 2

3
	// 页面初始化,初始化验证码
3 4
	Common.callSvc("SceneBean.initVerifyCode", null, function(resultData){
4 5
		if(typeof(resultData) == "string" ){
5 6
			resultData = new Wade.DataMap(resultData);
6 7
		}
7 8
		$("#J_ver_img").attr("src", "data:image/png;base64, " + resultData.get("VERIFY_IMG"));
8
		// 保存session_id
9
		
10
		// 保存session_id(以后每次请求,都会在Common中自动添加此SessionId,以便通过Session校验)
9 11
		Common.put("SESSION_ID", resultData.get("SESSION_ID"));
10 12
	});
11 13
	
@ -17,44 +19,29 @@ require(["wmTabbar","common","mobile","util"], function(WmTabbar,Common,Mobile)
17 19
			}
18 20
			$("#J_ver_img").attr("src", "data:image/png;base64, " + resultData.get("VERIFY_IMG"));
19 21
			$("#J_ver").val("");
20
			$("#J_ver").select();
21 22
		});
22 23
	})
23 24
	
25
	// 登录
24 26
	$("#sceneLoginBtn").tap(function(){
25 27
		var loginData = new Wade.DataMap();
26 28
		loginData.put("USER_NAME", $("#J_username").val());
27 29
		loginData.put("USER_PASSWORD", $("#J_pwd").val());
28 30
		loginData.put("VERIFY_CODE", $("#J_ver").val());
29 31
		
32
		// 将前台输入的参数传至后台校验
30 33
		Common.callSvc("SceneBean.login",loginData,function(data){
31 34
			console.log("结果[用户登陆]:" + data);
32
			//校验不正确
33
			if("0" != data.get("X_RESULTCODE")){
34
				$("#mention").text(data.get("X_RESULTINFO"));
35 35
			
36
			//校验正确	
37
			}else{
38
				Mobile.tip("亲爱的【"+data.get("ACCOUNT")+"】用户,登陆成功");
36
			if(typeof(resultData) == "string" ){
37
				resultData = new Wade.DataMap(resultData);
39 38
			}
39

40
			// 登录成功或失败之后的操作
41
			$("#retMsg").text("亲爱的【"+data.get("ACCOUNT")+"】用户,登陆成功");
42
			$("#loginForm").hide();
43
			$("#loginResult").show();
40 44
		});
41 45
	});
42 46
	
43
//	var loginData = new Wade.DataMap();
44
//	loginData.put("ACCOUNT","测试工号");
45
//	loginData.put("PASSWORD", "");
46
//	
47
//	Common.callSvc("LoginBean.login",loginData,function(data){
48
//		console.log("登陆成功:" + data);
49
//		Common.put("SESSION_ID",data.get("SESSION_ID"));
50
//		setTimeout(function(){
51
//			data.put("NEW_ACCOUNT","更新工号");
52
//			Common.callSvc("LoginBean.setLoginInfo",data,function(result){
53
//				console.log("更新信息:" + result);
54
//				Common.callSvc("LoginBean.getLoginInfo",null,function(result){
55
//					console.log("获取信息:" + result);
56
//				});
57
//			});
58
//		},200);
59
//	});
60 47
});

+ 12 - 11
display-server/web/biz/js/scene/TemplateRedirect.js

@ -1,12 +1,13 @@
1
2
require(["mobile","util"], function(Mobile) {
3
	
4
	// 开始游戏
5
	$("#startGame").tap(function(){
6
		
7
		// 页面跳转
8
		var param = new Wade.DataMap();
9
		Mobile.openTemplate("SceneBean_dataRequest",param);
10
	});
11
	
1

2
require(["mobile","util"], function(Mobile) {
3
	
4
	// 开始游戏
5
	$("#startGame").tap(function(){
6
		
7
		// 页面跳转需要渲染的数据
8
		var param = new Wade.DataMap();
9
		param.put("TemplateRedirectData","页面跳转(直接数据渲染)传过来的数据")
10
		Mobile.openTemplate("SceneBean_dataRequest",param);
11
	});
12
	
12 13
});

+ 3 - 2
display-server/web/template/webapp/scene/DataRequest.html

@ -64,7 +64,7 @@
64 64
				<tbody>
65 65
					<tr>
66 66
						<td width="30%"><label class="des">输入人名:</label></td>
67
						<td><input value="" type="text" id="J_username" name="J_username" class="ui-input ui-nt" maxlength="20" title="姓名"></td>
67
						<td><input value="{%TemplateRedirectData%}" type="text" id="J_username" name="J_username" class="ui-input ui-nt" maxlength="20" title="姓名"></td>
68 68
					</tr>
69 69
					<tr>
70 70
						<td>&nbsp;</td>
@ -84,7 +84,7 @@
84 84
						<td id="retName"></td>
85 85
					</tr>
86 86
					<tr>
87
						<td width="30%"><label class="des">评价:</label></td>
87
						<td><label class="des">评价:</label></td>
88 88
						<td id="retMsg"></td>
89 89
					</tr>
90 90
					<tr>
@ -96,6 +96,7 @@
96 96
				</tbody>
97 97
			</table>
98 98
		</div>
99
		
99 100
	</form>
100 101
	
101 102
</div>

+ 10 - 1
display-server/web/template/webapp/scene/Login.html

@ -50,6 +50,10 @@
50 50
	width: 1rem;
51 51
	height: 0.4rem;
52 52
}
53
#loginResult span {
54
	line-height: 0.4rem;
55
    height: 0.4rem;
56
}
53 57
</style>
54 58
</head>
55 59
<body>
@ -64,7 +68,7 @@
64 68
	
65 69
	<div class="m_content m_content-nofooter" id="content">
66 70
		<form class="reg_form">
67
			<table class="reg_table" cellpadding="0" cellspacing="0" border="0" width="100%">
71
			<table class="reg_table" cellpadding="0" cellspacing="0" border="0" width="100%" id="loginForm">
68 72
				<tbody>
69 73
					<tr>
70 74
						<td width="30%"><label class="des">用户名:</label></td>
@ -89,6 +93,11 @@
89 93
					</tr>
90 94
				</tbody>
91 95
			</table>
96
			
97
			<div id="loginResult" style="text-align: center;display: none;">
98
				<img src="biz/img/scene/login_success.png"/><br><br>
99
				<span id="retMsg"></span>
100
			</div>
92 101
		</form>
93 102
	</div>
94 103
</body>

+ 2 - 2
display-server/web/template/webapp/scene/Scene.html

@ -21,14 +21,14 @@
21 21
<div>
22 22
	<div class="c_list">
23 23
		<ul id="scene-menu">
24
			<li action="testCalendar">
24
			<!-- <li action="testCalendar">
25 25
				<div class="content">
26 26
					<div class="main">
27 27
						<div class="title">日历测试</div>
28 28
						<div class="info">暂时先放在这里!!!</div>
29 29
					</div>
30 30
				</div>
31
			</li>
31
			</li> -->
32 32
			
33 33
			<li action="SceneBean_login_init">
34 34
				<div class="content">