|
|
|
@ -7,7 +7,6 @@ const gisUtil = require('../../utils/gitUtil')
|
|
|
|
|
const util = require('../../utils/util') |
|
|
|
|
let qqmapsdk; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const global = {}; |
|
|
|
|
//年份范围
|
|
|
|
|
const date = new Date(); |
|
|
|
@ -23,8 +22,8 @@ for (let idx = min; idx < max; idx++) {
|
|
|
|
|
label: '' + idx + '年' |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const CITY = wx.getStorageSync('city') |
|
|
|
|
|
|
|
|
|
Page({ |
|
|
|
|
/** |
|
|
|
|
* 页面的初始数据 |
|
|
|
@ -32,7 +31,7 @@ Page({
|
|
|
|
|
data: { |
|
|
|
|
cityList: [], |
|
|
|
|
cityIndex: 0, |
|
|
|
|
cityName: '', |
|
|
|
|
cityName: CITY, |
|
|
|
|
switchYear: true, |
|
|
|
|
satellite: 2, |
|
|
|
|
scale: 13, |
|
|
|
@ -156,11 +155,9 @@ Page({
|
|
|
|
|
this.inputFun(); |
|
|
|
|
}, |
|
|
|
|
inputFun() { //输入框输入内容
|
|
|
|
|
console.log(this.data.land_name); |
|
|
|
|
$apiT.AJAX('get', 'applets/landlisted/page', { |
|
|
|
|
landCode: this.data.land_name, |
|
|
|
|
}, true).then(data => { |
|
|
|
|
console.log(data); |
|
|
|
|
if (data.code == 0) { |
|
|
|
|
this.setData({ |
|
|
|
|
list_arr: data.data.records, |
|
|
|
@ -169,7 +166,6 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
chooseFun(e) { //选择看地列表
|
|
|
|
|
console.log(e) |
|
|
|
|
let item = e.currentTarget.dataset.item; |
|
|
|
|
this.setData({ |
|
|
|
|
land_name: item.landCode, |
|
|
|
@ -183,23 +179,19 @@ Page({
|
|
|
|
|
getLatitude(landListedId) { |
|
|
|
|
$apiT.AJAX('GET', 'applets/landlistedlonlat/list/' + landListedId, { |
|
|
|
|
landListedId: landListedId, |
|
|
|
|
}, true).then(data => { |
|
|
|
|
console.log(data); |
|
|
|
|
if (data.code == 0) { |
|
|
|
|
let number = data.data[0].centerPoint; |
|
|
|
|
console.log(number) |
|
|
|
|
let l = number.indexOf('(') + 1; |
|
|
|
|
let z = number.indexOf(' '); |
|
|
|
|
let r = number.indexOf(')'); |
|
|
|
|
let log = number.substr(l, z - l); |
|
|
|
|
let lag = number.substr(z, r - z); |
|
|
|
|
this.setWKT1(data, 2) |
|
|
|
|
this.setData({ |
|
|
|
|
// polygons,
|
|
|
|
|
latitude: lag, |
|
|
|
|
longitude: log, |
|
|
|
|
}) |
|
|
|
|
this.addFeaturesToList(data, 2); |
|
|
|
|
}, true).then(res => { |
|
|
|
|
if (res && res.data && res.data.length > 0) { |
|
|
|
|
this.setWKT1(res, 3); |
|
|
|
|
if (res.data[0].centerPoint) { |
|
|
|
|
let centerPoint = res.data[0].centerPoint; |
|
|
|
|
let point = WKT.parse(centerPoint); |
|
|
|
|
this.setData({ |
|
|
|
|
latitude: point.coordinates[1], |
|
|
|
|
longitude: point.coordinates[0], |
|
|
|
|
}) |
|
|
|
|
this.setWKT1(res, 2) |
|
|
|
|
this.addFeaturesToList(res, 2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
@ -240,17 +232,10 @@ Page({
|
|
|
|
|
dialogVisible: true, |
|
|
|
|
}); |
|
|
|
|
global.selectFeature = feature; |
|
|
|
|
console.log(555, feature) |
|
|
|
|
//tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
|
let tid = feature.tid; //tid:1,2,3
|
|
|
|
|
//属性property 包含 地块id字段,按需使用。
|
|
|
|
|
let property = feature.properties; |
|
|
|
|
//添加---接口对接---获取地块数据------以下全部替换
|
|
|
|
|
console.log('添加---接口对接---获取地块数据------以下全部替换') |
|
|
|
|
//变量 tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。
|
|
|
|
|
//变量 property 包含 地块id字段,按需使用。
|
|
|
|
|
console.log(121212, property); |
|
|
|
|
// console.log(tid);
|
|
|
|
|
if (tid == 1 || tid == 2) { |
|
|
|
|
$apiT.AJAX('GET', 'applets/landlisted/' + (property.land_listed_id || property.landListedId), true).then(res => { |
|
|
|
|
this.setData({ |
|
|
|
@ -494,13 +479,9 @@ Page({
|
|
|
|
|
latitude, |
|
|
|
|
longitude |
|
|
|
|
} // 地图点击点的经纬度
|
|
|
|
|
console.log(point); |
|
|
|
|
let features = that.selectFeatureList(point); |
|
|
|
|
console.log(features); |
|
|
|
|
if (features && features.length > 0) { |
|
|
|
|
let f = features[0]; |
|
|
|
|
// console.log(f);
|
|
|
|
|
// console.log(f);
|
|
|
|
|
that.openLandInfo(f) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -546,7 +527,6 @@ Page({
|
|
|
|
|
markers: markers |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// console.log(this.data.markers);
|
|
|
|
|
}, |
|
|
|
|
// 清除标记
|
|
|
|
|
clearPoint(id) { |
|
|
|
@ -931,7 +911,6 @@ Page({
|
|
|
|
|
} |
|
|
|
|
return polygon |
|
|
|
|
}); |
|
|
|
|
// polygons = polygons.concat(newPolygons);
|
|
|
|
|
this.setData({ |
|
|
|
|
polygons: polygons.concat(newPolygons) |
|
|
|
|
}) |
|
|
|
@ -981,7 +960,6 @@ Page({
|
|
|
|
|
} |
|
|
|
|
return polygon |
|
|
|
|
}); |
|
|
|
|
// polygons = polygons.concat(newPolygons);
|
|
|
|
|
this.setData({ |
|
|
|
|
polygons: polygons.concat(newPolygons) |
|
|
|
|
}) |
|
|
|
@ -990,11 +968,14 @@ Page({
|
|
|
|
|
bindAddressChange(e) { |
|
|
|
|
let city = this.data.cityList[e.detail.value] |
|
|
|
|
wx.setStorageSync('city', city) |
|
|
|
|
this.setCity(city); |
|
|
|
|
}, |
|
|
|
|
setCity: function (city) { |
|
|
|
|
let index = this.data.cityList.indexOf(city) |
|
|
|
|
let that = this; |
|
|
|
|
qqmapsdk.geocoder({ |
|
|
|
|
address: city, |
|
|
|
|
sig:'FvbPshzJis7X9P4A5wbkLVnnOuYdtv', |
|
|
|
|
sig: 'FvbPshzJis7X9P4A5wbkLVnnOuYdtv', |
|
|
|
|
success: function (res) { |
|
|
|
|
var latitude = res.result.location.lat; |
|
|
|
|
var longitude = res.result.location.lng; |
|
|
|
@ -1008,7 +989,19 @@ Page({
|
|
|
|
|
cityName: city, |
|
|
|
|
cityIndex: index |
|
|
|
|
}) |
|
|
|
|
this.checkBtn(2) |
|
|
|
|
this.setData({ |
|
|
|
|
actives: [2] |
|
|
|
|
}) |
|
|
|
|
let { |
|
|
|
|
latitude, |
|
|
|
|
longitude, |
|
|
|
|
} = this.data.centerLocation; |
|
|
|
|
this.deletPolygon(2); |
|
|
|
|
this.removeFeaturesToList(2); |
|
|
|
|
this.inQuotation({ |
|
|
|
|
latitude, |
|
|
|
|
longitude |
|
|
|
|
}, 2); |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
@ -1032,17 +1025,6 @@ Page({
|
|
|
|
|
end: arryList[eIdx].value, |
|
|
|
|
}) |
|
|
|
|
// this.scaleBack();
|
|
|
|
|
$apiT.getCityList().then(res => { |
|
|
|
|
let index = res.data.indexOf(CITY) |
|
|
|
|
if (index !== -1) { |
|
|
|
|
this.setData({ |
|
|
|
|
cityIndex: index |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.setData({ |
|
|
|
|
cityList: res.data |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
@ -1054,5 +1036,12 @@ Page({
|
|
|
|
|
selected: 1 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
$apiT.getCityList().then(res => { |
|
|
|
|
this.setData({ |
|
|
|
|
cityList: res.data |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
let city = wx.getStorageSync('city') |
|
|
|
|
this.setCity(city) |
|
|
|
|
} |
|
|
|
|
}) |