seam 8 ani în urmă
părinte
comite
ede49f350f

+ 0 - 11
www/webapp/common/js/jq_extend.js

@@ -80,17 +80,6 @@ define(['config', 'native', 'zepto'], function (config, native, $) {
             callback.call(this, ev);
           });
         }
-      },
-      // 时间戳转化
-      timetrans: function (date) {
-        let date = new Date(date * 1000);//如果date为13位不需要乘1000
-        let Y = date.getFullYear() + '-';
-        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-        let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
-        let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
-        let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
-        let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
-        return Y + M + D + h + m + s;
       }
     })
     //由于加密是异步的,递归调用队列

+ 124 - 1
www/webapp/moonclub/dist/js/jq_extend.js

@@ -1 +1,124 @@
-define(["config","native","zepto"],function(e,t,n){return function(n){function i(e){var s=r.shift();s.data=e.data,n.autoAjax(s),r.length>0&&t.getSign(r[0].data,i)}n.extend(n,{getScript:function(e,t){var n=document.createElement("script");n.async="async",n.src=e,t&&(n.onload=t),document.getElementsByTagName("head")[0].appendChild(n)},autoAjax:function(t){t.no_sign=1;if(location.host=="yiguanjia.me")n.ajax(t);else{t.data.version=e.o2oVersion;var r=t.url;r.indexOf("?")==-1&&(r+="?"),r.charAt(r.length-1)!="?"&&(r+="&"),r+="callback=?",!t.data||(r.charAt(r.length-1)!="?"&&(r+=""),r+="&"+n.param(t.data)),n.ajaxJSONP({url:r,success:t.success?t.success:null,error:t.error?t.error:null})}},signAjax:function(n){if(e.isIOS||e.isAndroid){var s=n.data,o=n.success;n.success=function(e){o(e)},s.time||(s.time=(new Date).getTime()/1e3),r.push(n),r.length==1&&t.getSign(r[0].data,i)}else this.autoAjax(n)},newTouch:function(e,t,r){var i="tap";window.DocumentTouch&&document instanceof DocumentTouch||"ontouchstart"in window||(i="tap"),r!==undefined?n(r).on(i,e,function(e){t.call(this,e)}):n(e).on(i,function(e){t.call(this,e)})}});var r=[]}(n),n});
+/**
+ * desc: 对$进行扩展
+ * author: wangyang
+ * date: 2015-04-11
+ */
+define(['config', 'native', 'zepto'], function (config, native, $) {
+  (function ($) {
+    $.extend($, {
+      getScript: function (src, func) {
+        var script = document.createElement('script');
+        script.async = 'async';
+        script.src = src;
+        if (func) {
+          script.onload = func;
+        }
+        document.getElementsByTagName('head')[0].appendChild(script);
+      },
+      //根据域名判断使用ajax还是jsonP
+      autoAjax: function (param) {
+        param['no_sign'] = 1;
+        if (location.host == 'yiguanjia.me') {
+          $.ajax(param);
+        } else {
+          // api接口增加版本号
+          param.data['version'] = config.o2oVersion;
+          var url = param.url;
+          if (url.indexOf('?') == -1) {
+            url += '?';
+          }
+          if (url.charAt(url.length - 1) != '?') {
+            url += '&';
+          }
+          url += 'callback=?';
+          if (!!param.data) {
+            if (url.charAt(url.length - 1) != '?') {
+              url += '';
+            }
+            url += '&' + $.param(param.data);
+          }
+          $.ajaxJSONP({
+            url: url,
+            success: (!!param.success) ? param.success : null,
+            error: (!!param.error) ? param.error : null
+          })
+        }
+      },
+      //带验证的ajax
+      signAjax: function (options) {
+        if (config.isIOS || config.isAndroid) {
+          var params = options.data;
+          var sgf = options.success;
+
+          options.success = function (res) {
+            sgf(res);
+          }
+
+          if (!!!params.time) {
+            params.time = new Date().getTime() / 1000;
+          }
+          sign_queue.push(options);
+          if (sign_queue.length == 1) {
+            native.getSign(sign_queue[0].data, sign_callback);
+          }
+        } else {
+          this.autoAjax(options);
+        }
+      },
+      //touch绑定事件的封装
+      newTouch: function (el, callback, parent_dom) {
+        var event = 'tap';
+        if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
+          event = 'tap';
+        }
+        if (parent_dom !== undefined) {
+          $(parent_dom).on(event, el, function (ev) {
+            callback.call(this, ev);
+          });
+        } else {
+          $(el).on(event, function (ev) {
+            callback.call(this, ev);
+          });
+        }
+      },
+      // 时间戳转化
+      timetrans: function (d) {
+        let date = new Date(d * 1000);//如果date为13位不需要乘1000
+        let Y = date.getFullYear() + '-';
+        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+        let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+        let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+        let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+        let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+        return Y + M + D + h + m + s;
+      },
+      // 验证码
+      createCode: function createCode() {
+        let code = "";
+        let codeLength = 4; //验证码的长度
+        var i = 0
+        // var checkCode = $("#checkCode").val();
+        var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+          'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
+        for (; i < codeLength; i++) { //循环操作
+          var charIndex = Math.floor(Math.random() * 36); //取得随机数的索引
+          code += random[charIndex]; //根据索引取得随机数加到code上
+        }
+        return code; //把code值赋给验证码
+      }
+    })
+    //由于加密是异步的,递归调用队列
+    var sign_queue = [];
+
+    function sign_callback(res) {
+      var options = sign_queue.shift();
+      options.data = res.data;
+      $.autoAjax(options);
+      if (sign_queue.length > 0) {
+        native.getSign(sign_queue[0].data, sign_callback);
+      }
+    }
+  })($);
+
+  return $;
+})

