liukang hace 2 años
padre
commit
e2314e8e37
Se han modificado 37 ficheros con 3894 adiciones y 16 borrados
  1. 19 16
      manifest.json
  2. 0 0
      unpackage/dist/build/.automator/h5/.automator.json
  3. BIN
      unpackage/dist/build/h5.rar
  4. 2 0
      unpackage/dist/build/h5/index.html
  5. BIN
      unpackage/dist/build/h5/static/image/index1/bottom_img1.png
  6. BIN
      unpackage/dist/build/h5/static/image/index1/bottom_img2.png
  7. BIN
      unpackage/dist/build/h5/static/image/index1/bottom_img3.png
  8. BIN
      unpackage/dist/build/h5/static/image/index1/checked.png
  9. BIN
      unpackage/dist/build/h5/static/image/index1/footer_bg.png
  10. BIN
      unpackage/dist/build/h5/static/image/index1/img1.png
  11. BIN
      unpackage/dist/build/h5/static/image/index1/img2.png
  12. BIN
      unpackage/dist/build/h5/static/image/index1/img3.png
  13. BIN
      unpackage/dist/build/h5/static/image/index1/img4.png
  14. BIN
      unpackage/dist/build/h5/static/image/index1/logo.png
  15. BIN
      unpackage/dist/build/h5/static/image/index1/stop.png
  16. BIN
      unpackage/dist/build/h5/static/image/index1/tab1.png
  17. BIN
      unpackage/dist/build/h5/static/image/index1/tab2.png
  18. BIN
      unpackage/dist/build/h5/static/image/index1/tab3.png
  19. BIN
      unpackage/dist/build/h5/static/image/index1/tab4.png
  20. BIN
      unpackage/dist/build/h5/static/image/index1/task.png
  21. BIN
      unpackage/dist/build/h5/static/image/index1/top_bg.png
  22. BIN
      unpackage/dist/build/h5/static/image/index1/watch.png
  23. BIN
      unpackage/dist/build/h5/static/img/top_bg.faf33f16.png
  24. 0 0
      unpackage/dist/build/h5/static/index.b0707a6a.css
  25. 2036 0
      unpackage/dist/build/h5/static/js/api.js
  26. 102 0
      unpackage/dist/build/h5/static/js/cache.js
  27. 618 0
      unpackage/dist/build/h5/static/js/calendar.js
  28. 0 0
      unpackage/dist/build/h5/static/js/chunk-vendors.b0d6bf7d.js
  29. 259 0
      unpackage/dist/build/h5/static/js/encrypt.js
  30. 0 0
      unpackage/dist/build/h5/static/js/index.d285e0a8.js
  31. 110 0
      unpackage/dist/build/h5/static/js/math.js
  32. 0 0
      unpackage/dist/build/h5/static/js/pages-detail-detail.e43e13d9.js
  33. 0 0
      unpackage/dist/build/h5/static/js/pages-detail-detail~pages-index-index.23bda7c2.js
  34. 0 0
      unpackage/dist/build/h5/static/js/pages-index-index.87a75481.js
  35. 742 0
      unpackage/dist/build/h5/static/js/qqmap-wx-jssdk.js
  36. 6 0
      unpackage/dist/build/h5/static/js/weapp.qrcode.min.js
  37. BIN
      unpackage/dist/build/h5/static/logo.png

+ 19 - 16
manifest.json

