No Description

identity-authentication.html 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  7. <title>身份认证</title>
  8. <link rel="stylesheet" type="text/css" href="../common/reset.css"/>
  9. <link rel="stylesheet" type="text/css" href="./css/identity-authentication.css?v=1"/>
  10. <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
  11. <script type="text/javascript">
  12. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  13. window.onresize = function(){
  14. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  15. }
  16. </script>
  17. </head>
  18. <body>
  19. <div class="container">
  20. <div class="ID justID">
  21. <!-- <input id="justImgInput" type="file" accept="image/*" onChange="changeImgID('justImgInput')" /> -->
  22. <img class="bgImg" src="./img/zheng.png?v=1" />
  23. </div>
  24. <p class="certificates-hint">身份证正面照片</p>
  25. <div class="ID backID">
  26. <!-- <input id="backImgInput" type="file" accept="image/*" onChange="changeImgID('backImgInput')" /> -->
  27. <img class="bgImg" src="./img/fan.png?v=1" />
  28. </div>
  29. <p class="certificates-hint">身份证反面照片</p>
  30. <button class="button" onclick="goApply()">立即申请</button>
  31. </div>
  32. <!--提示弹框-->
  33. <div class="alert-info" style="display: none;">
  34. <!-- tip提示,2s后消失 -->
  35. <p></p>
  36. </div>
  37. </div>
  38. </body>
  39. </html>
  40. <script>
  41. var qs = parseQueryString(window.location.href);
  42. $().ready(function () {
  43. })
  44. function goApply () {
  45. // if($(".justID .bgImg").attr('src') == './img/zheng.png'){
  46. // showMsg('请上传身份证正面照')
  47. // return;
  48. // }
  49. // if($(".backID .bgImg").attr('src') == './img/fan.png'){
  50. // showMsg('请上传身份证反面照')
  51. // return;
  52. // }
  53. if(qs.type == 2){
  54. window.location.href='./examineIng.html?type=2'
  55. }else if(qs.type == 3){
  56. window.location.href='./examineIng.html?type=3'
  57. }else{
  58. window.location.href='./last.html'
  59. }
  60. }
  61. function changeImgID(html) {
  62. //获取读取我文件的File对象
  63. var selectedFile = '';
  64. if(html == 'justImgInput'){
  65. selectedFile = document.getElementById('justImgInput').files[0];
  66. }
  67. if(html == 'backImgInput'){
  68. selectedFile = document.getElementById('backImgInput').files[0];
  69. }
  70. var reader = new FileReader();
  71. reader.readAsDataURL(selectedFile);
  72. reader.onload = function () {
  73. //当读取完成后回调这个函数,然后此时文件的内容存储到了result中,直接操作即可
  74. // console.log(this)
  75. var base64Codes = this.result;
  76. if(html == 'justImgInput'){
  77. $(".justID .bgImg").attr('src',base64Codes);
  78. }
  79. if(html == 'backImgInput'){
  80. $(".backID .bgImg").attr('src',base64Codes)
  81. }
  82. }
  83. }
  84. //提示信息
  85. function showMsg(msg) {
  86. var msg = msg;
  87. var msgBox = $('.alert-info');
  88. msgBox.children('p').text(msg);
  89. msgBox.show();
  90. setTimeout(function() {
  91. msgBox.hide();
  92. }, 2000);
  93. }
  94. //获取地址栏参数
  95. function parseQueryString(url) {
  96. var urlObj = {};
  97. var reg = /([^?=&]+)=([^?=&]+)/g;
  98. url.replace(reg, function($0, $1, $2) {
  99. urlObj[$1] = decodeURIComponent($2);
  100. })
  101. return urlObj;
  102. }
  103. </script>