+ 130 - 131
www/webapp/moonclub/dist/js/main.js

@@ -2176,98 +2176,124 @@ define("zepto", (function (global) {
  * author: wangyang
  * date: 2015-04-11
  */
-define('$',['config', 'native', 'zepto'], function(config, native, $) {
-	(function($) {
-		$.extend($, {
-			getScript: function(src, func) {
-				var script = document.createElement('script');
-				script.async = 'async';
-				script.src = src;
-				if (func) {
-				   script.onload = func;
-				}
-				document.getElementsByTagName('head')[0].appendChild(script);
-			},
-			//根据域名判断使用ajax还是jsonP
-			autoAjax: function(param) {
-				param['no_sign'] = 1;
-				if (location.host == 'yiguanjia.me') {
-					$.ajax(param);
-				} else {
-					// api接口增加版本号
-					param.data['version'] = config.o2oVersion;
-					var url = param.url;
-					if (url.indexOf('?') == -1) {
-						url += '?';
-					}
-					if (url.charAt(url.length - 1) != '?') {
-						url += '&';
-					}
-					url += 'callback=?';
-					if (!!param.data) {
-						if (url.charAt(url.length - 1) != '?') {
-							url += '';
-						}
-						url += '&' + $.param(param.data);
-					}
-					$.ajaxJSONP({
-						url: url,
-						success: (!!param.success) ? param.success : null,
-						error: (!!param.error) ? param.error : null
-					})
-				}
-			},
-			//带验证的ajax
-			signAjax: function(options) {
-				if (config.isIOS || config.isAndroid ) {
-					var params = options.data;
-					var sgf = options.success;
-
-					options.success = function(res) {
-						sgf(res);
-					}
+define('$',['config', 'native', 'zepto'], function (config, native, $) {
+  (function ($) {
+    $.extend($, {
+      getScript: function (src, func) {
+        var script = document.createElement('script');
+        script.async = 'async';
+        script.src = src;
+        if (func) {
+          script.onload = func;
+        }
+        document.getElementsByTagName('head')[0].appendChild(script);
+      },
+      //根据域名判断使用ajax还是jsonP
+      autoAjax: function (param) {
+        param['no_sign'] = 1;
+        if (location.host == 'yiguanjia.me') {
+          $.ajax(param);
+        } else {
+          // api接口增加版本号
+          param.data['version'] = config.o2oVersion;
+          var url = param.url;
+          if (url.indexOf('?') == -1) {
+            url += '?';
+          }
+          if (url.charAt(url.length - 1) != '?') {
+            url += '&';
+          }
+          url += 'callback=?';
+          if (!!param.data) {
+            if (url.charAt(url.length - 1) != '?') {
+              url += '';
+            }
+            url += '&' + $.param(param.data);
+          }
+          $.ajaxJSONP({
+            url: url,
+            success: (!!param.success) ? param.success : null,
+            error: (!!param.error) ? param.error : null
+          })
+        }
+      },
+      //带验证的ajax
+      signAjax: function (options) {
+        if (config.isIOS || config.isAndroid) {
+          var params = options.data;
+          var sgf = options.success;
+
+          options.success = function (res) {
+            sgf(res);
+          }
 
-					if (!!!params.time) {
-						params.time = new Date().getTime() / 1000;
-					}
-					sign_queue.push(options);
-					if (sign_queue.length == 1) {
-						native.getSign(sign_queue[0].data, sign_callback);
-					}
-				} else {
-					this.autoAjax(options);
-				}
-			},
-			//touch绑定事件的封装
-			newTouch: function(el, callback, parent_dom) {
-				var event = 'tap';
-				if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
-					event = 'tap';
-				}
-				if (parent_dom !== undefined) {
-					$(parent_dom).on(event, el, function(ev) {
-						callback.call(this, ev);
-					});
-				} else {
-					$(el).on(event, function(ev) {
-						callback.call(this, ev);
-					});
-				}
-			}
-		})
-		//由于加密是异步的,递归调用队列
-		var sign_queue = [];
-		function sign_callback(res) {
-			var options = sign_queue.shift();
-			options.data = res.data;
-			$.autoAjax(options);
-			if (sign_queue.length > 0) {
-				native.getSign(sign_queue[0].data, sign_callback);
-			}
-		}
-	})($);
+          if (!!!params.time) {
+            params.time = new Date().getTime() / 1000;
+          }
+          sign_queue.push(options);
+          if (sign_queue.length == 1) {
+            native.getSign(sign_queue[0].data, sign_callback);
+          }
+        } else {
+          this.autoAjax(options);
+        }
+      },
+      //touch绑定事件的封装
+      newTouch: function (el, callback, parent_dom) {
+        var event = 'tap';
+        if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
+          event = 'tap';
+        }
+        if (parent_dom !== undefined) {
+          $(parent_dom).on(event, el, function (ev) {
+            callback.call(this, ev);
+          });
+        } else {
+          $(el).on(event, function (ev) {
+            callback.call(this, ev);
+          });
+        }
+      },
+      // 时间戳转化
+      timetrans: function (d) {
+        let date = new Date(d * 1000);//如果date为13位不需要乘1000
+        let Y = date.getFullYear() + '-';
+        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+        let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+        let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+        let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+        let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+        return Y + M + D + h + m + s;
+      },
+      // 验证码
+      createCode: function createCode() {
+        let code = "";
+        let codeLength = 4; //验证码的长度
+        var i = 0
+        // var checkCode = $("#checkCode").val();
+        var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+          'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
+        for (; i < codeLength; i++) { //循环操作
+          var charIndex = Math.floor(Math.random() * 36); //取得随机数的索引
+          code += random[charIndex]; //根据索引取得随机数加到code上
+        }
+        return code; //把code值赋给验证码
+      }
+    })
+    //由于加密是异步的,递归调用队列
+    var sign_queue = [];
+
+    function sign_callback(res) {
+      var options = sign_queue.shift();
+      options.data = res.data;
+      $.autoAjax(options);
+      if (sign_queue.length > 0) {
+        native.getSign(sign_queue[0].data, sign_callback);
+      }
+    }
+  })($);
 
-	return $;
+  return $;
 });
 /*!
  * SPA v1.0.7
@@ -7881,21 +7907,7 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
     });
   }
 
-  // 验证码
-  function createCode() {
-    code = "";
-    var codeLength = 4; //验证码的长度
-    var i = 0
-    // var checkCode = $("#checkCode").val();
-    // var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
-    //   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
-    var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); //随机数
-    for (; i < codeLength; i++) { //循环操作
-      var charIndex = Math.floor(Math.random() * 10); //取得随机数的索引
-      code += random[charIndex]; //根据索引取得随机数加到code上
-    }
-    return code; //把code值赋给验证码
-  }
+  
 
   // mo tai kuang
   function model(title, content) {
@@ -7939,7 +7951,7 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
       }, $view);
       // 重置验证码
       $.newTouch('.checkCodeBtn', function (event) {
-        $('#checkCode').val(createCode()); //刷新验证码
+        $('#checkCode').val($.createCode()()); //刷新验证码
       }, $view);
       // 获取短信验证码
       $.newTouch('.createCode', function (event) {
@@ -7959,7 +7971,7 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
           return;
         } else if (inputCode.toUpperCase() != code) { //若输入的验证码与产生的验证码不一致时
           //则弹出验证码输入错误
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           model('您输入的验证码有误,请重新输入!', '确定');
           return;
         } else if (viewShow) {
@@ -7971,11 +7983,11 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
               s = 60;
               viewShow = true
               createCode1.val("获取验证码");
-              $('#checkCode').val(createCode()); //刷新验证码
+              $('#checkCode').val($.createCode()); //刷新验证码
               clearTimeout(t);
             }
           }, 1000);
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           api.getCode({
             mobile: mobile
           }, function (res) {
@@ -7993,7 +8005,7 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
 
     $.newTouch('.checkCodeBtn', function (event) {
       event.preventDefault();
-      $('.code').val(createCode())
+      $('.code').val($.createCode())
     }, $view)
 
     // 咨询
@@ -8060,7 +8072,7 @@ define('pageUserInfo',['$', 'template', 'recharge', 'native', 'config', 'user',
       $doc.trigger('spa:closeloader');
       var tpl = template('userInfo/index');
       $('.spa-page-body', $view).html(tpl);
-      $('#checkCode').val(createCode())
+      $('#checkCode').val($.createCode())
       setTimeout(function () {
         pageData.scroll = new IScroll('#userInfoScroll');
         var calendar = new LCalendar();
@@ -8103,20 +8115,7 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
     });
   }
 
-  // 验证码
-  function createCode() {
-    code = "";
-    var codeLength = 4; //验证码的长度
-    var i = 0
-    // var checkCode = $("#checkCode").val();
-    var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
-    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
-    for (; i < codeLength; i++) { //循环操作
-      var charIndex = Math.floor(Math.random() * 36); //取得随机数的索引
-      code += random[charIndex]; //根据索引取得随机数加到code上
-    }
-    return code; //把code值赋给验证码
-  }
+
 
   // 判断身份证是否合法
   function checkID(ID) {
@@ -8224,7 +8223,7 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
       }, $view);
       // 重置验证码
       $.newTouch('.checkCodeBtn', function (event) {
-        $('#checkCode').val(createCode()); //刷新验证码
+        $('#checkCode').val($.createCode()); //刷新验证码
         $('.input', $view).val('')//清空验证码
       }, $view);
       // 获取短信验证码
@@ -8246,7 +8245,7 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
           return;
         } else if (inputCode.toUpperCase() != code) { //若输入的验证码与产生的验证码不一致时
           //则弹出验证码输入错误
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           model('您输入的验证码有误,请重新输入!', '确定');
           return;
         } else if (viewShow) {
@@ -8258,12 +8257,12 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
               s = 60;
               viewShow = true
               createCode1.val("获取验证码");
-              $('#checkCode').val(createCode()); //刷新验证码
+              $('#checkCode').val($.createCode()); //刷新验证码
               $('.input', $view).val('')//清空验证码
               clearTimeout(t);
             }
           }, 1000);
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           $('.input', $view).val('')//清空验证码
           api.getCode({
             mobile: mobile
@@ -8282,7 +8281,7 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
 
     $.newTouch('.checkCodeBtn', function (event) {
       event.preventDefault();
-      $('.code').val(createCode())
+      $('.code').val($.createCode())
     }, $view)
 
     // 咨询
@@ -8369,7 +8368,7 @@ define('pageRegistered',['$', 'template', 'recharge', 'native', 'config', 'user'
       $doc.trigger('spa:closeloader');
       var tpl = template('Registered/index');
       $('.spa-page-body', $view).html(tpl);
-      $('#checkCode').val(createCode())
+      $('#checkCode').val($.createCode())
       setTimeout(function () {
         pageData.scroll = new IScroll('#registeredScroll');
         var calendar = new LCalendar();

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
www/webapp/moonclub/dist/js/page/Registered.js


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
www/webapp/moonclub/dist/js/page/userInfo.js


+ 178 - 89
www/webapp/moonclub/js/jq_extend.js

@@ -3,96 +3,185 @@
  * author: wangyang
  * date: 2015-04-11
  */
-define(['config', 'native', 'zepto'], function(config, native, $) {
-	(function($) {
-		$.extend($, {
-			getScript: function(src, func) {
-				var script = document.createElement('script');
-				script.async = 'async';
-				script.src = src;
-				if (func) {
-				   script.onload = func;
-				}
-				document.getElementsByTagName('head')[0].appendChild(script);
-			},
-			//根据域名判断使用ajax还是jsonP
-			autoAjax: function(param) {
-				param['no_sign'] = 1;
-				if (location.host == 'yiguanjia.me') {
-					$.ajax(param);
-				} else {
-					// api接口增加版本号
-					param.data['version'] = config.o2oVersion;
-					var url = param.url;
-					if (url.indexOf('?') == -1) {
-						url += '?';
-					}
-					if (url.charAt(url.length - 1) != '?') {
-						url += '&';
-					}
-					url += 'callback=?';
-					if (!!param.data) {
-						if (url.charAt(url.length - 1) != '?') {
-							url += '';
-						}
-						url += '&' + $.param(param.data);
-					}
-					$.ajaxJSONP({
-						url: url,
-						success: (!!param.success) ? param.success : null,
-						error: (!!param.error) ? param.error : null
-					})
-				}
-			},
-			//带验证的ajax
-			signAjax: function(options) {
-				if (config.isIOS || config.isAndroid ) {
-					var params = options.data;
-					var sgf = options.success;
+define(['config', 'native', 'zepto'], function (config, native, $) {
+  (function ($) {
+    $.extend($, {
+      getScript: function (src, func) {
+        var script = document.createElement('script');
+        script.async = 'async';
+        script.src = src;
+        if (func) {
+          script.onload = func;
+        }
+        document.getElementsByTagName('head')[0].appendChild(script);
+      },
+      //根据域名判断使用ajax还是jsonP
+      autoAjax: function (param) {
+        param['no_sign'] = 1;
+        if (location.host == 'yiguanjia.me') {
+          $.ajax(param);
+        } else {
+          // api接口增加版本号
+          param.data['version'] = config.o2oVersion;
+          var url = param.url;
+          if (url.indexOf('?') == -1) {
+            url += '?';
+          }
+          if (url.charAt(url.length - 1) != '?') {
+            url += '&';
+          }
+          url += 'callback=?';
+          if (!!param.data) {
+            if (url.charAt(url.length - 1) != '?') {
+              url += '';
+            }
+            url += '&' + $.param(param.data);
+          }
+          $.ajaxJSONP({
+            url: url,
+            success: (!!param.success) ? param.success : null,
+            error: (!!param.error) ? param.error : null
+          })
+        }
+      },
+      //带验证的ajax
+      signAjax: function (options) {
+        if (config.isIOS || config.isAndroid) {
+          var params = options.data;
+          var sgf = options.success;
 
-					options.success = function(res) {
-						sgf(res);
-					}
+          options.success = function (res) {
+            sgf(res);
+          }
 
-					if (!!!params.time) {
-						params.time = new Date().getTime() / 1000;
-					}
-					sign_queue.push(options);
-					if (sign_queue.length == 1) {
-						native.getSign(sign_queue[0].data, sign_callback);
-					}
-				} else {
-					this.autoAjax(options);
-				}
-			},
-			//touch绑定事件的封装
-			newTouch: function(el, callback, parent_dom) {
-				var event = 'tap';
-				if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
-					event = 'tap';
-				}
-				if (parent_dom !== undefined) {
-					$(parent_dom).on(event, el, function(ev) {
-						callback.call(this, ev);
-					});
-				} else {
-					$(el).on(event, function(ev) {
-						callback.call(this, ev);
-					});
-				}
-			}
-		})
-		//由于加密是异步的,递归调用队列
-		var sign_queue = [];
-		function sign_callback(res) {
-			var options = sign_queue.shift();
-			options.data = res.data;
-			$.autoAjax(options);
-			if (sign_queue.length > 0) {
-				native.getSign(sign_queue[0].data, sign_callback);
-			}
-		}
-	})($);
+          if (!!!params.time) {
+            params.time = new Date().getTime() / 1000;
+          }
+          sign_queue.push(options);
+          if (sign_queue.length == 1) {
+            native.getSign(sign_queue[0].data, sign_callback);
+          }
+        } else {
+          this.autoAjax(options);
+        }
+      },
+      //touch绑定事件的封装
+      newTouch: function (el, callback, parent_dom) {
+        var event = 'tap';
+        if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
+          event = 'tap';
+        }
+        if (parent_dom !== undefined) {
+          $(parent_dom).on(event, el, function (ev) {
+            callback.call(this, ev);
+          });
+        } else {
+          $(el).on(event, function (ev) {
+            callback.call(this, ev);
+          });
+        }
+      },
+      // 时间戳转化
+      timetrans: function (d) {
+        let date = new Date(d * 1000);//如果date为13位不需要乘1000
+        let Y = date.getFullYear() + '-';
+        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
+        let D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
+        let h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+        let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+        let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+        return Y + M + D + h + m + s;
+      },
+      // 验证码
+      createCode: function createCode() {
+        let code = "";
+        let codeLength = 4; //验证码的长度
+        var i = 0
+        // var checkCode = $("#checkCode").val();
+        var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
+          'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
+        for (; i < codeLength; i++) { //循环操作
+          var charIndex = Math.floor(Math.random() * 36); //取得随机数的索引
+          code += random[charIndex]; //根据索引取得随机数加到code上
+        }
+        return code; //把code值赋给验证码
+      },
 
-	return $;
+      // 判断身份证是否合法
+      checkID: function checkID(ID) {
+        if (typeof ID !== 'string') return '您输入的身份证包含其他文字';
+        if (ID === '') return '身份证号不为空';
+        let city = {
+          11: "北京",
+          12: "天津",
+          13: "河北",
+          14: "山西",
+          15: "内蒙古",
+          21: "辽宁",
+          22: "吉林",
+          23: "黑龙江 ",
+          31: "上海",
+          32: "江苏",
+          33: "浙江",
+          34: "安徽",
+          35: "福建",
+          36: "江西",
+          37: "山东",
+          41: "河南",
+          42: "湖北 ",
+          43: "湖南",
+          44: "广东",
+          45: "广西",
+          46: "海南",
+          50: "重庆",
+          51: "四川",
+          52: "贵州",
+          53: "云南",
+          54: "西藏 ",
+          61: "陕西",
+          62: "甘肃",
+          63: "青海",
+          64: "宁夏",
+          65: "新疆",
+          71: "台湾",
+          81: "香港",
+          82: "澳门",
+          91: "国外"
+        };
+        let birthday = ID.substr(6, 4) + '/' + Number(ID.substr(10, 2)) + '/' + Number(ID.substr(12, 2));
+        let d = new Date(birthday);
+        let newBirthday = d.getFullYear() + '/' + Number(d.getMonth() + 1) + '/' + Number(d.getDate());
+        let currentTime = new Date().getTime();
+        let time = d.getTime();
+        let arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
+        let arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
+        let sum = 0, i, residue;
+
+        if (!/^\d{17}(\d|x)$/i.test(ID)) return '非法身份证';
+        if (city[ID.substr(0, 2)] === undefined) return "非法地区";
+        if (time >= currentTime || birthday !== newBirthday) return '非法生日';
+        for (i = 0; i < 17; i++) {
+          sum += ID.substr(i, 1) * arrInt[i];
+        }
+        residue = arrCh[sum % 11];
+        if (residue !== ID.substr(17, 1)) return '非法身份证哦';
+
+        // return city[ID.substr(0, 2)] + "," + birthday + "," + (ID.substr(16, 1) % 2 ? " 男" : "女") //浙江,1994/7/26, 男
+        return true
+      }
+    })
+    //由于加密是异步的,递归调用队列
+    var sign_queue = [];
+
+    function sign_callback(res) {
+      var options = sign_queue.shift();
+      options.data = res.data;
+      $.autoAjax(options);
+      if (sign_queue.length > 0) {
+        native.getSign(sign_queue[0].data, sign_callback);
+      }
+    }
+  })($);
+
+  return $;
 })

+ 6 - 81
www/webapp/moonclub/js/page/Registered.js

@@ -15,83 +15,8 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
     });
   }
 
