添加期末大作业文件夹Project,目前与Assignment5中一致
This commit is contained in:
24
Project/templates/index.html
Normal file
24
Project/templates/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<title>我的12306官网</title>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
var message = "";
|
||||
{% for msg in messages %}
|
||||
message += "{{ msg }}\n";
|
||||
{% endfor %}
|
||||
alert(message);
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Coming soon~</h1>
|
||||
<div><a href="signup.html">点击跳转注册</a></div>
|
||||
<div><a href="modify.html">点击跳转修改账号</a></div>
|
||||
</body>
|
||||
</html>
|
||||
96
Project/templates/modify.html
Normal file
96
Project/templates/modify.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<title>修改账户</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
var message = "";
|
||||
{% for msg in messages %}
|
||||
message += "{{ msg }}\n";
|
||||
{% endfor %}
|
||||
alert(message);
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="#" method="post">
|
||||
<ul>
|
||||
<div>
|
||||
<div>证件号码:</div>
|
||||
<input type="text" id="cardCode" name="cardCode" placeholder="请输入您的证件号码" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>登陆密码:</div>
|
||||
<input type="password" id="password" placeholder="请输入您的密码" required>
|
||||
<input id="encryptedPassword" name="encryptedPassword" type="hidden">
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>修改内容:</div>
|
||||
<select id="modifyType" name="modifyType" onchange="modify.showModifyPassword()" aria-label="请选择您的修改内容" title="请选择您的修改内容" required>
|
||||
<option value="1">删除账户</option>
|
||||
<option value="2">修改密码</option>
|
||||
<option value="3">修改手机号</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifyPassword" style="display: none;">
|
||||
<div>
|
||||
<div>修改密码:</div>
|
||||
<input type="password" id="newPassword" placeholder="6-20位字母、数字或符号">
|
||||
<input id="encryptedNewPassword" name="encryptedNewPassword" type="hidden">
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifyPassword" style="display: none;">
|
||||
<div>
|
||||
<div>确认密码:</div>
|
||||
<input type="password" id="confirmPassword" placeholder="再次输入您的修改密码">
|
||||
</div>
|
||||
</li>
|
||||
<li class="modifymobileNo" style="display: none;">
|
||||
<div>
|
||||
<div>修改手机号:</div>
|
||||
<input type="text" id="mobileNo" name="mobileNo" value title="手机号码" aria-label="手机号码" maxlength="11" placeholder="11位手机号">
|
||||
</div>
|
||||
</li>
|
||||
<div>
|
||||
<button type="submit" onclick="return submitForm()">确认</button>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
</form>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/checkInfo.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/modify.js') }}"></script>
|
||||
<script>
|
||||
function submitForm() {
|
||||
document.getElementById('encryptedPassword').value = md5(
|
||||
document.getElementById('password').value
|
||||
)
|
||||
|
||||
let modifyType = document.getElementById('modifyType').value
|
||||
if (modifyType === '1') {
|
||||
// document.getElementById('newPassword') = ''
|
||||
return true
|
||||
} else if (modifyType == '2') {
|
||||
document.getElementById('encryptedNewPassword').value = md5(
|
||||
document.getElementById('newPassword').value
|
||||
)
|
||||
return checkInfo.checkNewPassword()
|
||||
} else if (modifyType == '3') {
|
||||
return checkInfo.checkMobileNo()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
115
Project/templates/signup.html
Normal file
115
Project/templates/signup.html
Normal file
@@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<title>我的12306注册</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
var message = "";
|
||||
{% for msg in messages %}
|
||||
message += "{{ msg }}\n";
|
||||
{% endfor %}
|
||||
alert(message);
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form action="#" method="post">
|
||||
<ul>
|
||||
<li>
|
||||
<div>
|
||||
<div>用 户 名:</div>
|
||||
<input type="text" id="name" name="name" placeholder="用户名设置成功后不可修改" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>登陆密码:</div>
|
||||
<input type="password" id="password" placeholder="6-20位字母、数字或符号" required>
|
||||
<input id="encryptedPassword" name="encryptedPassword" type="hidden">
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>确认密码:</div>
|
||||
<input type="password" id="confirmPassword" placeholder="再次输入您的登录密码" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>证件类型:</div>
|
||||
<input name="cardTypeCode" id="cardTypeCode" value="1" type="hidden">
|
||||
<select id="cardType" aria-label="请选择您的证件类型" title="请选择您的证件类型" required>
|
||||
<option value="1">中国居民身份证</option>
|
||||
<option value="1">港澳台居民身份证</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>姓 名:</div>
|
||||
<input type="text" id="regist_name" name="regist_name" placeholder="请输入姓名" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>证件号码:</div>
|
||||
<input type="text" id="cardCode" name="cardCode" placeholder="请输入您的证件号码" maxlength="18" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>优惠(待)类型:</div>
|
||||
<select id="passengerType" name="passengerType" aria-label="请选择旅客类型" title="请选择旅客类型" required>
|
||||
<option value="1">成人</option>
|
||||
<option value="2">儿童</option>
|
||||
<option value="3">学生</option>
|
||||
<option value="4">残疾军人</option>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<li style="height: 1px;border-top: 1px dashed #DEDEDE;margin: 15px 0;"></li>
|
||||
<li>
|
||||
<div>
|
||||
<div>邮 箱:</div>
|
||||
<input type="text" id="email" name="email" title="请正确填写邮箱地址" placeholder="请正确填写邮箱地址" aria-label="请正确填写邮箱地址" required>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<div>手机号码:</div>
|
||||
<div>
|
||||
<select id="mobileCode" name="mobileCode" required>
|
||||
<option value="86">+86 中国</option>
|
||||
</select>
|
||||
<input type="text" id="mobileNo" name="mobileNo" value title="手机号码" aria-label="手机号码" maxlength="11" required>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<div>
|
||||
<button type="submit" onclick="return submitForm()">下一步</button>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
</form>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/checkInfo.js') }}"></script>
|
||||
<script>
|
||||
function submitForm() {
|
||||
if (checkInfo.checkCardCode() && checkInfo.checkMobileNo() && checkInfo.checkPassword()) {
|
||||
document.getElementById('encryptedPassword').value = md5(
|
||||
document.getElementById('password').value
|
||||
)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user