@@ -1,22 +1,25 @@
 {
     "name" : "rrx-H5",
     "appid" : "__UNI__A6486CD",
-	"h5": {
-		"devServer": {
-			"port": 80,
-			"disableHostCheck": true,
-			"proxy": {
-				"/api": {
-					"target": "https://daydayu.com",
-					"changeOrigin": true,
-					"secure":false,
-					"pathRewrite": {
-						"^/api": ""
-					}
-				}
-			}
-		}
-	},
+    "h5" : {
+        "devServer" : {
+            "port" : 80,
+            "disableHostCheck" : true,
+            "proxy" : {
+                "/api" : {
+                    "target" : "https://daydayu.com",
+                    "changeOrigin" : true,
+                    "secure" : false,
+                    "pathRewrite" : {
+                        "^/api" : ""
+                    }
+                }
+            }
+        },
+        "router" : {
+            "base" : "./"
+        }
+    },
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 0 - 0
unpackage/dist/build/.automator/h5/.automator.json


BIN
unpackage/dist/build/h5.rar


+ 2 - 0
unpackage/dist/build/h5/index.html

@@ -0,0 +1,2 @@
+<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>rrx-H5</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=./static/index.b0707a6a.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=./static/js/chunk-vendors.b0d6bf7d.js></script><script src=./static/js/index.d285e0a8.js></script></body></html>

BIN
unpackage/dist/build/h5/static/image/index1/bottom_img1.png


BIN
unpackage/dist/build/h5/static/image/index1/bottom_img2.png


BIN
unpackage/dist/build/h5/static/image/index1/bottom_img3.png


BIN
unpackage/dist/build/h5/static/image/index1/checked.png


BIN
unpackage/dist/build/h5/static/image/index1/footer_bg.png


BIN
unpackage/dist/build/h5/static/image/index1/img1.png


BIN
unpackage/dist/build/h5/static/image/index1/img2.png


BIN
unpackage/dist/build/h5/static/image/index1/img3.png


BIN
unpackage/dist/build/h5/static/image/index1/img4.png


BIN
unpackage/dist/build/h5/static/image/index1/logo.png


BIN
unpackage/dist/build/h5/static/image/index1/stop.png


BIN
unpackage/dist/build/h5/static/image/index1/tab1.png


BIN
unpackage/dist/build/h5/static/image/index1/tab2.png


BIN
unpackage/dist/build/h5/static/image/index1/tab3.png


BIN
unpackage/dist/build/h5/static/image/index1/tab4.png


BIN
unpackage/dist/build/h5/static/image/index1/task.png


BIN
unpackage/dist/build/h5/static/image/index1/top_bg.png


BIN
unpackage/dist/build/h5/static/image/index1/watch.png


BIN
unpackage/dist/build/h5/static/img/top_bg.faf33f16.png


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/index.b0707a6a.css


+ 2036 - 0
unpackage/dist/build/h5/static/js/api.js

@@ -0,0 +1,2036 @@
+// 加密 sha1 md5
+var encrypt = require('./encrypt.js');
+// 缓存
+var cache = require('./cache.js');
+// 数学精确计算
+var math = require('./math.js');
+// 腾讯位置服务
+var qqMap = require("./qqmap-wx-jssdk");
+// 二维码
+var qrCode = require("./weapp.qrcode.min");
+
+module.exports = {
+
+	/**
+	 * 小程序基本配置
+	 */
+	config: {
+		name: '日日学',
+		debug: false, //开发模式true,生产环境改为false;
+		version: 'xcx',
+		baseUrl: 'https://daydayu.com',
+		qqMap: false,
+		loading: false
+	},
+
+	/**
+	 * sha1加密
+	 * @param str
+	 * @param raw 加密方式 1str_sha1 0hex_sha1
+	 */
+	sha1: function(str, raw) {
+		return encrypt.sha1(str, raw);
+	},
+
+	/**
+	 * md5加密
+	 * @param str
+	 */
+	md5: function(str) {
+		return encrypt.md5(str);
+	},
+
+	/**
+	 * 缓存
+	 */
+	cache: cache,
+
+	/**
+	 * 数字精确计算
+	 */
+	math: math,
+
+	/**
+	 * 腾讯地图
+	 */
+	qqMap: qqMap,
+
+	/**
+	 * 消息提示
+	 * @param title
+	 * @param icon:success,error,loading,none 
+	 * @param success
+	 * @param time
+	 * @param mask
+	 */
+	info: function(title, icon, success, time, mask) {
+		if (typeof icon == 'function') {
+			success = icon;
+			icon = "none";
+		}
+		title = title == undefined ? "系统繁忙" : title;
+		icon = icon == undefined ? "none" : icon;
+		time = time == undefined ? 1000 : time;
+		mask = mask == undefined ? true : mask;
+		uni.showToast({
+			title: title,
+			icon: icon,
+			mask: mask,
+			duration: time,
+			success: setTimeout(function() {
+				success && success()
+			}, time)
+		});
+	},
+
+	/**
+	 * 确认提示框
+	 * @param {Object} content
+	 * @param {Object} success
+	 * @param {Object} cancel
+	 * @param {Object} confirmText
+	 * @param {Object} cancelText
+	 */
+	modal: function(content, success, cancel, confirmText, cancelText) {
+		let opt = {};
+		opt.title = this.config.name;
+		opt.content = content;
+		// 默认不显示取消
+		opt.showCancel = false;
+		if (typeof cancel == 'function' || (typeof cancel == 'boolean' && cancel)) {
+			opt.showCancel = true;
+		} else if (typeof cancel == 'string') {
+			cancelText = confirmText;
+			confirmText = cancel;
+		}
+		if (!this.isEmpty(confirmText)) {
+			opt.confirmText = confirmText;
+		}
+		if (!this.isEmpty(cancelText)) {
+			opt.cancelText = cancelText;
+			opt.showCancel = true;
+		}
+		opt.success = function(res) {
+			if (res.confirm) {
+				success && success();
+			} else if (res.cancel) {
+				typeof cancel == 'function' && cancel();
+			}
+		};
+		uni.showModal(opt);
+	},
+
+	/**
+	 * loading 提示框
+	 * @param title
+	 */
+	loading: function(title) {
+		var that = this;
+		title = typeof title == 'string' ? title : "加载中...";
+		!that.config.loading && uni.showLoading({
+			title: title,
+			mask: true,
+			success: function() {
+				that.config.loading = true;
+			}
+		});
+	},
+
+	/**
+	 * 关闭loading 提示框
+	 */
+	closeLoading: function() {
+		var that = this;
+		that.config.loading && uni.hideLoading({
+			noConflict: true,
+			success: function() {
+				that.config.loading = false;
+			}
+		});
+	},
+
+	/**
+	 * 判断登录
+	 * @param {Object} type 0不跳转登录 1跳转登录
+	 * @param {Object} success
+	 */
+	login: function(type, success) {
+		if (typeof type == 'function') {
+			success = type;
+			type = 1;
+		} else if (typeof type == 'undefined') {
+			type = 1;
+		}
+		var that = this;
+		/* var userInfo = this.getUserInfo();
+		if (this.isEmpty(userInfo)) {
+			if (type == 1) {
+				that.info('请先登录', function() {
+					var pages = getCurrentPages();
+					var route = pages[pages.length - 1].route;
+					// if (route != 'pages/login/choose') {
+					// 	that.jump('/pages/login/choose');
+					// }
+				});
+			}
+			return false;
+		} */
+		// return success && success(userInfo) || userInfo;
+		return success
+	},
+
+	/**
+	 * 页面跳转
+	 * @param url
+	 * @param type
+	 */
+	jump: function(url, type, params) {
+		var that = this;
+		if (that.isEmpty(url) && type !== -1) return false;
+		if (url === -1) {
+			var delta = type || 1;
+			type = url;
+		} else if (type === -1) {
+			var delta = 1;
+			if (params && params.delta) {
+				delta = params.delta;
+			}
+		}
+		type = type || 0, //默认0
+			params = params || {};
+		if (that.isEmpty(params)) {
+			cache.remove('jump_data');
+		} else {
+			cache.set('jump_data', params);
+		}
+		switch (type) {
+			case -1:
+				//关闭当前页面,返回上一页面或多级页面 delta:1 返回层数
+				setTimeout(function() {
+					uni.navigateBack({
+						delta: delta
+					});
+				}, 800);
+				return;
+			case 0:
+				//保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面
+				uni.navigateTo({
+					url: url
+				});
+				return;
+			case 1:
+				//关闭当前页面,跳转到应用内的某个页面
+				uni.redirectTo({
+					url: url
+				});
+				return;
+			case 2:
+				//关闭所有页面,打开到应用内的某个页面
+				uni.reLaunch({
+					url: url
+				});
+				return;
+			case 3:
+				//跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
+				uni.switchTab({
+					url: url
+				});
+				return;
+			default:
+				return false;
+		}
+	},
+
+	/**
+	 * 数据请求
+	 */
+	req: function(option, onsuccess, onerror, oncomplete) {
+		if (option == 'undefined') return false;
+		this.loading()
+		// console.log('请求',option);
+		var that = this,
+			config = {
+				sign: false, //是否签名数据
+				load: false, //是否显示loading提示
+				login: false, //是否需要登录
+				url: false,
+				data: option.data,
+				header: {
+					'content-type': 'application/x-www-form-urlencoded',
+				},
+				method: option.method?option.method:'GET',
+				dataType: 'json',
+				success: function(res) { //通讯成功
+
+					that.jslog('请求:' + option.url);
+					that.jslog(res.data);
+					that.closeLoading()
+					//获取返回数据
+					res = res.data;
+
+					//如果存在回调,优先执行回调函数
+					if (onsuccess) {
+						if (onsuccess(res) === false) {
+							return;
+						}
+					}
+
+					if (typeof(res) == 'object') {
+						// (res.info && res.info != 'success') && that.info(res.info);
+						/* if (res.status == 98) { //未登录或账号不存在
+							cache.remove('user_info');
+							that.login();
+						} else if (res.status == 99) { //token验证失败
+							cache.remove('token');
+						} */
+						if(res.code == 401) {
+							that.info(res.info)
+							setTimeout(function() {
+								that.jump('/pages/login/password_login')
+							}, 2000)
+						}
+						if(res.code == 0) {
+							that.info(res.info)
+							// setTimeout(function() {
+							// 	that.jump('/pages/login/password_login')
+							// }, 2000)
+						}
+					} else {
+						// that.modal('接口异常');
+					}
+				},
+				fail: function(res) { //通讯失败
+					that.jslog('请求:' + option.url);
+					that.jslog(res);
+					onerror && onerror();
+				},
+				complete: function(res) { //通讯完成
+					option.load && that.closeLoading();
+					oncomplete && oncomplete();
+				}
+			};
+
+		option.data && (option.data = option.data);
+		if (option.url) {
+			option.url = that.config.baseUrl + option.url;
+		} else {
+			return false;
+		}
+
+		option = that.extend({}, config, option);
+		if (option.login && !that.login()) {
+			return false;
+		}
+		// if (!option.data.submit) {
+		// 	option.data.submit = 'yes';
+		// }
+		if (option.sign) {
+			that.getsign(option.data, function(res) {
+				option.data = res;
+				option.load && that.loading(option.load);
+				uni.request(option);
+			})
+		} else {
+			option.load && that.loading(option.load);
+			uni.request(option);
+		}
+	},
+
+	
+	/**
+	 * 获取一个Token,登录成功请清空
+	 * @param {function}  callback :回调函数
+	 */
+	gettoken: function(callback) {
+		var that = this,
+			token = cache.get('token'),
+			timestamp = Date.parse(new Date()) / 1000;
+		// 10分钟缓冲
+		if (token && token.date_expire > (timestamp + 600)) return callback({
+			status: 1,
+			data: token
+		});
+		var uuid = that.uuid(),
+			//clientid=that.getClientId(),
+			uid = that.getUserInfo('id', 0);
+		uni.request({
+			url: that.config.baseUrl + 'token',
+			data: {
+				uuid: uuid,
+				uid: uid,
+				timestamp: timestamp
+			}, //clientid:clientid
+			timeout: 10000, //超时时间设置为10秒
+			success: function(res) {
+				var res = res.data;
+				if (res.status == 1) {
+					cache.set('token', res.data);
+				}
+				return callback(res);
+			},
+			complete: function(res) {
+				that.jslog('获取token:' + res);
+			}
+		});
+	},
+
+	/**
+	 * 数据签名
+	 * @param {string}     data:要签名的数据
+	 * @param {function}   onsuccess:成功回调函数
+	 * @param {function}   onerror:失败回调函数
+	 */
+	getsign: function(param, onsuccess, onerror) {
+		var that = this,
+			arr = [];
+		param._sign_uuid = that.uuid();
+		param._sign_uid = that.getUserInfo('id', 0);
+		param._timestamp = Date.parse(new Date()) / 1000;
+		param._version = that.config.version;
+		that.gettoken(function(res) {
+			if (res.status == 1) {
+				param._sign_token = res.data.token;
+				for (var i in param) {
+					if (!that.isEmpty(param[i], true)) {
+						arr.push(i + '=' + param[i]);
+					}
+				}
+				arr.sort();
+				param._sign = encrypt.sha1(arr.join('&') + res.data.token).toUpperCase();
+				return onsuccess(param);
+			} else {
+				return onerror && onerror(res.info) || that.info(res.info);
+			}
+		});
+	},
+
+	/**
+	 * 格式化参数(password加密)
+	 * @param {string}     query:参数
+	 */
+	formatparam: function(query) {
+		var json = {};
+		if (typeof(query) == 'object') {
+			for (var i in query) {
+				if (i.indexOf('password') > -1) {
+					query[i] = encrypt.md5(encrypt.sha1(query[i]));
+				}
+			}
+			return query;
+		} else {
+			var vars = query.split('&');
+			for (var i = 0; i < vars.length; i++) {
+				var pair = vars[i].split('=');
+				if (pair[0].indexOf('password') != -1) {
+					pair[1] = encrypt.md5(encrypt.sha1(pair[1]));
+				} else {
+					pair[1] = pair[1];
+				}
+				if (typeof json[pair[0]] === 'undefined') {
+					json[pair[0]] = pair[1];
+				} else if (typeof json[pair[0]] === 'string') {
+					var arr = [json[pair[0]], pair[1]];
+					json[pair[0]] = arr;
+				} else {
+					json[pair[0]].push(pair[1]);
+				}
+			}
+			return json;
+		}
+	},
+
+	/**
+	 * 判断是否数组
+	 * 
+	 * 1. 通过object类型的副属性class判断,
+	 * 	其中函数的class是Function,结果是[object Function]
+	 * 	普通的对象是Object,结果是[object Object]
+	 * 	Object.prototype.toString.call(arr) === '[object Array]'	
+	 * 2. 通过原型去判断
+	 * 	arr.constructor === Array	
+	 * 	Array.prototype.isPrototypeOf(arr)
+	 * 	arr.__proto__ === Array.prototype	
+	 * 	Object.getPrototypeOf(arr) === Array.prototype
+	 * 	arr instanceof Array
+	 * 3. es6新增方法
+	 * 	Array.isArray(arr)	
+	 */
+	isArray: function(arr) {
+		return arr && typeof(arr) == 'object' && Object.prototype.toString.call(arr) === '[object Array]';
+	},
+
+	/**
+	 * 否判断指定参数是否是一个纯粹的对象
+	 * 所谓"纯粹的对象",就是通过"{}"或"new Object"创建的,不包括数组等对象
+	 * 
+	 * 1. 通过object类型的副属性class判断
+	 * 	Object.prototype.toString.call(obj) === '[object Object]'
+	 * 2. 通过原型去判断
+	 * 	obj.constructor === Object
+	 * 	obj instanceof Object(数组也是对象,所以 arr instanceof Object 也为true)
+	 * 3. typeof
+	 * 	typeof obj(除了{},null和[]也是'object')
+	 */
+	isPlainObject: function(obj) {
+		if (Object.getPrototypeOf) {
+			return obj && typeof(obj) == 'object' && Object.getPrototypeOf(obj) == Object.prototype;
+		} else {
+			return obj && typeof(obj) == 'object' && Object.prototype.toString.call(obj) == "[object Object]" &&
+				!obj.length;
+		}
+	},
+
+	/**
+	 * 获取对象大小
+	 * @param object
+	 */
+	getLength: function(object) {
+		return Object.keys(object).length
+	},
+
+	/**
+	 * 判断两个Json(纯粹)对象是否一样
+	 * @param objA
+	 * @param objB
+	 */
+	compareJsonObj: function(objA, objB) {
+		if (!this.isPlainObject(objA) || !this.isPlainObject(objB)) return false; //判断类型是否正确
+		return this.compareObj(objA, objB); //默认为true
+	},
+
+	/**
+	 * 判断两个对象是否一样
+	 * @param objA
+	 * @param objB
+	 * @param flag
+	 */
+	compareObj: function(objA, objB, flag) {
+		if (this.getLength(objA) != this.getLength(objB)) return false;
+		flag = flag || true;
+		for (var key in objA) {
+			if (!flag) //flag为false,则跳出整个循环
+				break;
+			if (!objB.hasOwnProperty(key)) { //是否有自身属性,而不是继承的属性
+				flag = false;
+				break;
+			}
+			if (!this.isArray(objA[key])) { //子级不是数组时,比较属性值        	
+				if (this.isPlainObject(objA[key])) {
+					if (this.isPlainObject(objB[key])) {
+						if (!flag) //这里跳出循环是为了不让递归继续
+							break;
+						flag = this.compareObj(objA[key], objB[key], flag);
+					} else {
+						flag = false;
+						break;
+					}
+				} else {
+					if (String(objB[key]) != String(objA[key])) { //排除数字比较的类型差异
+						flag = false;
+						break;
+					}
+				}
+			} else {
+				if (!this.isArray(objB[key])) {
+					flag = false;
+					break;
+				}
+				var oA = objA[key],
+					oB = objB[key];
+				if (oA.length != oB.length) {
+					flag = false;
+					break;
+				}
+				for (var k in oA) {
+					if (!flag) //这里跳出循环是为了不让递归继续
+						break;
+					flag = this.compareObj(oA[k], oB[k], flag);
+				}
+			}
+		}
+		return flag;
+	},
+
+	/**
+	 * 将一个或多个对象的内容合并到目标对象
+	 * @param  Object target 目标对象,其他对象的成员属性将被附加到该对象上
+	 * @param  Object target 目标对象,第一个被合并的对象
+	 * @param  Object target 目标对象,第二个被合并的对象
+	 */
+	extend: Object.assign || function(target, source, deep) {
+		for (key in source) {
+			if (deep && (this.isPlainObject(source[key]) || this.isArray(source[key]))) {
+				if (this.isPlainObject(source[key]) && !this.isPlainObject(target[key])) {
+					target[key] = {};
+				}
+				if (this.isArray(source[key]) && !this.isArray(target[key])) {
+					target[key] = [];
+				}
+				this.extend(target[key], source[key], deep);
+			} else if (source[key] !== undefined) {
+				target[key] = source[key];
+			}
+		}
+		return target;
+	},
+
+	/**
+	 * 判断一个对象是否为空
+	 * @param {string}     string:要判断的参数
+	 * @param {string}     is_zero:是否要判断'0'
+	 */
+	isEmpty: function(string, is_zero = false) {
+		if (is_zero && string === '0') {
+			return true;
+		}
+		// 0 == '',false == '',[] == ''
+		if (string == '' || string == null || typeof(string) == 'undefined' || string == 'undefined') {
+			return true;
+		}
+		// 对象 和 数组
+		if (typeof(string) == 'object') {
+			return this.getLength(string) ? false : true;
+		}
+		return false;
+	},
+
+	/**
+	 * 为客户端生成一个唯一的uuid
+	 */
+	uuid: function() {
+		var uuid,
+			random = function() {
+				return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
+			};
+		uuid = cache.get('uuid');
+		if (!uuid) {
+			uuid = encrypt.sha1(random() + random() + '-' + random() + '-' + random() + '-' + random() + '-' +
+				random() + random() + random());
+			cache.set('uuid', uuid);
+		}
+		return uuid;
+	},
+
+	/**
+	 * 获取设备唯一标识
+	 */
+	getClientId: function() {
+		//获取客户端ID
+		var clientid = cache.get('client_id');
+		if (clientid) return clientid;
+		//TODO::
+	},
+
+	/**
+	 * 获取用户登录信息
+	 * @param k 键值
+	 * @param d 入没有返回的默认值
+	 */
+	getUserInfo: function(k, d) {
+		if (d == 'undefined') {
+			d = 0;
+		}
+		var userInfo = cache.get('user_info');
+		if (this.isEmpty(userInfo)) {
+			return d;
+		} else {
+			if (typeof k == 'undefined') {
+				return userInfo;
+			} else {
+				if (typeof userInfo[k] == 'undefined') {
+					return d;
+				} else {
+					return userInfo[k];
+				}
+			}
+		}
+	},
+
+	/**
+	 * 查找指定值的元素在数组中第一次出现的位置
+	 * 查找指定键的值的元素在二维数组中第一次出现的位置
+	 * @param arr  数组
+	 * @param val  要查找的值
+	 * @param key  二维数组元素的值对应的键
+	 */
+	indexOf: function(arr, val, key) {
+		if (this.isEmpty(arr) || this.isEmpty(val)) return -1;
+		if (typeof key == 'undefined') {
+			for (let i = 0; i < arr.length; i++) {
+				if (arr[i] == val) {
+					return i;
+				}
+			}
+		} else {
+			for (let i = 0; i < arr.length; i++) {
+				if (arr[i][key] == val) {
+					return i;
+				}
+			}
+		}
+		return -1;
+	},
+
+	/**
+	 * (批量)删除数组中指定值的元素
+	 * (批量)删除二维数组中指定键的值的元素
+	 * @param {Object} arr  (二维)数组
+	 * @param {Object} vals 值(数组)
+	 * @param {Object} key	值(数组)组对应的键
+	 */
+	removeItemByVals: function(arr, vals, key) {
+		var that = this;
+		if (this.isEmpty(arr) || this.isEmpty(vals)) return arr;
+		if (this.isArray(vals)) {
+			//!倒序删除
+			if (typeof key == 'undefined') {
+				for (let i = arr.length - 1; i >= 0; i--) {
+					let index = that.indexOf(vals, arr[i]);
+					if (index > -1) {
+						arr.splice(i, 1);
+					}
+				}
+			} else {
+				for (let i = arr.length - 1; i >= 0; i--) {
+					let index = that.indexOf(vals, arr[i][key]);
+					if (index > -1) {
+						arr.splice(i, 1);
+					}
+				}
+			}
+		} else {
+			let index = this.indexOf(arr, vals, key);
+			if (index > -1) {
+				arr.splice(index, 1);
+			}
+		}
+		return arr;
+	},
+
+	/**
+	 * 批量删除数组中指定键的元素
+	 * @param {Object} arr   数组
+	 * @param {Object} indexs 序号(数组)
+	 */
+	removeItemByIndex: function(arr, indexs) {
+		var that = this;
+		if (this.isEmpty(arr) || this.isEmpty(indexs)) return arr;
+		if (this.isArray(indexs)) {
+			//!倒序删除
+			for (let i = arr.length - 1; i >= 0; i--) {
+				let index = that.indexOf(indexs, i);
+				if (index > -1) {
+					arr.splice(i, 1);
+				}
+			}
+		} else {
+			arr.splice(indexs, 1);
+		}
+		return arr;
+	},
+
+	/**
+	 * 返回数组中某个单一列的值
+	 */
+	array_column: function(arr, key) {
+		if (this.isEmpty(arr)) return arr;
+		if (this.isEmpty(key)) return [];
+		var vals = [];
+		arr.forEach(item => {
+			vals.push(item[key]);
+		});
+		return vals;
+	},
+
+	/**
+	 * 对象按照key排序
+	 * @param {Object} arr
+	 */
+	array_ksort: function(arr) {
+		let sorted = {},
+			keys = Object.keys(arr);
+		keys.sort();
+		keys.forEach((key) => {
+			sorted[key] = arr[key];
+		})
+		return sorted;
+	},
+
+	/**
+	 * 数组按元素(指定键值)排序
+	 * @param {Object} arr
+	 * @param {Object} key
+	 * @param {Object} sort asc desc
+	 */
+	array_vsort: function(arr, key, sort) {
+		if (this.isEmpty(arr)) return arr;
+		key = key || '';
+		sort = sort || 'asc';
+		if (key == '') {
+			return arr.sort();
+		} else {
+			if (sort == 'asc') {
+				return arr.sort(function(a, b) {
+					return a[key] - b[key];
+				});
+			} else {
+				return arr.sort(function(a, b) {
+					return b[key] - a[key];
+				});
+			}
+		}
+	},
+	/**
+	 * 日期时间格式化
+	 * @param {Object} date 日期对象
+	 */
+	formatDate: function({
+		value = '',
+		mode = ''
+	}) {
+		var date = value
+		var that = this;
+		if(that.isEmpty(date,true)) {
+			date = new Date();
+		} else {
+			if (typeof date == 'number') {
+				date = new Date(parseInt(date));
+			} else if (typeof date == 'string') {
+				date = new Date(date);
+			}
+		}
+		var value1 = ''
+		let Y = date.getFullYear();
+		let M = +(date.getMonth()+1 < 10 ?  '0' +(date.getMonth()+1) : date.getMonth()+1) ;
+		let D = date.getDate();
+		let h = date.getHours();
+		let m = date.getMinutes();
+		let s = date.getSeconds();
+		if(mode == 'year-month') {
+			value1 = Y+ '-'+ M
+		} else {
+			value1 = Y+ '-'+M+ '-'+D
+		}
+		return value1
+	},
+	/**
+	 * 日期时间格式化
+	 * @param {Object} date 日期对象
+	 * @param {Object} type 增加加的时间间隔:y年 q季度(3个月) m月 d天
+	 * @param {Object} number 增加的时间间隔的个数
+	 * @param {Object} format 格式化样式
+	 */
+	formatDate1: function({
+		date = '',
+		type = 'y',
+		number = 0,
+		format = 'Y-m-d'
+	}) {
+		var that = this;
+		if (that.isEmpty(date, true)) {
+			date = new Date();
+		} else {
+			if (typeof date == 'number') {
+				date = new Date(parseInt(date) * 1000);
+			} else if (typeof date == 'string') {
+				date = new Date(date);
+			}
+		}
+		date = that.addDate(type, number, date);
+		var zero = function(value) {
+				if (value < 10) {
+					return '0' + value;
+				}
+				return value;
+			},
+			year = date.getFullYear(),
+			month = zero(date.getMonth() + 1),
+			day = zero(date.getDate());
+			// hour = zero(date.getHours()),
+			// minite = zero(date.getMinutes()),
+			// second = zero(date.getSeconds());
+		return format.replace(/Y|m|d/ig, function(matches) {
+			return ({
+				Y: year,
+				m: month,
+				d: day,
+				// H: hour,
+				// i: minite,
+				// s: second,
+			})[matches];
+		});
+	},
+
+	/**
+	 * 日期时间计算
+	 * addDate(type,number,date)
+	 * @param {Object} type 增加的时间间隔:y年 q季度(3个月) m月 d天
+	 * @param {Object} number 增加的时间间隔的个数
+	 * @param {Object} date 开始日期对象
+	 * @return {type} 新的日期对象
+	 * var now = new Date();
+	 * var newDate = addDate( "d", 5, now);
+	 */
+	addDate: function(type, number, date) {
+		switch (type) {
+			case "y": {
+				date.setFullYear(date.getFullYear() + number);
+				return date;
+				break;
+			}
+			case "q": {
+				date.setMonth(date.getMonth() + number * 3);
+				return date;
+				break;
+			}
+			case "m": {
+				date.setMonth(date.getMonth() + number);
+				return date;
+				break;
+			}
+			case "w": {
+				date.setDate(date.getDate() + number * 7);
+				return date;
+				break;
+			}
+			case "d": {
+				date.setDate(date.getDate() + number);
+				return date;
+				break;
+			}
+			case "h": {
+				date.setHours(date.getHours() + number);
+				return date;
+				break;
+			}
+			case "m": {
+				date.setMinutes(date.getMinutes() + number);
+				return date;
+				break;
+			}
+			case "s": {
+				date.setSeconds(date.getSeconds() + number);
+				return date;
+				break;
+			}
+			default: {
+				date.setDate(date.getDate() + number);
+				return date;
+				break;
+			}
+		}
+	},
+
+	/**
+	 * 二维码操作
+	 * @param {Object} canvas		图片路径
+	 * @param {Object} action 	操作类型 
+	 * 	qrcode:绘制二维码(根据内容data)
+	 * 	scan:扫描二维码
+	 * @param {Object} canvas 	绘制二维码canvasID
+	 * @param {Object} data 	绘制二维码内容
+	 * @param {Object} camera 扫描二维码是否只使用相机
+	 * @param {Object} success 	成功回调
+	 * @param {Object} error 	失败回调
+	 */
+	qrCodeOperat({
+		action = 'qrcode',
+		canvas,
+		data,
+		camera = false,
+		success,
+		error
+	}) {
+		var that = this;
+		switch (action) {
+			case 'qrcode':
+				qrCode({
+					width: 180,
+					height: 180,
+					x: 20,
+					y: 20,
+					canvasId: canvas,
+					text: data,
+				});
+				break;
+			case 'scan':
+				uni.scanCode({
+					onlyFromCamera: camera,
+					success(res) {
+						if (res.errMsg == 'scanCode:ok') {
+							// 二维码内容 res.result
+							success && success(res.result);
+						} else {
+							error && error(res);
+						}
+					},
+					fail(res) {
+						if (res.errMsg != 'scanCode:fail cancel') {
+							error && error(res);
+						}
+					}
+				});
+				break;
+			default:
+				that.modal('请明确二维码操作类型');
+		}
+	},
+
+	/**
+	 * 图片操作
+	 * @param {Object} path		图片路径
+	 * @param {Object} action 	操作类型 
+	 *  choose:选择图片
+	 *  upload:图片上传
+	 * 	info:图片信息 
+	 * 	read:读取图片(base64)
+	 *  write:保存图片(base64)
+	 * 	down:下载图片
+	 *  save:保存图片(临时路径)
+	 *  preview:图片预览
+	 * @param {Object} data 	保存图片:图片base64内容(不带 data:image/png;base64,),
+	 * 							图片预览:图片数组
+	 * @param {Object} fileName 保存图片的名称
+	 * @param {Object} menu 	图片预览:是否显示长按菜单
+	 * @param {Object} count 	图片选择:默认图片选择数量
+	 * @param {Object} success 	成功回调
+	 * @param {Object} error 	失败回调
+	 */
+	imageOperat({
+		action = 'choose',
+		path,
+		fileName = 'write',
+		data,
+		count = 1,
+		menu = true,
+		success,
+		error
+	}) {
+		var that = this;
+		if (action == 'choose') {
+			uni.chooseImage({
+				count: count,
+				sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+				sourceType: ['camera', 'album'], //相册选择、使用相机
+				success: (e) => {
+					e.tempFilePaths.forEach((item) => {
+						success && success(item);
+					});
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'upload') {
+			uni.uploadFile({
+				url: that.config.baseUrl + '/api/Publics/uploadLocality',
+				filePath: path,
+				name: 'upfile',
+				/* header: {
+					'content-type': 'multipart/form-data'
+				}, */
+				formData: {
+					// uid: that.getUserInfo('id', 0)
+					file: path
+				},
+				success(e) {
+					console.log(e)
+					let res = JSON.parse(e.data);
+					if (res.status == 1) {
+						success && success(res);
+					} else {
+						error && error({
+							errMsg: res.info
+						});
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'info') {
+			uni.getImageInfo({
+				src: path,
+				success(e) {
+					if (e.errMsg == 'getImageInfo:ok') {
+						//e.height e.width e.type
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'read') {
+			uni.getFileSystemManager().readFile({
+				filePath: path,
+				encoding: 'base64',
+				position: 0,
+				success(e) {
+					if (e.errMsg == 'readFile:ok') {
+						//let img = 'data:image/png;base64,' + e.data.replace(/[\r\n]/g, "");
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e_t) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'write') {
+			let filePath = `${uni.env.USER_DATA_PATH}/${fileName}.png`;
+			uni.getFileSystemManager().writeFile({
+				filePath: filePath,
+				data: data,
+				encoding: 'base64',
+				success(e) {
+					if (e.errMsg == 'writeFile:ok') {
+						success && success(filePath);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					console.log(e);
+					error && error(e);
+				}
+			});
+		} else if (action == 'down') {
+			uni.downloadFile({
+				url: path,
+				success(e) {
+					if (e.errMsg === 'downloadFile:ok') {
+						//e.tempFilePath
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			})
+		} else if (action == 'save') {
+			let filePath = `${uni.env.USER_DATA_PATH}/${fileName}.png`;
+			uni.getFileSystemManager().saveFile({
+				tempFilePath: path,
+				filePath: filePath,
+				success(e) {
+					if (e.errMsg == 'saveFile:ok') {
+						success && success(filePath);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					console.log(e);
+					error && error(e);
+				}
+			});
+		} else if (action == 'preview') {
+			uni.previewImage({
+				currnet: path,
+				urls: data,
+				showmenu: menu
+			});
+		}
+	},
+	/**
+	 * 视频操作
+	 */
+	viedoOperat({
+		action = 'choose',
+		count = 1, //上传视频的个数
+		mediaType = ['video'], //限制上传的类型为video
+		sourceType = ['album', 'camera'], //视频选择来源
+		maxDuration = 58, //拍摄限制时间
+		camera = 'back', //采用后置摄像头
+		filePath,
+		path,
+		size = 20,
+		success,
+		error
+	}) {
+		var that = this
+		if (action == 'choose') {
+			uni.chooseMedia({
+				count: count,
+				mediaType: mediaType,
+				sourceType: sourceType,
+				maxDuration: maxDuration,
+				camera: camera,
+				success(e) {
+					console.log(e)
+					if (e.errMsg == 'chooseMedia:ok') {
+						e.tempFiles.forEach((item) => {
+							let sel_size = parseFloat(item.size / 1024 / 1024).toFixed(1)
+							if (sel_size > size) {
+								let beyongSize = sel_size - size //获取视频超出限制大小的数量
+								that.info("上传的视频大小超限,超出" + beyongSize + "MB,请重新上传!")
+								error && error();
+							} else {
+								success && success(item);
+							}
+						});
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					console.log(e);
+					error && error(e);
+				}
+			})
+		}
+		//压缩视频
+		if (action == 'compress') {
+			uni.compressVideo({
+				quality: 'high',
+				src: filePath,
+				success(e) {
+					console.log(e)
+					if (e.errMsg == 'compressVideo:ok') {
+						// e.tempFiles.forEach((item) => {
+						success && success(e);
+						// });
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					console.log(e);
+					error && error(e);
+				}
+			})
+		}
+	},
+	/**
+	 * 位置服务
+	 * @param {Object} action 	操作类型 
+	 * 	getLocation: 获取当前的地理位置、速度
+	 *  openLocation: 使用微信内置地图查看位置
+	 *  chooseLocation: 打开地图选择位置
+	 *  choosePoi: 打开 POI 列表选择位置
+	 * 	getLatLng: 获取指定地址经纬度
+	 *  getAreaCode: 根据经纬度获取区划信息
+	 *  getDistance: 计算2个经纬度之间的距离
+	 * @param {Object} type 	返回坐标类型: wgs84返回gps坐标,gcj02 返回可用于 uni.openLocation 的坐标
+	 * @param {Object} address 	查询地址: '北京市海淀区彩和坊路海淀西大街74号'
+	 * @param {Object} from 	计算距离起点坐标,默认当前位置
+	 * {latitude: 0, longitude: 0}
+	 * @param {Object} to 		计算距离终点坐标
+	 * [{latitude: 0, longitude: 0}]
+	 * @param {Object} success 	成功回调
+	 * @param {Object} error 	失败回调
+	 */
+	locationOperat({
+		action = 'getLocation',
+		type = 'gcj02',
+		address,
+		from = '',
+		to,
+		success,
+		error
+	}) {
+		var that = this;
+		if (action == 'getLocation') {
+			uni.getLocation({
+				type: type,
+				success(e) {
+					if (e.errMsg == 'getLocation:ok') {
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'openLocation') {
+			var {
+				latitude,
+				longitude
+			} = from;
+			uni.openLocation({
+				latitude: latitude,
+				longitude: longitude,
+				success(e) {
+					if (e.errMsg == 'openLocation:ok') {
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'chooseLocation') {
+			var {
+				latitude = '',
+					longitude = ''
+			} = from;
+			uni.chooseLocation({
+				latitude: latitude,
+				longitude: longitude,
+				success(e) {
+					if (e.errMsg == 'chooseLocation:ok') {
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'choosePoi') {
+			var {
+				latitude = '',
+					longitude = ''
+			} = from;
+			uni.choosePoi({
+				success(e) {
+					if (e.errMsg == 'choosePoi:ok') {
+						success && success(e);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'getLatLng') {
+			new qqMap({
+				key: that.config.qqMapKey
+			}).geocoder({
+				address: address,
+				success(e) {
+					if (e.status == 0 && e.message == 'query ok') {
+						success && success(e.result);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'getAreaCode') {
+			new qqMap({
+				key: that.config.qqMapKey
+			}).reverseGeocoder({
+				success(e) {
+					if (e.status == 0 && e.message == 'query ok') {
+						success && success(e.result);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'getDistanceApi') {
+			new qqMap({
+				key: that.config.qqMapKey
+			}).calculateDistance({
+				from: from, //若起点有数据则采用起点坐标,若为空默认当前地址
+				to: to,
+				success(e) {
+					if (e.status == 0 && e.message == 'query ok') {
+						success && success(e.result.elements);
+					} else {
+						error && error(e);
+					}
+				},
+				fail(e) {
+					error && error(e);
+				}
+			});
+		} else if (action == 'getDistanceMath') { // 返回KM
+			var {
+				latitude: lat1 = '',
+				longitude: lng1 = ''
+			} = from;
+			if (lat1 == '' && lng1 == '') {
+				return 0;
+			}
+			var {
+				latitude: lat2 = '',
+				longitude: lng2 = ''
+			} = to;
+			var toRad = function(d) {
+				return d * Math.PI / 180;
+			};
+			var dis = 0;
+			var deltaLng = toRad(lng1) - toRad(lng2);
+			var radLat1 = toRad(lat1);
+			var radLat2 = toRad(lat2);
+			var deltaLat = radLat1 - radLat2;
+			var dis = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(deltaLat / 2), 2) + Math.cos(radLat1) * Math.cos(
+				radLat2) * Math.pow(Math.sin(deltaLng / 2), 2)));
+			return that.math.toFixed(dis * 6378.137, 2); // km
+		}
+	},
+
+	/**
+	 * 过滤emoji
+	 * @param {Object} str
+	 */
+	filterEmoji: function(str) {
+		return str.replace(/\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g, '');
+	},
+
+	/**
+	 * 打印对象
+	 * @param obj
+	 */
+	jslog: function(obj) {
+		this.config.debug && console.log(JSON.stringify(obj));
+	},
+
+	/**
+	 * form表单数据校验
+	 * @param value
+	 * @param rule
+	 */
+	formCheck: function(value, rule, error) {
+		var that = this;
+		var regs = {
+			required: [
+				/[\s\S]+/,
+				'必填项不能为空',
+			],
+			english: [
+				/^[a-zA-Z]+$/,
+				'必填项只能由大小写字母组成',
+			],
+			mobile: [
+				/^1[3|4|5|7|8|9][0-9]\d{4,8}$/,
+				'请输入正确的手机号',
+			],
+			phone: [
+				/^(\d{3,4}-?)?\d{7,9}$/g,
+				'请输入正确的电话号码',
+			],
+			email: [
+				/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,
+				'请输入正确的电子邮箱'
+			],
+			url: [
+				/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,
+				'请输入正确的链接'
+			],
+			number: [
+				/^\d+$/,
+				'必填项只能填数字'
+			],
+			code4: [
+				/^\d{4}$/,
+				'请输入正确的手机验证码'
+			],
+			code6: [
+				/^\d{6}$/,
+				'请输入正确的手机验证码'
+			],
+			captcha4: [
+				/^[0-9a-zA-Z]{4}$/,
+				'请输入正确的图片验证码'
+			],
+			date: [
+				/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,
+				'请输入正确的日期格式'
+			],
+			identity: [
+				/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,
+				'请输入正确的身份证号'
+			],
+			username: [
+				/^[a-zA-Z0-9\u4e00-\u9fa5-_\.]{2,12}$/,
+				'请输入正确的帐号(只能包含中文、英文、数字、下划线等字符)'
+			],
+			password: [
+				/^\w{6,16}$/,
+				'请输入正确的密码(6-16位数字,字母或符号)'
+			],
+			passwords: [
+				/^[a-zA-Z]+\w{5,12}$/,
+				'请输入正确的密码(以字母开头,长度在6-12之间)'
+			],
+			pwd: [
+				/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9a-zA-Z]{6,12}$/,
+				'请输入正确的密码(6-12位数字+字母组合)'
+			],
+			invite: [
+				/^[0-9a-zA-Z]{10}$/,
+				'邀请码为8位数字或字母组合'
+			],
+			truename: [
+				/^[\u4e00-\u9fa5]{2,4}$/,
+				'请输入正确的真实姓名(2-4个汉字)'
+			],
+			money: [
+				/((^[1-9]\d*)|^0)(\.\d{0,2}){0,1}$/,
+				'请输入正确的金额'
+			]
+		};
+		var reg = regs[rule];
+		if (that.isEmpty(reg)) {
+			return true;
+		} else {
+			if (value == '' || !RegExp(reg[0]).test(value)) {
+				that.info(error || reg[1]);
+				return false;
+			}
+			return true;
+		}
+	},
+
+	/****************************************************/
+
+	/**
+	 *获取系统信息
+	 * @param label 获取系统的某一项信息
+	 * screenWidth		屏幕宽度,
+	 * screenHeight 	屏幕高度,单位px
+	 * windowWidth		单位px可使用窗口宽度,单位px
+	 * windowHeight		可使用窗口高度,单位px
+	 * statusBarHeight	状态栏的高度,单位px
+	 * menuButton:右上角胶囊按钮的布局位置信息,坐标信息以屏幕左上角为原点
+	 * width			宽度,单位:px
+	 * height			高度,单位:px
+	 * top				上边界坐标,单位:px
+	 * right			右边界坐标,单位:px
+	 * bottom			下边界坐标,单位:px
+	 * left				左边界坐标,单位:px
+	 */
+	getSystemInfo(success) {
+		// 获取系统状态栏信息
+		uni.getSystemInfo({
+			success: (res) => {
+				if (res.errMsg == 'getSystemInfo:ok') {
+					res.menuButton = uni.getMenuButtonBoundingClientRect();
+					success && success(res);
+				} else {
+					that.modal('获取系统信息失败:' + res.errMsg);
+				}
+			},
+			fail: (res) => {
+				that.modal('获取系统信息失败:' + res.errMsg);
+			}
+		});
+	},
+
+	/**
+	 * 检查登录
+	 */
+	getSessionKey: function(success) {
+		let that = this;
+		let data = {};
+		data.openid = cache.get('open_id');
+		data.session_key = cache.get('session_key');
+		// 都存在
+		if (!that.isEmpty(data.session_key) && !that.isEmpty(data.openid)) {
+			uni.checkSession({
+				success() {
+					success && success(data);
+				},
+				fail() {
+					cache.remove('open_id');
+					cache.remove('session_key');
+					that.getOpenId(success);
+				}
+			});
+		} else {
+			cache.remove('open_id');
+			cache.remove('session_key');
+			that.getOpenId(success);
+		}
+	},
+
+	/**
+	 * 获取openid
+	 * @param success
+	 */
+	getOpenId: function(success, error) {
+		var that = this;
+		that.loading();
+		uni.login({
+			success: (e) => {
+				that.req({
+					url: 'public/getOpenid',
+					data: {
+						code: e.code
+					},
+					login: false,
+					load: false
+				}, function(res) {
+					if (res.status == 1) {
+						cache.set('open_id', res.data.openid);
+						cache.set('session_key', res.data.session_key);
+						success && success(res.data);
+					} else {
+						that.modal('微信登录失败:' + res.info, function() {
+							error && error();
+						});
+						return false;
+					}
+				}, function() {}, function() {
+					that.closeLoading();
+				});
+			},
+			fail: (e) => {
+				that.closeLoading();
+				that.modal('微信登录失败:' + e.errMsg, function() {
+					error && error();
+				});
+			}
+		});
+	},
+
+	/**
+	 * 登录
+	 * @param {Object} data
+	 * @param {Object} success
+	 * @param {Object} error
+	 */
+	doLogin: function(data, success, error) {
+		var that = this;
+		data.loginsubmit = 'yes';
+		this.req({
+			url: 'account/login',
+			data: data,
+			login: false
+		}, function(res) {
+			if (res.status == 1) {
+				cache.set('user_info', res.data);
+				success && success(res.data);
+			} else {
+				error && error(res);
+			}
+		});
+	},
+
+	/**
+	 * 注册
+	 * @param {Object} data
+	 * @param {Object} success
+	 * @param {Object} error
+	 */
+	doRegist: function(data, success, error) {
+		var that = this;
+		data.registsubmit = 'yes';
+		this.req({
+			url: 'account/register',
+			data: data,
+			login: false
+		}, function(res) {
+			if (res.status == 1) {
+				cache.set('user_info', res.data);
+				success && success(res.data);
+			} else {
+				error && error(res);
+			}
+		});
+	},
+
+	/**
+	 * 查询是否注册
+	 * @param {Object} success
+	 * @param {Object} error
+	 */
+	checkRegist: function(success, error) {
+		var that = this;
+		that.getSessionKey(function(data) {
+			that.req({
+				url: 'account/checkRegist',
+				data: {
+					open_id: data.openid,
+					registsubmit: 'yes'
+				},
+				login: false,
+				load: false
+			}, function(res) {
+				if (res.status == 1) {
+					success && success();
+				} else {
+					error && error();
+				}
+			});
+		});
+	},
+
+	/**
+	 * 获取会员信息
+	 * @param {Object} success
+	 * @param {Object} error
+	 */
+	getMemberInfo: function(success, error) {
+		var that = this;
+		this.req({
+			url: 'center/getMemberInfo',
+			load: false
+		}, function(res) {
+			if (res.status == 1) {
+				cache.set('user_info', res.data);
+				success && success(res.data);
+			} else {
+				error && error(res);
+			}
+		});
+	},
+
+	/**
+	 * 获取用户微信资料
+	 * @param success
+	 */
+	getUserProfile: function(success, error) {
+		var that = this;
+		that.loading('获取微信信息中...');
+		uni.getUserProfile({
+			lang: 'zh_CN',
+			desc: '用于完善会员资料',
+			success: (res) => {
+				if (res.errMsg == 'getUserProfile:ok') {
+					// 过滤掉emoji
+					res.userInfo.nickName = that.filterEmoji(res.userInfo.nickName);
+					success(res.userInfo);
+				} else {
+					that.modal('获取微信信息失败:' + res.errMsg, function() {
+						error && error(res);
+					});
+				}
+			},
+			fail: (res) => {
+				that.modal('获取微信信息失败:' + res.errMsg, function() {
+					console.log(res)
+					error && error(res);
+				});
+			},
+			complete: () => {
+				that.closeLoading();
+			}
+		});
+	},
+
+	/**
+	 * 获取配置信息
+	 * @param success
+	 */
+	getConfigInfo: function({
+		source = 'system',
+		label = '',
+		success
+	}) {
+		this.req({
+			url: 'public/configInfo',
+			data: {
+				source: source,
+				label: label
+			},
+			login: false,
+			load: false
+		}, function(res) {
+			success(res.data);
+		});
+	},
+
+	/**
+	 * 获取微信手机号
+	 * @param e
+	 * @param success
+	 */
+	getMobile: function(e, success) {
+		var that = this;
+		that.getSessionKey(function(data) {
+			if (e.detail.errMsg == 'getPhoneNumber:ok') {
+				that.req({
+					url: 'public/getMobile',
+					data: {
+						encryptedData: e.detail.encryptedData,
+						iv: e.detail.iv,
+						sessionKey: data.session_key
+					},
+					login: false
+				}, function(res) {
+					if (res.status == 1) {
+						success(res.data);
+					} else {
+						that.modal('获取手机号失败' + res.info);
+						return false;
+					}
+				});
+			} else {
+				that.modal('获取手机号失败' + e.detail.errMsg);
+			}
+		});
+	},
+
+	/**
+	 * 拨打电话
+	 * @param mobile
+	 */
+	makeCall: function(mobile) {
+		this.modal('确定拨打' + mobile, function() {
+			uni.makePhoneCall({
+				phoneNumber: mobile
+			});
+		}, true);
+	},
+
+	/**
+	 * 修改页面标题
+	 * @param title
+	 */
+	changeNavBarTitle: function(title) {
+		uni.setNavigationBarTitle({
+			title: title
+		});
+	},
+
+	/**
+	 * 检查版本更新
+	 */
+	checkUpdate: function() {
+		if (uni.canIUse('getUpdateManager')) {
+			const updateManager = uni.getUpdateManager()
+			updateManager.onCheckForUpdate(function(res) {
+				if (res.hasUpdate) {
+					updateManager.onUpdateReady(function() {
+						uni.showModal({
+							title: '更新提示',
+							content: '新版本已经准备好,是否重启应用?',
+							success: function(res) {
+								if (res.confirm) {
+									updateManager.applyUpdate()
+								}
+							}
+						})
+					})
+					updateManager.onUpdateFailed(function() {
+						uni.showModal({
+							title: '已经有新版本了~',
+							content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开~'
+						})
+					})
+				}
+			})
+		} else {
+			uni.showModal({
+				title: '提示',
+				content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
+			})
+		}
+	},
+	/**
+	 * html转义
+	 * @param {object} str    //需要转义内容
+	 * @param {object} success  
+	 */
+	escape2Html(str, success) {
+		var arrEntities = {
+			'lt': '<',
+			'gt': '>',
+			'nbsp': ' ',
+			'amp': '&',
+			'quot': '"'
+		};
+		return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t) {
+			return arrEntities[t];
+		}).replace(/<section/g, '<div').replace(/<u>/g, '').replace(/<u style="">/g, '').replace(/<\/u>/g, '');
+	},
+	/**
+	 * 分享信息
+	 */
+	shareInfo: function() {
+		var that = this;
+		var userInfo = cache.get('user_info');
+		if (!that.isEmpty(userInfo) && !that.isEmpty(userInfo.serial)) {
+			var path = `/pages/index/index?invite_code=${userInfo.serial}`;
+		} else {
+			var path = '/pages/index/index';
+		}
+		return {
+			title: that.config.name,
+			path: path,
+			// imageUrl: '/image/iconimg/login.png'
+		};
+	},
+	/**
+	 * 检测是否收藏
+	 * @param {object} id    //检测是否收藏的商品id
+	 * @param {object} success  
+	 */
+	checkStore(id, key, success) {
+		var that = this
+		var shopStore = cache.get(key);
+		if (that.isEmpty(shopStore)) {
+			success && success(false)
+		} else {
+			var have = 0
+			for (let i in shopStore) {
+				var d = shopStore[i];
+				if (d.id == id) {
+					// 有收藏
+					have = 1
+					success && success(true)
+					break;
+				}
+				if (have == 0) {
+					// 无收藏
+					success && success(false)
+				}
+			}
+		}
+	},
+	/**
+	 * 收藏缓存
+	 * @param {object} id    //需要收藏或取消的商品id
+	 * @param {object} success  
+	 */
+	changeStore(data, key, success) {
+		var shopStore = cache.get(key);
+		var that = this
+		var p = {}
+		p = data
+		if (that.isEmpty(shopStore)) {
+			var shopStore = []
+			shopStore.push(p);
+			cache.set(key, shopStore);
+			success && success('收藏成功')
+		} else {
+			var have = 0
+			for (let i in shopStore) {
+				var d = shopStore[i];
+				console.log(d, data)
+				if (d.id == data.id && d.table == data.table) {
+					// 有的话取消收藏
+					have = 1
+					shopStore.splice(i, 1);
+					cache.set(key, shopStore);
+					success && success('取消成功')
+					break;
+				}
+			}
+			if (have == 0) {
+				// 没有的话收藏
+				shopStore.push(p);
+				cache.set(key, shopStore);
+				success && success('收藏成功')
+			}
+		}
+	},
+
+	/****************************************************/
+
+	/**
+	 * 获取购物车信息,设置导航红点信息
+	 * @param index 设置信息 tabBar 序号
+	 */
+	getshopcar: function(success) {
+		var shopCar_list = cache.get('shop_car');
+		if (this.isEmpty(shopCar_list)) {
+			uni.hideTabBarRedDot({ //隐藏 tabBar 某一项的右上角文本
+				index: 2, //第几个 tabBar,从左边 0 算起
+				success: function() {
+					success && success(0);
+				}
+			});
+		} else {
+			var len = this.getLength(shopCar_list);
+			uni.setTabBarBadge({ //为 tabBar 某一项的右上角添加文本
+				index: 2, //第几个 tabBar,从左边 0 算起
+				text: String(len), //右上角添加的文本
+				success: function() {
+					success && success(len);
+				}
+			});
+		}
+	},
+	/**
+	 * 上拉刷新加载数据
+	 * @param {object} type
+	 * @param {object} page
+	 * @param {object} succes
+	 */
+	onReachFoot: function(url, data, succes) {
+		//type=1时请求找工作
+		if (url) {
+			this.req({
+				url: url,
+				data: data
+			}, function(res) {
+				if (res.status == 1) {
+					succes && succes(res.data);
+				}
+			})
+		} else {
+			succes && success(false)
+		}
+	},
+	/**
+	 * 电话聊天控制
+	 * @param price 价格
+	 * @param mobile 手机号
+	 * @param work_id 工作或求职id
+	 * @param {String} type 类型,work招工,worker求职
+	 * @param {String} buy_type 购买类型 pirce电话,chat_price聊天
+	 * @param send_id 被购买的用户id
+	 * @param send_name 被购买的名字
+	 */
+	makeCall(price, mobile, work_id, type, buy_type, send_id, send_name = '') {
+		var that = this
+		that.modal('将自动使用会员次数或东豆进行抵扣', function(params) {
+			that.req({
+				url: 'center/MobileOrMessage',
+				data: {
+					price: price,
+					mobile: mobile,
+					work_id: work_id,
+					type: type,
+					buy_type: buy_type,
+					send_id: send_id,
+					send_name: send_name
+				}
+			}, function(params) {
+				if (params.status == 1) {
+					if (buy_type == 'price') {
+						uni.makePhoneCall({
+							phoneNumber: mobile,
+						})
+					} else {
+						that.jump('/pages/chat/chat?id=' + send_id + '&nickname=' + send_name)
+					}
+				}
+				if (params.status == 2) {
+
+				}
+			})
+		}, true)
+	},
+	/**
+	 * 微信小程序防抖
+	 * @param func 防抖事件
+	 * @param wait 阻止时间
+	 */
+	debounce: function(func, wait) {
+		let timeout;
+		return function() {
+			console.log('防抖事件:' + func, '防抖时间:' + wait)
+			let context = this
+			let args = arguments
+			let later = () => {
+				timeout = null
+				func.apply(context, args)
+			}
+			clearTimeout(timeout)
+			timeout = setTimeout(later, wait)
+		}
+	}
+}

+ 102 - 0
unpackage/dist/build/h5/static/js/cache.js

@@ -0,0 +1,102 @@
+/**
+ * 缓存数据优化
+ * var cache = require('utils/cache.js');
+ * import cache from '../cache'
+ * 使用方法 【
+ *     一、设置缓存
+ *         string    cache.put('k', 'string你好啊');
+ *         json      cache.put('k', { "b": "3" }, 2);
+ *         array     cache.put('k', [1, 2, 3]);
+ *         boolean   cache.put('k', true);
+ *     二、读取缓存
+ *         默认值    cache.get('k')
+ *         string    cache.get('k', '你好')
+ *         json      cache.get('k', { "a": "1" })
+ *     三、移除/清理  
+ *         移除: cache.remove('k');
+ *         清理:cache.clear(); 
+ * 】
+ * @type {String}
+ */
+module.exports = {
+	/*
+	 * 缓存前缀 
+	 */
+	postfix:'twinkly_',
+	/**
+	 * 设置缓存 
+	 * @param  {[type]} k [键名]
+	 * @param  {[type]} v [键值]
+	 * @param  {[type]} e [过期时间:单位秒]
+	 * @param  {[type]} s 异步回调
+	 */
+    set:function(k, v, e, s){
+		var that=this;
+		var e=e || 0;
+		if(e>0) e=Date.parse(new Date()) + e*1000;
+		if(v){
+			
+			if(typeof s == 'function'){
+				wx.setStorage({
+					key: k,
+					data: v,
+					success() {
+						wx.setStorageSync(that.postfix + k, e)
+						s();
+					}
+				});
+			}else{
+				wx.setStorageSync(that.postfix + k, e)
+				wx.setStorageSync(k, v)
+			}
+		}else{
+			that.remove(k);
+		}
+	},
+	/**
+	 * 获取缓存 
+	 * @param  {[type]} k   [键名]
+	 */
+    get:function(k){
+		var that=this,
+		deadtime=wx.getStorageSync(that.postfix + k),
+		data=wx.getStorageSync(k);
+		if(deadtime>0){
+			var now=Date.parse(new Date());
+			if(deadtime<now){
+				return data;
+			}else{
+				return false;
+			}
+		}else{
+			return data;
+		}
+	},
+	/**
+	 * 清理指定缓存
+	 * @return {[type]} [description]
+	 */
+    remove:function(k){
+		var that=this;
+		wx.removeStorageSync(that.postfix + k);
+		wx.removeStorageSync(k);
+	},
+	/**
+	 * 获取缓存并销毁
+	 * @param  {[type]} k   [键名]
+	 * @param  {[type]} def [获取为空时默认]
+	 */
+	getonce:function(k){
+		var that=this;
+		var data=that.get(k);
+		that.remove(k);
+		return data;
+	},
+	/**
+	 * 清理所有缓存
+	 * @return {[type]} [description]
+	 */
+    clear:function(){
+		wx.clearStorageSync();
+	}
+}

+ 618 - 0
unpackage/dist/build/h5/static/js/calendar.js

@@ -0,0 +1,618 @@
+/**
+ * @1900-2100区间内的公历、农历互转
+ * 遇见更好的自己
+ * 
+ * @charset UTF-8
+ * @Author  Jea杨(JJonline@JJonline.Cn)
+ * @Time    2014-7-21
+ * @Time    2016-8-13 Fixed 2033hex、Attribution Annals
+ * @Time    2016-9-25 Fixed lunar LeapMonth Param Bug
+ * @Time    2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
+ * @Version 1.0.3
+ * @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
+ * @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
+ */
+module.exports = {
+
+	/**
+	 * 农历1900-2100的润大小信息表
+	 * @Array Of Property
+	 * @return Hex
+	 */
+	lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0,
+		0x055d2, //1900-1909
+		0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, //1910-1919
+		0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, //1920-1929
+		0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, //1930-1939
+		0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, //1940-1949
+		0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959
+		0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969
+		0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979
+		0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989
+		0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999
+		0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009
+		0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019
+		0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029
+		0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039
+		0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049
+		/**Add By JJonline@JJonline.Cn**/
+		0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059
+		0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069
+		0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079
+		0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089
+		0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099
+		0x0d520
+	], //2100
+
+	/**
+	 * 公历每个月份的天数普通表
+	 * @Array Of Property
+	 * @return Number
+	 */
+	solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
+
+	/**
+	 * 天干地支之天干速查表
+	 * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
+	 * @return Cn string
+	 */
+	Gan: ["\u7532", "\u4e59", "\u4e19", "\u4e01", "\u620a", "\u5df1", "\u5e9a", "\u8f9b", "\u58ec", "\u7678"],
+
+	/**
+	 * 天干地支之地支速查表
+	 * @Array Of Property
+	 * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
+	 * @return Cn string
+	 */
+	Zhi: ["\u5b50", "\u4e11", "\u5bc5", "\u536f", "\u8fb0", "\u5df3", "\u5348", "\u672a", "\u7533", "\u9149",
+		"\u620c", "\u4ea5"
+	],
+
+	/**
+	 * 天干地支之地支速查表<=>生肖
+	 * @Array Of Property
+	 * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
+	 * @return Cn string
+	 */
+	Animals: ["\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a", "\u7334", "\u9e21",
+		"\u72d7", "\u732a"
+	],
+
+	/**
+	 * 24节气速查表
+	 * @Array Of Property
+	 * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
+	 * @return Cn string
+	 */
+	solarTerm: ["\u5c0f\u5bd2", "\u5927\u5bd2", "\u7acb\u6625", "\u96e8\u6c34", "\u60ca\u86f0", "\u6625\u5206",
+		"\u6e05\u660e", "\u8c37\u96e8", "\u7acb\u590f", "\u5c0f\u6ee1", "\u8292\u79cd", "\u590f\u81f3",
+		"\u5c0f\u6691", "\u5927\u6691", "\u7acb\u79cb", "\u5904\u6691", "\u767d\u9732", "\u79cb\u5206",
+		"\u5bd2\u9732", "\u971c\u964d", "\u7acb\u51ac", "\u5c0f\u96ea", "\u5927\u96ea", "\u51ac\u81f3"
+	],
+
+	/**
+	 * 1900-2100各年的24节气日期速查表
+	 * @Array Of Property
+	 * @return 0x string For splice
+	 */
+	sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf97c3598082c95f8c965cc920f',
+		'97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
+		'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
+		'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
+		'97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
+		'97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
+		'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
+		'97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
+		'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
+		'97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
+		'9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
+		'97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
+		'97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
+		'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
+		'7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+		'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
+		'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
+		'97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+		'9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
+		'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
+		'97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
+		'9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
+		'7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
+		'7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+		'9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+		'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
+		'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
+		'97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+		'9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+		'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
+		'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
+		'977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
+		'7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+		'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
+		'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
+		'977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+		'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+		'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
+		'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
+		'977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+		'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
+		'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
+		'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
+		'7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+		'7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
+		'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
+		'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
+		'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
+		'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
+		'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
+		'7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
+		'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
+		'7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
+		'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
+		'665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
+		'7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
+		'7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
+		'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'
+	],
+
+	/**
+	 * 数字转中文速查表
+	 * @Array Of Property
+	 * @trans ['日','一','二','三','四','五','六','七','八','九','十']
+	 * @return Cn string
+	 */
+	nStr1: ["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d",
+		"\u5341"
+	],
+
+	/**
+	 * 日期转农历称呼速查表
+	 * @Array Of Property
+	 * @trans ['初','十','廿','卅']
+	 * @return Cn string
+	 */
+	nStr2: ["\u521d", "\u5341", "\u5eff", "\u5345"],
+
+	/**
+	 * 月份转农历称呼速查表
+	 * @Array Of Property
+	 * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
+	 * @return Cn string
+	 */
+	nStr3: ["\u6b63", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341",
+		"\u51ac", "\u814a"
+	],
+
+	/**
+	 * 返回农历y年一整年的总天数
+	 * @param lunar Year
+	 * @return Number
+	 * @eg:var count = calendar.lYearDays(1987) ;//count=387
+	 */
+	lYearDays: function(y) {
+		var i, sum = 348;
+		for (i = 0x8000; i > 0x8; i >>= 1) {
+			sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0;
+		}
+		return (sum + this.leapDays(y));
+	},
+
+	/**
+	 * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
+	 * @param lunar Year
+	 * @return Number (0-12)
+	 * @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
+	 */
+	leapMonth: function(y) { //闰字编码 \u95f0
+		return (this.lunarInfo[y - 1900] & 0xf);
+	},
+
+	/**
+	 * 返回农历y年闰月的天数 若该年没有闰月则返回0
+	 * @param lunar Year
+	 * @return Number (0、29、30)
+	 * @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
+	 */
+	leapDays: function(y) {
+		if (this.leapMonth(y)) {
+			return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
+		}
+		return (0);
+	},
+
+	/**
+	 * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
+	 * @param lunar Year
+	 * @return Number (-1、29、30)
+	 * @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
+	 */
+	monthDays: function(y, m) {
+		if (m > 12 || m < 1) {
+			return -1
+		} //月份参数从1至12,参数错误返回-1
+		return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
+	},
+
+	/**
+	 * 返回公历(!)y年m月的天数
+	 * @param solar Year
+	 * @return Number (-1、28、29、30、31)
+	 * @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
+	 */
+	solarDays: function(y, m) {
+		if (m > 12 || m < 1) {
+			return -1
+		} //若参数错误 返回-1
+		var ms = m - 1;
+		if (ms == 1) { //2月份的闰平规律测算后确认返回28或29
+			return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28);
+		} else {
+			return (this.solarMonth[ms]);
+		}
+	},
+
+	/**
+	 * 农历年份转换为干支纪年
+	 * @param  lYear 农历年的年份数
+	 * @return Cn string
+	 */
+	toGanZhiYear: function(lYear) {
+		var ganKey = (lYear - 3) % 10;
+		var zhiKey = (lYear - 3) % 12;
+		if (ganKey == 0) ganKey = 10; //如果余数为0则为最后一个天干
+		if (zhiKey == 0) zhiKey = 12; //如果余数为0则为最后一个地支
+		return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1];
+
+	},
+
+	/**
+	 * 公历月、日判断所属星座
+	 * @param  cMonth [description]
+	 * @param  cDay [description]
+	 * @return Cn string
+	 */
+	toAstro: function(cMonth, cDay) {
+		var s =
+			"\u6469\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u6469\u7faf";
+		var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
+		return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "\u5ea7"; //座
+	},
+
+	/**
+	 * 传入offset偏移量返回干支
+	 * @param offset 相对甲子的偏移量
+	 * @return Cn string
+	 */
+	toGanZhi: function(offset) {
+		return this.Gan[offset % 10] + this.Zhi[offset % 12];
+	},
+
+	/**
+	 * 传入公历(!)y年获得该年第n个节气的公历日期
+	 * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
+	 * @return day Number
+	 * @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
+	 */
+	getTerm: function(y, n) {
+		if (y < 1900 || y > 2100) {
+			return -1;
+		}
+		if (n < 1 || n > 24) {
+			return -1;
+		}
+		var _table = this.sTermInfo[y - 1900];
+		var _info = [
+			parseInt('0x' + _table.substr(0, 5)).toString(),
+			parseInt('0x' + _table.substr(5, 5)).toString(),
+			parseInt('0x' + _table.substr(10, 5)).toString(),
+			parseInt('0x' + _table.substr(15, 5)).toString(),
+			parseInt('0x' + _table.substr(20, 5)).toString(),
+			parseInt('0x' + _table.substr(25, 5)).toString()
+		];
+		var _calday = [
+			_info[0].substr(0, 1),
+			_info[0].substr(1, 2),
+			_info[0].substr(3, 1),
+			_info[0].substr(4, 2),
+
+			_info[1].substr(0, 1),
+			_info[1].substr(1, 2),
+			_info[1].substr(3, 1),
+			_info[1].substr(4, 2),
+
+			_info[2].substr(0, 1),
+			_info[2].substr(1, 2),
+			_info[2].substr(3, 1),
+			_info[2].substr(4, 2),
+
+			_info[3].substr(0, 1),
+			_info[3].substr(1, 2),
+			_info[3].substr(3, 1),
+			_info[3].substr(4, 2),
+
+			_info[4].substr(0, 1),
+			_info[4].substr(1, 2),
+			_info[4].substr(3, 1),
+			_info[4].substr(4, 2),
+
+			_info[5].substr(0, 1),
+			_info[5].substr(1, 2),
+			_info[5].substr(3, 1),
+			_info[5].substr(4, 2),
+		];
+		return parseInt(_calday[n - 1]);
+	},
+
+	/**
+	 * 传入农历数字月份返回汉语通俗表示法
+	 * @param lunar month
+	 * @return Cn string
+	 * @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
+	 */
+	toChinaMonth: function(m) { // 月 => \u6708
+		if (m > 12 || m < 1) {
+			return -1
+		} //若参数错误 返回-1
+		var s = this.nStr3[m - 1];
+		s += "\u6708"; //加上月字
+		return s;
+	},
+
+	/**
+	 * 传入农历日期数字返回汉字表示法
+	 * @param lunar day
+	 * @return Cn string
+	 * @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
+	 */
+	toChinaDay: function(d) { //日 => \u65e5
+		var s;
+		switch (d) {
+			case 10:
+				s = '\u521d\u5341';
+				break;
+			case 20:
+				s = '\u4e8c\u5341';
+				break;
+				break;
+			case 30:
+				s = '\u4e09\u5341';
+				break;
+				break;
+			default:
+				s = this.nStr2[Math.floor(d / 10)];
+				s += this.nStr1[d % 10];
+		}
+		return (s);
+	},
+
+	/**
+	 * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
+	 * @param y year
+	 * @return Cn string
+	 * @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
+	 */
+	getAnimal: function(y) {
+		return this.Animals[(y - 4) % 12]
+	},
+
+	/**
+	 * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
+	 * @param y  solar year
+	 * @param m  solar month
+	 * @param d  solar day
+	 * @return JSON object
+	 * @eg:console.log(calendar.solar2lunar(1987,11,01));
+	 */
+	solar2lunar: function(y, m, d) { //参数区间1900.1.31~2100.12.31
+		//年份限定、上限
+		if (y < 1900 || y > 2100) {
+			return -1; // undefined转换为数字变为NaN
+		}
+		//公历传参最下限
+		if (y == 1900 && m == 1 && d < 31) {
+			return -1;
+		}
+		//未传参  获得当天
+		if (!y) {
+			var objDate = new Date();
+		} else {
+			var objDate = new Date(y, parseInt(m) - 1, d)
+		}
+		var i, leap = 0,
+			temp = 0;
+		//修正ymd参数
+		var y = objDate.getFullYear(),
+			m = objDate.getMonth() + 1,
+			d = objDate.getDate();
+		var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0,
+			31)) / 86400000;
+		for (i = 1900; i < 2101 && offset > 0; i++) {
+			temp = this.lYearDays(i);
+			offset -= temp;
+		}
+		if (offset < 0) {
+			offset += temp;
+			i--;
+		}
+
+		//是否今天
+		var isTodayObj = new Date(),
+			isToday = false;
+		if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
+			isToday = true;
+		}
+		//星期几
+		var nWeek = objDate.getDay(),
+			cWeek = this.nStr1[nWeek];
+		//数字表示周几顺应天朝周一开始的惯例
+		if (nWeek == 0) {
+			nWeek = 7;
+		}
+		//农历年
+		var year = i;
+		var leap = this.leapMonth(i); //闰哪个月
+		var isLeap = false;
+
+		//效验闰月
+		for (i = 1; i < 13 && offset > 0; i++) {
+			//闰月
+			if (leap > 0 && i == (leap + 1) && isLeap == false) {
+				--i;
+				isLeap = true;
+				temp = this.leapDays(year); //计算农历闰月天数
+			} else {
+				temp = this.monthDays(year, i); //计算农历普通月天数
+			}
+			//解除闰月
+			if (isLeap == true && i == (leap + 1)) {
+				isLeap = false;
+			}
+			offset -= temp;
+		}
+		// 闰月导致数组下标重叠取反
+		if (offset == 0 && leap > 0 && i == leap + 1) {
+			if (isLeap) {
+				isLeap = false;
+			} else {
+				isLeap = true;
+				--i;
+			}
+		}
+		if (offset < 0) {
+			offset += temp;
+			--i;
+		}
+		//农历月
+		var month = i;
+		//农历日
+		var day = offset + 1;
+		//天干地支处理
+		var sm = m - 1;
+		var gzY = this.toGanZhiYear(year);
+
+		// 当月的两个节气
+		// bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
+		var firstNode = this.getTerm(y, (m * 2 - 1)); //返回当月「节」为几日开始
+		var secondNode = this.getTerm(y, (m * 2)); //返回当月「节」为几日开始
+
+		// 依据12节气修正干支月
+		var gzM = this.toGanZhi((y - 1900) * 12 + m + 11);
+		if (d >= firstNode) {
+			gzM = this.toGanZhi((y - 1900) * 12 + m + 12);
+		}
+
+		//传入的日期的节气与否
+		var isTerm = false;
+		var Term = null;
+		if (firstNode == d) {
+			isTerm = true;
+			Term = this.solarTerm[m * 2 - 2];
+		}
+		if (secondNode == d) {
+			isTerm = true;
+			Term = this.solarTerm[m * 2 - 1];
+		}
+		//日柱 当月一日与 1900/1/1 相差天数
+		var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10;
+		var gzD = this.toGanZhi(dayCyclical + d - 1);
+		//该日期所属的星座
+		var astro = this.toAstro(m, d);
+
+		return {
+			'lYear': year,
+			'lMonth': month,
+			'lDay': day,
+			'Animal': this.getAnimal(year),
+			'IMonthCn': (isLeap ? "\u95f0" : '') + this.toChinaMonth(month),
+			'IDayCn': this.toChinaDay(day),
+			'cYear': y,
+			'cMonth': m,
+			'cDay': d,
+			'gzYear': gzY,
+			'gzMonth': gzM,
+			'gzDay': gzD,
+			'isToday': isToday,
+			'isLeap': isLeap,
+			'nWeek': nWeek,
+			'ncWeek': "\u661f\u671f" + cWeek,
+			'isTerm': isTerm,
+			'Term': Term,
+			'astro': astro
+		};
+	},
+
+	/**
+	 * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
+	 * @param y  lunar year
+	 * @param m  lunar month
+	 * @param d  lunar day
+	 * @param isLeapMonth  lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
+	 * @return JSON object
+	 * @eg:console.log(calendar.lunar2solar(1987,9,10));
+	 */
+	lunar2solar: function(y, m, d, isLeapMonth) { //参数区间1900.1.31~2100.12.1
+		var isLeapMonth = !!isLeapMonth;
+		y = parseInt(y)
+		m = parseInt(m)
+		d = parseInt(d)
+		var leapOffset = 0;
+		var leapMonth = this.leapMonth(y);
+		var leapDay = this.leapDays(y);
+		if (isLeapMonth && (leapMonth != m)) {
+			return -1;
+		} //传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
+		if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) {
+			return -1;
+		} //超出了最大极限值
+		var day = this.monthDays(y, m);
+		var _day = day;
+		//bugFix 2016-9-25
+		//if month is leap, _day use leapDays method
+		if (isLeapMonth) {
+			_day = this.leapDays(y, m);
+		}
+		if (y < 1900 || y > 2100 || d > _day) {
+			return -1;
+		} //参数合法性效验
+
+		//计算农历的时间差
+		var offset = 0;
+		for (var i = 1900; i < y; i++) {
+			offset += this.lYearDays(i);
+		}
+		var leap = 0,
+			isAdd = false;
+		for (var i = 1; i < m; i++) {
+			leap = this.leapMonth(y);
+			if (!isAdd) { //处理闰月
+				if (leap <= i && leap > 0) {
+					offset += this.leapDays(y);
+					isAdd = true;
+				}
+			}
+			offset += this.monthDays(y, i);
+		}
+		//转换闰月农历 需补充该年闰月的前一个月的时差
+		if (isLeapMonth) {
+			offset += day;
+		}
+		//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
+		var stmap = Date.UTC(1900, 1, 30, 0, 0, 0);
+		var calObj = new Date((offset + d - 31) * 86400000 + stmap);
+		var cY = calObj.getUTCFullYear();
+		var cM = calObj.getUTCMonth() + 1;
+		var cD = calObj.getUTCDate();
+
+		return this.solar2lunar(cY, cM, cD);
+	}
+};

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/js/chunk-vendors.b0d6bf7d.js


+ 259 - 0
unpackage/dist/build/h5/static/js/encrypt.js

@@ -0,0 +1,259 @@
+module.exports = {
+	chrsz:8,
+	hexcase:0,
+	b64pad:'',
+	/**
+	 * 哈希算法加密
+	 * @param {string}     str:要加密的数据
+	 * @param {string}     raw:方式
+	 */
+	sha1:function(str, raw){
+		str = this.utf16to8(str);
+		if (raw == true) {
+			return this.str_sha1(str);
+		} else {
+			return this.hex_sha1(str);
+		}
+	},
+	md5:function md5(s){ 
+	   return this.binl2hex(this.core_md5(this.str2binl(s), s.length * this.chrsz));
+	},
+	utf16to8:function(str){
+		var out, i, len, c;
+		out = '';
+		len = str.length;
+		for (i = 0; i < len; i++) {
+			c = str.charCodeAt(i);
+			if ((c >= 0x0001) && (c <= 0x007F)) {
+				out += str.charAt(i);
+			} else if (c > 0x07FF) {
+				out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
+				out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
+				out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+			} else {
+				out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
+				out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
+			}
+		}
+		return out;
+	},
+	hex_sha1:function (s) {
+		return this.binb2hex(this.core_sha1(this.str2binb(s), s.length * this.chrsz));
+	},
+	str_sha1:function (s) {
+		return this.binb2str(this.core_sha1(this.str2binb(s), s.length * this.chrsz));
+	},
+	binb2hex:function(binarray) {
+		var hex_tab = this.hexcase ? '0123456789ABCDEF': '0123456789abcdef';
+		var str = "";
+		for (var i = 0; i < binarray.length * 4; i++) {
+			str += hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((3 - i % 4) * 8)) & 0xF);
+		}
+		return str;
+	},
+	binl2hex:function (binarray){
+		var hex_tab = this.hexcase ? '0123456789ABCDEF' : '0123456789abcdef';
+		var str = "";
+		for(var i = 0; i < binarray.length * 4; i++){
+			str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +hex_tab.charAt((binarray[i>>2] >> ((i%4)*8  )) & 0xF);
+		}
+		return str;
+	},
+	binb2str:function (bin) {
+		var str = "";
+		var mask = (1 << this.chrsz) - 1;
+		for (var i = 0; i < bin.length * 32; i += this.chrsz) str += String.fromCharCode((bin[i >> 5] >>> (32 - this.chrsz - i % 32)) & mask);
+		return str;
+	},
+	binl2str:function (bin){
+		var str = "";
+		var mask = (1 << this.chrsz) - 1;
+		for(var i = 0; i < bin.length * 32; i += this.chrsz) str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
+		return str;
+	},
+	binl2b64:function (binarray){
+		var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+		var str = '';
+		for(var i = 0; i < binarray.length * 4; i += 3){
+		var triplet = (((binarray[i   >> 2] >> 8 * ( i   %4)) & 0xFF) << 16)
+					| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
+					|  ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
+			for(var j = 0; j < 4; j++){
+				if(i * 8 + j * 6 > binarray.length * 32) str += this.b64pad;
+				else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+			}
+		}
+		return str;
+	},
+	str2binb:function (str) {
+		var bin = Array();
+		var mask = (1 << this.chrsz) - 1;
+		for (var i = 0; i < str.length * this.chrsz; i += this.chrsz) bin[i >> 5] |= (str.charCodeAt(i / this.chrsz) & mask) << (32 - this.chrsz - i % 32);
+		return bin;
+		
+	},
+	str2binl:function (str){
+		var bin = Array();
+		var mask = (1 << this.chrsz) - 1;
+		for(var i = 0; i < str.length * this.chrsz; i += this.chrsz) bin[i>>5] |= (str.charCodeAt(i / this.chrsz) & mask) << (i%32);
+		return bin;
+	},
+	safe_add:function (x, y) {
+		var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+		var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+		return (msw << 16) | (lsw & 0xFFFF);
+		
+	},
+	rol:function (num, cnt) {
+		return (num << cnt) | (num >>> (32 - cnt));
+	},
+	sha1_ft:function (t, b, c, d) {
+		if (t < 20) return (b & c) | ((~b) & d);
+		if (t < 40) return b ^ c ^ d;
+		if (t < 60) return (b & c) | (b & d) | (c & d);
+		return b ^ c ^ d;
+	},
+	sha1_kt:function (t) {
+		return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : (t < 60) ? -1894007588 : -899497514;
+	},
+	core_sha1:function (x, len) {
+		x[len >> 5] |= 0x80 << (24 - len % 32);
+		x[((len + 64 >> 9) << 4) + 15] = len;
+		var w = Array(80);
+		var a = 1732584193;
+		var b = -271733879;
+		var c = -1732584194;
+		var d = 271733878;
+		var e = -1009589776;
+		for (var i = 0; i < x.length; i += 16) {
+			var olda = a;
+			var oldb = b;
+			var oldc = c;
+			var oldd = d;
+			var olde = e;
+
+			for (var j = 0; j < 80; j++) {
+				if (j < 16) w[j] = x[i + j];
+				else w[j] = this.rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
+				var t = this.safe_add(this.safe_add(this.rol(a, 5), this.sha1_ft(j, b, c, d)), this.safe_add(this.safe_add(e, w[j]), this.sha1_kt(j)));
+				e = d;
+				d = c;
+				c = this.rol(b, 30);
+				b = a;
+				a = t;
+			}
+
+			a = this.safe_add(a, olda);
+			b = this.safe_add(b, oldb);
+			c = this.safe_add(c, oldc);
+			d = this.safe_add(d, oldd);
+			e = this.safe_add(e, olde);
+		}
+		return Array(a, b, c, d, e);
+	},
+	core_md5:function (x, len){
+		x[len >> 5] |= 0x80 << ((len) % 32);
+		x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+		var a =  1732584193;
+		var b = -271733879;
+		var c = -1732584194;
+		var d =  271733878;
+
+		for(var i = 0; i < x.length; i += 16){
+			var olda = a;
+			var oldb = b;
+			var oldc = c;
+			var oldd = d;
+
+			a = this.md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+			d = this.md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+			c = this.md5_ff(c, d, a, b, x[i+ 2], 17,  606105819);
+			b = this.md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+			a = this.md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+			d = this.md5_ff(d, a, b, c, x[i+ 5], 12,  1200080426);
+			c = this.md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+			b = this.md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+			a = this.md5_ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
+			d = this.md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+			c = this.md5_ff(c, d, a, b, x[i+10], 17, -42063);
+			b = this.md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+			a = this.md5_ff(a, b, c, d, x[i+12], 7 ,  1804603682);
+			d = this.md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+			c = this.md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+			b = this.md5_ff(b, c, d, a, x[i+15], 22,  1236535329);
+
+			a = this.md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+			d = this.md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+			c = this.md5_gg(c, d, a, b, x[i+11], 14,  643717713);
+			b = this.md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+			a = this.md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+			d = this.md5_gg(d, a, b, c, x[i+10], 9 ,  38016083);
+			c = this.md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+			b = this.md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+			a = this.md5_gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
+			d = this.md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+			c = this.md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+			b = this.md5_gg(b, c, d, a, x[i+ 8], 20,  1163531501);
+			a = this.md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+			d = this.md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+			c = this.md5_gg(c, d, a, b, x[i+ 7], 14,  1735328473);
+			b = this.md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+			a = this.md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+			d = this.md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+			c = this.md5_hh(c, d, a, b, x[i+11], 16,  1839030562);
+			b = this.md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+			a = this.md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+			d = this.md5_hh(d, a, b, c, x[i+ 4], 11,  1272893353);
+			c = this.md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+			b = this.md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+			a = this.md5_hh(a, b, c, d, x[i+13], 4 ,  681279174);
+			d = this.md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+			c = this.md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+			b = this.md5_hh(b, c, d, a, x[i+ 6], 23,  76029189);
+			a = this.md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+			d = this.md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+			c = this.md5_hh(c, d, a, b, x[i+15], 16,  530742520);
+			b = this.md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+			a = this.md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+			d = this.md5_ii(d, a, b, c, x[i+ 7], 10,  1126891415);
+			c = this.md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+			b = this.md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+			a = this.md5_ii(a, b, c, d, x[i+12], 6 ,  1700485571);
+			d = this.md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+			c = this.md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+			b = this.md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+			a = this.md5_ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
+			d = this.md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+			c = this.md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+			b = this.md5_ii(b, c, d, a, x[i+13], 21,  1309151649);
+			a = this.md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+			d = this.md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+			c = this.md5_ii(c, d, a, b, x[i+ 2], 15,  718787259);
+			b = this.md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+			a = this.safe_add(a, olda);
+			b = this.safe_add(b, oldb);
+			c = this.safe_add(c, oldc);
+			d = this.safe_add(d, oldd);
+		}
+		return Array(a, b, c, d);
+	},
+	md5_cmn:function (q, a, b, x, s, t){
+		return this.safe_add(this.rol(this.safe_add(this.safe_add(a, q), this.safe_add(x, t)), s),b);
+	},
+	md5_ff:function (a, b, c, d, x, s, t){
+		return this.md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+	},
+	md5_gg:function (a, b, c, d, x, s, t){
+		return this.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+	},
+	md5_hh:function (a, b, c, d, x, s, t){
+		return this.md5_cmn(b ^ c ^ d, a, b, x, s, t);
+	},
+	md5_ii:function (a, b, c, d, x, s, t){
+		return this.md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+	}
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/js/index.d285e0a8.js


+ 110 - 0
unpackage/dist/build/h5/static/js/math.js

@@ -0,0 +1,110 @@
+module.exports = {
+	/**
+	 * +
+	 * @param arg1
+	 * @param arg2
+	 * @returns {number}
+	 */
+	add: function(arg1, arg2) {
+		var r1, r2, m;
+		try {
+			r1 = arg1.toString().split(".")[1].length
+		} catch (e) {
+			r1 = 0
+		}
+		try {
+			r2 = arg2.toString().split(".")[1].length
+		} catch (e) {
+			r2 = 0
+		}
+		m = Math.pow(10, Math.max(r1, r2))
+		return (arg1 * m + arg2 * m) / m
+	},
+	/**
+	 * -
+	 * @param arg1
+	 * @param arg2
+	 * @returns {number}
+	 */
+	sub: function(arg1, arg2) {
+		var r1, r2, m, n;
+		try {
+			r1 = arg1.toString().split(".")[1].length
+		} catch (e) {
+			r1 = 0
+		}
+		try {
+			r2 = arg2.toString().split(".")[1].length
+		} catch (e) {
+			r2 = 0
+		}
+		m = Math.pow(10, Math.max(r1, r2));
+		n = (r1 >= r2) ? r1 : r2;
+		return ((arg1 * m - arg2 * m) / m).toFixed(n);
+	},
+	/**
+	 *  *
+	 * @param arg1
+	 * @param arg2
+	 * @returns {number}
+	 */
+	mul: function(arg1, arg2) {
+		var m = 0,
+			s1 = arg1.toString(),
+			s2 = arg2.toString();
+		try {
+			m += s1.split(".")[1].length
+		} catch (e) {}
+		try {
+			m += s2.split(".")[1].length
+		} catch (e) {}
+		return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
+	},
+	/**
+	 * /
+	 * @param arg1
+	 * @param arg2
+	 * @returns {number}
+	 */
+	div: function(arg1, arg2) {
+		var t1 = 0,
+			t2 = 0,
+			r1, r2;
+		try {
+			t1 = arg1.toString().split(".")[1].length
+		} catch (e) {}
+		try {
+			t2 = arg2.toString().split(".")[1].length
+		} catch (e) {}
+		r1 = Number(arg1.toString().replace(".", ""))
+		r2 = Number(arg2.toString().replace(".", ""))
+		return this.mul((r1 / r2), Math.pow(10, t2 - t1));
+	},
+	/**
+	 * 保留有效小数位 四舍五入,解决toFixed方法bug
+	 * @param num 需要操作的数字
+	 * @param decimal 保留小数的位数
+	 * @returns {string}
+	 */
+	toFixed: function(num, decimal) {
+		if(typeof decimal == 'undefined'){
+			decimal = 2;
+		}
+		var times = Math.pow(10, decimal)
+		var des = num * times + 0.5
+		des = (parseInt(des, 10) / times).toString()
+		if(decimal > 0){
+			var arr = des.split('.')
+			var len = decimal;
+			if(arr.length == 1){
+				des += '.';
+			}else{
+				len = decimal - arr[1].length;
+			}
+			for (let i = 1; i <= len; i++) {
+				des += '0';
+			}
+		}
+		return des;
+	},
+};

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-detail-detail.e43e13d9.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-detail-detail~pages-index-index.23bda7c2.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-index.87a75481.js


+ 742 - 0
unpackage/dist/build/h5/static/js/qqmap-wx-jssdk.js

@@ -0,0 +1,742 @@
+/**
+ * 微信小程序JavaScriptSDK
+ * 地图
+ * 苍源怡家
+ * @version 1.1
+ * @date 2019-01-20
+ */
+
+var ERROR_CONF = {
+    KEY_ERR: 311,
+    KEY_ERR_MSG: 'key格式错误',
+    PARAM_ERR: 310,
+    PARAM_ERR_MSG: '请求参数信息有误',
+    SYSTEM_ERR: 600,
+    SYSTEM_ERR_MSG: '系统错误',
+    WX_ERR_CODE: 1000,
+    WX_OK_CODE: 200
+};
+var BASE_URL = 'https://apis.map.qq.com/ws/';
+var URL_SEARCH = BASE_URL + 'place/v1/search';
+var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
+var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
+var URL_CITY_LIST = BASE_URL + 'district/v1/list';
+var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
+var URL_DISTANCE = BASE_URL + 'distance/v1/';
+var EARTH_RADIUS = 6378136.49;
+var Utils = {
+    /**
+     * 得到终点query字符串
+     * @param {Array|String} 检索数据
+     */
+    location2query(data) {
+        if (typeof data == 'string') {
+            return data;
+        }
+        var query = '';
+        for (var i = 0; i < data.length; i++) {
+            var d = data[i];
+            if (!!query) {
+                query += ';';
+            }
+            if (d.location) {
+                query = query + d.location.lat + ',' + d.location.lng;
+            }
+            if (d.latitude && d.longitude) {
+                query = query + d.latitude + ',' + d.longitude;
+            }
+        }
+        return query;
+    },
+
+    /**
+     * 计算角度
+     */
+    rad(d) {
+      return d * Math.PI / 180.0;
+    },  
+    /**
+     * 处理终点location数组
+     * @return 返回终点数组
+     */
+    getEndLocation(location){
+      var to = location.split(';');
+      var endLocation = [];
+      for (var i = 0; i < to.length; i++) {
+        endLocation.push({
+          lat: parseFloat(to[i].split(',')[0]),
+          lng: parseFloat(to[i].split(',')[1])
+        })
+      }
+      return endLocation;
+    },
+
+    /**
+     * 计算两点间直线距离
+     * @param a 表示纬度差
+     * @param b 表示经度差
+     * @return 返回的是距离,单位m
+     */
+    getDistance(latFrom, lngFrom, latTo, lngTo) {
+      var radLatFrom = this.rad(latFrom);
+      var radLatTo = this.rad(latTo);
+      var a = radLatFrom - radLatTo;
+      var b = this.rad(lngFrom) - this.rad(lngTo);
+      var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
+      distance = distance * EARTH_RADIUS;
+      distance = Math.round(distance * 10000) / 10000;
+      return parseFloat(distance.toFixed(0));
+    },
+    /**
+     * 使用微信接口进行定位
+     */
+    getWXLocation(success, fail, complete) {
+        wx.getLocation({
+            type: 'gcj02',
+            success: success,
+            fail: fail,
+            complete: complete
+        });
+    },
+
+    /**
+     * 获取location参数
+     */
+    getLocationParam(location) {
+        if (typeof location == 'string') {
+            var locationArr = location.split(',');
+            if (locationArr.length === 2) {
+                location = {
+                    latitude: location.split(',')[0],
+                    longitude: location.split(',')[1]
+                };
+            } else {
+                location = {};
+            }
+        }
+        return location;
+    },
+
+    /**
+     * 回调函数默认处理
+     */
+    polyfillParam(param) {
+        param.success = param.success || function () { };
+        param.fail = param.fail || function () { };
+        param.complete = param.complete || function () { };
+    },
+
+    /**
+     * 验证param对应的key值是否为空
+     * 
+     * @param {Object} param 接口参数
+     * @param {String} key 对应参数的key
+     */
+    checkParamKeyEmpty(param, key) {
+        if (!param[key]) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return true;
+        }
+        return false;
+    },
+
+    /**
+     * 验证参数中是否存在检索词keyword
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkKeyword(param){
+        return !this.checkParamKeyEmpty(param, 'keyword');
+    },
+
+    /**
+     * 验证location值
+     * 
+     * @param {Object} param 接口参数
+     */
+    checkLocation(param) {
+        var location = this.getLocationParam(param.location);
+        if (!location || !location.latitude || !location.longitude) {
+            var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
+            param.fail(errconf);
+            param.complete(errconf);
+            return false;
+        }
+        return true;
+    },
+
+    /**
+     * 构造错误数据结构
+     * @param {Number} errCode 错误码
+     * @param {Number} errMsg 错误描述
+     */
+    buildErrorConfig(errCode, errMsg) {
+        return {
+            status: errCode,
+            message: errMsg
+        };
+    },
+
+    /**
+     * 
+     * 数据处理函数
+     * 根据传入参数不同处理不同数据
+     * @param {String} feature 功能名称
+     * search 地点搜索
+     * suggest关键词提示
+     * reverseGeocoder逆地址解析
+     * geocoder地址解析
+     * getCityList获取城市列表:父集
+     * getDistrictByCityId获取区县列表:子集
+     * calculateDistance距离计算
+     * @param {Object} param 接口参数
+     * @param {Object} data 数据
+     */
+    handleData(param,data,feature){
+      if (feature === 'search') {
+        var searchResult = data.data;
+        var searchSimplify = [];
+        for (var i = 0; i < searchResult.length; i++) {
+          searchSimplify.push({
+            id: searchResult[i].id || null,
+            title: searchResult[i].title || null,
+            latitude: searchResult[i].location && searchResult[i].location.lat || null,
+            longitude: searchResult[i].location && searchResult[i].location.lng || null,
+            address: searchResult[i].address || null,
+            category: searchResult[i].category || null,
+            tel: searchResult[i].tel || null,
+            adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
+            city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
+            district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
+            province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
+          })
+        }
+        param.success(data, {
+          searchResult: searchResult,
+          searchSimplify: searchSimplify
+        })
+      } else if (feature === 'suggest') {
+        var suggestResult = data.data;
+        var suggestSimplify = [];
+        for (var i = 0; i < suggestResult.length; i++) {
+          suggestSimplify.push({
+            adcode: suggestResult[i].adcode || null,
+            address: suggestResult[i].address || null,
+            category: suggestResult[i].category || null,
+            city: suggestResult[i].city || null,
+            district: suggestResult[i].district || null,
+            id: suggestResult[i].id || null,
+            latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
+            longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
+            province: suggestResult[i].province || null,
+            title: suggestResult[i].title || null,
+            type: suggestResult[i].type || null
+          })
+        }
+        param.success(data, {
+          suggestResult: suggestResult,
+          suggestSimplify: suggestSimplify
+          })
+      } else if (feature === 'reverseGeocoder') {
+        var reverseGeocoderResult = data.result;
+        var reverseGeocoderSimplify = {
+          address: reverseGeocoderResult.address || null,
+          latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
+          longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
+          adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
+          city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
+          district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
+          nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
+          province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
+          street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
+          street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
+          recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
+          rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
+        };
+        if (reverseGeocoderResult.pois) {//判断是否返回周边poi
+          var pois = reverseGeocoderResult.pois;
+          var poisSimplify = [];
+          for (var i = 0;i < pois.length;i++) {
+            poisSimplify.push({
+              id: pois[i].id || null,
+              title: pois[i].title || null,
+              latitude: pois[i].location && pois[i].location.lat || null,
+              longitude: pois[i].location && pois[i].location.lng || null,
+              address: pois[i].address || null,
+              category: pois[i].category || null,
+              adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
+              city: pois[i].ad_info && pois[i].ad_info.city || null,
+              district: pois[i].ad_info && pois[i].ad_info.district || null,
+              province: pois[i].ad_info && pois[i].ad_info.province || null
+            })
+          }
+          param.success(data,{
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify,
+            pois: pois,
+            poisSimplify: poisSimplify
+          })
+        } else {
+          param.success(data, {
+            reverseGeocoderResult: reverseGeocoderResult,
+            reverseGeocoderSimplify: reverseGeocoderSimplify
+          })
+        }
+      } else if (feature === 'geocoder') {
+        var geocoderResult = data.result;
+        var geocoderSimplify = {
+          title: geocoderResult.title || null,
+          latitude: geocoderResult.location && geocoderResult.location.lat || null,
+          longitude: geocoderResult.location && geocoderResult.location.lng || null,
+          adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
+          province: geocoderResult.address_components && geocoderResult.address_components.province || null,
+          city: geocoderResult.address_components && geocoderResult.address_components.city || null,
+          district: geocoderResult.address_components && geocoderResult.address_components.district || null,
+          street: geocoderResult.address_components && geocoderResult.address_components.street || null,
+          street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
+          level: geocoderResult.level || null
+        };
+        param.success(data,{
+          geocoderResult: geocoderResult,
+          geocoderSimplify: geocoderSimplify
+        });
+      } else if (feature === 'getCityList') {
+        var provinceResult = data.result[0];
+        var cityResult = data.result[1];
+        var districtResult = data.result[2];
+        param.success(data,{
+          provinceResult: provinceResult,
+          cityResult: cityResult,
+          districtResult: districtResult
+        });
+      } else if (feature === 'getDistrictByCityId') {
+        var districtByCity = data.result[0];
+        param.success(data, districtByCity);
+      } else if (feature === 'calculateDistance') {
+        var calculateDistanceResult = data.result.elements;  
+        var distance = [];
+        for (var i = 0; i < calculateDistanceResult.length; i++){
+          distance.push(calculateDistanceResult[i].distance);
+        }   
+        param.success(data, {
+          calculateDistanceResult: calculateDistanceResult,
+          distance: distance
+          });
+      } else {
+        param.success(data);
+      }
+    },
+
+    /**
+     * 构造微信请求参数,公共属性处理
+     * 
+     * @param {Object} param 接口参数
+     * @param {Object} param 配置项
+     * @param {String} feature 方法名
+     */
+    buildWxRequestConfig(param, options, feature) {
+        var that = this;
+        options.header = { "content-type": "application/json" };
+        options.method = 'GET';
+        options.success = function (res) {
+            var data = res.data;
+            if (data.status === 0) {
+              that.handleData(param, data, feature);
+            } else {
+                param.fail(data);
+            }
+        };
+        options.fail = function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        options.complete = function (res) {
+            var statusCode = +res.statusCode;
+            switch(statusCode) {
+                case ERROR_CONF.WX_ERR_CODE: {
+                    param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+                    break;
+                }
+                case ERROR_CONF.WX_OK_CODE: {
+                    var data = res.data;
+                    if (data.status === 0) {
+                        param.complete(data);
+                    } else {
+                        param.complete(that.buildErrorConfig(data.status, data.message));
+                    }
+                    break;
+                }
+                default:{
+                    param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
+                }
+
+            }
+        };
+        return options;
+    },
+
+    /**
+     * 处理用户参数是否传入坐标进行不同的处理
+     */
+    locationProcess(param, locationsuccess, locationfail, locationcomplete) {
+        var that = this;
+        locationfail = locationfail || function (res) {
+            res.statusCode = ERROR_CONF.WX_ERR_CODE;
+            param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+        };
+        locationcomplete = locationcomplete || function (res) {
+            if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
+                param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
+            }
+        };
+        if (!param.location) {
+            that.getWXLocation(locationsuccess, locationfail, locationcomplete);
+        } else if (that.checkLocation(param)) {
+            var location = Utils.getLocationParam(param.location);
+            locationsuccess(location);
+        }
+    }
+};
+
+
+class QQMapWX {
+
+    /**
+     * 构造函数
+     * 
+     * @param {Object} options 接口参数,key 为必选参数
+     */
+    constructor(options) {
+        if (!options.key) {
+            throw Error('key值不能为空');
+        }
+        this.key = options.key;
+    };
+
+    /**
+     * POI周边检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * @see http://lbs.qq.com/webservice_v1/guide-search.html
+     */
+    search(options) {
+        var that = this;
+        options = options || {};
+
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            orderby: options.orderby || '_distance',
+            page_size: options.page_size || 10,
+            page_index: options.page_index || 1,
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.address_format) {
+            requestParam.address_format = options.address_format;
+        }
+
+        if (options.filter) {
+            requestParam.filter = options.filter;
+        }
+
+        var distance = options.distance || "1000";
+        var auto_extend = options.auto_extend || 1;
+        var region = null;
+        var rectangle = null;
+
+        //判断城市限定参数
+        if (options.region) {
+          region = options.region;
+        }
+
+        //矩形限定坐标(暂时只支持字符串格式)
+        if (options.rectangle) {
+          rectangle = options.rectangle;
+        }
+
+        var locationsuccess = function (result) {        
+          if (region && !rectangle) {
+            //城市限定参数拼接
+            requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
+          } else if (rectangle && !region) {
+            //矩形搜索
+            requestParam.boundary = "rectangle(" + rectangle + ")";
+            } else {
+              requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
+            }            
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_SEARCH,
+                data: requestParam
+            }, 'search'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * sug模糊检索
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 参数对象结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-suggestion.html
+     */
+    getSuggestion(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (!Utils.checkKeyword(options)) {
+            return;
+        }
+
+        var requestParam = {
+            keyword: options.keyword,
+            region: options.region || '全国',
+            region_fix: options.region_fix || 0,
+            policy: options.policy || 0,
+            page_size: options.page_size || 10,//控制显示条数
+            page_index: options.page_index || 1,//控制页数
+            get_subpois : options.get_subpois || 0,//返回子地点
+            output: 'json',
+            key: that.key
+        };
+        //长地址
+        if (options.address_format) {
+          requestParam.address_format = options.address_format;
+        }
+        //过滤
+        if (options.filter) {
+          requestParam.filter = options.filter;
+        }
+        //排序
+        if (options.location) {
+          var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_SUGGESTION,
+              data: requestParam
+            }, "suggest"));      
+          };
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_SUGGESTION,
+            data: requestParam
+          }, "suggest"));      
+        } 
+    };
+
+    /**
+     * 逆地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-gcoder.html
+     */
+    reverseGeocoder(options) {
+      console.log(options)
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            coord_type: options.coord_type || 5,
+            get_poi: options.get_poi || 0,
+            output: 'json',
+            key: that.key
+        };
+        if (options.poi_options) {
+            requestParam.poi_options = options.poi_options
+        }
+
+        var locationsuccess = function (result) {
+            requestParam.location = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+                url: URL_GET_GEOCODER,
+                data: requestParam
+            }, 'reverseGeocoder'));
+        };
+        Utils.locationProcess(options, locationsuccess);
+    };
+
+    /**
+     * 地址解析
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-geocoder.html
+     */
+    geocoder(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        if (Utils.checkParamKeyEmpty(options, 'address')) {
+            return;
+        }
+
+        var requestParam = {
+            address: options.address,
+            output: 'json',
+            key: that.key
+        };
+
+        //城市限定
+        if (options.region) {
+          requestParam.region = options.region;
+        }
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_GET_GEOCODER,
+            data: requestParam
+        },'geocoder'));
+    };
+
+
+    /**
+     * 获取城市列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getCityList(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+        var requestParam = {
+            output: 'json',
+            key: that.key
+        };
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_CITY_LIST,
+            data: requestParam
+        },'getCityList'));
+    };
+
+    /**
+     * 获取对应城市ID的区县列表
+     *
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-region.html
+     */
+    getDistrictByCityId(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'id')) {
+            return;
+        }
+
+        var requestParam = {
+            id: options.id || '',
+            output: 'json',
+            key: that.key
+        };
+
+        wx.request(Utils.buildWxRequestConfig(options, {
+            url: URL_AREA_LIST,
+            data: requestParam
+        },'getDistrictByCityId'));
+    };
+
+    /**
+     * 用于单起点到多终点的路线距离(非直线距离)计算:
+     * 支持两种距离计算方式:步行和驾车。
+     * 起点到终点最大限制直线距离10公里。
+     *
+     * 新增直线距离计算。
+     * 
+     * @param {Object} options 接口参数对象
+     * 
+     * 请求参数结构可以参考
+     * http://lbs.qq.com/webservice_v1/guide-distance.html
+     */
+    calculateDistance(options) {
+        var that = this;
+        options = options || {};
+        Utils.polyfillParam(options);
+
+        if (Utils.checkParamKeyEmpty(options, 'to')) {
+            return;
+        }
+
+        var requestParam = {
+            mode: options.mode || 'walking',
+            to: Utils.location2query(options.to),
+            output: 'json',
+            key: that.key
+        };
+
+        if (options.from) {
+          options.location = options.from;
+        }
+
+        //计算直线距离
+        if(requestParam.mode == 'straight'){        
+          var locationsuccess = function (result) {
+            var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
+            var data = {
+              message:"query ok",
+              result:{
+                elements:[]
+              },
+              status:0
+            };
+            for (var i = 0; i < locationTo.length; i++) {
+              data.result.elements.push({//将坐标存入
+                distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
+                duration:0,
+                from:{
+                  lat: result.latitude,
+                  lng:result.longitude
+                },
+                to:{
+                  lat: locationTo[i].lat,
+                  lng: locationTo[i].lng
+                }
+              });            
+            }
+            var calculateResult = data.result.elements;
+            var distanceResult = [];
+            for (var i = 0; i < calculateResult.length; i++) {
+              distanceResult.push(calculateResult[i].distance);
+            }  
+            return options.success(data,{
+              calculateResult: calculateResult,
+              distanceResult: distanceResult
+            });
+          };
+          
+          Utils.locationProcess(options, locationsuccess);
+        } else {
+          var locationsuccess = function (result) {
+            requestParam.from = result.latitude + ',' + result.longitude;
+            wx.request(Utils.buildWxRequestConfig(options, {
+              url: URL_DISTANCE,
+              data: requestParam
+            },'calculateDistance'));
+          };
+
+          Utils.locationProcess(options, locationsuccess);
+        }      
+    }
+};
+
+module.exports = QQMapWX;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 6 - 0
unpackage/dist/build/h5/static/js/weapp.qrcode.min.js


BIN
unpackage/dist/build/h5/static/logo.png


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio