| | |
| | | }, |
| | | choseLocation() { |
| | | console.log(111); |
| | | wx.chooseLocation({ |
| | | success: (res) => { |
| | | console.log(res) |
| | | // this.setData({ |
| | | // address: res.name, |
| | | // detailedaddress: res.address, |
| | | // locmap: { |
| | | // latitude: res.latitude, |
| | | // longitude: res.longitude |
| | | // }, |
| | | // markers: [{ |
| | | // id: 0, |
| | | // latitude: res.latitude, |
| | | // longitude: res.longitude, |
| | | // iconPath: '/images/ProRep/weizhi.png', |
| | | // width: '50rpx', |
| | | // height: '50rpx' |
| | | // }] |
| | | // }) |
| | | }, |
| | | fail: () => { |
| | | wx.getSetting({ |
| | | success: (res) => { |
| | | var statu = res.authSetting; |
| | | if (!statu['scope.userLocation']) { //未授权 |
| | | wx.showModal({ |
| | | title: '授权定位', |
| | | content: '需要获取您的地理位置,请先设置授权', |
| | | // cancelColor: 'skyblue', |
| | | confirmText: "去设置", |
| | | success: (res) => { |
| | | console.log(res); |
| | | if (res.cancel) { |
| | | //点击取消,默认隐藏弹框 |
| | | } else { |
| | | //点击确定 |
| | | wx.openSetting({ |
| | | withSubscriptions: true, |
| | | success: (res) => { |
| | | console.log(res); |
| | | this.onLoad() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | // wx.chooseLocation({ |
| | | // success: (res) => { |
| | | // console.log(res) |
| | | // // this.setData({ |
| | | // // address: res.name, |
| | | // // detailedaddress: res.address, |
| | | // // locmap: { |
| | | // // latitude: res.latitude, |
| | | // // longitude: res.longitude |
| | | // // }, |
| | | // // markers: [{ |
| | | // // id: 0, |
| | | // // latitude: res.latitude, |
| | | // // longitude: res.longitude, |
| | | // // iconPath: '/images/ProRep/weizhi.png', |
| | | // // width: '50rpx', |
| | | // // height: '50rpx' |
| | | // // }] |
| | | // // }) |
| | | // }, |
| | | // fail: () => { |
| | | // wx.getSetting({ |
| | | // success: (res) => { |
| | | // var statu = res.authSetting; |
| | | // if (!statu['scope.userLocation']) { //未授权 |
| | | // wx.showModal({ |
| | | // title: '授权定位', |
| | | // content: '需要获取您的地理位置,请先设置授权', |
| | | // // cancelColor: 'skyblue', |
| | | // confirmText: "去设置", |
| | | // success: (res) => { |
| | | // console.log(res); |
| | | // if (res.cancel) { |
| | | // //点击取消,默认隐藏弹框 |
| | | // } else { |
| | | // //点击确定 |
| | | // wx.openSetting({ |
| | | // withSubscriptions: true, |
| | | // success: (res) => { |
| | | // console.log(res); |
| | | // this.onLoad() |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | // }) |
| | | }, |
| | | goMap() { |
| | | let plugin = requirePlugin('routePlan'); |