window._d = 5;


//获取短信验证码
//倒计时
var timer;
~ function(w) {
  var g = _myFn.util;
  myFn = {
    /**
     * 请求上下文
     * @type {String}
     */
    prefix: "/pre-loan"
      /**
       * 成功状态
       * @type {Number}
       */
      ,
    successCode: 1
      /**
       * 活体识别上传地址
       */
      ,
    host: "http://testapp.wimift.com/pre-loan" //测试环境
      // ,host: "http://192.168.100.248:18081" //生产环境
      // ,tfs:"http://172.30.0.182:7500/v1/tfs/"//tfs图片地址,生产上面的要修改
      ,
    tfs: "https://img.wimift.com/v1/tfs/" //tfs生产上传图片地址
      /**
        20170925项目迁移更新
        校验用户活体识别分数的接口地址
      **/
      ,
    verifyUserUrl: "/live/fppIndentifyFace.json"

      /**
        20170925项目迁移更新
        图片上传的完整url String
      **/
      ,
    uploadImageUrl: "/live/uploadFacePhoto.json"

      /**
        20170925项目迁移更新
        上传通讯录的完整url String
      **/
      ,
    uploadContactUrl: "/addressBook/saveUcAddressBook.json"

      /**
        20170925项目迁移更新
        上传设备指纹的完整url String
      **/
      ,
    uploadAllDeviceInfoUrl: "/device/uploadFingerprint.json"

      /**
        20170925项目迁移更新
        上传通话记录的完整url String
      **/
      ,
    uploadCallLogUrl: "/callLog/upload.json",

     /**
        上传短信的地址
      **/
     uploadSmsUrl: "/sms/uploadSms.json"

      /**
        全局变量
      **/
      ,
    g: g
      /**
      	产品类型:
      	1001:小贷
      **/
      ,
    productType: "101"
      /**
      	产品编号
      **/
      ,
    productNo: "101001"
      /**
       * 页面公共调用额度端方法参数
       * @type {Object}
       */
      ,
    titleInfo: { "hasTitleBar": true, "backEnable": false, "title": "标题" } //由钱盒调用
    /**
     * md5加密工具
     * @type {[type]}
     */
    ,
    md5: g._MD5.b64_md5
      /**
       * 字符串格式化工具
       * @type {[type]}
       */
      ,
    fs: g._formatStr
      /**
       * 正则表达式对象
       * @type {[type]}
       */
      ,
    reg: _myFn.reg
      /**
       * 获取地址栏的信息
       * @type {[type]}
       */
      ,
    options: g._getURLParam(null, "tpfToken")
      /**
       * 上滑翻页
       * @type {[type]}
       */
      ,
    pullSwitchPage: _myFn.pullSwitchPage
      /**
       * sessionStorage操作工具
       * @type {[type]}
       */
      ,
    ss: _myFn.storageUtil.sessionUtil
      /**
       * 自己又封装了一层的myFn.ajax(function(
       * @type {[type]}
       */
      ,
    ajax: _myFn.ajax.getData
      /**
      //sessionStorage中存储值的key
      说明:
      	initPwdRefer:
      	3: 个人中心 的修改密码 loan/loanResetPwd.html 的 忘记原密码 跳转 至 identification/setPayPwdInput.html

      	5:从 借款主页 /loan/loanMoney.html页面的跳转至 /loan/loanRepayEarly.html
      	6:从 个人中心 借款记录 /loan/loanRecord.html 跳转至  /loan/loanRepayEarly.html
      **/
      ,
    sessionKey: {
      userBaseInfo: "__iboxpapy__microfinance__userBaseInfo" //用户基本信息
        ,
      sensitiveUserInfo: "__iboxpapy__microfinance__sensitiveUserInfo" //用户身份证信息
        ,
      getUCEmgContact: "__iboxpapy__microfinance__getUCEmgContact" //用户紧急联系人信息
        ,
      getUpdateEmgContact: "__iboxpapy__microfinance__getUpdateEmgContact" //修改紧急联系人的信息
        ,
      IDCardPath_shouchi: "_iboxpay_IDCardPath_shouchi" //手持身份证图片存放地址
        ,
      IDCardPath_zheng: "_iboxpay_IDCardPath_zheng" //正面身份证图片存放地址
        ,
      IDCardPath_fan: "_iboxpay_IDCardPath_fan" //反身份证图片存放地址
        ,
      IDCardPath_shouchi_80: "_iboxpay_IDCardPath_shouchi_80" //80*80手持身份证图片存放地址
        ,
      IDCardPath_zheng_80: "_iboxpay_IDCardPath_zheng_80" //80*80正面身份证图片存放地址
        ,
      IDCardPath_fan_80: "_iboxpay_IDCardPath_fan_80" //80*80反身份证图片存放地址
        ,
      loan_info: "_iboxpay_loan_info" //借款详情
        ,
      loan_repaymentPlan: "_iboxpay_loan_repayment_plan" //借款产品详情-环境计划
        ,
      tpl_bankList: "_iboxpay_tpl_bankList" //支持的银行列表
        ,
      tpl_myBankList_credit: "_iboxpay_tpl_myBankList_credit" //我的银行信用卡列表
        ,
      tpl_myBankList_bank: "_iboxpay_tpl_myBankList_bank" //我的银行卡列表
        ,
      productInfo: "__iboxpay_productInfo" //产品信息
        ,
      accountDetail: "__iboxpay_account_detail" //账户信息
        ,
      loanBanCardInfo: "__iboxpay_loan_bank_card_info" //借款银行卡信息
        ,
      earlyRepay: "__iboxpay_early_repay" //提前还款
        ,
      failReason: "__iboxpay_fail_reason" //失败原因
        ,
      successInformation: "__iboxpay_successs_information" //还款成功时的银行信息
        ,
      loanPayMoney: "__iboxpay_loan_pay_money" //借款总额（本金+利息）
        ,
      errorBaseInfo: "__iboxpay_error_base_info" //存储错误的用户信息的字段
        ,
      tempBaseInfo: "__boxpay_temp_base_info" //存储临时输入的数据
        ,
      pagesURL: "__iboxpay_pages_url" //存储页面跳转信息
        ,
      initPwdRefer: "__iboxpay_init_pwd_refer" //标识从哪个页面跳转到修改密码页的,
        ,
      amount: "__iboxpay_amount" //获取可贷款金额
        ,
      loanPayCardEdit: "__iboxpay_loan_pay_card_eidt" //修改的银行卡信息
        ,
      inputPwdPageFlag: "__iboxpay_input_pwd_page_flag" //标识从哪个业务中跳转而来的
        ,
      loanTempCreditBankCard: "__iboxpay_loan_temp_credit_bank_card" //借款时缓存的信用卡信息
        ,
      loanTempSaveBankCard: "__iboxpay_loan_temp_save_bank_card" //借款时缓存的储蓄卡信息
        ,
      loanTempAddCreditBankCard: "__iboxpay_loan_temp_add_credit_bank_card" //添加信用卡时,缓存
        ,
      loanTempAddSaveBankCard: "__iboxpay_loan_temp_add_save_bank_card" //添加储蓄卡时,缓存
        ,
      loanTerm: "__iboxpay_loan_term" //借款周期
        ,
      page: "__iboxpay_loan_page" //翻页页码
        ,
      loanAdvanceRepay: "__iboxpay_loan_advance_repay" //整笔还款数据
        ,
      initSetPwdPrompt: "__iboxpay_init_set_pwd_prompt" //初始化密码提示
        ,
      pengingRepay: "__iboxpay_one_repay_money" //一次性还款中的应还金额
        ,
      stageRepay: "__iboxpay_stage_repay_money" //分期还款中的应还金额
        ,
      advanceRepayExtraInfo: "__iboxpay_stage_advanceRepayExtraInfo" //分期还款中提前还款
        ,
      loanRecordRepay: "__iboxpay_loan_record_repay" //还款记录明细
        ,
      loanHistoryRecord: "__iboxpay_loan_history_record" //还信用卡历史信息缓存
        ,
      isUpdateLoanUserInfo: "__iboxpay_is_update_loan_user_info" //是否要更新用户信息
    }
    //自定义弹出窗
    ,
    $alert: function(msg, okFn, cancelFn, isConfirmFlag, settings) {
        // if($("._temp_mask").length)return false;
        var id = "jihuo-dialog";
        var okId = "jihuo-dialog-btn-ok";
        var cancelId = "jihuo-dialog-btn-cancel";
        var setting = $.extend({
          isTitle: true,
          okClass: "ot",
          cancelClass: "ot",
          okText: "确定",
          cancelText: "取消"
        }, settings || {});
        if ($("body #" + id).length) {
          $("body #" + id).remove();
        }
        var titleHide = setting.isTitle ? "" : "hide";
        var arr = ['<div class="jihuo-dialog hide" id="' + id + '">',
          '<div class="jihuo-dialog-msg">',
          '<div class="jihuo-dialog-msg-title ' + titleHide + '">提示</div>',
          '<div class="jihuo_dialog_msg-content"></div>',
          '</div>',
          '<div class="jihuo-dialog-btn bordertop1px jihuo-dialog-btn-only-ok">',
          '<div class="' + setting.okClass + '" id="' + okId + '">' + setting.okText + '</div>',
          '<div class="borderleft1px ' + setting.cancelClass + '" id="' + cancelId + '">' + setting.cancelText + '</div>',
          '</div>',
          '</div>'
        ];
        $("body").append(arr.join(''));
        $("body #" + id + " .jihuo_dialog_msg-content").html(msg);
        if (isConfirmFlag) {
          $(".jihuo-dialog-btn").removeClass("jihuo-dialog-btn-only-ok");
        }
        g._showDialogNoTitle({
          obj: $("#" + id),
          cancelObj: isConfirmFlag ? $("#" + cancelId) : $("#" + okId),
          okObj: $("#" + okId),
          okFn: okFn,
          cancelFn: isConfirmFlag ? cancelFn : okFn
        });

      }
      /**
       * 获取产品周期
       * @param  {function} fn 回调函数
       * @return {[type]}      [description]
       */
      /*,getTerm:function(fn){
      	var loanTerm=false;//myFn.ss.get(myFn.sessionKey.loanTerm);
      	if(loanTerm){
      		fn&&fn(loanTerm);
      	}else{
      		var product=myFn.getProductInfo();
      		myFn.ajax(function(d){
                  if(d.resultCode==myFn.successCode){
                      fn&&fn(d.terms||[]);
                      myFn.ss.set(myFn.sessionKey.loanTerm,d.terms||[]);
                  }else{
                      myFn.$alert(d.errorDesc);
                  }
              },myFn.prefix+"/product/getProductsInfo.json",{token:myFn.options.token});

      	}
      }*/
      ,
    getTerm: function(fn) {
      var loanTerm = false; //myFn.ss.get(myFn.sessionKey.loanTerm);
      if (loanTerm) {
        fn && fn(loanTerm);
      } else {
        // var product=myFn.getProductInfo();
        myFn.ajax(function(d) {
          if (d.resultCode == myFn.successCode) {
            // fn&&fn(d.data.terms||[]);
            fn && fn(d.data);
            // myFn.ss.set(myFn.sessionKey.loanTerm,d.data.terms||[]);
          } else {
            myFn.$alert(d.errorDesc);
          }
        }, myFn.prefix + "/product/getProductInfoByProductNo.json", { token: myFn.options.token });

      }
    },
    queryOrgDataPullStatus: function(token) {
      myFn.ajax(function(d) {
        if (d.resultCode == 1 && d.data == true) {
          myFn.ajax(function(res) {
            if (res.resultCode == 1) {
              myFn.go("../result/qualificationResultsSuccess.html");
            } else {
              myFn.go("../result/qualificationResultsFail.html", true, true);
            }
          }, myFn.prefix + "/risk/riskFilter.json", {
            token: token
          });
        } else if (d.resultCode == 1 && d.data == false) {
          myFn.go("../result/qualificationResultsFail.html?getDataFail=1", true, true);
        } else {
          myFn.$alert(d.errorDesc);
        }
      }, myFn.prefix + "/uc/queryOrgDataPullStatus.json", {
        token: token
      })
    },
    xToX: function(x) {
        var expr = /^(\d{17}(X|x))$/;
        if (expr.test(x)) {
          var lastWord = x.substring(x.length - 1);
          lastWord = lastWord.toUpperCase();
          x = x.substring(0, x.length - 1) + lastWord;
          return x;
        } else {
          return x;
        }
      }
      //去所有空格
      ,
    replaceSpace: function(str) {
        return str ? str.replace(/\s/g, "") : "";
      }
      //格式化银行卡号4位隔开
      ,
    formatBankCode: function(str) {
        if (g._isEmpty(str)) {
          return "";
        }
        str = myFn.replaceSpace(str);
        var step = 4,
          l = str.length,
          n = parseInt(l / 4);
        if (n > 0) {
          var sa = [],
            i = 0;
          for (; i < n; i++) {
            sa.push(str.substr(4 * i, 4));
          }
          var ends = str.substr(4 * i);
          if (ends.length > 0) {
            sa.push(ends);
          }
          return sa.join(" ");
        } else {
          return str;
        }
      }
      /**
       * 把对象组合为url请求参数
       * @param  {json} obj json对象的参数
       * @return {[type]}     [description]
       */
      ,
    buildURLParamByJSON: function(obj) {
        var str = ""
        if (obj) {
          for (o in obj) {
            str += "&" + o + "=" + obj[o];
          }
        }
        return str;
      }
      /**
       * 格式化金格
       * @param  {String} str           金额字符串
       * @param  {boolean} notNeedSuffix 是否需要小数点后面的,默认是带上的
       * @return {String}               格式化后的
       */
      ,
    formatMoney: function(str, notNeedSuffix) {
        if (str === undefined || isNaN((str + "").replace(/,/g, ""))) {
          return "";
        }
        str += "";
        if (!str) return "";
        var fuhao = str.indexOf("-") > -1 ? "-" : "";
        str = str.replace(/,|-/g, "");
        if (!str) return "";
        var point = str.indexOf(".");
        var suffix = "";
        var prefix = "";
        if (point < 0) {
          suffix = ".00";
          prefix = str;
        } else {
          var ppos = str.indexOf(".");
          suffix = str.substr(ppos);
          if (suffix.length < 3) {
            suffix += "0";
          }
          prefix = str.substring(0, ppos);
        }
        var len = prefix.length;
        var mod = len % 3;
        var zheng = Math.floor(len / 3);
        var first = prefix.substring(0, mod);
        var last = prefix.substr(mod);
        var newPrefix = "";
        for (var i = 0; i < zheng; ++i) {
          newPrefix += last.substr(i * 3, 3) + ",";
        }
        if (first && newPrefix) {
          first = first + ",";
        }
        return fuhao + first + newPrefix.substring(0, newPrefix.length - 1) + (notNeedSuffix ? "" : suffix);

      }
      //跳转
      ,
    go: function(url, noSave, replace) { //noSave:true 不记录当前跳转动作,false:记录,replace：浏览器历史记录
        //页面跳转
        if (!noSave) { //记录当前页面数据
          var pagesURL = myFn.ss.get(myFn.sessionKey.pagesURL);
          if (!pagesURL) { //初始化 currentIndex第一个进入页面的
            pagesURL = { currentIndex: -1, urls: [] };
          }
          // if(pagesURL.currentIndex==-1){
          //跳转前存储当前页面的地址
          pagesURL.currentIndex = pagesURL.currentIndex - 0 + 1;
          pagesURL.urls.push(location.href);
          // }
          // pagesURL.currentIndex=pagesURL.currentIndex-0+1;
          // pagesURL.urls.push(url);
          myFn.ss.set(myFn.sessionKey.pagesURL, pagesURL);
        }
        var href = url + (url.indexOf("?") > -1 ? "&rmd" : "?rmd") + "=" + (+new Date);
        if (replace) {
          window.location.replace(href);
        } else {
          window.location.href = href;
        }

      }
      //给自定义键盘添加事件
      /**
      	complateFn:最后一次密码输入完成后调用,
      	complate:当删除密码时调用
      	firstOverFn:当第一次密码输入完成后调用
      **/
      ,
    bindKeyboardEvent: function(complateFn, deleteFn, firstOverFn) {
        $(".keyboard-content").on("touchend", ".keyboard .td", function() {
          var obj = $(this);
          var value = obj.attr("v");
          var len = 6;
          if (value) {
            var showPwdCircle = $(".show-pwd-first").length ? $(".show-pwd-first").hasClass("hide") ? $(".show-pwd-second") : $(".show-pwd-first") : $(".show-pwd-second");
            var input = showPwdCircle.find(".input");
            var firstPwd = $("#firstPwd");
            var secondPwd = $("#secondPwd");
            var isFirst = showPwdCircle.hasClass("show-pwd-first"); //是否是输入第一次
            if (value == "del") {
              if (input.val().length) { //当里面有值时就删除
                input.val(input.val().substring(0, input.val().length - 1));
                deleteFn && deleteFn();
              }
            } else {
              if (len - 1 == input.val().length) { //当输入最后一个时
                if (isFirst) { //当是第一次输入时
                  //存储密码,显示确认密码
                  if (firstOverFn && !firstOverFn(input.val() + "" + value)) {
                    input.val(input.val() + "" + value);
                    return false;
                  } else {
                    $(".show-pwd-first").addClass("hide");
                    $(".show-pwd-second").removeClass("hide");
                  }
                }
              } else if (input.val().length == len) { //已经输入六位后
                return false;
              }
              input.val(input.val() + "" + value);
              if (!isFirst && len == input.val().length) { //较验两次输入的是否一致
                complateFn && complateFn(firstPwd.val(), secondPwd.val());
              }
            }

          }
        });
      }
      //给自定义键盘添加事件
      /**
      	使用 自定义的输入框来显示输入的密码
      	complateFn:最后一次密码输入完成后调用,
      	complate:当删除密码时调用
      	firstOverFn:当第一次密码输入完成后调用
      **/
      ,
    bindKeyboardEvent2: function(complateFn, deleteFn, firstOverFn) {
      var firstVal = "";
      $(".keyboard-content").off("touchend").on("touchend", ".keyboard .td", function() {
        var obj = $(this);
        var value = obj.attr("v");
        var len = 6;
        //获取第一次或者是第二次
        var isFirst = true;
        var parentContainer = (function() {
          if ($(".first-pwd").hasClass("hide")) {
            isFirst = false;
            return $(".second-pwd");
          } else {
            isFirst = true;
            return $(".first-pwd");
          }

        })();
        var showPwdCircle = parentContainer.find(".pwd-val");
        if (value) {
          var input = parentContainer.find(".password");
          var inputVal = input.val();
          if (value == "del") {
            if (inputVal.length) { //当里面有值时就删除
              var nowLength = inputVal.length - 1;
              input.val(inputVal.substring(0, nowLength));
              showPwdCircle.find(".active:eq(" + nowLength + ")").removeClass("active");
              deleteFn && deleteFn(isFirst);
            }
          } else {
            if (inputVal.length == len) { //已经输入六位后
              return false;
            }
            var allPwd = inputVal + "" + value;
            input.val(allPwd);
            showPwdCircle.find("i:eq(" + inputVal.length + ")").addClass("active");
            if (inputVal.length == len - 1) {
              if (!isFirst) { //输完
                complateFn && complateFn(firstVal, allPwd);
              } else { //第一次输入密码
                firstVal = allPwd;
                firstOverFn && firstOverFn(allPwd);
              }
            }
          }

        }

      });
    },
    checkInputPwd: function(complateFn, deleteFn) {
      $(".show-input-pwd-page").off("touchend").on("touchend", ".keyboard .td", function() {
        var obj = $(this);
        var value = obj.attr("v");
        var len = 6;
        if (value) {
          var showPwdCircle = $(".pwd-val");
          var input = $("#password");
          var inputVal = input.val();
          if (value == "del") {
            if (inputVal.length) { //当里面有值时就删除
              var nowLength = inputVal.length - 1;
              input.val(inputVal.substring(0, nowLength));
              showPwdCircle.find(".active:eq(" + nowLength + ")").removeClass("active");
              deleteFn && deleteFn();
            }
          } else {
            if (inputVal.length == len) { //已经输入六位后
              return false;
            }
            input.val(inputVal + "" + value);
            showPwdCircle.find("i:eq(" + inputVal.length + ")").addClass("active");
            if (inputVal.length == len - 1) {
              complateFn && complateFn(inputVal + "" + value);
            }
          }

        }

      });
    },
    checkCreditInputPwd: function(complateFn, deleteFn) {
        $(".show-input-pwd-pages").off("touchend").on("touchend", ".keyboard .td", function() {
          var obj = $(this);
          var value = obj.attr("v");
          var len = 11;
          if (value) {
            var showPwdCircle = $(".pwd-val");
            var input = $("#secondPwd");
            var inputVal = input.val();
            if (value == "del") {
              if (inputVal.length) { //当里面有值时就删除
                var nowLength = inputVal.length - 1;
                input.val(inputVal.substring(0, nowLength));
                showPwdCircle.find(".active:eq(" + nowLength + ")").removeClass("active");
                deleteFn && deleteFn();
              }
            } else {
              if (inputVal.length == len) { //已经输入六位后
                return false;
              }
              input.val(inputVal + "" + value);
              showPwdCircle.find("i:eq(" + inputVal.length + ")").addClass("active");
              if (inputVal.length == len - 1) {
                complateFn && complateFn(inputVal + "" + value);
              }
            }

          }

        });
      }
      //设置表单值
      ,
    setFormData: function(data, prefix, flag) { //flag false 默认为 id查询,true 为class 查询
        prefix || (prefix = "");
        for (d in data) {
          var el = flag ? $("." + prefix + d) : $("#" + prefix + d);
          if (el.length) {
            var tn = el[0].tagName.toLowerCase();
            var dv = myFn.fs(data[d]);
            dv == "null" && (dv = "");
            if (tn == "select") {
              el.find("option[value='" + dv + "']").attr("selected", true);
            } else if (tn == "div" || tn == "span" || tn == "p") {
              el.html(dv);
            } else {
              el.val(dv);
            }
          }
        }
      }
      //监听表单
      /**
      	frmid 被监听的表单id
      	subBtn 提交按钮
      	grayClass 要移出的灰色按钮
      	expectName 不需要临听的input的名称 字符串 或 数组

      **/
      ,
    checkInput: function(inputs, subBtn, grayClass, checkbox, expectName) {
        var flag = true;
        //检测input是否都已输入
        inputs.each(function(n, obj) {
          var o = $(obj);
          var type = o.attr("type");
          var name = o.attr("name");
          o.val($.trim(o.val()));
          if (type != "checkbox" && type != "radio") {
            if (expectName) { //判断是否在排除的字段内
              if (g._isString(expectName)) { //当传入的是字符串时
                if (name == expectName) {
                  return true;
                }
              } else if (g._isArray(expectName)) {
                var b = false;
                for (var i = 0; i < expectName.length; ++i) {
                  if (name == expectName[i]) {
                    b = true;
                    break;
                  }
                }
                if (b) {
                  return b;
                }
              }
            }
            flag = flag && (o.val().length > 0);
          }
        });
        if (checkbox && checkbox.length) {
          //检测自定义复选框
          if (checkbox.length) {
            checkbox.each(function(n, obj) {
              flag = flag && $(obj).hasClass("checkbox-active");
            });
          }
        }
        if (flag) {
          subBtn.removeClass(grayClass);
        } else {
          subBtn.addClass(grayClass);
        }
      }

      ,
    listenFormInput: function(frmId, subBtn, grayClass, expectName) {
        var frm = $("#" + frmId);
        var inputs = frm.find("input"); //获取表单内的所有的input
        var checkbox = frm.find(".checkbox");
        grayClass = grayClass || "grayBtn";
        inputs.on("input", function() {
          myFn.checkInput(inputs, subBtn, grayClass, checkbox, expectName);
        });
        //监听自定义复选框
        if (checkbox.length) {
          checkbox.off("click").on("click", function() {
            $(this).toggleClass("checkbox-active");
            myFn.checkInput(inputs, subBtn, grayClass, checkbox, expectName);
          });
        }
        myFn.checkInput(inputs, subBtn, grayClass, checkbox, expectName);
      }

      //提交表单
      ,
    submitForm: function(fn, subBtn, grayClass) {
        var obtnText = subBtn.html();
        grayClass = grayClass || "grayBtn";
        subBtn.addClass(grayClass);
        //subBtn.html("提交中。。。");
        fn(function() {
          subBtn.removeClass(grayClass);
          subBtn.html(obtnText);
        }); //当失败时调用的fn;

      }
      //复制对象
      ,
    extendJSON: function(src, desc, isDigui) {
        function isJson(obj) {
          return "[object Object]" == Object.prototype.toString.call(obj);
        }

        function copyJSON(src) {
          var obj = {};
          for (s in src) {
            if (isJson(src[s])) {
              obj[s] = copyJSON(src[s]);
            } else if (src[s] !== undefined) {
              obj[s] = src[s];
            }
          }
          return obj;
        }
        var obj = isDigui ? desc : copyJSON(desc);
        for (s in src) {
          if (isJson(obj[s]) && isJson(src[s])) {
            obj[s] = myFn.extendJSON(src[s], obj[s], true);
          } else if (src[s] !== undefined) {
            obj[s] = src[s];
          }
        }
        return obj;
      }
      /**
       * 设置倒计时
       * @param  {[type]} obj       [description]
       * @param  {[type]} className [description]
       * @param  {[type]} t         [description]
       * @return {[type]}           [description]
       */
      ,
    sendMsgTime: function(obj, className, t) {
        if (t <= -99) {
          clearInterval(timer);
          obj.removeClass(className);
          obj.html("获取验证码");
          return;
        }
        t || (t = 90);
        timer = setInterval(function() {
          if (t <= 0) {
            clearInterval(timer);
            obj.removeClass(className);
            obj.html("获取验证码");
          } else {
            !obj.hasClass(className) && obj.addClass(className);
            obj.html((t--) + "秒后重试");
          }
        }, 1000);
      }
      //清除验证码倒计时
      ,
    sendClearMsgTime: function(obj, className, t) {
        clearInterval(timer);
        obj.removeClass(className);
        obj.html("获取验证码");
      }
      //验证用户手机号的认证手机号的验证码
      ,
    getVerifyCode: function(btnObj, param, grayClass) {
        param["token"] = myFn.options.token;
        grayClass = grayClass || "grayBtn";
        if (!btnObj.hasClass(grayClass)) {
          btnObj.addClass(grayClass);
          // var userInfo
          myFn.ajax(function(d) {
            if (d.resultCode == myFn.successCode) {
              myFn.sendMsgTime(btnObj, grayClass);
            } else {
              myFn.$alert(d.errorDesc, function() {
                btnObj.removeClass(grayClass);
              });
            }
          }, myFn.prefix + "/captcha/getVerifyCode.json", param);
        }
      }
      //获取银行卡四要素验证短信验证码
      ,
    getCheckBankCardVerifyCode: function(btnObj, param, grayClass) {
      param["token"] = myFn.options.token;
      grayClass = grayClass || "grayBtn";
      if (!btnObj.hasClass(grayClass)) {
        btnObj.addClass(grayClass);
        // var userInfo
        myFn.ajax(function(d) {
          if (d.resultCode == myFn.successCode) {
            myFn.sendMsgTime(btnObj, grayClass);
          } else {
            myFn.$alert(d.errorDesc, function() {
              btnObj.removeClass(grayClass);
            });
          }
        }, myFn.prefix + "/captcha/getCheckBankCardVerifyCode.json", param);
      }
    },
    toCheckPwd: function(pwdObj, fn) {
        var pwd = pwdObj.val();
        myFn.ajax(function(d) {
          fn && fn(d);
        }, myFn.prefix + "/uc/verifyPassword.json", {
          token: myFn.options.token,
          passwordMd5: myFn.md5(myFn.fs(pwd)).toUpperCase()
        });
      }
      //验证交易密码
      ,
    validatePassword: function(pwdObj, btnObj, fn, flag) {
        if (btnObj && btnObj.hasClass("grayBtn")) return false;
        myFn.toCheckPwd(pwdObj, function(d) {
          if (d.resultCode == myFn.successCode) {
            fn && fn();
          } else {
            myFn.$alert(d.errorDesc, function() {
              btnObj && btnObj.addClass("grayBtn");
              if (flag === false) {

              } else {
                pwdObj.val("");
              }

            });
          }
        })
      }
      //弹出试的验证交易密码
      ,
    validatePassword2: function(pwdObj, fn) {
        myFn.toCheckPwd(pwdObj, function(d) {
          fn && fn(d);
        });
      }
      //加载完毕图标
      ,
    addLoadOver: function(containerObj, txt) {
        var clsName = "loading";
        var loading = containerObj.find("." + clsName);
        txt || (txt = "<img src='../images/loading.gif'>");
        if (!loading.length) {
          loading = $("<div class='" + clsName + "'>" + txt + "</div>")
          containerObj.append(loading);
        } else {
          loading.html(txt).appendTo(containerObj).removeClass("hide");
        }
        return loading;
      }
      //翻页
      //containerObj 列表容器,加载完毕后的回调函数,最外屋的滚动容器
      ,
    switchPage: function(containerObj, fn, outScroll) {
        var f = false;
        var loading;
        var isLoaded = true;
        outScroll || (outScroll = $(document));
        loading = myFn.addLoadOver(containerObj);

        function over(flag) { //false是本页加载完毕,true:数据全部加载完毕
          f = flag || false;
          if (flag) {
            loading.appendTo(containerObj).html("加载完毕");
          } else {
            loading.addClass("hide");
          }
          isLoaded = true;
        }
        $(window).on("scroll", function() {
          if (f || !isLoaded) return false; //已加载完毕
          var obj = $(this);
          if (obj.scrollTop() + obj.height() + 20 >= containerObj.height()) {
            isLoaded = false;
            fn && fn(over);
            addLoading();
          }
        });
      }
      //客户端版本判断
      ,
    checkAppVersion: function() {
        var cv = myFn.options.clientVersion;
        var rcv = "3.4.1"; //ios
        if (g._isAndroid()) {
          rcv = "3.4.4";
        }
        if (cv && cv < rcv) {
          myFn.$alert("您的APP客户端版本过低,请升级到最新版本");
          return false;
        }
        return true;
      }
      //验证新用户客户端版本判断
      ,
    checkAppVersion346: function() {
        var cv = myFn.options.clientVersion;
        var rcv = "3.4.6"; //ios
        if (g._isAndroid()) {
          rcv = "3.4.6";
        }
        if (cv && cv < rcv) {
          myFn.$alert("您的APP客户端版本过低,请升级到最新版本");
          return false;
        }
        return true;
      }
      //客户端紧急联系人版本判断
      ,
    checkAppVersionUCEmg: function() {
        var cv = myFn.options.clientVersion;
        var rcv = "3.4.5"; //ios
        if (g._isAndroid()) {
          rcv = "3.4.5";
        }
        if (cv && cv < rcv) {
          myFn.$alert("您当前APP版本过低，小贷君无法为您获取联系人信息，请到应用商城下载升级最新版APP（v3.4.6及以上版本介可支持）。");
          return false;
        }
        return true;
      }
      /**
       * 判断三期的兼容版本
       * @return {[type]} [description]
       */
      ,
    checkAppVersion345: function() {
        var cv = myFn.options.clientVersion;
        // alert(JSON.stringify(cv));
        var rcv = "3.4.5"; //ios
        if (g._isAndroid()) {
          rcv = "3.4.6";
        }
        if (cv && cv < rcv) {
          return false;
        }
        return true;
      }
      /**
       * 判断face ++的兼容版本
       * @return {[type]} [description]
       */
      ,
    checkAppVersionFace: function() {
        var cv = myFn.options.clientVersion;
        var rcv = "3.5.2"; //ios
        if (g._isAndroid()) {
          rcv = "3.5.2";
        }
        if (cv && cv < rcv) {
          return false;
        }
        return true;
      }
      /**
       * andriod 3.4.7问题
       * @return {[type]} [description]
       */
      ,
    checkAndroidAppVersion347: function() {
        var cv = myFn.options.clientVersion;
        var rcv = "3.4.7"; //android
        if (g._isAndroid() && cv && cv <= rcv) {
          return false;
        }
        return true;
      }
      /**
       * 迁移后活体识别,活体识别分数，上传通讯录地址改为微米的地址 判断版本号
       * @return {[type]} [description]
       */
      ,
    checkhost368: function() {
    	//容易付版本号 5.4.1
        var cv = myFn.options.clientVersion;
        var rcv = "5.4.0"; //ios
        if (g._isAndroid()) {
          rcv = "5.4.0";
        }
        if (cv && cv < rcv) {
          return false;
        }
        return true;
      }
      /**
       *20170925项目迁移更新
       *判断版本号是否在迁移之后的版本，上传图片地址和分数地址；
       * @return {[type]} [description]
       */
      ,
    returnParams: function(username) {
        var params = {};
        if (myFn.checkhost368()) {
          params = {
            username: username,
            uploadImageUrl: myFn.host + myFn.uploadImageUrl+"?token="+myFn.options.token,
            verifyUserUrl: myFn.host + myFn.verifyUserUrl+"?token="+myFn.options.token
          }
        } else {
          params = {
            username: username
          }
        }
        return params;
      }
      //计算页面滚动值
      ,
    calPageScroll: function(fn) {

      var bst = $("body")[0].scrollTop;
      var bh = $("body")[0].clientHeight;
      var wh = $(window).height();
      //console.log(bst+"  "+bh+"  "+wh);
      if (bh - bst - wh < 30) {
        fn && fn();
      }


    },
    getPayStatus: function(v) {
      var str = "";
      switch (v - 0) {
        case 2:
          str = "还款成功";
          break;
        case 1:
          str = "代扣失败";
          break;
        case 3:
          str = "处理中";
          break;
      }
      return str;
    },
    getResultCodeStatus: function(v) {
        return {
          "0": "还款失败",
          "1": "还款成功",
          "2": "处理中"
        }[v];
      }
      /**
       * 获取还款状态
       * @param  {[type]} v [description]
       * @return {[type]}   [description]
       */
      ,
    getLoanStatusStr: function(v) {
        return {
          "1": "未还款",
          "2": "未还清",
          "3": "逾期",
          "4": "已还款",
          "5": "提前还款",
          "6": "逾期已还款",
          "7": "借款中",
          "8": "借款失败",
          "9": "分期还款中"
        }[v];

      }
      /**
       * 获取还款状态(一次性还是分期)
       * @param  {[type]} v [description]
       * @return {[type]}   [description]
       */
      ,
    getRepayTypeStr: function(v) {
        return {
          "0": "一次性还款",
          "1": "分期还款"
        }[v];

      }
      /*
       *版权信息文字
       */
      ,
    copyrightText: "本服务由微米信息提供"
      /**
       * 上送设备指纹信息,返回风控初始化参数
       * @param  {Function} fn [description]
       * @return {[type]}      [description]
       */
      ,
    uploadDeviceInfor: function(fn, tokenKey, type) {
        var that = this;
        that.ajax(function(d) {
          if (d.resultCode != 1) {
            // that.$alert(d.errorDesc);
          } else {
            fn && fn(d);
          }
        }, myFn.prefix + "/risk/giveDeviceInfo.json", { token: this.options.token, platForm: type || "h5", tokenKey: tokenKey || "" });
      }
      //获取产品信息
      ,
    getProductInfo: function(type) {
        type || (type = myFn.productType);
        var product = myFn.ss.get(myFn.sessionKey.productInfo);
        if (!product) {
          myFn.ajax(function(d) {
            if (d.resultCode == myFn.successCode) {
              product = d.rows[0];
              myFn.ss.set(myFn.sessionKey.productInfo, product);
            } else {
              myFn.$alert(d.errorDesc);
            }
          }, myFn.prefix + "/product/getProductList.json", { token: myFn.options.token, productType: type }, false);
        }
        return product;
      }
      //获取用户的基本信息
      //获取数据
      ,
    getUserBaseInfo: function(callback) { //flag是否要重新刷新获取用户信息
        var userInfo = myFn.ss.get(myFn.sessionKey.userBaseInfo);
        var isUpdateLoanUserInfo = 1; //myFn.ss.get(myFn.sessionKey.isUpdateLoanUserInfo);//值为1则更新
        if (!userInfo || isUpdateLoanUserInfo == 1) {
          myFn.ajax(function(d) {
            if (d.resultCode != myFn.successCode) {
              if (d.errorCode == "box-upa-10091" || d.errorCode == "box-upa-10092" || d.errorCode == "box-upa-10093") {
                myFn.go("../baseInfo/NoMerchantInformation.html"); //跳转到商户信息不全时提示页面
              } else {
                myFn.$alert(d.errorDesc);
              }
            } else {
              userInfo = d;
              myFn.ss.set(myFn.sessionKey.userBaseInfo, d); //存储基本信息
              myFn.ss.set(myFn.sessionKey.isUpdateLoanUserInfo, "0");

              callback && callback(d);
            }
          }, myFn.prefix + "/uc/getLoanUserInfo.json", { token: myFn.options.token }, false);
        } else {
          callback && callback(userInfo);
        }
        return userInfo;
      }
      //获取用户身份证的信息
      ,
    getSensitiveUserInfo: function(callback) { //flag是否要重新刷新获取用户信息
        var sensitiveUserInfo = myFn.ss.get(myFn.sessionKey.sensitiveUserInfo);
        var isUpdateLoanUserInfo = myFn.ss.get(myFn.sessionKey.isUpdateLoanUserInfo); //值为1则更新
        if (!sensitiveUserInfo || isUpdateLoanUserInfo == 1) {
          myFn.ajax(function(d) {
            if (d.resultCode != myFn.successCode) {
              myFn.$alert(d.errorDesc);
            } else {
              sensitiveUserInfo = d;
              myFn.ss.set(myFn.sessionKey.sensitiveUserInfo, d); //存储基本信息
              myFn.ss.set(myFn.sessionKey.isUpdateLoanUserInfo, "0");
              callback && callback(d);
            }
          }, myFn.prefix + "/uc/getSensitiveUserInfo.json", { token: myFn.options.token }, false);
        } else {
          callback && callback(sensitiveUserInfo);
        }
        return sensitiveUserInfo;
      }
      //获取紧急联系人的信息
      ,
    getUCEmgContact: function(callback) { //flag是否要重新刷新获取用户信息
        var getUCEmgContact = myFn.ss.get(myFn.sessionKey.getUCEmgContact);
        var isUpdateLoanUserInfo = myFn.ss.get(myFn.sessionKey.isUpdateLoanUserInfo); //值为1则更新
        if (!getUCEmgContact || isUpdateLoanUserInfo == 1) {
          myFn.ajax(function(d) {
            if (d.resultCode != myFn.successCode) {
              myFn.$alert(d.errorDesc);
            } else {
              getUCEmgContact = d;
              myFn.ss.set(myFn.sessionKey.getUCEmgContact, d); //存储基本信息
              myFn.ss.set(myFn.sessionKey.isUpdateLoanUserInfo, "0");
              callback && callback(d);
            }
          }, myFn.prefix + "/uc/getUCEmgContact.json", { token: myFn.options.token }, false);
        } else {
          callback && callback(getUCEmgContact);
        }
        return getUCEmgContact;
      }
      //定时关闭页面提示框
      ,
    hideLoadTip: function(obj) {
        setTimeout(function() {
          obj.hide();
        }, 1000);
      }
      //获取主账户信息
      // ,getAccountDetail:function(){
      // 	var account=myFn.ss.get(myFn.sessionKey.accountDetail);
      // 	if(!account){
      // 		myFn.ajax(function(d){
      // 			if(d.resultCode==myFn.successCode){
      // 				account=d;
      // 				myFn.ss.set(myFn.sessionKey.accountDetail,d);
      // 			}else{
      // 				myFn.$alert(d.errorDesc);
      // 			}
      // 		},myFn.prefix+"/uc/getAccountDetail.json",{token:myFn.options.token},false);
      // 	}
      // 	return account;
      // }
      //获取可贷款的金额
      ,
    getAmount: function(flag) {
        var amount = myFn.ss.get(myFn.sessionKey.amount);
        if (!amount || flag) {
          myFn.ajax(function(d) {
            if (d.resultCode != myFn.successCode) {
              myFn.$alert(d.errorDesc);
            } else {
              amount = d;
              myFn.ss.set(myFn.sessionKey.amount, d); //存储基本信息
            }
          }, myFn.prefix + "/uc/getSubAccountDetail.json", { token: myFn.options.token }, false);
        }
        return amount;

      }
      /**
       * 调出输入交易密码窗口
       * @param  {function} okFn 密码输入正确后的调用
       * @param  {function} cancelFn 密码输入正确后的调用
       * @return {[type]}      [description]
       */
      ,
    toInputPwd: function(okFn, cancelFn) {
      //设还款
      var Mask = new _myFn.Mask("body");
      var pwdPage = $(".show-input-pwd-page");
      pwdPage.addClass("show-input-pwd-page-show");
      Mask._createMask();
      pwdPage.css({ "z-index": Mask._zIndex + 1 });
      $(".cancel").off("click").on("click", function() {
        Mask._removeMask();
        pwdPage.removeClass("show-input-pwd-page-show");
        $(".pwd-input-error").html("");
        $(".pwd-input .active").removeClass("active");
        $(".ok").removeClass("gt");
        $("#password").val("");
        cancelFn && cancelFn();
      });
      $(".ok").off("click").on("click", function() {
        var obj = $(this);
        if (obj.hasClass("gt")) return false;
        if ($("#password").val().length == 6) {
          obj.addClass("gt");
          myFn.validatePassword2($("#password"), function(dd) {
            if (dd.resultCode == myFn.successCode) {
              okFn && okFn();
            } else {
              $(".pwd-input-error").html(dd.errorDesc);
              obj.removeClass("gt");
            }

          });

        }
      });
      myFn.checkInputPwd();
    },
    toCreditInputPwd: function(okFn, cancelFn) {
      //设还款
      var Mask = new _myFn.Mask("body");
      var pwdPage = $(".show-input-pwd-pages");
      pwdPage.addClass("show-input-pwd-page-show");
      pwdPage.css({ "z-index": Mask._zIndex + 1 });
      $(".ok").off("click").on("click", function() {
        Mask._removeMask();
        pwdPage.removeClass("show-input-pwd-page-show");
        $(".pwd-input-error").html("");
        $(".pwd-input .active").removeClass("active");
        $(".ok").removeClass("gt");
        $("#password").val("");
        cancelFn && cancelFn();
      });
      myFn.checkCreditInputPwd();
    }
  }
}(window);


