xml地图|网站地图|网站标签 [设为首页] [加入收藏]

5929皇家赌场js常用util

来源:http://www.ccidsi.com 作者:集成介绍 人气:126 发布时间:2019-05-05
摘要:/**到月日期格式*/ function monthFormatter(date) {  return date.Format("yyyy-MM"); } /**到月解析日期*/ function monthParser(date) {  if(date != "") {   date = "-01";   return new Date(Date.parse(date.replace(/-/g, "/")));  

/**到月日期格式*/
function monthFormatter(date) {
 return date.Format("yyyy-MM");
}
/**到月解析日期*/
function monthParser(date) {
 if(date != "") {
  date = "-01";
  return new Date(Date.parse(date.replace(/-/g, "/")));
 } else {
  return new Date(); 
 }
}

config.debug = true;

/**听大人讲iframe对象拿到iframe的window对象*/
function GetFrameWindow(frame){
 return frame && typeof(frame)=="object" && frame.tagName == "IFRAME" && frame.contentWindow;
}

};

/**处理datagrid合并*/
function sks_handleMerge(id, obj) {
 for(var i in obj) {
  var arr = obj[i];
  if(null != arr && arr.length > 0) {
   for(var j in arr) {
    $(id).datagrid("mergeCells", {
     index : arr[j].index,
     type : "footer",
     field : i,
     rowspan : arr[j].rowspan,
     colspan : 0
    });
   }
  }
 }
}

}

/**
 * 将目的转成get请求参数方式
 * 如?param1=value1¶m2=value2
 */
function changeParamToStr(param) {
 var result = "";
 if (param) {
  for ( var i in param) {
   result = "&" i "=" param[i];
  }
 }
 if (result != "") {
  result = "?" result.substring(1);
 }
 return result;
}

}
} else {
var tjArr = localStorage.getItem("jsArr") ? localStorage.getItem("jsArr") : '[{}]';
var dataArr = {

/** 获取当前月的起止日期 */
Date.prototype.getCurrentMonth = function(date) {
 var today;
 if (null == date || undefined == date || date == "") {
  today = this;
 } else {
  today = date;
 }
 var year = today.getFullYear();
 var month = today.getMonth();
 var firstDay = new Date(year, month, 1);
 if (month == 11) {
  month = 0;
  year ;
 } else {
  month ;
 }
 var nextDay = new Date(year, month, 1);
 var resultObj = new Object();
 resultObj['startDate'] = firstDay.Format("yyyy-MM-dd");
 resultObj['endDate'] = new Date(nextDay.valueOf() - 24 * 60 * 60 * 1000)
   .Format("yyyy-MM-dd");
 return resultObj;
};

window.alert = function(str) {

/**创建上传窗口 公共措施,chunk 是或不是分割大文件,callBack 上传成功之后的回调*/
function Uploader(root, param,callBack){
 var addWin = $("<div style='overflow: hidden;'/>");
 var upladoer = $("<iframe/>");
 upladoer.attr({"src":root "/plupload/uploader.jsp" changeParamToStr(param),
   width:"100%",height:"100%",frameborder:"0",scrolling:"no"});
 addWin.window({
  title:"上传文件",
  height:350,
  width:550,
  minimizable:false,
  modal:true,
  collapsible:false,
  maximizable:false,
  resizable:false,
  content:upladoer,
  onClose:function(){
   var fw = GetFrameWindow(upladoer[0]);
   var files = fw.files;
   $(this).window("destroy");
   callBack.call(this,files);
  },
  onOpen:function(){
   var target = $(this);
   setTimeout(function(){
    var fw = GetFrameWindow(upladoer[0]);
    fw.target = target;
   },100);
  }
 });
}

localStorage.setItem("jsArr", jsArr);

/**减1天正式格式(yyyy-MM-dd)  */
function reduceOneDay(date) {
 var dateTime = new Date(Date.parse(date.replace(/-/g, "/")));
 var result = new Date(dateTime.getTime() - 24*60*60*1000);
 return result.Format("yyyy-MM-dd");
}

i.style.display = 'none';

 for ( var k in o) {
  if (new RegExp("(" k ")").test(format)) {
   format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k]
     : ("00" o[k]).substr(("" o[k]).length));
  }
 }
 return format;
};

},

