init
Showing
1 changed file
with
29 additions
and
14 deletions
| ... | @@ -14,43 +14,58 @@ | ... | @@ -14,43 +14,58 @@ |
| 14 | <script src="https://cdn.bootcss.com/holder/2.9.4/holder.min.js"></script> | 14 | <script src="https://cdn.bootcss.com/holder/2.9.4/holder.min.js"></script> |
| 15 | <script type="text/javascript" src="/resource/upload.js"></script> | 15 | <script type="text/javascript" src="/resource/upload.js"></script> |
| 16 | <script> | 16 | <script> |
| 17 | (function($){ | 17 | (function ($) { |
| 18 | $.fn.serializeJson=function(){ | 18 | $.fn.serializeJson = function () { |
| 19 | var serializeObj={}; | 19 | var serializeObj = {}; |
| 20 | var array=this.serializeArray(); | 20 | var array = this.serializeArray(); |
| 21 | var str=this.serialize(); | 21 | var str = this.serialize(); |
| 22 | $(array).each(function(){ | 22 | $(array).each(function () { |
| 23 | if(serializeObj[this.name]){ | 23 | if (serializeObj[this.name]) { |
| 24 | if($.isArray(serializeObj[this.name])){ | 24 | if ($.isArray(serializeObj[this.name])) { |
| 25 | serializeObj[this.name].push(this.value); | 25 | serializeObj[this.name].push(this.value); |
| 26 | }else{ | 26 | } else { |
| 27 | serializeObj[this.name]=[serializeObj[this.name],this.value]; | 27 | serializeObj[this.name] = [serializeObj[this.name], this.value]; |
| 28 | } | 28 | } |
| 29 | }else{ | 29 | } else { |
| 30 | serializeObj[this.name]=this.value; | 30 | serializeObj[this.name] = this.value; |
| 31 | } | 31 | } |
| 32 | }); | 32 | }); |
| 33 | return serializeObj; | 33 | return serializeObj; |
| 34 | }; | 34 | }; |
| 35 | })(jQuery); | 35 | })(jQuery); |
| 36 | |||
| 36 | function getUrlParam(name) { | 37 | function getUrlParam(name) { |
| 37 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 | 38 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 |
| 38 | var r = window.location.search.substr(1).match(reg); //匹配目标参数 | 39 | var r = window.location.search.substr(1).match(reg); //匹配目标参数 |
| 39 | if (r != null) return unescape(r[2]); return null; //返回参数值 | 40 | if (r != null) return unescape(r[2]); |
| 41 | return null; //返回参数值 | ||
| 40 | } | 42 | } |
| 43 | |||
| 41 | function getNowFormatDate() { | 44 | function getNowFormatDate() { |
| 42 | var date = new Date(); | 45 | var date = new Date(); |
| 43 | var seperator1 = "-"; | 46 | var seperator1 = "-"; |
| 44 | var year = date.getFullYear(); | 47 | var year = date.getFullYear(); |
| 45 | var month = date.getMonth() + 1; | 48 | var month = date.getMonth() + 1; |
| 46 | var strDate = date.getDate(); | 49 | var strDate = date.getDate(); |
| 50 | var hour = date.getHours(); | ||
| 51 | var min = date.getMinutes(); | ||
| 52 | var sec = date.getSeconds(); | ||
| 47 | if (month >= 1 && month <= 9) { | 53 | if (month >= 1 && month <= 9) { |
| 48 | month = "0" + month; | 54 | month = "0" + month; |
| 49 | } | 55 | } |
| 50 | if (strDate >= 0 && strDate <= 9) { | 56 | if (strDate >= 0 && strDate <= 9) { |
| 51 | strDate = "0" + strDate; | 57 | strDate = "0" + strDate; |
| 52 | } | 58 | } |
| 53 | var currentdate = year + seperator1 + month + seperator1 + strDate; | 59 | if (hour >= 1 && hour <= 9) { |
| 60 | hour = "0" + hour; | ||
| 61 | } | ||
| 62 | if (min >= 1 && min <= 9) { | ||
| 63 | min = "0" + min; | ||
| 64 | } | ||
| 65 | if (sec >= 1 && sec <= 9) { | ||
| 66 | sec = "0" + sec; | ||
| 67 | } | ||
| 68 | var currentdate = year + seperator1 + month + seperator1 + strDate + ' ' + hour + ':' + min + ':' + sec; | ||
| 54 | return currentdate; | 69 | return currentdate; |
| 55 | } | 70 | } |
| 56 | 71 | ... | ... |
-
Please register or sign in to post a comment