From b9ce503ff0f84fd24aeb0f44e281cd4f0ea36433 Mon Sep 17 00:00:00 2001 From: JerryYan <792602257@qq.com> Date: Sun, 30 Aug 2020 15:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/pay.css | 3 ++- js/shundaijian.js | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/css/pay.css b/css/pay.css index b45e0df..1549647 100644 --- a/css/pay.css +++ b/css/pay.css @@ -250,6 +250,7 @@ .receiveInfo { display: flex; justify-content: space-between; + padding: 5px 0; } .receiveInfo ._right { @@ -262,7 +263,7 @@ ._alipay, ._wechat { - height: 150px; + height: 128px; width: 50vw; } diff --git a/js/shundaijian.js b/js/shundaijian.js index 398afc0..f3c0747 100644 --- a/js/shundaijian.js +++ b/js/shundaijian.js @@ -232,6 +232,8 @@ const app = new Vue({ method: "GET", data: { page: this.currentPage, + lat: this.location[0], + lng: this.location[1], }, dataType: 'json', success: (res) => { @@ -251,14 +253,21 @@ const app = new Vue({ }, }, created() { - plus.geolocation.getCurrentPosition((p) => { - console.log(p.coords.latitude); - console.log(p.coords.longitude); - this.location=[p.coords.latitude, p.coords.longitude]; + var lat = localStorage.getItem('lat'); + var lng = localStorage.getItem('lng'); + if (!lat || !lng) { + plus.geolocation.getCurrentPosition((p) => { + console.log(p.coords.latitude); + console.log(p.coords.longitude); + this.location=[p.coords.latitude, p.coords.longitude]; + this.loadData(); + },function (err) { + mui.alert('获取当前位置失败') + waiting.close(); + }) + } else { + this.location=[lat, lng]; this.loadData(); - },function (err) { - mui.alert('获取当前位置失败') - waiting.close(); - }) + } }, }) \ No newline at end of file