/** 获取当前周的起止日期 */
Date.prototype.getCurrentWeek = function(date) {
 var today;
 if (null == date || undefined == date || date == "") {
  today = this;
 } else {
  today = date;
 }
 var week = today.getDay();
 if (week == 0) {
  week = 7
 }
 var startDate = new Date(today.valueOf() - (week - 1) * 24 * 60 * 60 * 1000);
 var endDate = new Date(startDate.valueOf() 6 * 24 * 60 * 60 * 1000);
 var resultObj = new Object();
 resultObj['startDate'] = startDate.Format("yyyy-MM-dd");
 resultObj['endDate'] = endDate.Format("yyyy-MM-dd");
 return resultObj;
};

/*用浏览器内部调换器实现html转码*/

/**到年日期格式*/
function yearFormatter(date) {
 return date.Format("yyyy");
}
/**到年解析日期*/
function yearParser(date) {
 if(date != "") {
  date = "-01-01";
  return new Date(Date.parse(date.replace(/-/g, "/")));
 } else {
  return new Date(); 
 }
}

getBeforeDay: function(date, days) {
var date = date || new Date();

    var dialog = $("<div class='diy-msk'></div>").dialog({
  modal : true
 });
 $(dialog).parent().css("display", "none");
 $(dialog).parent().next().css("display", "none");
 
    $("<div class='datagrid-mask-msg'></div>").html(!msg ? "正在管理中,请稍候..." : msg)
        .appendTo(selector).css({
            display : "block",
            left : ($(document.body).outerWidth(true) - 190) / 2,
            top : offset.top ($(selector).height() - 45) / 2
        });
}

}

/** 日期格式化 */
Date.prototype.Format = function(format) {
 var o = {
  "M " : this.getMonth() 1, // month
  "d " : this.getDate(), // day
  "H " : this.getHours(), // hour
  "m " : this.getMinutes(), // minute
  "s " : this.getSeconds(), // second
  "q " : Math.floor((this.getMonth() 3) / 3), // quarter
  "S" : this.getMilliseconds()
 // millisecond
 };

title: param.infoTitle,

/**移除等待遮罩层*/
function removeLoad(selector) {
 $(selector " .panel window").remove();
 $(selector " .window-shadow").remove();
 $(selector " .window-mask").remove();
 $(selector " .datagrid-mask-msg").remove();
}

},

 if (/(y )/.test(format)) {
  format = format.replace(RegExp.$1, (this.getFullYear() "")
    .substr(4 - RegExp.$1.length));
 }

},