//加载键盘
$(".keyboard-content").load("../common/keyboard.html?rmd=" + (+new Date));


//初始化input pwd的位置
var $showInputPwdPage = $(".show-input-pwd-page");
var $showInputPwdPages = $(".show-input-pwd-pages");
if ($showInputPwdPages.length) {
  $showInputPwdPages.load("../tpl/creditInputPwd.html?rmd=" + (+new Date), function() {
    var alh = $showInputPwdPages.height();
    $showInputPwdPages.css({ bottom: -alh });
  });
}

if ($showInputPwdPage.length) {


  $showInputPwdPage.load("../tpl/inputPwd.html?rmd=" + (+new Date), function() {
    var alh = $showInputPwdPage.height();
    $showInputPwdPage.css({ bottom: -alh });
  });

  $showInputPwdPage.on("click", ".find-pwd span", function() {
    myFn.$alert("找回密码需要重新验证身份,并设置新密码,您确定吗?", function() {
      return "1"
    }, function() {
      myFn.ss.set(myFn.sessionKey.initPwdRefer, "onInputPwd");
      // myFn.g._appCallBack('setClientInfo',myFn.extendJSON({"title":"设置交易密码"},myFn.titleInfo), function (res) {});
      myFn.go("../identification/loan_authentication_phone.html"); //跳转到设置密码页
//    myFn.go("../identification/setPayPwdInfo.html"); //跳转到设置密码页
    }, true, {
      isTitle: false,
      okClass: "gt",
      okText: "取消",
      cancelText: "确认"
    });
  });
}

