Browse Source

修改导航功能

master
王健 4 years ago
parent
commit
a4f188da5e
  1. 39
      components/detail-announcement/detail-announcement.js

39
components/detail-announcement/detail-announcement.js

@ -1,4 +1,5 @@
const $api = require('../../utils/api').API;
const WKT = require('../../utils/terraformer-wkt-parser.min');
Component({
options: {
addGlobalClass: true
@ -85,25 +86,31 @@ Component({
// var landListedId = 'CQ202106280037'
if (this.properties.info.transactionStatus == 'toBeListed') {
$api.AJAX('GET', 'applets/landtolistlonlat/list/' + proposedseriaId, true).then(res => {
var latitude = res.data[0].landLonLat.split(';')[0].split(',')[0]
var longitude = res.data[0].landLonLat.split(';')[0].split(',')[1]
wx.openLocation({
latitude: Number(longitude),
longitude: Number(latitude),
name: res.data[0].name,
scale: 28
})
if (res && res.data && res.data.length > 0) {
let point = WKT.parse(res.data[0].centerPoint).coordinates
let latitude = point[0]
let longitude = point[1]
wx.openLocation({
latitude: Number(longitude),
longitude: Number(latitude),
name: res.data[0].name,
scale: 28
})
}
})
} else {
$api.AJAX('GET', 'applets/landlistedlonlat/list/' + landListedId, true).then(res => {
var latitude = res.data[0].landLonLat.split(';')[0].split(',')[0]
var longitude = res.data[0].landLonLat.split(';')[0].split(',')[1]
wx.openLocation({
latitude: Number(longitude),
longitude: Number(latitude),
name: res.data[0].name,
scale: 28
})
if (res && res.data && res.data.length > 0) {
let point = WKT.parse(res.data[0].centerPoint).coordinates
let latitude = point[0]
let longitude = point[1]
wx.openLocation({
latitude: Number(longitude),
longitude: Number(latitude),
name: res.data[0].name,
scale: 28
})
}
})
}
}

Loading…
Cancel
Save