loginTest.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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. padding: 0;
  31. margin: 0;
  32. }
  33. .logon_bg{
  34. position: absolute;
  35. width:100%;
  36. bottom: 0;
  37. }
  38. .bak{
  39. width: 100%;
  40. height: 100%;
  41. }
  42. .mainDiv{
  43. top: 0;
  44. position: absolute;
  45. width: 100%;
  46. height: 100%;
  47. }
  48. .loginmainDiv{
  49. margin-top: 6.25rem;
  50. width: 100%;
  51. height: 100%;
  52. text-align: center;
  53. }
  54. .footer {
  55. height: 100px;
  56. position: absolute;
  57. bottom: 0;
  58. }
  59. .footer-inner {
  60. margin: 0 auto;
  61. padding: 10px;
  62. text-align: center;
  63. }
  64. .loginbtn{
  65. margin-top: 3.125rem;
  66. width: 95%;
  67. height: 2.5rem;
  68. margin-left: 0.3125rem;
  69. margin-right: 0.3125rem;
  70. }
  71. .title{
  72. color: white;
  73. font-family: 微软雅黑;
  74. font-size: 2.5rem;
  75. }
  76. .loginmain{
  77. margin-top: 3.125rem;
  78. margin-left: 0.3125rem;
  79. margin-right: 0.3125rem;
  80. }
  81. </style>
  82. <script>
  83. var originalHeight=document.documentElement.clientHeight ||document.body.clientHeight;
  84. window.onresize=function(){
  85. var resizeHeight=document.documentElement.clientHeight || document.body.clientHeight;
  86. if(resizeHeight-0<originalHeight-0){
  87. $(".logon_bg").hide();
  88. }else{
  89. $(".logon_bg").show();
  90. }
  91. }
  92. window.onload = function () {
  93. //alert(window.location.href);
  94. if(getQueryString("code")!="") {
  95. $.ajax({
  96. type: "POST",
  97. url: "http://139.196.105.31:8080/LoginService/DMWebservice",
  98. data: {method: 'LoginInterface', data: getQueryString("code")},
  99. dataType: "json",
  100. success: function (json) {
  101. var arr=json[0].data;
  102. var mobile=arr[0].mobile;
  103. userLoginWeChat(mobile);
  104. //alert(arr[0].mobile);
  105. },
  106. error: function (e) {
  107. },
  108. });
  109. }
  110. /*if(localStorage.getItem("jzmm")=="true"){
  111. document.getElementById("jzmm").checked=true;
  112. document.getElementById("username").value=localStorage.getItem("username");
  113. document.getElementById("password").value=localStorage.getItem("password");
  114. }else{
  115. document.getElementById("username").value="";
  116. document.getElementById("password").value="";
  117. }*/
  118. };
  119. function getQueryString(name){
  120. var reg = new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
  121. var r = window.location.search.substr(1).match(reg);
  122. if(r!=null){
  123. return decodeURIComponent(r[2]);
  124. }
  125. return '';
  126. };
  127. function userLoginWeChat(mobile) {
  128. var strSql = "select * from health.系统用户信息表新 t where mobile='"+mobile+"'";
  129. new WsCommonClass ("QueryDataBaseJson",["sql"],[strSql],querySuccess,"queryUserWeChat");
  130. }
  131. function userLogin(){
  132. var username = $("#username").val();
  133. var password = $("#password").val();
  134. var yzm=$("#yzm").val();
  135. if(username == ""){
  136. mui.toast("请输入用户名");
  137. return;
  138. }
  139. if(password == ""){
  140. mui.toast("请输入密码");
  141. return;
  142. }
  143. var strSql = "select t.*,y.random,case WHEN sysdate BETWEEN time and TIMESTAMPADD(SECOND,+60*3,time) " +
  144. "then '0' else '1' END status from health.系统用户信息表新 t left join health.sendmsg y on t.mobile=y.phone " +
  145. " where t.mobile='"+username+"' and t.password='"+password+"'";
  146. //if(password == "1qaz2wsx!")
  147. //strSql = "select * from health.系统用户信息表新 t where t.mobile='"+username+"'";
  148. // 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";
  149. new WsCommonClass("QueryDataBaseJson",["sql"],[strSql],querySuccess,"queryUser");
  150. }
  151. function changejzmm() {
  152. if(document.getElementById("jzmm").checked==true){
  153. var username=$("#username").val();
  154. var password=$("#password").val();
  155. localStorage.setItem("username",username);
  156. localStorage.setItem("password",password);
  157. localStorage.setItem("jzmm","true");
  158. }else{
  159. localStorage.setItem("username","");
  160. localStorage.setItem("password","");
  161. localStorage.setItem("jzmm","false");
  162. }
  163. }
  164. function querySuccess(evt,KeyValue){
  165. if(evt.IsSuc=="Fault"){
  166. mui.toast('用户名或密码错误!\n请输入正确的用户名密码!',{ duration:'long', type:'div' })
  167. return;
  168. }
  169. var jsonData = evt.data;
  170. if(jsonData.length == 0){
  171. //mui.alert('用户名或密码错误!\n请输入正确的用户名密码!', '系统提示', function() {});
  172. mui.toast('用户名或密码错误!\n请输入正确的用户名密码!',{ duration:'long', type:'div' })
  173. return;
  174. }
  175. if(jsonData != null){
  176. if(KeyValue=="queryUser"){
  177. if(jsonData[0].ISSYSTEMUSER=="0"){
  178. localStorage.setItem("district",jsonData[0].DISTRICT);
  179. localStorage.setItem("districtcode",jsonData[0].DISTRICTCODE);
  180. localStorage.setItem("town",jsonData[0].TOWN);
  181. localStorage.setItem("towncode",jsonData[0].TOWNCODE);
  182. localStorage.setItem("town1",jsonData[0].TOWN1);
  183. localStorage.setItem("towncode1",jsonData[0].TOWNCODE1);
  184. localStorage.setItem("ROLE",jsonData[0].ROLE);
  185. localStorage.setItem("username",$("#username").val());
  186. localStorage.setItem("password",$("#password").val());
  187. localStorage.setItem("userid",jsonData[0].ID);
  188. localStorage.setItem("mobile",jsonData[0].MOBILE);
  189. //insertActionRecord('用户登录');
  190. var url = "mainTest.html?district="+jsonData[0].DISTRICT+"&town="+jsonData[0].DISTRICT+"&towncode="+jsonData[0].TOWNCODE+"&date="+getDateStr();
  191. window.location=url;
  192. }else{
  193. mui.toast('该用户无效!')
  194. }
  195. }else if(KeyValue=="queryUserWeChat"){
  196. localStorage.setItem("district",jsonData[0].DISTRICT);
  197. localStorage.setItem("districtcode",jsonData[0].DISTRICTCODE);
  198. localStorage.setItem("town",jsonData[0].TOWN);
  199. localStorage.setItem("towncode",jsonData[0].TOWNCODE);
  200. localStorage.setItem("town1",jsonData[0].TOWN1);
  201. localStorage.setItem("towncode1",jsonData[0].TOWNCODE1);
  202. localStorage.setItem("ROLE",jsonData[0].ROLE);
  203. localStorage.setItem("username",$("#username").val());
  204. localStorage.setItem("password",$("#password").val());
  205. localStorage.setItem("userid",jsonData[0].ID);
  206. localStorage.setItem("mobile",jsonData[0].MOBILE);
  207. //insertActionRecord('用户登录');
  208. var url = "mainTest.html?district="+jsonData[0].DISTRICT+"" +
  209. "&town="+jsonData[0].DISTRICT+"" +
  210. "&towncode="+jsonData[0].TOWNCODE+"" +
  211. "&date="+getDateStr();
  212. window.location=url;
  213. }
  214. }
  215. }
  216. function querySuccessMsg(evt,KeyValue){
  217. if(KeyValue=="sendMsgPhone"){
  218. if(evt.code=="200"){
  219. mui.toast("短信发送成功!");
  220. localStorage.setItem("random",evt.random);
  221. }
  222. }
  223. }
  224. </script>
  225. </head>
  226. <body background="assets/image/login.png" style=" background-repeat:no-repeat ;background-size:100% 100%;background-attachment: fixed;">
  227. <div class="mainDiv">
  228. <div class="loginmainDiv">
  229. <img src="assets/image/loginninin.png" />
  230. <label class="title">无证行医</label>
  231. <br/>
  232. <br />
  233. <label class="title" style="padding-top: 0.625rem;">基层排查客户端</label>
  234. <div class="mui-input-group loginmain" >
  235. <div class="mui-input-row">
  236. <label>用户名:</label>
  237. <input id="username" type="text" class="mui-input-clear" value="" placeholder="请输入用户名">
  238. </div>
  239. <div class="mui-input-row">
  240. <label>密码:</label>
  241. <input id="password" type="password" class="mui-input-password" value="" placeholder="请输入密码">
  242. </div>
  243. <!--<div class="mui-input-row mui-checkbox">
  244. <input type="checkbox" id="jzmm" onchange="changejzmm()">
  245. <label>记住密码 <input id="xcqtContent"></label>
  246. </div>-->
  247. </div>
  248. <button type="button" class="mui-btn mui-btn-primary loginbtn" onclick="userLogin()" >登录 </button>
  249. </div>
  250. </div>
  251. <footer class="footer">
  252. <div class="footer-inner">
  253. <label style="color: white;">ICP备案主体信息:沪ICP备10043767号</label>
  254. <br/><br/>
  255. <label style="color: white;">ICP备案服务信息:沪ICP备10043767号-5A</label>
  256. </div>
  257. </footer>
  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>