function exit() {
  myFn.$alert("确定要退出帮你还吗?", function() {
    myFn.ss.del(myFn.sessionKey.pagesURL);
    myFn.g._appCallBack('exit', {}, function(res) {});
  }, null, true);
}

//返回  以及钱盒调用的
/**
isDel 是否只进行删除数据操作,false,true表示进行删除
delNum 删除的个数,-1:指全部删除
要添加的url
**/
var onBackIsOver = true;

function onBack(isDel, delNum, saveUrl) {
  if (!onBackIsOver) return false;

  var href = location.href; //判断后退直接退出帮你还
  if (href.indexOf('credit/enterZMCredit.html?goToZm') != -1 || href.indexOf('bangnihuan/index_wait.html') != -1 ||
    href.indexOf('baseInfo/loanAuditResult.html') != -1 || href.indexOf('loan/loanMoney.html') != -1 || href.indexOf('bangnihuan/bangnihuanIndex.html') != -1 || href.indexOf('baseInfo/NoMerchantInformation.html') != -1 ||
    href.indexOf('bangnihuan/index_over.html') != -1 || href.indexOf('baseInfo/addUCEmgContact.html') != -1 || href.indexOf('result/qualificationResultsFail.html') != -1 || href.indexOf('loan/BNHindex.html') != -1 || href.indexOf('result/qualificationResultsSuccess.html') != -1 || href.indexOf('baseInfo/writeBankPhoneNo.html') != -1) {
    return exit();
  }
  if ($("html").hasClass("html-go-left")) {
    hideScrollPage();
    return false;
  }

  function reset() { //重置客户端的返回状态
    try {
      myFn.g._appCallBack('setClientInfo', {
        "hasTitleBar": true,
        "hasBackBtn": true,
        "backEnable": true
      }, myFn.titleInfo, function(res) {});
    } catch (e) {

    }
  }
  var pagesURL = myFn.ss.get(myFn.sessionKey.pagesURL);
  onBackIsOver = false;
  if (pagesURL) {
    if (pagesURL.currentIndex <= -1) { //到头了,即退出
      onBackIsOver = true;
      exit();
    } else {
      var url = "";
      delNum = delNum || 1;
      if (delNum == -1) { //清空所有的值
        pagesURL.currentIndex = delNum;
        pagesURL.urls = [];
      } else {
        pagesURL.currentIndex -= delNum;
        url = pagesURL.urls.splice(-delNum);
      }
      if (saveUrl) {
        pagesURL.currentIndex = pagesURL.currentIndex - 0 + 1;
        pagesURL.urls.push(saveUrl);
      }
      myFn.ss.set(myFn.sessionKey.pagesURL, pagesURL);
      onBackIsOver = true;
      if (!isDel && url) { //当不是只删除地址时进行跳转
        reset();
        window.location.href = url; //+(url.indexOf("?")>-1?"&rmd":"?rmd")+"="+(+ new Date);
      }
    }
  } else {
    if (!isDel) {
      onBackIsOver = true;
      myFn.$alert("确定要退出帮你还吗?", function() {
        myFn.g._appCallBack('exit', {}, function(res) {});
      }, null, true);
    } else {
      var pagesURL = {};
      pagesURL.currentIndex = delNum;
      pagesURL.urls = [];
      myFn.ss.set(myFn.sessionKey.pagesURL, pagesURL);
    }
  }
}

