5 changed files with 203 additions and 135 deletions
@ -1,66 +1,118 @@ |
|||||
// subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
|
// subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
|
||||
|
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') |
||||
Page({ |
Page({ |
||||
|
|
||||
/** |
/** |
||||
* 页面的初始数据 |
* 页面的初始数据 |
||||
*/ |
*/ |
||||
data: { |
data: { |
||||
|
addressContent:'', |
||||
}, |
fmData: { |
||||
|
gridId: '', |
||||
/** |
attachmentList:[],//图片
|
||||
* 生命周期函数--监听页面加载 |
voiceList:[], |
||||
*/ |
latitude:"", |
||||
onLoad(options) { |
longitude:"", |
||||
|
resiId:"", |
||||
}, |
happenTime:"", |
||||
|
content:"",//内容
|
||||
/** |
address:"",//地址
|
||||
* 生命周期函数--监听页面初次渲染完成 |
}, |
||||
*/ |
}, |
||||
onReady() { |
|
||||
|
/** |
||||
}, |
* 生命周期函数--监听页面加载 |
||||
|
*/ |
||||
/** |
onLoad(options) { |
||||
* 生命周期函数--监听页面显示 |
this.data.qqMapWX = new QQMapWX({ |
||||
*/ |
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ' |
||||
onShow() { |
}) |
||||
|
this.reverseLocation() |
||||
}, |
}, |
||||
|
|
||||
/** |
/** |
||||
* 生命周期函数--监听页面隐藏 |
* 生命周期函数--监听页面初次渲染完成 |
||||
*/ |
*/ |
||||
onHide() { |
onReady() { |
||||
|
|
||||
}, |
}, |
||||
|
|
||||
/** |
/** |
||||
* 生命周期函数--监听页面卸载 |
* 生命周期函数--监听页面显示 |
||||
*/ |
*/ |
||||
onUnload() { |
onShow() { |
||||
|
this.reverseLocation |
||||
}, |
}, |
||||
|
|
||||
/** |
/** |
||||
* 页面相关事件处理函数--监听用户下拉动作 |
* 生命周期函数--监听页面隐藏 |
||||
*/ |
*/ |
||||
onPullDownRefresh() { |
onHide() { |
||||
|
|
||||
}, |
}, |
||||
|
|
||||
/** |
/** |
||||
* 页面上拉触底事件的处理函数 |
* 生命周期函数--监听页面卸载 |
||||
*/ |
*/ |
||||
onReachBottom() { |
onUnload() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面相关事件处理函数--监听用户下拉动作 |
||||
|
*/ |
||||
|
onPullDownRefresh() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 页面上拉触底事件的处理函数 |
||||
|
*/ |
||||
|
onReachBottom() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 用户点击右上角分享 |
||||
|
*/ |
||||
|
onShareAppMessage() {}, |
||||
|
//跳转地图选点
|
||||
|
toughGetLocation() { |
||||
|
// this.getLocation(false);
|
||||
|
wx.chooseLocation({ |
||||
|
success: res => { |
||||
|
console.log('resadddres', res) |
||||
|
const { |
||||
|
fmData |
||||
|
} = this.data; |
||||
|
this.setData({ |
||||
|
fmData: { |
||||
|
...fmData, |
||||
|
address: res.address, |
||||
|
longitude: res.longitude, |
||||
|
latitude: res.latitude |
||||
|
}, |
||||
|
addressContent: res.address |
||||
|
}); |
||||
|
console.log(this.data.fmData); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
reverseLocation() { |
||||
|
const _this = this |
||||
|
this.data.qqMapWX.reverseGeocoder({ |
||||
|
success(res) { |
||||
|
console.log(res); |
||||
|
_this.setData({ |
||||
|
addressContent:res.result.address, |
||||
|
'fmData.address': res.result.address, |
||||
|
'fmData.longitude':res.result.location.lng, |
||||
|
'fmData.latitude':res.result.location.lat, |
||||
|
}) |
||||
|
}, |
||||
|
fail(err) { |
||||
|
console.debug(err) |
||||
|
} |
||||
|
}) |
||||
}, |
}, |
||||
|
|
||||
/** |
|
||||
* 用户点击右上角分享 |
|
||||
*/ |
|
||||
onShareAppMessage() { |
|
||||
|
|
||||
} |
|
||||
}) |
}) |
||||
Loading…
Reference in new issue