Ver código fonte

【进度】首页完成

程志平 4 anos atrás
pai
commit
1b894d7d0b

+ 157 - 0
css/index.css

@@ -0,0 +1,157 @@
+html,
+body {
+	margin: 0;
+	padding: 0;
+	width: calc(100% - 0px);
+	height: calc(100% - 0px);
+}
+
+#container {
+	width: 100%;
+	height: 100%;
+	min-width: 1900px;
+	min-height: 960px;
+	max-width: 1920px;
+	max-height: 1080px;
+	background: url(../images/bg.png) no-repeat;
+	background-size: 100% 100%;
+	margin: 0 auto;
+}
+
+#login_form {
+	display: flex;
+	flex-direction: column;
+	justify-content: center;
+	align-items: center;
+	padding: 200px 0 0 1015px;
+	width: 600px;
+}
+
+#title {
+	width: 546px;
+	height: 42px;
+	line-height: 42px;
+	font-size: 42px;
+	font-family: Microsoft YaHei;
+	font-weight: bold;
+	color: #3CADFD;
+	margin-top: 19px;
+	background: linear-gradient(180deg, #4393F8 0%, #535EF0 100%);
+	-webkit-background-clip: text;
+	-webkit-text-fill-color: transparent;
+}
+
+#logo {
+	width: 95px;
+	height: 95px;
+	background: url(../images/logo.png) 0 0 no-repeat;
+	background-size: 95px 95px;
+}
+
+#form-class {
+	margin: 40px;
+}
+
+.layui-input-block {
+	margin-left: 40px;
+}
+
+.layui-form-item {
+	position: relative;
+}
+
+.uname-icon {
+	position: absolute;
+	left: 50px;
+	padding: 0;
+	width: 45px;
+	z-index: 999;
+	height: 58px;
+	line-height: 58px;
+	background: url(../images/yonghuming.png) 20px center no-repeat;
+	background-size: 22px;
+}
+
+.upwd-icon {
+	position: absolute;
+	left: 50px;
+	padding: 0;
+	width: 45px;
+	z-index: 999;
+	height: 58px;
+	line-height: 58px;
+	background: url(../images/mima.png) 20px center no-repeat;
+	background-size: 22px;
+}
+
+.uname {
+	margin: 0;
+	width: 400px;
+	height: 58px;
+	border-radius: 29px;
+	border: 0;
+	padding-left: 60px;
+	background: #F6F7FB;
+	font-size: 26px;
+}
+
+.upwd {
+	margin: 0;
+	width: 400px;
+	height: 58px;
+	background: #F6F7FB;
+	border-radius: 29px;
+	border: 0;
+	padding-left: 60px;
+	font-size: 26px;
+}
+
+input::-webkit-input-placeholder {
+	/* 使用webkit内核的浏览器 */
+	height: 22px;
+	line-height: 22px;
+	font-size: 20px;
+	font-family: Microsoft YaHei-3970(82674968);
+	font-weight: 400;
+	color: #B4B4B4;
+}
+
+input:-moz-placeholder {
+	/* Firefox版本4-18 */
+	height: 22px;
+	line-height: 22px;
+	font-size: 20px;
+	font-family: Microsoft YaHei-3970(82674968);
+	font-weight: 400;
+	color: #B4B4B4;
+}
+
+input::-moz-placeholder {
+	/* Firefox版本19+ */
+	height: 22px;
+	line-height: 22px;
+	font-size: 20px;
+	font-family: Microsoft YaHei-3970(82674968);
+	font-weight: 400;
+	color: #B4B4B4;
+}
+
+input:-ms-input-placeholder {
+	/* IE浏览器 */
+	height: 22px;
+	line-height: 22px;
+	font-size: 20px;
+	font-family: Microsoft YaHei-3970(82674968);
+	font-weight: 400;
+	color: #B4B4B4;
+}
+
+.layui-btn {
+	margin-top: 40px;
+	width: 400px;
+	height: 58px;
+	font-size: 22px;
+	background: linear-gradient(180deg, #4393F8, #535EF0);
+	box-shadow: 1px 4px 16px 0px rgba(84, 136, 254, 0.25);
+	border-radius: 29px;
+}

+ 15 - 0
dev_mag.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="zh">
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1.0">
+	<meta http-equiv="X-UA-Compatible" content="ie=edge">
+	<link rel="stylesheet" href="css/main.css">
+	<title>设备管理</title>
+</head>
+<body>
+	<div id="container">
+		
+	</div>
+</body>
+</html>

BIN
images/add.png


BIN
images/bg.png


BIN
images/diwen.png


BIN
images/duizhang.png


BIN
images/exit.png


BIN
images/feilvshezhi.png


BIN
images/logo.png


BIN
images/mima.png


BIN
images/susheguanli.png


BIN
images/yonghuming.png


BIN
images/yongshuifenxi.png


BIN
images/yue.png


+ 65 - 0
index.html

@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="zh">
+	<head>
+		<meta charset="UTF-8">
+		<meta name="viewport" content="width=device-width, initial-scale=1.0">
+		<meta http-equiv="X-UA-Compatible" content="ie=edge">
+		<link rel="stylesheet" href="./layui/css/layui.css">
+		<link rel="stylesheet" href="./css/index.css">
+		<title>管理首页</title>
+	</head>
+	<body>
+		<div id="container">
+			<div id="login_form">
+				<div id="logo"></div>
+				<div id="title">南昌交通学院热水端管理后台</div>
+				<div id="form-class">
+					<form class="layui-form" action="" lay-filter="example">
+						<div class="layui-form-item">
+							<label class="layui-form-label uname-icon"></label>
+							<div class="layui-input-block">
+								<input type="text" name="username" lay-verify="title" autocomplete="off"
+									placeholder="请输入账号" class="layui-input uname">
+							</div>
+						</div>
+						<div class="layui-form-item">
+							<label class="layui-form-label upwd-icon"></label>
+							<div class="layui-input-block">
+								<input type="password" name="password" placeholder="请输入密码" autocomplete="off"
+									class="layui-input upwd">
+							</div>
+						</div>
+
+						<div class="layui-form-item">
+							<div class="layui-input-block">
+								<button type="button" class="layui-btn" lay-submit="" lay-filter="demo1">登 陆</button>
+							</div>
+						</div>
+					</form>
+				</div>
+			</div>
+		</div>
+		<script src="./js/api.js" charset="utf-8"></script>
+		<script>
+			layui.use(['form', 'layer'], function() {
+				var form = layui.form,
+					layer = layui.layer;
+				window.$ = layui.$;
+
+				//监听提交
+				form.on('submit(demo1)', function(data) {
+					const dt = 'callback(' + JSON.stringify(data.field) + ')';
+					// const dt = JSON.stringify(data.field);
+					// layer.alert(dt, {
+					// 	title: '最终的提交信息'
+					// })
+					// 跨域请求,采用jsonp格式
+					// share_ajax('https://jtishfw.ncjti.edu.cn/jxch-smartmp/HotWaters/wpget_stu.action?data=' + dt,'','','','','jsonp');
+					// 非跨域请求,默认json格式
+					share_ajax('https://jtishfw.ncjti.edu.cn/jxch-smartmp/HotWaters/wpget_stu.action?data=' + dt);
+					return false;
+				});
+			});
+		</script>
+	</body>
+</html>

+ 98 - 0
js/api.js

@@ -0,0 +1,98 @@
+document.write('<script src="./layui/layui.js" charset="utf-8"></script>');
+
+/**
+ * ajax请求公共函数
+ */
+function share_ajax(url, p_data, p_index, p_obj, p_method, p_dataType) {
+	const data = (arguments[1] && arguments[1] !== '') ? arguments[1] : ''; // data
+	const index = (arguments[2] && arguments[2] !== '') ? arguments[2] : ''; // index
+	const obj = (arguments[3] && arguments[3] !== '') ? arguments[3] : ''; // obj
+	const method = (arguments[4] && arguments[4] !== '') ? arguments[4] : 'POST'; // method
+	const data_type = (arguments[5] && arguments[5] !== '') ? arguments[5] : 'JSON'; // dataType
+
+	$.ajax({
+		url: url,
+		type: method,
+		data: data,
+		dataType: data_type,
+		// async: true,
+		// contentType: 'application/json; charset=UTF-8', //'application/x-www-form-urlencoded',
+		// xhrFields: {
+		// 	withCredentials: true
+		// },
+		beforeSend: function() {
+			//请求前的处理
+			console.log('请求前的处理')
+		},
+		success: function(res) {
+			if (res.code === 0) {
+				layer.msg(res.msg, {
+					icon: 1,
+					time: 1000
+				});
+				if (index !== '')
+					layer.close(index);
+				if (obj !== '')
+					obj.del();
+				if (res.url !== '')
+					self.setInterval(function() {
+						self.location = res.url;
+					}, 1000); // 设置时间
+			} else {
+				layer.alert(res.msg, {
+					icon: 5
+				});
+			}
+		},
+		error: function(XMLHttpRequest, textStatus, errorThrown) {
+			// console.log(XMLHttpRequest);
+			if (XMLHttpRequest && typeof(XMLHttpRequest.responseJSON) != 'undefined') {
+				const objJSON = XMLHttpRequest.responseJSON.traces[0];
+				layer.alert(
+					"状态信息:" + textStatus +
+					"<br>状态编码:" + XMLHttpRequest.status + " (" + errorThrown + ")" +
+					"<br>================错误描述========================" +
+					"<br>描述:" + objJSON.message +
+					"<br>编码:" + objJSON.code +
+					"<br>名称:" + objJSON.name +
+					"<br>文件:" + objJSON.file +
+					"<br>行号:" + objJSON.line, {
+						icon: 7,
+						title: '异常提示',
+						area: ['600px', '350px']
+					}
+				);
+			} else if (XMLHttpRequest.statusText === 'success'){
+				layer.alert("请查看控制台(Console)信息!", {
+					icon: 2,
+					title: '出现异常'
+				});
+			} else {
+				layer.alert("请查看控制台(Console)信息!", {
+					icon: 5,
+					title: '未知异常'
+				});
+			}
+		},
+		complete: function() {
+			//请求完成的处理
+			console.log('请求完成的处理')
+		}
+	});
+}
+
+/**
+ * 登出
+ */
+function log_out(url) {
+	$('#logout').click(function(data) {
+		layer.confirm('是否退出登录?', {
+			icon: 3,
+			title: '提示'
+		}, function(index) {
+			share_ajax(url);
+
+			layer.close(index);
+		});
+	});
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
layui/css/layui.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
layui/css/modules/code.css


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
layui/css/modules/laydate/default/laydate.css


BIN
layui/css/modules/layer/default/icon-ext.png


BIN
layui/css/modules/layer/default/icon.png


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
layui/css/modules/layer/default/layer.css


BIN
layui/css/modules/layer/default/loading-0.gif


BIN
layui/css/modules/layer/default/loading-1.gif


BIN
layui/css/modules/layer/default/loading-2.gif


BIN
layui/font/iconfont.eot


Diferenças do arquivo suprimidas por serem muito extensas
+ 554 - 0
layui/font/iconfont.svg


BIN
layui/font/iconfont.ttf


BIN
layui/font/iconfont.woff


BIN
layui/font/iconfont.woff2


Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
layui/layui.js