From 40fdfea3e2e64768428a112e139907cf469d4027 Mon Sep 17 00:00:00 2001 From: dengxiongfei Date: Wed, 5 Jan 2022 16:13:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- App.vue | 9 +-- .../packingStationItem.vue | 2 +- components/qn-map/qn-map.nvue | 49 +++++++++----- manifest.json | 22 +++--- pages/client-list/index.vue | 8 +-- pages/client/index.nvue | 57 +++++++--------- pages/login/index.vue | 53 +++------------ pages/mine/index.vue | 67 +++++++++---------- utils/http/http.js | 4 +- utils/locationTransform.js | 53 +++++++++++++++ 11 files changed, 172 insertions(+), 154 deletions(-) create mode 100644 utils/locationTransform.js diff --git a/.gitignore b/.gitignore index 11f6b81..637ef21 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ jsconfig.json .vscode/settings.json components/qn-map/qn-map.vue pages/client/index2.vue -./unpackage/** +unpackage/ diff --git a/App.vue b/App.vue index 2cf70cb..8a5e0b3 100644 --- a/App.vue +++ b/App.vue @@ -7,14 +7,9 @@ export default { if (!token) { go2('login') } - console.log('App launched') }, - onShow: function () { - console.log('App Show') - }, - onHide: function () { - console.log('App Hide') - } + onShow: function () {}, + onHide: function () {} } diff --git a/components/bussiness-components/packingStationItem.vue b/components/bussiness-components/packingStationItem.vue index 97929dd..33d5da8 100644 --- a/components/bussiness-components/packingStationItem.vue +++ b/components/bussiness-components/packingStationItem.vue @@ -112,7 +112,7 @@ export default { return phoneNum.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') } } - return '' + return '--' } }, computed: { diff --git a/components/qn-map/qn-map.nvue b/components/qn-map/qn-map.nvue index eab5a35..e7262de 100644 --- a/components/qn-map/qn-map.nvue +++ b/components/qn-map/qn-map.nvue @@ -7,6 +7,7 @@ :longitude="centerPoint.longitude" :latitude="centerPoint.latitude" :markers="markers" + :show-location="true" :scale="scale" @labeltap="labeltap" @regionchange="regionchange" @@ -62,23 +63,6 @@ export default { } }) }, - location: { - handler(val) { - let data = { - longitude: val.longitude, - latitude: val.latitude, - scale: this.scale - } - if (this.mapContext) { - this.mapContext.moveToLocation({ - longitude: val.longitude, - latitude: val.latitude - }) - } - this.$emit('reset', data) - }, - deep: true - } }, methods: { // 生成markers @@ -182,7 +166,36 @@ export default { break } }, 500) - } + }, + // 移动到当前坐标 + moveTo({longitude,latitude,scale}) { + scale = Math.ceil(scale) + if(!isNaN(scale)) { + this.scale = scale + }else { + scale = null + } + let data = { + longitude: longitude, + latitude: latitude, + scale: scale || this.scale + } + if (this.mapContext) { + this.mapContext.moveToLocation({ + longitude: longitude, + latitude: latitude, + success:res => { + console.log('移动success',res) + }, + fail:err => { + console.log('移动fail',err) + } + }) + } + setTimeout(() => { + this.$emit('reset', data) + },100) + } } } diff --git a/manifest.json b/manifest.json index 45ed8c0..f7ce734 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "paper-shop-app", + "name" : "纸掌柜", "appid" : "__UNI__8C1E198", "description" : "", "versionName" : "1.0.0", @@ -24,21 +24,20 @@ }, /* 模块配置 */ "modules" : { - "Maps" : {} + "Maps" : {}, + "Geolocation" : {}, + "FaceID" : {} }, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ "android" : { "permissions" : [ - "", - "", + "", "", "", - "", "", "", - "", "", "", "", @@ -56,7 +55,7 @@ "maps" : { "amap" : { "appkey_ios" : "5e4da36f4c1649ca28a1f8f795bcf5d2", - "appkey_android" : "2ced501c80ee5f6a74ba43ef7c2d36bd" + "appkey_android" : "877848546f7f3717101a17c33e1d4df3" } }, "payment" : { @@ -66,7 +65,14 @@ "UniversalLinks" : "" } }, - "ad" : {} + "ad" : {}, + "geolocation" : { + "amap" : { + "__platform__" : [ "ios", "android" ], + "appkey_ios" : "5e4da36f4c1649ca28a1f8f795bcf5d2", + "appkey_android" : "877848546f7f3717101a17c33e1d4df3" + } + } } }, "uniStatistics" : { diff --git a/pages/client-list/index.vue b/pages/client-list/index.vue index ebc188c..2e9a65f 100644 --- a/pages/client-list/index.vue +++ b/pages/client-list/index.vue @@ -98,7 +98,6 @@ export default { getCompanyList({ ...this.params, ...this.pagination }) .then((res) => { if (res) { - console.log('res:', res) if (this.pagination.pageNum == 1) { this.list = res.records } else { @@ -116,7 +115,6 @@ export default { }, downCallback() { this.pagination.pageNum = 1 - console.log('下拉刷新:') this.getList() .then(({ list, total }) => { this.$refs.list.refreshSuccess({ list, total }) @@ -126,12 +124,9 @@ export default { }) }, upCallback(page) { - console.log('上拉加载:', page) this.pagination.pageNum++ this.getList() .then(({ list, total }) => { - console.log('list.length:', list.length) - console.log('total:', total) this.$refs.list.loadSuccess({ list, total }) }) .catch(() => { @@ -142,8 +137,7 @@ export default { watch: { params: { handler(val) { - console.log('val:', val) - // this.getList() + this.getList() }, deep: true } diff --git a/pages/client/index.nvue b/pages/client/index.nvue index da5514e..eb64ea4 100644 --- a/pages/client/index.nvue +++ b/pages/client/index.nvue @@ -14,9 +14,9 @@
- + - + @@ -61,10 +61,11 @@