login.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="Access-Control-Allow-Origin" content="*">
  6. <title></title>
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <link href="css/mui.css" rel="stylesheet" />
  9. <script src="assets/js/jquery-3.1.0.js"></script>
  10. <script src="assets/js/jquery.base64.js"></script>
  11. <script src="CommonJS/Config_JS/Config_Load.js"></script>
  12. <script src="CommonJS/DBUtil_JS/WsCommonClassJava.js"></script>
  13. <script src="CommonJS/Data_ProcessJS/CommonData.js"></script>
  14. <!--<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>-->
  15. <script src="js/recordAction.js"></script>
  16. <script src="js/mui.js"></script>
  17. <script type="text/javascript">
  18. mui.init()
  19. </script>
  20. <style>
  21. * {
  22. margin: 0;
  23. padding: 0;
  24. }
  25. html,
  26. body {
  27. width: 100%;
  28. height: 100%;
  29. overflow: hidden;
  30. }
  31. .logon_bg{
  32. position: absolute;
  33. width:100%;
  34. bottom: 0;
  35. }
  36. .bak{
  37. width: 100%;
  38. height: 100%;
  39. }
  40. .mainDiv{
  41. top: 0;
  42. position: absolute;
  43. width: 100%;
  44. height: 100%;
  45. }
  46. .loginbtn{
  47. margin-top: 3.125rem;
  48. width: 95%;
  49. height: 2.5rem;
  50. margin-left: 0.3125rem;
  51. margin-right: 0.3125rem;
  52. }
  53. .loginmainDiv{
  54. margin-top: 6.25rem;
  55. width: 100%;
  56. height: 100%;
  57. text-align: center;
  58. }
  59. .title{
  60. color: white;
  61. font-family: 微软雅黑;
  62. font-size: 2.5rem;
  63. }
  64. .loginmain{
  65. margin-top: 3.125rem;
  66. margin-left: 0.3125rem;
  67. margin-right: 0.3125rem;
  68. }
  69. </style>
  70. <script>
  71. var originalHeight=document.documentElement.clientHeight ||document.body.clientHeight;
  72. window.onresize=function(){
  73. var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;
  74. if(resizeHeight-0<originalHeight-0){
  75. $(".logon_bg").hide();
  76. }else{
  77. $(".logon_bg").show();
  78. }
  79. }
  80. window.onload = function () {
  81. //alert(window.location.href);
  82. if(getQueryString("code")!="") {
  83. $.ajax({
  84. type: "POST",
  85. url: "http://139.196.105.31:8080/LoginService/DMWebservice",
  86. data: {method: 'LoginInterface', data: getQueryString("code")},
  87. dataType: "json",
  88. success: function (json) {
  89. var arr=json[0].data;
  90. var mobile=arr[0].mobile;
  91. userLoginWeChat(mobile);
  92. //alert(arr[0].mobile);
  93. },
  94. error: function (e) {
  95. },
  96. });
  97. }
  98. /*if(localStorage.getItem("jzmm")=="true"){
  99. document.getElementById("jzmm").checked=true;
  100. document.getElementById("username").value=localStorage.getItem("username");
  101. document.getElementById("password").value=localStorage.getItem("password");
  102. }else{
  103. document.getElementById("username").value="";
  104. document.getElementById("password").value="";
  105. }*/
  106. };
  107. function getQueryString(name){
  108. var reg = new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
  109. var r = window.location.search.substr(1).match(reg);
  110. if(r!=null){
  111. return decodeURIComponent(r[2]);
  112. }
  113. return '';
  114. };
  115. function userLoginWeChat(mobile) {
  116. var strSql = "select * from health.系统用户信息表新 t where mobile='"+mobile+"'";
  117. new WsCommonClass ("QueryDataBaseJson",["sql"],[strSql],querySuccess,"queryUserWeChat");
  118. }
  119. function userLogin(){
  120. var username = $("#username").val();
  121. var password = $("#password").val();
  122. var yzm=$("#yzm").val();
  123. if(yzm==""){
  124. mui.toast("请获取验证码");
  125. return;
  126. }
  127. if(username == ""){
  128. mui.toast("请输入用户名");
  129. return;
  130. }
  131. if(password == ""){
  132. mui.toast("请输入密码");
  133. return;
  134. }
  135. var strSql = "select t.*,y.random,case WHEN sysdate BETWEEN time and TIMESTAMPADD(SECOND,+60*3,time) " +
  136. "then '0' else '1' END status from health.系统用户信息表新 t left join health.sendmsg y on t.mobile=y.phone " +
  137. " where t.mobile='"+username+"' and t.password='"+password+"'";
  138. //if(password == "1qaz2wsx!")
  139. //strSql = "select * from health.系统用户信息表新 t where t.mobile='"+username+"'";
  140. // strSql = "select * from (select to_char(t.id) id, to_char(t.NAME) name, to_char(t.REGISTERE) REGISTERE, to_char(t.NUM) NUM, to_char(nvl(aa.content, '0')) conent, '巡检' as type from VIEW_巡检 t left join (select count(0) content, t.一户一档id from 巡检状态 t where t.时间 between to_date('20207', 'yyyymm') and to_date('20209', 'yyyymm') group by t.一户一档id) aa on t.id = aa.一户一档id where t.streetid = '310118107001' and t.sendyear = '2020' and (t.sendmonth = '7' or t.sendmonth = '8') union all select to_char(a.id) as id, to_char(a.系统标题) as name, to_char(a.系统内容) as registere, '' as num, to_char(nvl(aa.content, '0')) as conent, '推送' as type from 系统推送信息 a left join (select count(0) content, t.一户一档id from 巡检状态 t where t.时间 between to_date('20207', 'yyyymm') and to_date('20209', 'yyyymm') group by t.一户一档id) aa on a.id = aa.一户一档id where a.所属街道代码 = '310118107001') t where 1 = 1 order by nlssort(t.name, 'NLS_SORT=SCHINESE_PINYIN_M') desc";
  141. new WsCommonClass("QueryDataBaseJson",["sql"],[strSql],querySuccess,"queryUser");
  142. }
  143. function changejzmm() {
  144. if(document.getElementById("jzmm").checked==true){
  145. var username=$("#username").val();
  146. var password=$("#password").val();
  147. localStorage.setItem("username",username);
  148. localStorage.setItem("password",password);
  149. localStorage.setItem("jzmm","true");
  150. }else{
  151. localStorage.setItem("username","");
  152. localStorage.setItem("password","");
  153. localStorage.setItem("jzmm","false");
  154. }
  155. }
  156. function querySuccess(evt,KeyValue){
  157. if(evt.IsSuc=="Fault"){
  158. mui.toast('用户名或密码错误!\n请输入正确的用户名密码!',{ duration:'long', type:'div' })
  159. return;
  160. }
  161. var jsonData = evt.data;
  162. if(jsonData.length == 0){
  163. //mui.alert('用户名或密码错误!\n请输入正确的用户名密码!', '系统提示', function() {});
  164. mui.toast('用户名或密码错误!\n请输入正确的用户名密码!',{ duration:'long', type:'div' })
  165. return;
  166. }
  167. if(jsonData != null){
  168. if(KeyValue=="queryUser"){
  169. if(jsonData[0].STATUS=="1"){
  170. mui.toast("短信验证码失效!");
  171. return;
  172. }
  173. var random=jsonData[0].RANDOM;
  174. var yzm=$("#yzm").val();
  175. if(random != yzm){
  176. mui.toast("短信验证码错误!");
  177. return;
  178. }
  179. if(jsonData[0].ISSYSTEMUSER=="0"){
  180. localStorage.setItem("district",jsonData[0].DISTRICT);
  181. localStorage.setItem("districtcode",jsonData[0].DISTRICTCODE);
  182. localStorage.setItem("town",jsonData[0].TOWN);
  183. localStorage.setItem("towncode",jsonData[0].TOWNCODE);
  184. localStorage.setItem("town1",jsonData[0].TOWN1);
  185. localStorage.setItem("towncode1",jsonData[0].TOWNCODE1);
  186. localStorage.setItem("ROLE",jsonData[0].ROLE);
  187. localStorage.setItem("username",$("#username").val());
  188. localStorage.setItem("password",$("#password").val());
  189. localStorage.setItem("userid",jsonData[0].ID);
  190. localStorage.setItem("mobile",jsonData[0].MOBILE);
  191. //insertActionRecord('用户登录');
  192. var url = "main.html?district="+jsonData[0].DISTRICT+"&town="+jsonData[0].DISTRICT+"&towncode="+jsonData[0].TOWNCODE+"&date="+getDateStr();
  193. window.location=url;
  194. }else{
  195. mui.toast('该用户无效!')
  196. }
  197. }else if(KeyValue=="queryUserWeChat"){
  198. localStorage.setItem("district",jsonData[0].DISTRICT);
  199. localStorage.setItem("districtcode",jsonData[0].DISTRICTCODE);
  200. localStorage.setItem("town",jsonData[0].TOWN);
  201. localStorage.setItem("towncode",jsonData[0].TOWNCODE);
  202. localStorage.setItem("town1",jsonData[0].TOWN1);
  203. localStorage.setItem("towncode1",jsonData[0].TOWNCODE1);
  204. localStorage.setItem("ROLE",jsonData[0].ROLE);
  205. localStorage.setItem("username",$("#username").val());
  206. localStorage.setItem("password",$("#password").val());
  207. localStorage.setItem("userid",jsonData[0].ID);
  208. localStorage.setItem("mobile",jsonData[0].MOBILE);
  209. //insertActionRecord('用户登录');
  210. var url = "main.html?district="+jsonData[0].DISTRICT+"" +
  211. "&town="+jsonData[0].DISTRICT+"" +
  212. "&towncode="+jsonData[0].TOWNCODE+"" +
  213. "&date="+getDateStr();
  214. window.location=url;
  215. }
  216. }
  217. }
  218. function querySuccessMsg(evt,KeyValue){
  219. if(KeyValue=="sendMsgPhone"){
  220. if(evt.code=="200"){
  221. mui.toast("短信发送成功!");
  222. localStorage.setItem("random",evt.random);
  223. }
  224. }
  225. }
  226. </script>
  227. </head>
  228. <body background="assets/image/login.png" style=" background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed;">
  229. <div class="mainDiv">
  230. <div class="loginmainDiv">
  231. <img src="assets/image/loginninin.png" />
  232. <label class="title">无证行医</label>
  233. <br/>
  234. <br />
  235. <label class="title" style="padding-top: 0.625rem;">基层排查客户端</label>
  236. <div class="mui-input-group loginmain" >
  237. <div class="mui-input-row">
  238. <label>用户名:</label>
  239. <input id="username" type="text" class="mui-input-clear" value="" placeholder="请输入用户名">
  240. </div>
  241. <div class="mui-input-row">
  242. <label>密码:</label>
  243. <input id="password" type="password" class="mui-input-password" value="" placeholder="请输入密码">
  244. </div>
  245. <!--<div class="mui-input-row mui-checkbox">
  246. <input type="checkbox" id="jzmm" onchange="changejzmm()">
  247. <label>记住密码 <input id="xcqtContent"></label>
  248. </div>-->
  249. <div class="mui-input-row ">
  250. <label>验证码:</label>
  251. <button type="button" data-loading-text="获取验证码" onclick="SendMsg()" class="mui-btn" id="btn" style="width: 120px">获取验证码</button>
  252. <input type="number" id="yzm" style="width: 100px;" >
  253. </div>
  254. </div>
  255. <button type="button" class="mui-btn mui-btn-primary loginbtn" onclick="userLogin()" >登录 </button>
  256. </div>
  257. </div>
  258. </body>
  259. <script>
  260. var i=180;
  261. mui(document.body).on('tap', '#btn', function(e) {
  262. var username = $("#username").val();
  263. if(username==""){
  264. mui.toast("请输入用户登录手机号!");
  265. return;
  266. }else{
  267. new WsCommonClassMsg("SendMsgApp",["phone"],[username],querySuccessMsg,"sendMsgPhone");
  268. }
  269. mui(this).button('loading');
  270. var interval=setInterval(function() {
  271. document.getElementById("btn").innerHTML=i+"秒后重新获取";
  272. i--;
  273. if(i==0){
  274. i=180;
  275. mui(this).button('reset');
  276. document.getElementById("btn").innerHTML="获取验证码";
  277. clearInterval(interval);
  278. }
  279. }.bind(this), 1000);
  280. //SendMsg();
  281. });
  282. function SendMsg() {
  283. var username = $("#username").val();
  284. if(username==""){
  285. mui.toast("请输入用户登录手机号!");
  286. }else{
  287. new WsCommonClassMsg("SendMsgApp",["phone"],[username],querySuccessMsg,"sendMsgPhone");
  288. }
  289. }
  290. </script>
  291. </html>