var domanUrl = "//" + window.location.host; var base_path = "//test.iamberry.com/rst/wechat"; window.addEventListener('pageshow', function(e) { // 通过persisted属性判断是否存在 BF Cache if(e.persisted) { location.reload(); } }); //ajax loading $(window).ajaxStart(function(){ $(".covers").show(); }); $(window).ajaxStop(function(){ $(".covers").hide(); }); function formatDateFull(now) { now = new Date(now); var year=now.getFullYear(); var month=now.getMonth()+1; if(month<10){ month="0"+month; } var date=now.getDate(); if(date<10){ date="0"+date; } return year+"-"+month+"-"+date; } function formatDateMinute(now) { now = new Date(now); var year=now.getFullYear(); var month=now.getMonth()+1; if(month<10){ month="0"+month; } var date=now.getDate(); if(date<10){ date="0"+date; } var hour=now.getHours(); if(hour<10){ hour="0"+hour; } var Minute=now.getMinutes(); if(Minute<10){ Minute="0"+Minute; } return year+"-"+month+"-"+date+" "+hour+":"+Minute; } function time_before(t){ var minute=1000*60; var hour=minute*60; var day=hour*24; var halfamonth=day*15; var month=day*30; var now=new Date().getTime(); var diffValue=now-new Date().setTime(t); var monthC=diffValue/month; var weekC=diffValue/(7*day); var dayC=diffValue/day; var hourC=diffValue/hour; var minC=diffValue/minute; if(dayC>=1){ result="距离今日还有"+parseInt(dayC)+"天"; }else if(hourC>=1){ result="距离交付还有"+parseInt(hourC)+"小时"; }else if(minC>=2){ result="距离交付还有"+parseInt(minC)+"分钟"; }else{ result="已超过交付时间"; } return result; }; //封装document.getElementById function dc(objectid) { if(document.getElementById && document.getElementById(objectid)) { return document.getElementById(objectid);// w3c dom } else if (document.all && document.all(objectid)) { return document.all(objectid);// msie 4 dom } else if (document.layers && document.layers[objectid]) { return document.layers[objectid];// nn 4 dom.. note: this won't find nested layers } else { return false; } } function getParam(paramName) { paramValue = "", isFound = !1; if(this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) { arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0; while(i < arrSource.length && !isFound) { arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++ } } return paramValue == "" && (paramValue = null), paramValue };