-  // 验证码
-  function createCode() {
-    code = "";
-    var codeLength = 4; //验证码的长度
-    var i = 0
-    // var checkCode = $("#checkCode").val();
-    var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
-    'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
-    for (; i < codeLength; i++) { //循环操作
-      var charIndex = Math.floor(Math.random() * 36); //取得随机数的索引
-      code += random[charIndex]; //根据索引取得随机数加到code上
-    }
-    return code; //把code值赋给验证码
-  }
 
-  // 判断身份证是否合法
-  function checkID(ID) {
-    if (typeof ID !== 'string') return '您输入的身份证包含其他文字';
-    if (ID === '') return '身份证号不为空';
-    var city = {
-      11: "北京",
-      12: "天津",
-      13: "河北",
-      14: "山西",
-      15: "内蒙古",
-      21: "辽宁",
-      22: "吉林",
-      23: "黑龙江 ",
-      31: "上海",
-      32: "江苏",
-      33: "浙江",
-      34: "安徽",
-      35: "福建",
-      36: "江西",
-      37: "山东",
-      41: "河南",
-      42: "湖北 ",
-      43: "湖南",
-      44: "广东",
-      45: "广西",
-      46: "海南",
-      50: "重庆",
-      51: "四川",
-      52: "贵州",
-      53: "云南",
-      54: "西藏 ",
-      61: "陕西",
-      62: "甘肃",
-      63: "青海",
-      64: "宁夏",
-      65: "新疆",
-      71: "台湾",
-      81: "香港",
-      82: "澳门",
-      91: "国外"
-    };
-    var birthday = ID.substr(6, 4) + '/' + Number(ID.substr(10, 2)) + '/' + Number(ID.substr(12, 2));
-    var d = new Date(birthday);
-    var newBirthday = d.getFullYear() + '/' + Number(d.getMonth() + 1) + '/' + Number(d.getDate());
-    var currentTime = new Date().getTime();
-    var time = d.getTime();
-    var arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
-    var arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
-    var sum = 0, i, residue;
 
-    if (!/^\d{17}(\d|x)$/i.test(ID)) return '非法身份证';
-    if (city[ID.substr(0, 2)] === undefined) return "非法地区";
-    if (time >= currentTime || birthday !== newBirthday) return '非法生日';
-    for (i = 0; i < 17; i++) {
-      sum += ID.substr(i, 1) * arrInt[i];
-    }
-    residue = arrCh[sum % 11];
-    if (residue !== ID.substr(17, 1)) return '非法身份证哦';
-
-    // return city[ID.substr(0, 2)] + "," + birthday + "," + (ID.substr(16, 1) % 2 ? " 男" : "女") //浙江,1994/7/26, 男
-    return true
-  }
 
   // 调用模态框
   function model(title, content) {
@@ -136,7 +61,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
       }, $view);
       // 重置验证码
       $.newTouch('.checkCodeBtn', function (event) {
-        $('#checkCode').val(createCode()); //刷新验证码
+        $('#checkCode').val($.createCode()); //刷新验证码
         $('.input', $view).val('')//清空验证码
       }, $view);
       // 获取短信验证码
