|
|
@ -9,11 +9,12 @@ Page({ |
|
|
|
|
|
|
|
selectedValue:'', |
|
|
|
look:true, |
|
|
|
informFlag:false, |
|
|
|
informFlag:true, |
|
|
|
longitude: 120.372537, |
|
|
|
latitude: 36.098056, |
|
|
|
scale: 13, |
|
|
|
mapCtx: mapCtx, |
|
|
|
mapFlag:false |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@ -21,9 +22,70 @@ Page({ |
|
|
|
*/ |
|
|
|
onLoad(options) { |
|
|
|
this.data.mapCtx = wx.createMapContext("party-masses-map"); |
|
|
|
this.partyservicecenterlist(); |
|
|
|
this.getLocation().then(() => { |
|
|
|
this.reverseLocation() |
|
|
|
}) |
|
|
|
this.addMarkers() |
|
|
|
// this.partyservicecenterlist();
|
|
|
|
}, |
|
|
|
getLocation () { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
const _this = this |
|
|
|
wx.getLocation({ |
|
|
|
type: 'gcj02', |
|
|
|
success (res) { |
|
|
|
if (res.latitude && res.longitude) { |
|
|
|
_this.setData({ |
|
|
|
'personalInfo.issueLatitude': res.latitude, |
|
|
|
'personalInfo.issueLongitude': res.longitude |
|
|
|
}) |
|
|
|
// _this.getDeptIdByItude()
|
|
|
|
console.log(res.latitude ,res.longitude); |
|
|
|
resolve(true) |
|
|
|
} |
|
|
|
}, |
|
|
|
fail (err) { |
|
|
|
reject(err) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
reverseLocation () { |
|
|
|
const _this = this |
|
|
|
this.data.qqMapWX.reverseGeocoder({ |
|
|
|
location: { |
|
|
|
latitude: _this.data.personalInfo.issueLatitude, |
|
|
|
longitude: _this.data.personalInfo.issueLongitude |
|
|
|
}, |
|
|
|
success (res) { |
|
|
|
_this.setData({ |
|
|
|
addressContent: res.result.address, |
|
|
|
'personalInfo.enterpriseAddress': res.result.address, |
|
|
|
'personalInfo.issueAddress': res.result.address |
|
|
|
}) |
|
|
|
|
|
|
|
// const query = wx.createSelectorQuery();
|
|
|
|
// const query_1 = wx.createSelectorQuery();
|
|
|
|
// var height = 0
|
|
|
|
// query.select('#tabBar').boundingClientRect(function (res) {
|
|
|
|
// height = height+ Math.trunc(res.height)
|
|
|
|
// }).exec()
|
|
|
|
|
|
|
|
// query_1.select('#m_height').boundingClientRect(function (res) {
|
|
|
|
// height = height+ Math.trunc(res.height)
|
|
|
|
// _this.setData({
|
|
|
|
// m_height: height
|
|
|
|
// })
|
|
|
|
// }).exec()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
fail (err) { |
|
|
|
console.debug(err) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
@ -95,22 +157,22 @@ Page({ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
partyservicecenterlist: function () { |
|
|
|
var _this = this; |
|
|
|
var params = { |
|
|
|
orgId: wx.getStorageSync("gridId"), |
|
|
|
orgType: "grid" |
|
|
|
}; |
|
|
|
index_1.partyservicecenterlist(params).then(function (res) { |
|
|
|
console.log("获取党群服务中心", res); |
|
|
|
_this.setData({ |
|
|
|
partyMassesList: res.data |
|
|
|
}); |
|
|
|
_this.addMarkers(_this.data.partyMassesList); |
|
|
|
}).catch(function (err) { |
|
|
|
console.error(err); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// partyservicecenterlist: function () {
|
|
|
|
// var _this = this;
|
|
|
|
// var params = {
|
|
|
|
// orgId: wx.getStorageSync("gridId"),
|
|
|
|
// orgType: "grid"
|
|
|
|
// };
|
|
|
|
// index_1.partyservicecenterlist(params).then(function (res) {
|
|
|
|
// console.log("获取党群服务中心", res);
|
|
|
|
// _this.setData({
|
|
|
|
// partyMassesList: res.data
|
|
|
|
// });
|
|
|
|
// _this.addMarkers(_this.data.partyMassesList);
|
|
|
|
// }).catch(function (err) {
|
|
|
|
// console.error(err);
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
onPickerChange (event) { |
|
|
|
const selectedIndex = event.detail.value; |
|
|
|
const selectedValue = ['是', '否'][selectedIndex]; |
|
|
@ -139,5 +201,10 @@ Page({ |
|
|
|
this.setData({ |
|
|
|
informFlag:true |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleMap(){ |
|
|
|
this.setData({ |
|
|
|
mapFlag:true |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |