diff --git a/app.json b/app.json index 5cb837b..7b79654 100644 --- a/app.json +++ b/app.json @@ -34,9 +34,12 @@ "backgroundColor": "#252330" }, "sitemapLocation": "sitemap.json", + "requiredPrivateInfos": [ + "getFuzzyLocation" + ], "permission": { - "scope.userLocation": { - "desc": "需要获取您的地理位置,请确认授权,否则地图功能将无法使用" + "scope.userFuzzyLocation": { + "desc": "为更好体验,需要获取您的地理位置,请确认授权" } } } diff --git a/pages/home/index.js b/pages/home/index.js index 46ae0e2..18ef759 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -275,6 +275,7 @@ Page({ this.setData({ isShowAuth: false }) + this.onCancel() } }, @@ -311,7 +312,7 @@ Page({ includePoints: list, }) let that = this; - wx.getLocation({ + wx.getFuzzyLocation({ type: 'gcj02', success: function(res) { that.setData({ @@ -325,12 +326,16 @@ Page({ }); }, fail: function(res) { - console.log(res); - if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { - that.setData({ - isShowAuth: true - }) - } + console.log(res) + that.setData({ + latitude: 31.2336800000, + longitude: 121.4715700000, + }) + that.getData({ + latitude: that.data.latitude, + longitude: that.data.longitude, + zoom: 1 + }); }, }) }, @@ -480,15 +485,44 @@ Page({ }) }, - // 回到开始 + // 由原来的回到开始改为定位 goFrist() { - let list = [{ - longitude: this.data.longitude, - latitude: this.data.latitude - }]; - // this.data.includePoints + let that = this; + wx.getFuzzyLocation({ + type: 'gcj02', + success: function(res) { + that.setData({ + latitude: res.latitude, + longitude: res.longitude, + }) + that.getData({ + latitude: res.latitude, + longitude: res.longitude, + zoom: 1 + }); + let list = [{ + longitude: that.data.longitude, + latitude: that.data.latitude + }]; + // this.data.includePoints + that.setData({ + includePoints: list + }) + }, + fail: function(res) { + console.log(res.errMsg) + if (res.errMsg == 'getFuzzyLocation:fail auth deny' || res.errMsg == 'getFuzzyLocation:fail:auth denied' || res.errMsg == 'getFuzzyLocation:fail no permission') { + that.setData({ + isShowAuth: true + }) + } + }, + }) + }, + onCancel(e){ + console.log(e) this.setData({ - includePoints: list + isShowAuth: false }) } }) diff --git a/pages/home/index.wxml b/pages/home/index.wxml index cf5db33..9cffc2a 100644 --- a/pages/home/index.wxml +++ b/pages/home/index.wxml @@ -112,4 +112,4 @@ - + diff --git a/pages/myBookings/index.wxml b/pages/myBookings/index.wxml index b6ca669..0d6a4aa 100644 --- a/pages/myBookings/index.wxml +++ b/pages/myBookings/index.wxml @@ -7,11 +7,10 @@ {{memberLessonTicket.venueLesson.name}} - 预约成功 + 已预约 未签到 已签到 已取消 - 待审核 @@ -54,7 +53,7 @@ - + 取消预约 我要签到 @@ -62,4 +61,4 @@ - \ No newline at end of file + diff --git a/pages/myBookingsList/index.wxml b/pages/myBookingsList/index.wxml index 96428eb..d9ea590 100644 --- a/pages/myBookingsList/index.wxml +++ b/pages/myBookingsList/index.wxml @@ -14,11 +14,10 @@ 预约单号: {{item.orderSn}} - 预约成功 + 已预约 未签到 已完成 已取消 - 待审核 @@ -42,4 +41,4 @@ 暂无预约 ~ - \ No newline at end of file + diff --git a/pages/sportsGroundList/index.js b/pages/sportsGroundList/index.js index f94a717..fe56bf7 100644 --- a/pages/sportsGroundList/index.js +++ b/pages/sportsGroundList/index.js @@ -1,7 +1,7 @@ // pages/sportsGroundList/index.js const app = getApp(); -let latitude = 0; // 纬度 -let longitude = 0; // 经度 +let latitude = 31.2336800000; // 纬度 +let longitude = 121.4715700000; // 经度 let page = 1; Page({ @@ -24,7 +24,7 @@ Page({ this.setData({ state: options.state }) - this.getLocation(); + this.getLocationDistance(); }, /** @@ -106,6 +106,21 @@ Page({ } }, + getLocationDistance(){ + let that = this; + wx.getFuzzyLocation({ + type: 'gcj02', + success: function(res) { + latitude = res.latitude; + longitude = res.longitude; + that.getData() + }, + fail: function(res) { + that.getData() + }, + }) + }, + // 获取数据 getData(e) { wx.showLoading({ @@ -144,35 +159,6 @@ Page({ isShowNewplot: true }) }) - }, + } - // 活动当前坐标 - getLocation() { - let that = this; - wx.getLocation({ - type: 'gcj02', - success: function(res) { - latitude = res.latitude; - longitude = res.longitude; - that.getData() - }, - fail: function(res) { - if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { - that.setData({ - isShowAuth: true - }) - } - }, - }) - }, - - // 获取授权 - setAuthSuccess(e) { - if (e.detail.authSetting['scope.userLocation']) { - this.getLocation(); - this.setData({ - isShowAuth: false - }) - } - }, -}) \ No newline at end of file +}) diff --git a/pages/sportsGroundList/index.wxml b/pages/sportsGroundList/index.wxml index dabf4f7..ef6eb5b 100644 --- a/pages/sportsGroundList/index.wxml +++ b/pages/sportsGroundList/index.wxml @@ -34,9 +34,7 @@ - - 暂无运动场馆 ~ - \ No newline at end of file + diff --git a/project.config.json b/project.config.json index b22fba3..fbb3691 100644 --- a/project.config.json +++ b/project.config.json @@ -1,7 +1,8 @@ { "description": "项目配置文件。", "packOptions": { - "ignore": [] + "ignore": [], + "include": [] }, "setting": { "urlCheck": false, @@ -42,22 +43,11 @@ "libVersion": "2.17.0", "appid": "wx73eb8a9ed10a029d", "projectname": "%E6%99%BA%E6%85%A7%E4%BA%91%E9%A6%86", - "isGameTourist": false, "simulatorType": "wechat", "simulatorPluginLibVersion": {}, - "condition": { - "search": { - "list": [] - }, - "conversation": { - "list": [] - }, - "game": { - "currentL": -1, - "list": [] - }, - "miniprogram": { - "list": [] - } + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 } } \ No newline at end of file