diff --git a/.eslintrc.js b/.eslintrc.js index 115cc02..df00c53 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,4 +28,4 @@ module.exports = { }, // extends: 'eslint:recommended', rules: {}, -} +} \ No newline at end of file diff --git a/app.js b/app.js index a9de1b9..b140d4f 100644 --- a/app.js +++ b/app.js @@ -18,8 +18,30 @@ App({ } }) }) + + // 获取topbar相关信息 + const that = this; + // 顶部状态栏的信息 + const systemInfo = wx.getSystemInfoSync(); + // 胶囊按钮位置信息 + const menuButtonInfo = wx.getMenuButtonBoundingClientRect(); + // 导航栏高度 = 状态栏到胶囊的间距(胶囊距上距离-状态栏高度) * 2 + 胶囊高度 + 状态栏高度 + that.globalData.navBarHeight = (menuButtonInfo.top - systemInfo.statusBarHeight) * 2 + menuButtonInfo.height + systemInfo.statusBarHeight; + that.globalData.menuRight = systemInfo.screenWidth - menuButtonInfo.right; + that.globalData.menuBottom = menuButtonInfo.top - systemInfo.statusBarHeight; + that.globalData.menuHeight = menuButtonInfo.height; + that.globalData.menuWidth = menuButtonInfo.width; + that.globalData.statusBarHeight = systemInfo.statusBarHeight; }, globalData: { - userInfo: null + userInfo: null, + + // 自定义topbar相关信息 + navBarHeight: 0, // 导航栏高度 + statusBarHeight: 0, // 状态栏的高度 + menuRight: 0, // 胶囊距右方间距(保持左、右间距一致) + menuBottom: 0, // 胶囊距底部间距(保持底部间距一致) + menuHeight: 0, // 胶囊高度(自定义内容可与胶囊高度保证一致) + menuWidth: 0, // 胶囊宽度(自定义内容可与胶囊宽度保证一致) } -}) +}) \ No newline at end of file diff --git a/app.json b/app.json index 0f8e064..b49919d 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "pages": [ - "pages/index/index", - "pages/explore/index", + "pages/home/index", + "pages/home/chooseLocation/index", "pages/my/index" ], "window": { @@ -17,19 +17,19 @@ "backgroundColor": "#000000", "list": [ { - "pagePath": "pages/index/index", + "pagePath": "pages/home/index", "text": "首页" }, - { - "pagePath": "pages/explore/index", - "text": "发现" - }, { "pagePath": "pages/my/index", "text": "我的" } ] }, - "style": "v2", - "sitemapLocation": "sitemap.json" + "sitemapLocation": "sitemap.json", + "permission": { + "scope.userLocation": { + "desc": "您的位置信息仅用于当前小程序中获取定位" + } + } } \ No newline at end of file diff --git a/components/info-card/index.js b/components/info-card/index.js new file mode 100644 index 0000000..4bad8bd --- /dev/null +++ b/components/info-card/index.js @@ -0,0 +1,25 @@ +// components/info-card/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + data: { + "type": Object, + "value": {} + } + }, + + /** + * 组件的初始数据 + */ + data: { + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) diff --git a/components/info-card/index.json b/components/info-card/index.json new file mode 100644 index 0000000..c084d29 --- /dev/null +++ b/components/info-card/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image", + "stars-mark": "/components/stars-mark/index" + } +} \ No newline at end of file diff --git a/components/info-card/index.less b/components/info-card/index.less new file mode 100644 index 0000000..ce71410 --- /dev/null +++ b/components/info-card/index.less @@ -0,0 +1,38 @@ +/* components/info-card/index.wxss */ +.card { + height: 120px; + width: 343px; + margin: 16px auto; + border-radius: 9px; + overflow: hidden; + background: #ffffff; + box-shadow: 0 6px 30px 5px #0000000d, 0 16px 24px 2px #0000000a, 0 8px 10px -5px #00000014; + + .info { + height: 100%; + width: auto; + background-color: #fff; + display: inline-flex; + flex-direction: column; + justify-content: space-around; + padding-left: 16px; + + .name { + color: #000000e6; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + text-align: left; + line-height: 22px; + } + + .price { + color: #000000e6; + font-size: 14px; + font-weight: 600; + font-family: "PingFang SC"; + text-align: left; + line-height: 22px; + } + } +} \ No newline at end of file diff --git a/components/info-card/index.wxml b/components/info-card/index.wxml new file mode 100644 index 0000000..850e95e --- /dev/null +++ b/components/info-card/index.wxml @@ -0,0 +1,10 @@ + + + + + {{data.name}} + + ¥{{data.floorPrice}} -¥{{data.ceilingPrice}} + {{data.free}} + + \ No newline at end of file diff --git a/components/stars-mark/index.js b/components/stars-mark/index.js new file mode 100644 index 0000000..a405dce --- /dev/null +++ b/components/stars-mark/index.js @@ -0,0 +1,25 @@ +// components/stars-mark/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + score: { + "type": Number, + "value": "" + } + }, + + /** + * 组件的初始数据 + */ + data: { + }, + + /** + * 组件的方法列表 + */ + methods: { + + } +}) diff --git a/components/stars-mark/index.json b/components/stars-mark/index.json new file mode 100644 index 0000000..fa2d209 --- /dev/null +++ b/components/stars-mark/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon" + } +} \ No newline at end of file diff --git a/components/stars-mark/index.less b/components/stars-mark/index.less new file mode 100644 index 0000000..a4e1a76 --- /dev/null +++ b/components/stars-mark/index.less @@ -0,0 +1,45 @@ +/* components/stars-mark/index.wxss */ +.score { + height: 20px; + width: 143.6px; + font-size: 12px; + font-weight: 600; + font-family: "PingFang SC"; + line-height: 20px; + display: inline-flex; + position: relative; + + .stars-container { + display: inline-flex; + width: 100.6px; + position: relative; + + .stars-background { + color: #dcdcdc; + display: inline-flex; + padding-top: 2px; + + view { + padding-right: 5.15px; + } + } + + .stars { + color: #e37318; + display: inline-flex; + padding-top: 2px; + position: absolute; + overflow: hidden; + + view { + padding-right: 5.15px; + } + } + } + + text { + color: #e37318; + position: absolute; + right: 0; + } +} \ No newline at end of file diff --git a/components/stars-mark/index.wxml b/components/stars-mark/index.wxml new file mode 100644 index 0000000..aa71d6a --- /dev/null +++ b/components/stars-mark/index.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + {{score}}分 + \ No newline at end of file diff --git a/config/cities.js b/config/cities.js new file mode 100644 index 0000000..dae6e3c --- /dev/null +++ b/config/cities.js @@ -0,0 +1,93 @@ +/** 配置城市名的数据 */ +export const cities = { + hotCities: ['北京', '上海', '广州', '深圳', '成都'], + sortedCities: [{ + index: 'A', + children: ['澳门', '阿克苏', '阿吉', '鞍山'] + }, + { + index: 'B', + children: ['北京', '包头', '宝鸡', '滨州', '宝山', '巴中'] + }, + { + index: 'C', + children: ['重庆', '成都', '长沙', '常州', '长春', '沧州'] + }, + { + index: 'D', + children: ['大连', '东莞', '德阳', '丹东', '大庆', '大同'] + }, + { + index: 'E', + children: ['鄂尔多斯', '恩施', '鄂州'] + }, + { + index: 'F', + children: ['福州', '佛山', '抚顺', '阜阳', '防城港', '阜新'] + }, + { + index: 'G', + children: ['广州', '贵阳', '赣州', '桂林', '广元', '贵港'] + }, + { + index: 'H', + children: ['上海', '深圳', '杭州', '哈尔滨', '合肥', '海口'] + }, + { + index: 'J', + children: ['金华', '济南', '嘉兴', '江门', '吉林'] + }, + { + index: 'K', + children: ['昆明', '克拉玛依', '开封', '喀什', '凯里', '克孜勒苏'] + }, + { + index: 'L', + children: ['兰州', '拉萨', '洛阳', '丽江', '廊坊', '连云港'] + }, + { + index: 'M', + children: ['梅州', '绵阳', '马鞍山', '茂名', '牡丹江', '眉山'] + }, + { + index: 'N', + children: ['南京', '南昌', '南宁', '宁波', '南通', '南充'] + }, + { + index: 'P', + children: ['莆田', '平顶山', '盘锦', '攀枝花', '萍乡'] + }, + { + index: 'Q', + children: ['青岛', '秦皇岛', '泉州', '曲靖', '齐齐哈尔', '七台河'] + }, + { + index: 'R', + children: ['日喀则', '日照'] + }, + { + index: 'S', + children: ['上海', '深圳', '沈阳', '苏州', '石家庄', '三亚'] + }, + { + index: 'T', + children: ['天津', '太原', '唐山', '台州', '泰安', '铁岭'] + }, + { + index: 'W', + children: ['武汉', '无锡', '潍坊', '威海', '乌鲁木齐', '梧州'] + }, + { + index: 'X', + children: ['西安', '厦门', '徐州', '西宁', '湘潭', '许昌'] + }, + { + index: 'Y', + children: ['杭州', '武汉', '郑州', '石家庄', '西安'] + }, + { + index: 'Z', + children: ['张家口', '中山', '珠海', '肇庆', '舟山', '漳州'] + } + ] +} \ No newline at end of file diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..af0b293 --- /dev/null +++ b/config/index.js @@ -0,0 +1,8 @@ +/** 小程序基本配置 */ +// 是否使用mock数据代替api返回 +export const config = { + useMock: true +} + +// 使用腾讯定位服务的key +export const locationKey = ''; \ No newline at end of file diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 21207df..041456e 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -4,13 +4,10 @@ Component({ value: 'index', list: [{ icon: 'home', - value: 'index', + value: 'home', label: '首页', - },{ - icon: 'control-platform', - value: 'explore', - label: '发现', - }, { + }, + { icon: 'user', value: 'my', label: '我的' @@ -24,7 +21,7 @@ Component({ if (curPage) { const nameRe = /pages\/(\w+)\/index/.exec(curPage.route); - if (nameRe[1]) { + if (nameRe) { this.setData({ value: nameRe[1] }) diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json index df5bd1d..31f8169 100644 --- a/custom-tab-bar/index.json +++ b/custom-tab-bar/index.json @@ -2,6 +2,6 @@ "component": true, "usingComponents": { "t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar", - "t-tab-bar-item": "tdesign-miniprogram/tab-bar/tab-bar-item" + "t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item" } } \ No newline at end of file diff --git a/custom-tab-bar/index.wxml b/custom-tab-bar/index.wxml index 69a9b7b..b3fcb34 100644 --- a/custom-tab-bar/index.wxml +++ b/custom-tab-bar/index.wxml @@ -1,5 +1,5 @@ - - + + {{item.label}} \ No newline at end of file diff --git a/lib/qqmap/qqmap-wx-jssdk.js b/lib/qqmap/qqmap-wx-jssdk.js new file mode 100644 index 0000000..595b65b --- /dev/null +++ b/lib/qqmap/qqmap-wx-jssdk.js @@ -0,0 +1,1122 @@ +/** + * 微信小程序JavaScriptSDK + * + * @version 1.2 + * @date 2019-03-06 + */ + +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 URL_DIRECTION = BASE_URL + 'direction/v1/'; +var MODE = { + driving: 'driving', + transit: 'transit' +}; +var EARTH_RADIUS = 6378136.49; +var Utils = { + /** + * md5加密方法 + * 版权所有©2011 Sebastian Tschan,https://blueimp.net + */ + safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); + }, + bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + }, + md5cmn(q, a, b, x, s, t) { + return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b); + }, + md5ff(a, b, c, d, x, s, t) { + return this.md5cmn((b & c) | (~b & d), a, b, x, s, t); + }, + md5gg(a, b, c, d, x, s, t) { + return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t); + }, + md5hh(a, b, c, d, x, s, t) { + return this.md5cmn(b ^ c ^ d, a, b, x, s, t); + }, + md5ii(a, b, c, d, x, s, t) { + return this.md5cmn(c ^ (b | ~d), a, b, x, s, t); + }, + binlMD5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << (len % 32); + x[((len + 64) >>> 9 << 4) + 14] = len; + + var i; + var olda; + var oldb; + var oldc; + var oldd; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + + a = this.md5ff(a, b, c, d, x[i], 7, -680876936); + d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + + a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = this.md5gg(b, c, d, a, x[i], 20, -373897302); + a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + + a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = this.md5hh(d, a, b, c, x[i], 11, -358537222); + c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); + + a = this.md5ii(a, b, c, d, x[i], 6, -198630844); + d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = this.safeAdd(a, olda); + b = this.safeAdd(b, oldb); + c = this.safeAdd(c, oldc); + d = this.safeAdd(d, oldd); + } + return [a, b, c, d]; + }, + binl2rstr(input) { + var i; + var output = ''; + var length32 = input.length * 32; + for (i = 0; i < length32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff); + } + return output; + }, + rstr2binl(input) { + var i; + var output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + var length8 = input.length * 8; + for (i = 0; i < length8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32); + } + return output; + }, + rstrMD5(s) { + return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)); + }, + rstrHMACMD5(key, data) { + var i; + var bkey = this.rstr2binl(key); + var ipad = []; + var opad = []; + var hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = this.binlMD5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5c5c5c5c; + } + hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); + return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)); + }, + rstr2hex(input) { + var hexTab = '0123456789abcdef'; + var output = ''; + var x; + var i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f); + } + return output; + }, + str2rstrUTF8(input) { + return unescape(encodeURIComponent(input)); + }, + rawMD5(s) { + return this.rstrMD5(this.str2rstrUTF8(s)); + }, + hexMD5(s) { + return this.rstr2hex(this.rawMD5(s)); + }, + rawHMACMD5(k, d) { + return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)); + }, + hexHMACMD5(k, d) { + return this.rstr2hex(this.rawHMACMD5(k, d)); + }, + + md5(string, key, raw) { + if (!key) { + if (!raw) { + return this.hexMD5(string); + } + return this.rawMD5(string); + } + if (!raw) { + return this.hexHMACMD5(key, string); + } + return this.rawHMACMD5(key, string); + }, + /** + * 得到md5加密后的sig参数 + * @param {Object} requestParam 接口参数 + * @param {String} sk签名字符串 + * @param {String} featrue 方法名 + * @return 返回加密后的sig参数 + */ + getSig(requestParam, sk, feature, mode) { + var sig = null; + var requestArr = []; + Object.keys(requestParam).sort().forEach(function(key){ + requestArr.push(key + '=' + requestParam[key]); + }); + if (feature == 'search') { + sig = '/ws/place/v1/search?' + requestArr.join('&') + sk; + } + if (feature == 'suggest') { + sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk; + } + if (feature == 'reverseGeocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'geocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'getCityList') { + sig = '/ws/district/v1/list?' + requestArr.join('&') + sk; + } + if (feature == 'getDistrictByCityId') { + sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk; + } + if (feature == 'calculateDistance') { + sig = '/ws/distance/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'direction') { + sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk; + } + sig = this.md5(sig); + return sig; + }, + /** + * 得到终点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 if (feature == 'direction') { + var direction = data.result.routes; + param.success(data,direction); + } 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 + ")"; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else if (rectangle && !region) { + //矩形搜索 + requestParam.boundary = "rectangle(" + rectangle + ")"; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else { + requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } + 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; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_SUGGESTION, + data: requestParam + }, "suggest")); + }; + Utils.locationProcess(options, locationsuccess); + } else { + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + 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) { + 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; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder'); + } + 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; + } + + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder'); + } + + 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 + }; + + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList'); + } + + 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 + }; + + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId'); + } + + 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; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance'); + } + wx.request(Utils.buildWxRequestConfig(options, { + url: URL_DISTANCE, + data: requestParam + },'calculateDistance')); + }; + + Utils.locationProcess(options, locationsuccess); + } + }; + + /** + * 路线规划: + * + * @param {Object} options 接口参数对象 + * + * 请求参数结构可以参考 + * https://lbs.qq.com/webservice_v1/guide-road.html + */ + direction(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + + var requestParam = { + output: 'json', + key: that.key + }; + + //to格式处理 + if (typeof options.to == 'string') { + requestParam.to = options.to; + } else { + requestParam.to = options.to.latitude + ',' + options.to.longitude; + } + //初始化局部请求域名 + var SET_URL_DIRECTION = null; + //设置默认mode属性 + options.mode = options.mode || MODE.driving; + + //设置请求域名 + SET_URL_DIRECTION = URL_DIRECTION + options.mode; + + if (options.from) { + options.location = options.from; + } + + if (options.mode == MODE.driving) { + if (options.from_poi) { + requestParam.from_poi = options.from_poi; + } + if (options.heading) { + requestParam.heading = options.heading; + } + if (options.speed) { + requestParam.speed = options.speed; + } + if (options.accuracy) { + requestParam.accuracy = options.accuracy; + } + if (options.road_type) { + requestParam.road_type = options.road_type; + } + if (options.to_poi) { + requestParam.to_poi = options.to_poi; + } + if (options.from_track) { + requestParam.from_track = options.from_track; + } + if (options.waypoints) { + requestParam.waypoints = options.waypoints; + } + if (options.policy) { + requestParam.policy = options.policy; + } + if (options.plate_number) { + requestParam.plate_number = options.plate_number; + } + } + + if (options.mode == MODE.transit) { + if (options.departure_time) { + requestParam.departure_time = options.departure_time; + } + if (options.policy) { + requestParam.policy = options.policy; + } + } + + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode); + } + wx.request(Utils.buildWxRequestConfig(options, { + url: SET_URL_DIRECTION, + data: requestParam + }, 'direction')); + }; + + Utils.locationProcess(options, locationsuccess); + } +}; + +module.exports = QQMapWX; \ No newline at end of file diff --git a/lib/qqmap/qqmap-wx-jssdk.min.js b/lib/qqmap/qqmap-wx-jssdk.min.js new file mode 100644 index 0000000..8fa1477 --- /dev/null +++ b/lib/qqmap/qqmap-wx-jssdk.min.js @@ -0,0 +1 @@ +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 URL_DIRECTION = BASE_URL + 'direction/v1/'; var MODE = { driving: 'driving', transit: 'transit' }; var EARTH_RADIUS = 6378136.49; var Utils = { safeAdd(x, y) { var lsw = (x & 0xffff) + (y & 0xffff); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return (msw << 16) | (lsw & 0xffff) }, bitRotateLeft(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }, md5cmn(q, a, b, x, s, t) { return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b) }, md5ff(a, b, c, d, x, s, t) { return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) }, md5gg(a, b, c, d, x, s, t) { return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) }, md5hh(a, b, c, d, x, s, t) { return this.md5cmn(b ^ c ^ d, a, b, x, s, t) }, md5ii(a, b, c, d, x, s, t) { return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) }, binlMD5(x, len) { x[len >> 5] |= 0x80 << (len % 32); x[((len + 64) >>> 9 << 4) + 14] = len; var i; var olda; var oldb; var oldc; var oldd; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (i = 0; i < x.length; i += 16) { olda = a; oldb = b; oldc = c; oldd = d; a = this.md5ff(a, b, c, d, x[i], 7, -680876936); d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); b = this.md5gg(b, c, d, a, x[i], 20, -373897302); a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); d = this.md5hh(d, a, b, c, x[i], 11, -358537222); c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); a = this.md5ii(a, b, c, d, x[i], 6, -198630844); d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); a = this.safeAdd(a, olda); b = this.safeAdd(b, oldb); c = this.safeAdd(c, oldc); d = this.safeAdd(d, oldd) } return [a, b, c, d] }, binl2rstr(input) { var i; var output = ''; var length32 = input.length * 32; for (i = 0; i < length32; i += 8) { output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff) } return output }, rstr2binl(input) { var i; var output = []; output[(input.length >> 2) - 1] = undefined; for (i = 0; i < output.length; i += 1) { output[i] = 0 } var length8 = input.length * 8; for (i = 0; i < length8; i += 8) { output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32) } return output }, rstrMD5(s) { return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) }, rstrHMACMD5(key, data) { var i; var bkey = this.rstr2binl(key); var ipad = []; var opad = []; var hash; ipad[15] = opad[15] = undefined; if (bkey.length > 16) { bkey = this.binlMD5(bkey, key.length * 8) } for (i = 0; i < 16; i += 1) { ipad[i] = bkey[i] ^ 0x36363636; opad[i] = bkey[i] ^ 0x5c5c5c5c } hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8); return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) }, rstr2hex(input) { var hexTab = '0123456789abcdef'; var output = ''; var x; var i; for (i = 0; i < input.length; i += 1) { x = input.charCodeAt(i); output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) } return output }, str2rstrUTF8(input) { return unescape(encodeURIComponent(input)) }, rawMD5(s) { return this.rstrMD5(this.str2rstrUTF8(s)) }, hexMD5(s) { return this.rstr2hex(this.rawMD5(s)) }, rawHMACMD5(k, d) { return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) }, hexHMACMD5(k, d) { return this.rstr2hex(this.rawHMACMD5(k, d)) }, md5(string, key, raw) { if (!key) { if (!raw) { return this.hexMD5(string) } return this.rawMD5(string) } if (!raw) { return this.hexHMACMD5(key, string) } return this.rawHMACMD5(key, string) }, getSig(requestParam, sk, feature, mode) { var sig = null; var requestArr = []; Object.keys(requestParam).sort().forEach(function (key) { requestArr.push(key + '=' + requestParam[key]) }); if (feature == 'search') { sig = '/ws/place/v1/search?' + requestArr.join('&') + sk } if (feature == 'suggest') { sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk } if (feature == 'reverseGeocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'geocoder') { sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk } if (feature == 'getCityList') { sig = '/ws/district/v1/list?' + requestArr.join('&') + sk } if (feature == 'getDistrictByCityId') { sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk } if (feature == 'calculateDistance') { sig = '/ws/distance/v1/?' + requestArr.join('&') + sk } if (feature == 'direction') { sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk } sig = this.md5(sig); return sig }, 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 }, 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 }, 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 }) }, 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 () { } }, 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 }, checkKeyword(param) { return !this.checkParamKeyEmpty(param, 'keyword') }, 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 }, buildErrorConfig(errCode, errMsg) { return { status: errCode, message: errMsg } }, 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) { 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 if (feature == 'direction') { var direction = data.result.routes; param.success(data, direction) } else { param.success(data) } }, 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 { constructor(options) { if (!options.key) { throw Error('key值不能为空') } this.key = options.key }; 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 + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else if (rectangle && !region) { requestParam.boundary = "rectangle(" + rectangle + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } else { requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")"; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') } } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search')) }; Utils.locationProcess(options, locationsuccess) }; 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; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) }; Utils.locationProcess(options, locationsuccess) } else { if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, "suggest")) } }; reverseGeocoder(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; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'reverseGeocoder')) }; Utils.locationProcess(options, locationsuccess) }; 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 } if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_GET_GEOCODER, data: requestParam }, 'geocoder')) }; getCityList(options) { var that = this; options = options || {}; Utils.polyfillParam(options); var requestParam = { output: 'json', key: that.key }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_CITY_LIST, data: requestParam }, 'getCityList')) }; 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 }; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_AREA_LIST, data: requestParam }, 'getDistrictByCityId')) }; 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; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') } wx.request(Utils.buildWxRequestConfig(options, { url: URL_DISTANCE, data: requestParam }, 'calculateDistance')) }; Utils.locationProcess(options, locationsuccess) } }; direction(options) { var that = this; options = options || {}; Utils.polyfillParam(options); if (Utils.checkParamKeyEmpty(options, 'to')) { return } var requestParam = { output: 'json', key: that.key }; if (typeof options.to == 'string') { requestParam.to = options.to } else { requestParam.to = options.to.latitude + ',' + options.to.longitude } var SET_URL_DIRECTION = null; options.mode = options.mode || MODE.driving; SET_URL_DIRECTION = URL_DIRECTION + options.mode; if (options.from) { options.location = options.from } if (options.mode == MODE.driving) { if (options.from_poi) { requestParam.from_poi = options.from_poi } if (options.heading) { requestParam.heading = options.heading } if (options.speed) { requestParam.speed = options.speed } if (options.accuracy) { requestParam.accuracy = options.accuracy } if (options.road_type) { requestParam.road_type = options.road_type } if (options.to_poi) { requestParam.to_poi = options.to_poi } if (options.from_track) { requestParam.from_track = options.from_track } if (options.waypoints) { requestParam.waypoints = options.waypoints } if (options.policy) { requestParam.policy = options.policy } if (options.plate_number) { requestParam.plate_number = options.plate_number } } if (options.mode == MODE.transit) { if (options.departure_time) { requestParam.departure_time = options.departure_time } if (options.policy) { requestParam.policy = options.policy } } var locationsuccess = function (result) { requestParam.from = result.latitude + ',' + result.longitude; if (options.sig) { requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) } wx.request(Utils.buildWxRequestConfig(options, { url: SET_URL_DIRECTION, data: requestParam }, 'direction')) }; Utils.locationProcess(options, locationsuccess) } }; module.exports = QQMapWX; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b0dbc76..969b7dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,306 @@ { "name": "miniprogram-starter", + "version": "0.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { + "name": "miniprogram-starter", + "version": "0.0.2", + "license": "MIT", "dependencies": { - "tdesign-miniprogram": "^0.12.1" + "mockjs": "^1.1.0", + "tdesign-miniprogram": "^1.1.15" + }, + "devDependencies": { + "eslint": "^8.49.0" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", + "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, "node_modules/dayjs": { @@ -13,28 +308,1686 @@ "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.2.tgz", "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "dev": true, + "dependencies": { + "flatted": "^3.2.7", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mockjs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz", + "integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==", + "dependencies": { + "commander": "*" + }, + "bin": { + "random": "bin/random" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tdesign-miniprogram": { - "version": "0.12.1", - "resolved": "https://registry.npmmirror.com/tdesign-miniprogram/-/tdesign-miniprogram-0.12.1.tgz", - "integrity": "sha512-nRQu3us411XbFz7AFa1o/ZffZtc+jxRLYhLCALzivsqFDQt0YaxBQbtRNxg7fwKtaKezg/wl+IFSymm4OfgiCQ==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.1.15.tgz", + "integrity": "sha512-dFGA5fQnObN6bjer3CIcRhNOsjz9VwV2oBC+EEz2bFMYMQQZ0A754TWQzHr/UkW/q+qEMakfxGxlKTa19YSwzw==", "dependencies": { "dayjs": "^1.10.7" } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.8.1.tgz", + "integrity": "sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@eslint/js": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.49.0.tgz", + "integrity": "sha512-1S8uAY/MTJqVx0SC4epBq+N2yhuwtNwLbJYNZyhL2pO1ZVKn5HFXav5T41Ryzy9K9V7ZId2JB2oy/W4aCd9/2w==", + "dev": true + }, + "@humanwhocodes/config-array": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "dayjs": { "version": "1.11.2", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.2.tgz", "integrity": "sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==" }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.49.0.tgz", + "integrity": "sha512-jw03ENfm6VJI0jA9U+8H5zfl5b+FvuU3YYvZRdZHOlU2ggJkxrlkJH4HcDrZpj6YwD8kuYqvQM8LyesoazrSOQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.49.0", + "@humanwhocodes/config-array": "^0.11.11", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + } + }, + "eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + }, + "espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "requires": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + } + }, + "esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.0.tgz", + "integrity": "sha512-OHx4Qwrrt0E4jEIcI5/Xb+f+QmJYNj2rrK8wiIdQOIrB9WrrJL8cjZvXdXuBTkkEwEqLycb5BeZDV1o2i9bTew==", + "dev": true, + "requires": { + "flatted": "^3.2.7", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "keyv": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mockjs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz", + "integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==", + "requires": { + "commander": "*" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, "tdesign-miniprogram": { - "version": "0.12.1", - "resolved": "https://registry.npmmirror.com/tdesign-miniprogram/-/tdesign-miniprogram-0.12.1.tgz", - "integrity": "sha512-nRQu3us411XbFz7AFa1o/ZffZtc+jxRLYhLCALzivsqFDQt0YaxBQbtRNxg7fwKtaKezg/wl+IFSymm4OfgiCQ==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/tdesign-miniprogram/-/tdesign-miniprogram-1.1.15.tgz", + "integrity": "sha512-dFGA5fQnObN6bjer3CIcRhNOsjz9VwV2oBC+EEz2bFMYMQQZ0A754TWQzHr/UkW/q+qEMakfxGxlKTa19YSwzw==", "requires": { "dayjs": "^1.10.7" } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index fa434e8..5885178 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,22 @@ "version": "0.0.2", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "npx eslint ./ --no-eslintrc -c ./.eslintrc.js" }, - "keywords": ["wechat", "miniprogram", "starter"], + "keywords": [ + "wechat", + "miniprogram", + "starter" + ], "author": "leejim", "license": "MIT", "description": "a start-kit for wechat miniprogram powerby TDesign miniprogram", "dependencies": { - "tdesign-miniprogram": "^0.12.1" + "mockjs": "^1.1.0", + "tdesign-miniprogram": "^1.1.15" }, - "devDependencies": {} -} + "devDependencies": { + "eslint": "^8.49.0" + } +} \ No newline at end of file diff --git a/pages/explore/index.json b/pages/explore/index.json deleted file mode 100644 index ac05698..0000000 --- a/pages/explore/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "发现", - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/explore/index.less b/pages/explore/index.less deleted file mode 100644 index 204b9db..0000000 --- a/pages/explore/index.less +++ /dev/null @@ -1 +0,0 @@ -/* pages/explore/index.wxss */ \ No newline at end of file diff --git a/pages/explore/index.wxml b/pages/explore/index.wxml deleted file mode 100644 index 179190c..0000000 --- a/pages/explore/index.wxml +++ /dev/null @@ -1,3 +0,0 @@ - - Explore Page - \ No newline at end of file diff --git a/pages/explore/index.js b/pages/home/chooseLocation/index.js similarity index 52% rename from pages/explore/index.js rename to pages/home/chooseLocation/index.js index 5961137..6669bbf 100644 --- a/pages/explore/index.js +++ b/pages/home/chooseLocation/index.js @@ -1,11 +1,19 @@ -// pages/explore/index.js +// pages/home/chooseLocation/index.js +import { + fetchLocation +} from '../../../services/fetchLocation'; +import { cities } from '../../../config/cities'; + Page({ /** * 页面的初始数据 */ data: { - + currentCity: '深圳', + indexList: [], + hotCities: cities.hotCities, + sortedCities: cities.sortedCities }, /** @@ -19,7 +27,9 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onReady() { - + this.setData({ + indexList: this.data.sortedCities.map((item) => item.index), + }); }, /** @@ -62,5 +72,21 @@ Page({ */ onShareAppMessage() { + }, + + // 更新定位 + updateLocation() { + fetchLocation().then((data) => { + console.log(data); + // this.setData({ + // currentLocation: data + // }) + }); + }, + // 更换当前城市 + changeCity(e) { + this.setData({ + currentCity: e.currentTarget.dataset.city + }) } }) \ No newline at end of file diff --git a/pages/home/chooseLocation/index.json b/pages/home/chooseLocation/index.json new file mode 100644 index 0000000..e966e2d --- /dev/null +++ b/pages/home/chooseLocation/index.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon", + "t-button": "tdesign-miniprogram/button/button", + "t-indexes": "tdesign-miniprogram/indexes/indexes", + "t-indexes-anchor": "tdesign-miniprogram/indexes-anchor/indexes-anchor", + "t-cell-group": "tdesign-miniprogram/cell-group/cell-group", + "t-cell": "tdesign-miniprogram/cell/cell" + }, + "navigationBarTitleText": "选择城市" +} \ No newline at end of file diff --git a/pages/home/chooseLocation/index.less b/pages/home/chooseLocation/index.less new file mode 100644 index 0000000..5420054 --- /dev/null +++ b/pages/home/chooseLocation/index.less @@ -0,0 +1,45 @@ +/* pages/home/chooseLocation/index.wxss */ +.location { + position: relative; + height: 65px; + display: flex; + align-items: center; + + .currentLocation { + display: inline-flex; + position: absolute; + left: 16px; + align-items: center; + color: #000000e6; + font-weight: 400; + font-family: "PingFang SC"; + text-align: center; + font-size: 16px; + line-height: 24px; + } + + .btn { + position: absolute; + right: 16px; + height: 28px; + width: 72px; + border-radius: 100px; + font-size: 14px; + font-weight: 600; + font-family: "PingFang SC"; + text-align: center; + line-height: 22px; + } +} + +.title { + height: 30px; + padding-left: 16px; + background: #f3f3f3; + color: #000000e6; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + text-align: left; + line-height: 30px; +} \ No newline at end of file diff --git a/pages/home/chooseLocation/index.wxml b/pages/home/chooseLocation/index.wxml new file mode 100644 index 0000000..98fe5cc --- /dev/null +++ b/pages/home/chooseLocation/index.wxml @@ -0,0 +1,19 @@ + + + + {{currentCity}}市 + + 更新定位 + + + 热门城市 + + + + + + + + + + \ No newline at end of file diff --git a/pages/home/components/custom-top-bar/index.js b/pages/home/components/custom-top-bar/index.js new file mode 100644 index 0000000..e541a93 --- /dev/null +++ b/pages/home/components/custom-top-bar/index.js @@ -0,0 +1,52 @@ +// components/custom-top-bar/index.js +const app = getApp(); + +// 使用定位服务 +import { + fetchLocation +} from '../../../../services/fetchLocation'; + +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + navBarHeight: app.globalData.navBarHeight, + statusBarHeight: app.globalData.statusBarHeight, + menuRight: app.globalData.menuRight, + menuBottom: app.globalData.menuBottom, + menuHeight: app.globalData.menuHeight, + menuWidth: app.globalData.menuWidth, + + city: '深圳市' + }, + + /** + * 组件的方法列表 + */ + methods: { + // 跳转选择地区的页面 + chooseLocation: function () { + wx.navigateTo({ + url: '/pages/home/chooseLocation/index', + }) + } + }, + lifetimes: { + attached: function () { + fetchLocation().then((data)=>{ + console.log(data); + // this.setData({ + // city: data + // }) + }); + } + } +}) \ No newline at end of file diff --git a/pages/home/components/custom-top-bar/index.json b/pages/home/components/custom-top-bar/index.json new file mode 100644 index 0000000..fa2d209 --- /dev/null +++ b/pages/home/components/custom-top-bar/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "t-icon": "tdesign-miniprogram/icon/icon" + } +} \ No newline at end of file diff --git a/pages/home/components/custom-top-bar/index.less b/pages/home/components/custom-top-bar/index.less new file mode 100644 index 0000000..1c640c9 --- /dev/null +++ b/pages/home/components/custom-top-bar/index.less @@ -0,0 +1,14 @@ +/* components/custom-top-bar/index.wxss */ +.topbar-container { + .location { + display: inline-flex; + margin-left: 16px; + align-items: center; + color: #000000e6; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + text-align: center; + line-height: 20px; + } +} \ No newline at end of file diff --git a/pages/home/components/custom-top-bar/index.wxml b/pages/home/components/custom-top-bar/index.wxml new file mode 100644 index 0000000..81d8f55 --- /dev/null +++ b/pages/home/components/custom-top-bar/index.wxml @@ -0,0 +1,6 @@ + + + + {{city}} + + \ No newline at end of file diff --git a/pages/home/components/popup-button/index.js b/pages/home/components/popup-button/index.js new file mode 100644 index 0000000..6a81eb5 --- /dev/null +++ b/pages/home/components/popup-button/index.js @@ -0,0 +1,50 @@ +// pages/home/components/popupButton/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + "text": { + "type": String, + "value": '分类内容' + }, + "reset": { + "type": Boolean, + "value": false, + "observer": "statusReset" + } + }, + + /** + * 组件的初始数据 + */ + data: { + chosen: false + }, + + /** + * 组件的方法列表 + */ + methods: { + handleClick() { + let newStatus = !this.data.chosen; + this.setData({ + chosen: newStatus + }) + + this.triggerEvent('clickBtn', newStatus ? { + chosen: true, + tag: this.properties.text + } : { + chosen: false, + tag: this.properties.text + }) + }, + statusReset(){ + this.setData({ + chosen: false + }) + this.triggerEvent('finshReset'); + } + } +}) \ No newline at end of file diff --git a/pages/home/components/popup-button/index.json b/pages/home/components/popup-button/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/home/components/popup-button/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/components/popup-button/index.less b/pages/home/components/popup-button/index.less new file mode 100644 index 0000000..5a34b46 --- /dev/null +++ b/pages/home/components/popup-button/index.less @@ -0,0 +1,24 @@ +/* pages/home/components/popupButton/index.wxss */ +.btn { + display: inline-flex; + width: 28.3vw; + height: 4.9vh; + border-radius: 100px; + background: #f3f3f3; + font-size: 1.7vh; + font-weight: 400; + font-family: "PingFang SC"; + line-height: 22px; + align-items: center; + justify-content: center; +} + +.normal { + color: #000000e6; +} + +.chosen { + color: #0052d9; + border: 1px solid #0052d9; + background: #f2f3ff; +} \ No newline at end of file diff --git a/pages/home/components/popup-button/index.wxml b/pages/home/components/popup-button/index.wxml new file mode 100644 index 0000000..f8b8634 --- /dev/null +++ b/pages/home/components/popup-button/index.wxml @@ -0,0 +1,4 @@ + + diff --git a/pages/home/index.js b/pages/home/index.js new file mode 100644 index 0000000..fa37000 --- /dev/null +++ b/pages/home/index.js @@ -0,0 +1,191 @@ +// index.js +const app = getApp(); +import { + fetchSwiperLis, + fetchAtvsList +} from '../../services/fetchAtvsList'; + +const domain = ['IT互联网', '艺术设计', '科技', '电商', '教育', '医疗健康', '心理学', '摄影']; +const form = ['讲座', '展览', '工作坊']; + +Page({ + data: { + // 导航栏高度 + navBarHeight: app.globalData.navBarHeight, + + // 轮播图 + current: 0, + autoplay: true, + duration: 500, + interval: 5000, + swiperList: [], + atvsList: [], + + // 当前活动分类 + selectedColTitle: 1, + + // 筛选弹窗 + popupVisible: false, + choosingDate: false, + domain, + form, + priceMax: 588, + priceDefault: [0, 288], + reset: false, + // 用户选择的筛选条件 + tags: [], + dateRange: [], + startTime: '', + endTime: '', + priceRange: [] + }, + + // 转换标题的事件 + selectColTitile(e) { + this.setData({ + selectedColTitle: parseInt(e.currentTarget.dataset.index) + }); + }, + + // 加载页面数据 + async loadData() { + // 加载活动的信息 + const swiper = await fetchSwiperLis(); + const atvsList = await fetchAtvsList(); + this.setData({ + swiperList: swiper.data, + atvsList: atvsList.data + }) + + // 将价格范围设置为初始范围 + this.setData({ + priceRange: this.data.priceDefault + }); + + // 加载今明两日的日期 + this.loadDate(); + }, + + // 开关筛选弹窗 + handlePopup() { + let newStatus = !this.data.popupVisible; + this.setData({ + popupVisible: newStatus, + choosingDate: false + }) + }, + + // 选择标签 + chooseTag({ + detail + }) { + if (detail.chosen) { + this.data.tags.push(detail.tag) + } else { + this.data.tags.forEach((item, idx) => { + if (item == detail.tag) + this.data.tags.splice(idx, 1); + }) + }; + }, + + // 加载今日的日期 + loadDate() { + let date = new Date(); + let year = date.getUTCFullYear(), + month = date.getUTCMonth() + 1, + day = date.getUTCDate(); + this.setData({ + startTime: year + '年' + month + '月' + day + '日', + endTime: month + '月' + (day + 1) + '日' + }); + this.data.dateRange.push(this.data.startTime, this.data.endTime) + }, + + // 进入选择日期 + chooseDate() { + let newStatus = !this.data.choosingDate; + this.setData({ + choosingDate: newStatus + }); + }, + + // 在日历中选择日期 + handleSelect(e) { + let { + value + } = e.detail; + this.data.dateRange = []; + + if (value.length > 1) { + value.forEach((time) => { + let date = new Date(time); + let year = date.getUTCFullYear(), + month = date.getUTCMonth() + 1, + day = date.getUTCDate() + 1; + + this.data.dateRange.push(year + '年' + month + '月' + day + '日'); + }); + }; + }, + + // 确认提交选择的日期 + comfirmDate() { + let start = this.data.dateRange[0], + end = this.data.dateRange[1]; + if (start && end) { + if (start.slice(0, 4) == end.slice(0, 4)) { + this.setData({ + startTime: start, + endTime: end.slice(5) + }) + } else { + this.setData({ + startTime: start, + endTime: end + }) + }; + } + this.chooseDate(); + }, + + // 选择价格范围 + choosePrice(e) { + this.setData({ + priceRange: e.detail.value + }) + }, + + // 完成筛选 + submit() { + let filter = { + tags: this.data.tags, + dateRange: this.data.dateRange, + priceRange: this.data.priceDefault + }; + console.log(filter); + this.handlePopup(); + }, + + // 重置筛选条件 + reset() { + this.setData({ + tags: [], + dateRange: [], + priceRange: this.data.priceDefault, + reset: true + }); + this.loadDate(); + }, + + // 完成重置,将reset值改回原来的假值 + finshReset() { + this.setData({ + reset: false + }) + }, + + onLoad() { + this.loadData(); + } +}) \ No newline at end of file diff --git a/pages/home/index.json b/pages/home/index.json new file mode 100644 index 0000000..e01cb7c --- /dev/null +++ b/pages/home/index.json @@ -0,0 +1,19 @@ +{ + "navigationBarTitleText": "首页", + "usingComponents": { + "custom-top-bar": "./components/custom-top-bar/index", + "t-search": "tdesign-miniprogram/search/search", + "t-swiper": "tdesign-miniprogram/swiper/swiper", + "t-swiper-nav": "tdesign-miniprogram/swiper-nav/swiper-nav", + "t-row": "tdesign-miniprogram/row/row", + "t-col": "tdesign-miniprogram/col/col", + "t-icon": "tdesign-miniprogram/icon/icon", + "info-card": "/components/info-card/index", + "t-popup": "tdesign-miniprogram/popup/popup", + "t-button": "tdesign-miniprogram/button/button", + "popup-button": "./components/popup-button/index", + "t-slider": "tdesign-miniprogram/slider/slider", + "t-calendar": "tdesign-miniprogram/calendar/calendar" + }, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/home/index.less b/pages/home/index.less new file mode 100644 index 0000000..f9a5e22 --- /dev/null +++ b/pages/home/index.less @@ -0,0 +1,252 @@ +/**index.wxss**/ +.fixed-container { + width: 100%; + position: fixed; + z-index: 99; + background-size: cover; + background-color: #fff; + + /* search */ + .search { + height: 56px; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + + .example-search { + height: 40px; + width: 343px; + } + } +} + +scroll-view { + padding-bottom: calc(env(safe-area-inset-bottom) + 112rpx); + + /* title */ + .title { + width: 80px; + height: 28px; + opacity: 1; + color: #000000e6; + font-size: 20px; + font-weight: 600; + font-family: "PingFang SC"; + text-align: left; + line-height: 28px; + margin-left: 16px; + } + + /* swiper */ + .swiper { + margin-top: 13px; + + .card-theme { + --td-swiper-radius: 0; + --td-swiper-item-padding: 16px 0 41.81px 0; + --td-swiper-center-padding: 16px 12px 41.81px 12px; + --td-swiper-nav-dot-color: #e7e7e7; + --td-swiper-nav-dot-active-color: #0052d9; + } + + .card-theme .card-theme-nav { + bottom: 23.81px; + } + + .t-swiper__item { + height: 217px !important; + transition: box-shadow 1s ease, + padding 0.8s ease; + } + + .t-swiper__item[aria-hidden="false"] { + padding: var(--td-swiper-center-padding, 0); + } + + .t-swiper__item[aria-hidden="false"] .t-image { + box-shadow: 0 6px 30px 5px #0000000d, 0 16px 24px 2px #0000000a, 0 8px 10px -5px #00000014; + } + + .t-image { + height: 100% !important; + } + } + + /* activesList */ + .t-row { + position: relative; + } + + .t-icon { + display: inline-block; + vertical-align: sub; + } + + .colTitle { + color: #000000e6; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + height: 48px; + line-height: 48px; + text-align: center; + border-bottom: 0.5px solid #e7e7e7; + } + + .selectedColTitle { + color: #0052d9; + font-size: 14px; + font-weight: 600; + } + + .colTitle:nth-child(3)::before { + content: ''; + width: 1px; + height: 22px; + background-color: #e7e7e7; + position: absolute; + right: 33%; + top: 50%; + transform: translateY(-50%); + } +} + +.popup { + .block { + width: 100vw; + height: 84vh; + background: #fff; + border-top-left-radius: 16rpx; + border-top-right-radius: 16rpx; + } + + .wrapper { + margin: 32rpx; + display: block; + } + + .header { + height: 6.8vh; + padding: 0 4.3vw; + display: flex; + align-items: center; + } + + .hidden { + visibility: hidden; + } + + .title { + flex: 1; + text-align: center; + font-weight: 600; + font-size: 36rpx; + } + + .cancel { + color: #000000; + } + + .all { + width: 91.5vw; + margin: 0 4.3vw; + position: relative; + + view text { + display: block; + margin-bottom: 1.5vh; + color: #000000e6; + font-size: 1.7vh; + font-weight: 600; + font-family: "PingFang SC"; + text-align: left; + line-height: 2.7vh; + } + + .btnContainer { + display: grid; + grid-template-columns: auto auto auto; + grid-column-gap: 3.2vw; + grid-row-gap: 1.5vh; + } + + .form { + margin-top: 3vh; + padding-bottom: 3vh; + border-bottom: 0.5px solid #e7e7e7; + } + + .date { + margin-top: 3vh; + position: relative; + padding-bottom: 6.4vw; + border-bottom: 0.5px solid #e7e7e7; + color: #000000e6; + font-size: 2vh; + font-weight: 400; + font-family: "PingFang SC"; + text-align: left; + line-height: 3vh; + + .dateBtn { + position: absolute; + height: 3.4vh; + width: 19.2vw; + right: 0; + border-radius: 100px; + font-size: 1.7vh; + font-weight: 600; + font-family: "PingFang SC"; + text-align: center; + line-height: 2.7vh; + } + } + + .price { + margin: 3vh 0; + + .t-slider { + width: 91.5vw; + height: 5.7vh; + font-size: 1.7vh; + } + } + + .bottomBtns { + display: flex; + justify-content: space-between; + + button { + height: 5.9vh; + width: 44vw; + font-size: 2vh; + font-weight: 600; + font-family: "PingFang SC"; + text-align: center; + line-height: 3vh; + } + } + } + + .chosingDate { + position: relative; + + .t-calendar__title { + display: none; + } + + button { + position: absolute; + bottom: -9vh; + height: 5.9vh; + width: 91.5vw; + margin: 0 4.3vw; + font-size: 2vh; + font-weight: 600; + font-family: "PingFang SC"; + text-align: center; + line-height: 3vh; + } + } +} \ No newline at end of file diff --git a/pages/home/index.wxml b/pages/home/index.wxml new file mode 100644 index 0000000..6e2f893 --- /dev/null +++ b/pages/home/index.wxml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + 热门推荐 + + + + + + + 全部活动 + + 最新活动 + 高分活动 + + + 筛选 + + + + + + + + + + + + + 全部筛选 + + + + + + + + 面向领域 + + + + + + 活动形式 + + + + + + 活动日期 + {{ startTime }}-{{ endTime }} + 选择日期 + + + 价格范围(元) + + + + 重置 + 完成 + + + + + + + + + + + + + 选择日期 + + + + + + + + 确认日期 + + + \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js deleted file mode 100644 index 0bc1771..0000000 --- a/pages/index/index.js +++ /dev/null @@ -1,48 +0,0 @@ -// index.js -// 获取应用实例 -const app = getApp() - -Page({ - data: { - motto: 'Hello World', - userInfo: {}, - hasUserInfo: false, - canIUse: wx.canIUse('button.open-type.getUserInfo'), - canIUseGetUserProfile: false, - canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false - }, - // 事件处理函数 - bindViewTap() { - wx.navigateTo({ - url: '../logs/logs' - }) - }, - onLoad() { - if (wx.getUserProfile) { - this.setData({ - canIUseGetUserProfile: true - }) - } - }, - getUserProfile(e) { - // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 - wx.getUserProfile({ - desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - console.log(res) - this.setData({ - userInfo: res.userInfo, - hasUserInfo: true - }) - } - }) - }, - getUserInfo(e) { - // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 - console.log(e) - this.setData({ - userInfo: e.detail.userInfo, - hasUserInfo: true - }) - } -}) diff --git a/pages/index/index.json b/pages/index/index.json deleted file mode 100644 index a860429..0000000 --- a/pages/index/index.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "navigationBarTitleText": "首页", - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/index/index.less b/pages/index/index.less deleted file mode 100644 index eb64203..0000000 --- a/pages/index/index.less +++ /dev/null @@ -1,19 +0,0 @@ -/**index.wxss**/ -.userinfo { - display: flex; - flex-direction: column; - align-items: center; - color: #aaa; -} - -.userinfo-avatar { - overflow: hidden; - width: 128rpx; - height: 128rpx; - margin: 20rpx; - border-radius: 50%; -} - -.usermotto { - margin-top: 200px; -} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml deleted file mode 100644 index f00d294..0000000 --- a/pages/index/index.wxml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - 请使用1.4.4及以上版本基础库 - - - - {{userInfo.nickName}} - - - - {{motto}} - - diff --git a/pages/my/components/custom-top-bar/index.js b/pages/my/components/custom-top-bar/index.js new file mode 100644 index 0000000..9051de5 --- /dev/null +++ b/pages/my/components/custom-top-bar/index.js @@ -0,0 +1,29 @@ +// components/custom-top-bar/index.js +const app = getApp(); + +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + navBarHeight: app.globalData.navBarHeight, + statusBarHeight: app.globalData.statusBarHeight + }, + + /** + * 组件的方法列表 + */ + methods: { + + }, + lifetimes: { + + } +}) \ No newline at end of file diff --git a/pages/my/components/custom-top-bar/index.json b/pages/my/components/custom-top-bar/index.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/pages/my/components/custom-top-bar/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/my/components/custom-top-bar/index.less b/pages/my/components/custom-top-bar/index.less new file mode 100644 index 0000000..f690bc7 --- /dev/null +++ b/pages/my/components/custom-top-bar/index.less @@ -0,0 +1,15 @@ +/* pages/my/components/custom-top-bar/index.wxss */ +.topbar-container { + background-color: #fff; + background-size: cover; + + .title { + display: flex; + color: #000000e6; + font-size: 18px; + font-weight: 600; + font-family: "PingFang SC"; + text-align: center; + justify-content: center; + } +} \ No newline at end of file diff --git a/pages/my/components/custom-top-bar/index.wxml b/pages/my/components/custom-top-bar/index.wxml new file mode 100644 index 0000000..9ec97d1 --- /dev/null +++ b/pages/my/components/custom-top-bar/index.wxml @@ -0,0 +1,4 @@ + + + 我的 + \ No newline at end of file diff --git a/pages/my/components/info-card/index.js b/pages/my/components/info-card/index.js new file mode 100644 index 0000000..88d21da --- /dev/null +++ b/pages/my/components/info-card/index.js @@ -0,0 +1,34 @@ +// pages/my/components/info-card/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + "info": { + "type": Object, + "value": {} + } + }, + + /** + * 组件的初始数据 + */ + data: { + info: [] + }, + + /** + * 组件的方法列表 + */ + methods: { + + }, + + lifetimes: { + attached(){ + this.setData({ + info: this.properties.info + }) + } + } +}) diff --git a/pages/my/components/info-card/index.json b/pages/my/components/info-card/index.json new file mode 100644 index 0000000..6ffda42 --- /dev/null +++ b/pages/my/components/info-card/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "t-image": "tdesign-miniprogram/image/image" + } +} \ No newline at end of file diff --git a/pages/my/components/info-card/index.less b/pages/my/components/info-card/index.less new file mode 100644 index 0000000..1cb54e6 --- /dev/null +++ b/pages/my/components/info-card/index.less @@ -0,0 +1,73 @@ +/* pages/my/components/info-card/index.wxss */ +.info-card { + width: 311px; + height: 120px; + margin: 16px auto; + background-color: #fff; + overflow: hidden; + border-radius: 9px; + box-shadow: 0 6px 30px 5px #0000000d, 0 16px 24px 2px #0000000a, 0 8px 10px -5px #00000014; + + .atvInfo { + display: inline-flex; + flex-direction: column; + margin: 16px 0 0 16px; + + .name { + width: 159px; + text-align: left; + color: #000000e6; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + line-height: 22px; + margin-bottom: 4px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .date { + width: 159px; + text-align: left; + color: #00000099; + font-size: 12px; + font-weight: 400; + font-family: "PingFang SC"; + line-height: 20px; + } + + .status { + width: 159px; + text-align: left; + position: relative; + margin-top: 24px; + } + + .unfinished { + color: #2ba471; + font-size: 14px; + font-weight: 600; + font-family: "PingFang SC"; + line-height: 22px; + } + + .finished { + color: #00000066; + font-size: 14px; + font-weight: 600; + font-family: "PingFang SC"; + line-height: 22px; + } + + .comment { + position: absolute; + right: 0; + color: #0052d9; + font-size: 14px; + font-weight: 400; + font-family: "PingFang SC"; + line-height: 22px; + } + } +} \ No newline at end of file diff --git a/pages/my/components/info-card/index.wxml b/pages/my/components/info-card/index.wxml new file mode 100644 index 0000000..3e08dd7 --- /dev/null +++ b/pages/my/components/info-card/index.wxml @@ -0,0 +1,12 @@ + + + + + {{info.name}} + {{info.date}} + + {{info.status ? '已完成' : '待参加'}} + 去评价 + + + \ No newline at end of file diff --git a/pages/my/index.js b/pages/my/index.js index 026df8e..921d1b5 100644 --- a/pages/my/index.js +++ b/pages/my/index.js @@ -1,11 +1,29 @@ -// logs.js -const util = require('../../utils/util.js') +// index.js +const app = getApp(); +import { + fetchMyatvs +} from '../../services/fetchMyAtvs'; Page({ data: { - logs: [] + navBarHeight: app.globalData.navBarHeight, + profile: "https://tdesign.gtimg.com/miniprogram/images/avatar1.png", + username: '蔡宣轩', + tags: ['29岁', '设计/艺术从业者'], + myAtvs: [] + }, + + // 加载页面数据 + async loadData() { + const { + data + } = await fetchMyatvs(); + this.setData({ + myAtvs: data + }) }, - onLoad() { + onLoad() { + this.loadData(); } -}) +}) \ No newline at end of file diff --git a/pages/my/index.json b/pages/my/index.json index c0a8251..3a6db00 100644 --- a/pages/my/index.json +++ b/pages/my/index.json @@ -1,4 +1,14 @@ { "navigationBarTitleText": "我的", - "usingComponents": {} + "usingComponents": { + "t-avatar": "tdesign-miniprogram/avatar/avatar", + "t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group", + "t-icon": "tdesign-miniprogram/icon/icon", + "custom-top-bar": "./components/custom-top-bar/index", + "t-tabs": "tdesign-miniprogram/tabs/tabs", + "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", + "t-image": "tdesign-miniprogram/image/image", + "info-card": "./components/info-card/index" + }, + "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/my/index.less b/pages/my/index.less index 94d4b88..1d9ad48 100644 --- a/pages/my/index.less +++ b/pages/my/index.less @@ -1,8 +1,85 @@ -.log-list { - display: flex; - flex-direction: column; - padding: 40rpx; +page { + background: #f5f6f7; + position: relative; +} + +.background { + height: 163px; + background-color: #fff; + background-size: cover; +} + +custom-top-bar { + width: 100%; + position: fixed; + z-index: 99; + top: 0; } -.log-item { - margin: 10rpx; + +.content { + position: absolute; + width: 100%; + margin-top: 5px; + padding-bottom: calc(env(safe-area-inset-bottom) + 112rpx); +} + +.myInfo { + width: 343px; + height: 96px; + border-radius: 12px; + background: #ffffff; + margin: 0 auto 16px auto; + display: flex; + flex-direction: row; + align-items: center; + position: relative; + + .profile { + margin: 16px; + } + + .info { + .username { + color: #000000e6; + font-size: 16px; + font-weight: 600; + font-family: "PingFang SC"; + line-height: 24px; + margin-bottom: 8px; + } + + .tags { + text { + display: inline-block; + height: 24px; + border-radius: 3px; + background: #f3f3f3; + color: #000000e6; + font-size: 12px; + font-weight: 400; + font-family: "PingFang SC"; + text-align: center; + line-height: 24px; + margin-right: 8px; + padding: 0 8px; + } + } + } + + .t-icon { + position: absolute; + right: 16px; + } } + +.myAtvs { + width: 343px; + border-radius: 12px; + overflow: hidden; + background: #ffffff; + margin: 0 auto; + + .custom-tabs { + height: 48px; + } +} \ No newline at end of file diff --git a/pages/my/index.wxml b/pages/my/index.wxml index d5ba77b..26cacf0 100644 --- a/pages/my/index.wxml +++ b/pages/my/index.wxml @@ -1,4 +1,24 @@ - - - My Page + + + + + + + + {{username}} + + {{item}} + + + + + + + + + + + + + \ No newline at end of file diff --git a/project.config.json b/project.config.json index 6f5b5d1..5a26bea 100644 --- a/project.config.json +++ b/project.config.json @@ -43,11 +43,12 @@ "disableUseStrict": false, "useCompilerPlugins": [ "less" - ] + ], + "condition": false }, "compileType": "miniprogram", "libVersion": "2.19.4", - "appid": "wxcdfa13a58381f0fc", + "appid": "wx05141a42c465a077", "projectname": "miniprogram-starter", "condition": {}, "editorSetting": { diff --git a/project.private.config.json b/project.private.config.json index 48b9b50..244ebb8 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,5 +1,5 @@ { - "projectname": "miniprogram-starter", + "projectname": "tdesign-miniprogram-starter-apply", "setting": { "compileHotReLoad": true }, diff --git a/services/delay.js b/services/delay.js new file mode 100644 index 0000000..d768498 --- /dev/null +++ b/services/delay.js @@ -0,0 +1,6 @@ +/** 模拟网络请求延时 */ +export default function delay(ms = 500) { + return new Promise(resolve => { + setTimeout(resolve, ms); + }) +} \ No newline at end of file diff --git a/services/fetchAtvsList.js b/services/fetchAtvsList.js new file mode 100644 index 0000000..8760c96 --- /dev/null +++ b/services/fetchAtvsList.js @@ -0,0 +1,80 @@ +/** 模拟主页的请求 */ +import { config } from '../config/index'; +import delay from './delay'; + +const swiperList = [ + '/src/imgs/home/swiper1.png', + '/src/imgs/home/swiper2.png', + '/src/imgs/home/swiper1.png', + '/src/imgs/home/swiper2.png' +]; +const atvsList = [{ + imgUrl: '/src/imgs/home/atv1.png', + name: '2019 SICC服务设计创新大会', + floorPrice: '500.00', + ceilingPrice: '800.00', + free: '免费活动', + score: 5 + }, + { + imgUrl: '/src/imgs/home/atv2.png', + name: '2021 SICC服务设计创新大会', + floorPrice: '3000.00', + ceilingPrice: '4000.00', + score: 4.5 + }, + { + imgUrl: '/src/imgs/home/atv3.png', + name: '少年与星空 插画巡展', + floorPrice: '400.00', + ceilingPrice: '500.00', + score: 4.5 + }, + { + imgUrl: '/src/imgs/home/atv4.png', + name: 'Universe AI艺术展', + floorPrice: '500.00', + ceilingPrice: '800.00', + score: 3.5 + }, +]; + +// mock轮播图数据 +function mockFetchSwiperList() { + return delay().then(() => { + return { + data: swiperList + } + }) +} + +// mock活动列表数据 +function mockFetchAtvsList(){ + return delay().then(() => { + return { + data: atvsList + } + }) +} + +// 获取轮播图的请求 +export function fetchSwiperLis() { + if (config.useMock) { + return mockFetchSwiperList(); + } else { + return new Promise((resolve) => { + resolve('real api') + }) + } +}; + +// 获取活动的请求 +export function fetchAtvsList() { + if (config.useMock) { + return mockFetchAtvsList(); + } else { + return new Promise((resolve) => { + resolve('real api') + }) + } +} \ No newline at end of file diff --git a/services/fetchLocation.js b/services/fetchLocation.js new file mode 100644 index 0000000..5144a41 --- /dev/null +++ b/services/fetchLocation.js @@ -0,0 +1,36 @@ +/** 模拟获取当前定位 */ +import { + locationKey +} from '../config/index'; +// 使用定位服务 +var QQMapWX = require("../lib/qqmap/qqmap-wx-jssdk"); + +// 获取定位 +function fetchCity() { + qqmapsdk.reverseGeocoder({ + success: function (res) { + return new Promise((resolve)=>{ + resolve(res.result.ad_info.city); + }) + }, + fail: function (error) { + return new Promise((reject)=>{ + reject(error); + }) + } + }) +} + +// 获取当前定位的方法 +export function fetchLocation() { + if (locationKey) { + var qqmapsdk = new QQMapWX({ + key: locationKey + }); + fetchCity(); + } else { + return new Promise((resolve)=>{ + resolve('Please set your key for location services.') + }) + } +} \ No newline at end of file diff --git a/services/fetchMyAtvs.js b/services/fetchMyAtvs.js new file mode 100644 index 0000000..441510b --- /dev/null +++ b/services/fetchMyAtvs.js @@ -0,0 +1,49 @@ +/** 模拟获取我的页面的数据 */ +import { + config +} from '../config/index'; +import delay from './delay'; + +const myAtvs = [{ + imgUrl: '/src/imgs/my/atv2.png', + name: '2021 SICC服务设计创新大会', + date: '2021年3月16日', + status: 0 + }, + { + imgUrl: '/src/imgs/my/atv3.png', + name: '少年与星空 插画巡展', + date: '2021年6月5日', + status: 1 + }, + { + imgUrl: '/src/imgs/my/atv1.png', + name: '2019 SICC服务设计创新大会', + date: '2019年3月16日', + status: 1 + }, + { + imgUrl: '/src/imgs/my/atv4.png', + name: 'Universe AI艺术展', + date: '2019年3月16日', + status: 1 + } +]; + +function mockFetchMyatvs() { + return delay().then(() => { + return { + data: myAtvs + }; + }) +}; + +export function fetchMyatvs() { + if (config.useMock) { + return mockFetchMyatvs(); + } else { + return new Promise((resolve) => { + resolve('real api') + }); + } +} \ No newline at end of file diff --git a/src/imgs/home/atv1.png b/src/imgs/home/atv1.png new file mode 100644 index 0000000..9493368 Binary files /dev/null and b/src/imgs/home/atv1.png differ diff --git a/src/imgs/home/atv2.png b/src/imgs/home/atv2.png new file mode 100644 index 0000000..68aa099 Binary files /dev/null and b/src/imgs/home/atv2.png differ diff --git a/src/imgs/home/atv3.png b/src/imgs/home/atv3.png new file mode 100644 index 0000000..7f3863f Binary files /dev/null and b/src/imgs/home/atv3.png differ diff --git a/src/imgs/home/atv4.png b/src/imgs/home/atv4.png new file mode 100644 index 0000000..c735ac6 Binary files /dev/null and b/src/imgs/home/atv4.png differ diff --git a/src/imgs/home/swiper1.png b/src/imgs/home/swiper1.png new file mode 100644 index 0000000..7e0fd38 Binary files /dev/null and b/src/imgs/home/swiper1.png differ diff --git a/src/imgs/home/swiper2.png b/src/imgs/home/swiper2.png new file mode 100644 index 0000000..f03fb90 Binary files /dev/null and b/src/imgs/home/swiper2.png differ diff --git a/src/imgs/my/atv1.png b/src/imgs/my/atv1.png new file mode 100644 index 0000000..9493368 Binary files /dev/null and b/src/imgs/my/atv1.png differ diff --git a/src/imgs/my/atv2.png b/src/imgs/my/atv2.png new file mode 100644 index 0000000..68aa099 Binary files /dev/null and b/src/imgs/my/atv2.png differ diff --git a/src/imgs/my/atv3.png b/src/imgs/my/atv3.png new file mode 100644 index 0000000..7f3863f Binary files /dev/null and b/src/imgs/my/atv3.png differ diff --git a/src/imgs/my/atv4.png b/src/imgs/my/atv4.png new file mode 100644 index 0000000..c735ac6 Binary files /dev/null and b/src/imgs/my/atv4.png differ diff --git a/src/imgs/top-bar/topbar-bc.png b/src/imgs/top-bar/topbar-bc.png new file mode 100644 index 0000000..8ca488a Binary files /dev/null and b/src/imgs/top-bar/topbar-bc.png differ diff --git a/src/imgs/topbar/topbar-bc.png b/src/imgs/topbar/topbar-bc.png new file mode 100644 index 0000000..8ca488a Binary files /dev/null and b/src/imgs/topbar/topbar-bc.png differ diff --git a/t.woff b/t.woff new file mode 100644 index 0000000..d18934f Binary files /dev/null and b/t.woff differ