<%--
|
Created by IntelliJ IDEA.
|
User: Dell
|
Date: 2023/6/26
|
Time: 16:10
|
To change this template use File | Settings | File Templates.
|
--%>
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
<html>
|
<head>
|
<title>Title</title>
|
<link rel="stylesheet" href="/HxzkFlow/css/layui.css" media="all">
|
<link href="/HxzkFlow/images/favicon.ico" rel="icon" type="image/x-icon"/>
|
|
</head>
|
<body style="width: 100%;height: 100%;background-color: #EFF1F4">
|
<div></div>
|
<div style="width: 100%;height: 100%;">
|
<div class="layui-card" style="width: 100%;height: 100%;">
|
<div class="layui-card-header">个人信息
|
<button style="margin-left: 50px" id="cancelBtn" class="layui-btn" onclick="enableInputs()">修改</button>
|
</div>
|
<div class="layui-card-body">
|
<form class="layui-form" method="post" action="/HxzkFlow/hxzk/upUser" style="margin-top: 20px" onsubmit="return checkadd()">
|
<input type="text" name="companyabbname" id="gs1" style="display: none">
|
<div class="layui-form-item">
|
<label class="layui-form-label">公司简称</label>
|
<div class="layui-input-block">
|
<input type="text" name="companyabbname1" disabled id="gs" required lay-verify="required" placeholder="请输入简称" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label">登录电话</label>
|
<div class="layui-input-inline">
|
<input type="text" name="" disabled style="width: 260px" id="phone" required lay-verify="required" placeholder="请输入电话" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item" id="sock1" style="display: none">
|
<label class="layui-form-label">新登录电话</label>
|
<div class="layui-input-inline">
|
<input type="text" name="loginphone" style="width: 260px" id="" required lay-verify="required" placeholder="请输入电话" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layui-form-item" id="sock2" style="display: none">
|
<label class="layui-form-label">验证码</label>
|
<div class="layui-input-inline">
|
<input type="text" style="width: 120px" id="yzm" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
|
<input type="button" id="djs" class="layui-btn layui-btn-normal" value="获取验证码" onclick="YanZhengMa()" style="position: relative;left: 150px;top: -38px">
|
</div>
|
</div>
|
|
<div class="layui-form-item" id="sock3" style="display: none">
|
<div class="layui-input-block">
|
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
|
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
<script src="/HxzkFlow/js/layui.js" charset="utf-8"></script>
|
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
|
<script>
|
var Zong = localStorage.getItem("gsjc")
|
var yanzhengma = 0;
|
var huoquyanzhengma = "未获取";
|
$("#gs").val(Zong)
|
$("#gs1").val(Zong)
|
var data = "companyabbname="+Zong
|
$.post("/HxzkFlow/hxzk/findLoginPhone",data,function (data){
|
console.log(data)
|
$("#phone").val(data.loginphone)
|
})
|
|
function enableInputs(){
|
document.getElementById('sock1').style.display = '';
|
document.getElementById('sock2').style.display = '';
|
document.getElementById('sock3').style.display = '';
|
// var inputBoxes = document.getElementById("sock1"); // 获取所有的输入框元素
|
// console.log(inputBoxes.length)
|
// for(var i=0;i<inputBoxes.length;i++){
|
// inputBoxes[i].disabled = false; // 取消禁用状态
|
// }
|
|
}
|
function YanZhengMa() {
|
var phone = $("#phone").val();
|
if (phone == "") {
|
alert("请先输入手机号!")
|
}else {
|
var djs1= $("#djs").val()
|
if(djs1 != "获取验证码"){
|
alert("请耐心等待倒计时结束!")
|
}else{
|
$.ajax({
|
url: '/HxzkFlow/hxzk/Login11',
|
async: false,
|
data: {
|
phone: phone
|
},
|
success: function (data) {
|
yanzhengma = data;
|
}
|
})
|
huoquyanzhengma = "已获取"
|
|
// 设置倒计时的总时长为60秒
|
var totalTime = 60;
|
// 开始倒计时
|
var countdown = setInterval(function () {
|
// 更新剩余时间
|
totalTime--;
|
// 将剩余时间显示在页面上
|
$("#djs").val(totalTime + " 秒") ;
|
// 判断倒计时是否结束
|
if (totalTime <= 0) {
|
// 清除倒计时
|
clearInterval(countdown);
|
// 倒计时结束时的操作
|
$("#djs").val("获取验证码");
|
}
|
}, 1000);
|
}
|
|
}
|
}
|
function checkadd(){
|
if(huoquyanzhengma == "未获取"){
|
alert("请先获取验证码!")
|
return false
|
}else{
|
var yan = $("#yzm").val();
|
if(yanzhengma == yan){
|
return true;
|
}else{
|
alert("验证码不正确!")
|
return false
|
}
|
return false;
|
}
|
}
|
|
/**
|
* 判断用户在规定的时间内没有操作系统,则刷新浏览器
|
* 参数:时间(单位分钟)
|
* */
|
function timeUserFun(time){
|
var time = time || 2;
|
var userTime = 3600;
|
var objTime = {
|
init:0,
|
time:function(){
|
objTime.init += 1;
|
if(objTime.init === userTime){// 达到限制时间时,用户未操作事件,则刷新整个页面
|
localStorage.removeItem("gsjc")
|
sessionStorage.removeItem("admin")
|
alert("您长时间未操作当前页面,请重新登录")
|
var data = "Zong="+sessionStorage.getItem("admin");
|
//获取该用户最新时间
|
$.post("/HxzkFlow/hxzk/userdate",data,function (data){
|
|
})
|
parent.location.reload()
|
//达到限制时间没操作,所要执行的动作
|
}
|
},
|
eventFun:function(){
|
//清除上次监听,重新开始新的监听
|
clearInterval(testUser);
|
objTime.init = 0;
|
testUser = setInterval(objTime.time,1000);
|
}
|
};
|
//监听当前时间流动
|
var testUser = setInterval(objTime.time,1000);
|
|
//监听相应事件
|
var body = document.querySelector('html');
|
body.addEventListener("click",objTime.eventFun);
|
body.addEventListener("keydown",objTime.eventFun);
|
body.addEventListener("mousemove",objTime.eventFun);
|
body.addEventListener("mousewheel",objTime.eventFun);
|
}
|
(function () {
|
timeUserFun(1);
|
|
}(0));
|
//Demo
|
|
</script>
|
</body>
|
</html>
|