//切换自定义复选框按钮
$(".checkbox").on("click", function() {
  var obj = $(this);
  var btnClass = obj.attr("btnClass");
  obj.toggleClass("checkbox-active");
  if (btnClass) {
    if (obj.hasClass("checkbox-active")) {
      $("." + btnClass).removeClass("grayBtn");
    } else {
      $("." + btnClass).addClass("grayBtn");
    }
  }
});


//页内滑动页面
/**
url:要加载的页面的地址
parentContentObj 其父页面
**/
// function hideScrollPage(e){
// 	e&&e.preventDefault();
// 	e&&e.stopPropagation();
// 	var scrollPage=$("#___inner_page_scroll__");
// 	scrollPage.addClass("my-animat-back");
// 	setTimeout(function(){
// 		scrollPage.removeClass("my-animate-go").removeClass("my-animat-back").hide();
// 		new _myFn.Mask("body")._removeMask("___inner_page_scroll_mask__");
// 	},1000);
// 	$(".___inner_page_scroll_mask__").remove();
// 	$("body").css({overflow:"auto"});
// 	$("#content").css({"margin-bottom":"2.5rem",height:"auto",overflow:"auto"});
// 	$("#content").removeClass("content-userSlect");
// }

// function scrollPage(url,parentContentObj){
// 	if(!url)return false;
// 	var id="___inner_page_scroll__";
// 	var page="___inner_page_scroll_page__";
// 	var maskClass="___inner_page_scroll_mask__";
// 	var scrollPage=$("#"+id);
// 	var content=parentContentObj||$("body");
// 	if(!scrollPage.length){
// 		// scrollPage=$("<div id="+id+"><i class='icon-close'></i><div class='"+page+"'></div></div>");
// 		scrollPage=$("<div id="+id+"><div class='"+page+"'></div></div>");
// 		content.css({"overflow-x":"hidden"});
// 		content.append(scrollPage);
// 		$("#"+id+" .icon-close").on("click",hideScrollPage);
// 	}
// 	var mask=new _myFn.Mask("body");
// 	mask._createMask(maskClass);
// 	//$("html").css({overflow:"hidden"});

