123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
- <title>身份认证</title>
- <link rel="stylesheet" type="text/css" href="../common/reset.css"/>
- <link rel="stylesheet" type="text/css" href="./css/identity-authentication.css?v=1"/>
- <script type="text/javascript" src="../common/jquery-2.1.0.js"></script>
- <script type="text/javascript">
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- </script>
- </head>
- <body>
- <div class="container">
- <div class="ID justID">
- <!-- <input id="justImgInput" type="file" accept="image/*" onChange="changeImgID('justImgInput')" /> -->
- <img class="bgImg" src="./img/zheng.png?v=1" />
- </div>
- <p class="certificates-hint">身份证正面照片</p>
- <div class="ID backID">
- <!-- <input id="backImgInput" type="file" accept="image/*" onChange="changeImgID('backImgInput')" /> -->
- <img class="bgImg" src="./img/fan.png?v=1" />
- </div>
- <p class="certificates-hint">身份证反面照片</p>
- <button class="button" onclick="goApply()">立即申请</button>
- </div>
- <!--提示弹框-->
- <div class="alert-info" style="display: none;">
- <!-- tip提示,2s后消失 -->
- <p></p>
- </div>
- </div>
- </body>
- </html>
- <script>
- var qs = parseQueryString(window.location.href);
- $().ready(function () {
- })
- function goApply () {
- // if($(".justID .bgImg").attr('src') == './img/zheng.png'){
- // showMsg('请上传身份证正面照')
- // return;
- // }
- // if($(".backID .bgImg").attr('src') == './img/fan.png'){
- // showMsg('请上传身份证反面照')
- // return;
- // }
- if(qs.type == 2){
- window.location.href='./examineIng.html?type=2'
- }else if(qs.type == 3){
- window.location.href='./examineIng.html?type=3'
- }else{
- window.location.href='./last.html'
- }
- }
- function changeImgID(html) {
- //获取读取我文件的File对象
- var selectedFile = '';
- if(html == 'justImgInput'){
- selectedFile = document.getElementById('justImgInput').files[0];
- }
- if(html == 'backImgInput'){
- selectedFile = document.getElementById('backImgInput').files[0];
- }
- var reader = new FileReader();
- reader.readAsDataURL(selectedFile);
- reader.onload = function () {
- //当读取完成后回调这个函数,然后此时文件的内容存储到了result中,直接操作即可
- // console.log(this)
- var base64Codes = this.result;
- if(html == 'justImgInput'){
- $(".justID .bgImg").attr('src',base64Codes);
- }
- if(html == 'backImgInput'){
- $(".backID .bgImg").attr('src',base64Codes)
- }
- }
- }
- //提示信息
- function showMsg(msg) {
- var msg = msg;
- var msgBox = $('.alert-info');
- msgBox.children('p').text(msg);
- msgBox.show();
- setTimeout(function() {
- msgBox.hide();
- }, 2000);
- }
- //获取地址栏参数
- function parseQueryString(url) {
- var urlObj = {};
- var reg = /([^?=&]+)=([^?=&]+)/g;
- url.replace(reg, function($0, $1, $2) {
- urlObj[$1] = decodeURIComponent($2);
- })
- return urlObj;
- }
- </script>
|