/**管理等待遮罩层*/
function onLoading(selector, msg) {
    var offset = $(selector).offset();

// 查询字符串

/** 通过时间回到中文星期 */
function getChineseWeek(date) {
 var d = new Date(date.replace(/-/g, "/"));
 var week = d.getDay();
 var str;
 if (week == 0) {
  str = "日";
 } else if (week == 1) {
  str = "一";
 } else if (week == 2) {
  str = "二";
 } else if (week == 3) {
  str = "三";
 } else if (week == 4) {
  str = "四";
 } else if (week == 5) {
  str = "五";
 } else if (week == 6) {
  str = "六";
 }
 return "星期" str;
}

// 微信分享

/** 数字格式化 */
function numberFormat(s, n) {
 n = n > 0 && n <= 20 ? n : 2;
 var m = parseFloat(s "") < 0 ? "-" : "";
 s = parseFloat((Math.abs(s) "").replace(/[^d.-]/g, "")).toFixed(n) "";
 var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
 t = "";
 for (i = 0; i < l.length; i ) {
  t = l[i] ((i 1) % 3 == 0 && (i 1) != l.length ? "," : "");
 }
 return m t.split("").reverse().join("") "." r;
}

error: function(err) {

imgUrl: param.imgUrl,

return str.replace(/(&|<|>|"|'| )/g, function(str, item) {

'd ': date.getDate(), //day

// 删除空白字符串

}

return new Date(Date.parse(date.toString()) - 86400000 * days);

setTimeout(function() {

wx.onMenuShareAppMessage({//分享朋友

countStayTime: function() {
var second = 0;

'<': '<',

}

return str.replace(/(&|<|>|"|'| )/g, function(str, item) {

window.setInterval(function() {

return;
} else if (Object.prototype.isPrototypeOf(tmp) && Object.keys(tmp).length === 0) {
// 空对象

}

},

'm ': date.getMinutes(), //minute

'<':'<',

'q ': Math.floor((date.getMonth() 3) / 3), //quarter
'S': date.getMilliseconds() //millisecond

referrer = window.parent.document.referrer;
} catch (e2) {

authType: '1'

context = r[2];

Backbone.ajax({
url: '/plug/do/A2ATApp/saveCustomerInfo',

appVersion: 'appVersion'

},

});

window.onbeforeunload = function() {
if ($.cookie('tjRefer') == '') {
var tjT = eval('(' localStorage.getItem("jsArr") ')');
if (tjT) {

//正则解码

},

};

formatDate: function(date, format) {
var o = {

});

/*用浏览器内部调换器完毕html解码*/

second ;
}, 1000);
var tjArr = localStorage.getItem("jsArr") ? localStorage.getItem("jsArr") : '[{}]';

delBlankSpace: function(str) {
var str = str.replace(/</?[^>]*>/gim, "");// 去掉全部的html标识
var result = str.replace(/(^s )|(s $)/g, "");// 去掉前后空格

}
reg = null;
r = null;

code: wxCode,

i.remove();
}, 9);

},

referrer = document.referrer;

blankRegExp: function(str) {
if (typeof str != "string")

noAlert : function(){

imgUrl: param.imgUrl,

isWeixin: function() {
var ua = navigator.userAgent.toLowerCase();

});

alert('error==' JSON.stringify(e));

$.cookie('tjRefer', getReferrer(), {

operatorType: 'operatorType',

dataType: "JSON",

document.title = t;
var i = document.createElement('iframe');

success: function() {

console.log('请求页面报错: ' err);

return;
} else if (typeof (tmp) == "undefined") {
// undefined

return format;

};

}

},

},

tjT[tjT.length - 1].time = second;
var jsArr = JSON.stringify(tjT);

});

}
for ( var k in o) {
if (new RegExp('(' k ')').test(format)) {

document.body.appendChild(i);

referrer = window.top.document.referrer;
} catch (e) {
if (window.parent) {
try {

},

*/

};
if (/(y )/.test(format)) {

return standTime; //单位:s

},

});

success && success();
} else {

}

'timeOut': Date.parse(new Date()) (second * 1000)

title: param.infoTitle,

link: param.link, // 分享链接

 

// 获取过去的n天

};

},

'h ': date.getHours(), //hour

});

error: function(e) {

tjArr = eval('(' tjArr ')');

' ':' '

// 获取页面停留时间,重视jquery.cookie.js

'>':'>',

dataType: 'json',

wx.onMenuShareTimeline({//分享朋友圈

'timeIn': Date.parse(new Date()),

shareToWeiXin: function(param, success, cancel, mSuccess, mCancel) {
var self = this;
// this.getContent(utils.getQueryString("infoId"),utils.getQueryString('salesmanId'));

tjArr = JSON.stringify(dataArr);

getUserInfo: function(success) {
var self = this;
var url = location.href;
var wxCode = utils.getQueryString("code");

}

},

return;

'&':'&',

},

});

alert('验证签字url == ' url)

getReferrer: function() {
var referrer = '';
try {

HTMLEncode:function (html){

本文由68399皇家赌场发布于集成介绍,转载请注明出处:5929皇家赌场js常用util

关键词: 68399皇家赌场

上一篇:自己写的HTML5,编程小游戏

下一篇:没有了

最火资讯