From 4aec6bf9eebbf81a0dfcdc723044e4abec3316cb Mon Sep 17 00:00:00 2001 From: limqhz <540344226@qq.com> Date: Sat, 22 Apr 2023 16:03:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=A2=E5=A4=B1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=90=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index.js | 59 +++++++++++++++++++++++++------ pages/home/index.wxml | 2 +- pages/sportsGroundList/index.js | 35 ++---------------- pages/sportsGroundList/index.wxml | 4 +-- project.config.json | 22 ++++-------- 5 files changed, 59 insertions(+), 63 deletions(-) diff --git a/pages/home/index.js b/pages/home/index.js index 46ae0e2..587e488 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -325,11 +325,19 @@ Page({ }); }, fail: function(res) { - console.log(res); + that.setData({ + latitude: 31.2336800000, + longitude: 121.4715700000, + }) + that.getData({ + latitude: that.data.latitude, + longitude: that.data.longitude, + zoom: 1 + }); if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { - that.setData({ - isShowAuth: true - }) + // that.setData({ + // isShowAuth: true + // }) } }, }) @@ -480,15 +488,44 @@ Page({ }) }, - // 回到开始 + // 由原来的回到开始改为定位 goFrist() { - let list = [{ - longitude: this.data.longitude, - latitude: this.data.latitude - }]; - // this.data.includePoints + let that = this; + wx.getLocation({ + 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: this.data.longitude, + latitude: this.data.latitude + }]; + // this.data.includePoints + this.setData({ + includePoints: list + }) + }, + fail: function(res) { + console.log(res.errMsg) + if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { + 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/sportsGroundList/index.js b/pages/sportsGroundList/index.js index f94a717..653519f 100644 --- a/pages/sportsGroundList/index.js +++ b/pages/sportsGroundList/index.js @@ -24,7 +24,7 @@ Page({ this.setData({ state: options.state }) - this.getLocation(); + this.getData(); }, /** @@ -144,35 +144,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 From be00a4cb3e34936b2ab6413a44c2d9a1f107f820 Mon Sep 17 00:00:00 2001 From: limqhz <540344226@qq.com> Date: Sat, 22 Apr 2023 19:28:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=B8=A2=E5=A4=B1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=90=E8=A1=8C=E9=97=AE=E9=A2=98-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E4=BD=8D=E6=96=B9=E6=B3=95=E4=B8=BA?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 7 +++++-- pages/home/index.js | 19 ++++++++----------- pages/sportsGroundList/index.js | 21 ++++++++++++++++++--- 3 files changed, 31 insertions(+), 16 deletions(-) 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 587e488..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,6 +326,7 @@ Page({ }); }, fail: function(res) { + console.log(res) that.setData({ latitude: 31.2336800000, longitude: 121.4715700000, @@ -334,11 +336,6 @@ Page({ longitude: that.data.longitude, zoom: 1 }); - if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { - // that.setData({ - // isShowAuth: true - // }) - } }, }) }, @@ -491,7 +488,7 @@ Page({ // 由原来的回到开始改为定位 goFrist() { let that = this; - wx.getLocation({ + wx.getFuzzyLocation({ type: 'gcj02', success: function(res) { that.setData({ @@ -504,17 +501,17 @@ Page({ zoom: 1 }); let list = [{ - longitude: this.data.longitude, - latitude: this.data.latitude + longitude: that.data.longitude, + latitude: that.data.latitude }]; // this.data.includePoints - this.setData({ + that.setData({ includePoints: list }) }, fail: function(res) { console.log(res.errMsg) - if (res.errMsg == 'getLocation:fail auth deny' || res.errMsg == 'getLocation:fail:auth denied') { + if (res.errMsg == 'getFuzzyLocation:fail auth deny' || res.errMsg == 'getFuzzyLocation:fail:auth denied' || res.errMsg == 'getFuzzyLocation:fail no permission') { that.setData({ isShowAuth: true }) diff --git a/pages/sportsGroundList/index.js b/pages/sportsGroundList/index.js index 653519f..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.getData(); + 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({ From 3a422e7ead338edf9619de64ebc545c5649ebcde Mon Sep 17 00:00:00 2001 From: limqhz <540344226@qq.com> Date: Sat, 22 Apr 2023 19:29:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9B=9E=E9=80=80=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=9C=80=E8=A6=81=E5=AE=A1=E6=A0=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/myBookings/index.wxml | 7 +++---- pages/myBookingsList/index.wxml | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) 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 +