// 	$("."+maskClass).css({height:"100%"});
// 	$("#content").css({"margin-bottom":0,height:$(window).height(),overflow:"hidden"});

// 	scrollPage.css({"z-index":mask._zIndex+1}).show().addClass("my-animate-go");
// 	$("#content").addClass("content-userSlect");
// 	$("."+page).load(url+(url.indexOf("?")>-1?"&rmd":"?rmd")+"="+(+ new Date));
// }
// $("body").on("tap",".___inner_page_scroll_mask__",hideScrollPage);




//显示文本删除图标
if ($(".input").length) {
  $(".input").on("input", function() {
    var obj = $(this);
    var v = obj.val();
    var p = obj.parent();
    var i = obj.siblings(".clear");
    if (!i.length) {
      i = $("<i class='clear'></i>")
      p.append(i);
    }
    if (v.length > 0) {
      p.addClass("input-div");
    } else {
      p.removeClass("input-div");
    }
  });
  $("body").on("tap", ".clear", function() {
    var obj = $(this);
    obj.siblings(".input").val("");
    obj.parent().removeClass("input-div");
  });
}



//展示协义
$(".to-show-argeement").on("click", function() {
  myFn.go("../bangnihuan/showArguments.html?type=" + $(this).attr("type"));
})

$('#content').append('<section class="copyright"><p>' + myFn.copyrightText + '</p></section>');