Browse Source

地块详情 地图展示地块

master
gisnewbie 4 years ago
parent
commit
cf2082ad0a
  1. 74
      pages/look-detail/look-detail.js
  2. 2
      pages/look-detail/look-detail.wxml
  3. 38
      pages/look/look.js
  4. 4
      utils/gisApi.js
  5. 11
      utils/util.js

74
pages/look-detail/look-detail.js

File diff suppressed because one or more lines are too long

2
pages/look-detail/look-detail.wxml

@ -34,7 +34,7 @@
<text class="look-top-text">土地池</text> <text class="look-top-text">土地池</text>
</view> </view>
</view> </view>
<map class="map"> <map class="map" polygons="{{polygons}}" latitude="{{latitude}}" longitude="{{longitude}}" >
<cover-view slot="callout"> <cover-view slot="callout">
<cover-view marker-id="1"></cover-view> <cover-view marker-id="1"></cover-view>
<cover-view marker-id="2"></cover-view> <cover-view marker-id="2"></cover-view>

38
pages/look/look.js

@ -2,6 +2,8 @@
const $api = require('../../utils/gisApi').API; const $api = require('../../utils/gisApi').API;
const WKT = require('../../utils/terraformer-wkt-parser.min'); const WKT = require('../../utils/terraformer-wkt-parser.min');
const gisUtil = require('../../utils/gitUtil') const gisUtil = require('../../utils/gitUtil')
const util = require('../../utils/util')
const global = {}; const global = {};
//年份范围 //年份范围
@ -72,10 +74,12 @@ Page({
dialogVisible: false, dialogVisible: false,
buttons: [{text: '取消'}, {text: '详情'}], buttons: [{text: '取消'}, {text: '详情'}],
titleLand:'G01-XXXXXXXXXXX02', titleLand:'G01-XXXXXXXXXXX02',
landListedId:'CQ20210617152223',
totalConsArea:'42356', totalConsArea:'42356',
startingFloorPrice:'45852', startingFloorPrice:'45852',
transferPrice:'12553', transferPrice:'12553',
auctionDate:'2021-07-18', auctionDate:'2021-07-18',
years:arryList, years:arryList,
indexStart:0, indexStart:0,
indexEnd:0, indexEnd:0,
@ -117,6 +121,7 @@ Page({
console.log(property); console.log(property);
this.setData({ this.setData({
titleLand:'G01-XXXXXXXXXXX03', titleLand:'G01-XXXXXXXXXXX03',
landListedId:'CQ20210617152223',
totalConsArea:'68749', totalConsArea:'68749',
startingFloorPrice:'25784', startingFloorPrice:'25784',
transferPrice:'23546', transferPrice:'23546',
@ -135,11 +140,12 @@ Page({
halfScreenDialogVisible: false halfScreenDialogVisible: false
}); });
}, },
tapDialogButton(e) { tapDialogButton(e) {
let index = e.detail.index; let index = e.detail.index;
if(index===0){ if(index===0){
this.setData({ this.setData({
dialogVisible: false, dialogVisible: false,
landListedId:'',
titleLand:'', titleLand:'',
totalConsArea:'', totalConsArea:'',
startingFloorPrice:'', startingFloorPrice:'',
@ -150,14 +156,14 @@ Page({
} }
else{ else{
console.log('跳转到地块详情页面') console.log('跳转到地块详情页面')
//跳转到地块详情页面 //跳转到地块详情页面 landListedId:'CQ20210617152223',
this.navigateToLandDetail(1) this.navigateToLandDetail(this.data.landListedId);
} }
}, },
//跳转到地块详情页面 //跳转到地块详情页面
navigateToLandDetail(id){ navigateToLandDetail(landListedId){
wx.navigateTo({ wx.navigateTo({
url: '/pages/look-detail/look-detail?active=1', url: '/pages/look-detail/look-detail?active=1&landListedId='+landListedId,
}) })
}, },
// closeDialog: function () { // closeDialog: function () {
@ -494,7 +500,7 @@ Page({
} }
markers.push(mark) markers.push(mark)
this.setData({ this.setData({
markers: markers markers: markers
}) })
}, },
//定位当前 //定位当前
@ -713,19 +719,7 @@ markers: markers
that.setWKT(data, id); that.setWKT(data, id);
}) })
}, },
/*
* 10和16进制转换
* prin 为true将10进制转为16进制
* prin 为false将16进制转为10进制
*/
ten2XO(ten){
let val = Number(ten);
let xo= val.toString(16)
if(val<16){
xo = '0'+xo
}
return xo;
},
// 地块数据解析 // 地块数据解析
setWKT(data, id) { setWKT(data, id) {
let { let {
@ -750,9 +744,9 @@ markers: markers
}) })
} }
}) })
let strokeColor = ''+ item.line_color + this.ten2XO(item.line_opaqueness); let strokeColor = ''+ item.line_color + util.ten2XO(item.line_opaqueness);
let strokeWidth = item.strokeWidth ? Number(item.strokeWidth):2; let strokeWidth = item.strokeWidth ? Number(item.strokeWidth):2;
let fillColor = ''+ item.fill_color + this.ten2XO(item.fill_opaqueness); let fillColor = ''+ item.fill_color + util.ten2XO(item.fill_opaqueness);
let polygon = { let polygon = {
points, points,
strokeColor, strokeColor,

4
utils/gisApi.js

@ -1,4 +1,6 @@
const baseURL = 'https://yoursairdata.com/gis/' // const baseURL = 'https://yoursairdata.com/gis/'
const baseURL = 'http://47.108.164.110:8080/'
const GET = 'GET'; const GET = 'GET';
const POST = 'POST'; const POST = 'POST';
const PUT = 'PUT'; const PUT = 'PUT';

11
utils/util.js

@ -14,7 +14,16 @@ const formatNumber = n => {
return n[1] ? n : `0${n}` return n[1] ? n : `0${n}`
} }
const ten2XO =(ten)=>{
let val = Number(ten);
let xo= val.toString(16)
if(val<16){
xo = '0'+xo
}
return xo;
}
module.exports = { module.exports = {
formatTime, formatTime,
formatNumber formatNumber,
ten2XO
} }

Loading…
Cancel
Save