diff --git a/index/index.js b/index/index.js index 6eac3bf..799f171 100644 --- a/index/index.js +++ b/index/index.js @@ -186,6 +186,7 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onLoad: function(options) { + this.getLocation(); let that = this; let optionss; if (wx.getStorageSync('options')){ @@ -207,6 +208,32 @@ Page({ //获取条形码 // util.barcode("barcode", optionss.quancode, 510, 100); }, + /** + * 获得经纬度 + */ + getLocation() { + let that = this; + wx.getLocation({ + type: "wgs84", + success: function (res) { + console.log(res, 9999) + if (res && res.longitude && res.latitude) { + Http.post({ + url: config.api.updateLBS, + data: { + latitude: res.latitude, + longitude: res.longitude + } + }).then(res => { + console.log(res,9999) + }) + } + }, + fail: error => { + console.log(error); + } + }) + }, onShow: function() { if (typeof this.getTabBar === 'function' && this.getTabBar()) { diff --git a/pages/integralmall/payIntegcoupondetail/index.wxml b/pages/integralmall/payIntegcoupondetail/index.wxml index 3c49962..3a4a33a 100644 --- a/pages/integralmall/payIntegcoupondetail/index.wxml +++ b/pages/integralmall/payIntegcoupondetail/index.wxml @@ -35,7 +35,7 @@ - +