@@ -158,7 +83,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
           return;
         } else if (inputCode.toUpperCase() != code) { //若输入的验证码与产生的验证码不一致时
           //则弹出验证码输入错误
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           model('您输入的验证码有误,请重新输入!', '确定');
           return;
         } else if (viewShow) {
@@ -170,12 +95,12 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
               s = 60;
               viewShow = true
               createCode1.val("获取验证码");
-              $('#checkCode').val(createCode()); //刷新验证码
+              $('#checkCode').val($.createCode()); //刷新验证码
               $('.input', $view).val('')//清空验证码
               clearTimeout(t);
             }
           }, 1000);
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           $('.input', $view).val('')//清空验证码
           api.getCode({
             mobile: mobile
@@ -194,7 +119,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
 
     $.newTouch('.checkCodeBtn', function (event) {
       event.preventDefault();
-      $('.code').val(createCode())
+      $('.code').val($.createCode())
     }, $view)
 
     // 咨询
@@ -281,7 +206,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
       $doc.trigger('spa:closeloader');
       var tpl = template('Registered/index');
       $('.spa-page-body', $view).html(tpl);
-      $('#checkCode').val(createCode())
+      $('#checkCode').val($.createCode())
       setTimeout(function () {
         pageData.scroll = new IScroll('#registeredScroll');
         var calendar = new LCalendar();

+ 7 - 21
www/webapp/moonclub/js/page/userInfo.js

@@ -15,21 +15,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
     });
   }
 
-  // 验证码
-  function createCode() {
-    code = "";
-    var codeLength = 4; //验证码的长度
-    var i = 0
-    // var checkCode = $("#checkCode").val();
-    // var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
-    //   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数
-    var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9); //随机数
-    for (; i < codeLength; i++) { //循环操作
-      var charIndex = Math.floor(Math.random() * 10); //取得随机数的索引
-      code += random[charIndex]; //根据索引取得随机数加到code上
-    }
-    return code; //把code值赋给验证码
-  }
+  
 
   // mo tai kuang
   function model(title, content) {
@@ -73,7 +59,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
       }, $view);
       // 重置验证码
       $.newTouch('.checkCodeBtn', function (event) {
-        $('#checkCode').val(createCode()); //刷新验证码
+        $('#checkCode').val($.createCode()); //刷新验证码
       }, $view);
       // 获取短信验证码
       $.newTouch('.createCode', function (event) {
@@ -93,7 +79,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
           return;
         } else if (inputCode.toUpperCase() != code) { //若输入的验证码与产生的验证码不一致时
           //则弹出验证码输入错误
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           model('您输入的验证码有误,请重新输入!', '确定');
           return;
         } else if (viewShow) {
@@ -105,11 +91,11 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
               s = 60;
               viewShow = true
               createCode1.val("获取验证码");
-              $('#checkCode').val(createCode()); //刷新验证码
+              $('#checkCode').val($.createCode()); //刷新验证码
               clearTimeout(t);
             }
           }, 1000);
-          $('#checkCode').val(createCode()); //刷新验证码
+          $('#checkCode').val($.createCode()); //刷新验证码
           api.getCode({
             mobile: mobile
           }, function (res) {
@@ -127,7 +113,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
 
     $.newTouch('.checkCodeBtn', function (event) {
       event.preventDefault();
-      $('.code').val(createCode())
+      $('.code').val($.createCode())
     }, $view)
 
     // 咨询
@@ -194,7 +180,7 @@ define(['$', 'template', 'recharge', 'native', 'config', 'user', 'product', 'api
       $doc.trigger('spa:closeloader');
       var tpl = template('userInfo/index');
       $('.spa-page-body', $view).html(tpl);
-      $('#checkCode').val(createCode())
+      $('#checkCode').val($.createCode())
       setTimeout(function () {
         pageData.scroll = new IScroll('#userInfoScroll');
         var calendar = new LCalendar();

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff