You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
255 lines
6.9 KiB
255 lines
6.9 KiB
// pages/look-detail/look-detail.js |
|
const $api = require('../../utils/api').API; |
|
const gisUtil = require('../../utils/gitUtil') |
|
Page({ |
|
|
|
/** |
|
* 页面的初始数据 |
|
*/ |
|
data: { |
|
state: true, |
|
landListedId: '', |
|
myData: {}, |
|
tabList: [{ |
|
id: 1, |
|
name: '公告信息' |
|
}, { |
|
id: 2, |
|
name: '成交信息' |
|
}, { |
|
id: 3, |
|
name: '呈现项目' |
|
}, |
|
// { |
|
// id: 6, |
|
// name: '拟供地块' |
|
// } |
|
], |
|
sedTabList: [{ |
|
id: 4, |
|
name: '基础测算' |
|
}, { |
|
id: 5, |
|
name: '高级测算' |
|
}], |
|
active: 1,//当前选择项 |
|
markShow: false, |
|
annoutInfo: {}, |
|
clinchInfo: {}, |
|
presentInfo: { |
|
list: {}, |
|
more: [] |
|
}, |
|
latitude: '29.56', |
|
longitude: '106.58', |
|
basisInfo: {}, |
|
seniorInfo: {}, |
|
polygons: [], |
|
orgiData: {}, |
|
isDone: false, |
|
mid: '', |
|
}, |
|
setMark(e) { |
|
let { |
|
markShow |
|
} = this.data; |
|
$api.getCalulaDeatail(this.data.landListedId).then(res => { |
|
if (res.data) { |
|
this.setData({ |
|
orgiData: res.data |
|
}) |
|
} |
|
if (markShow) { |
|
let active = Number(e.currentTarget.dataset.id) |
|
this.setData({ |
|
state: false, |
|
markShow: false, |
|
active |
|
}) |
|
} else { |
|
this.setData({ |
|
markShow: true |
|
}) |
|
} |
|
}) |
|
}, |
|
|
|
tabDowm(e) { |
|
let active = Number(e.currentTarget.dataset.id) |
|
if (active !== this.data.active) { |
|
this.setData({ |
|
active |
|
}) |
|
} |
|
}, |
|
|
|
comeBack() { |
|
wx.navigateBack({ |
|
delta: 1 |
|
}) |
|
}, |
|
|
|
markHide() { |
|
this.setData({ |
|
markShow: false |
|
}) |
|
}, |
|
getData(id) { |
|
$api.AJAX('GET', 'applets/landlistedlonlat/list/' + id, { |
|
landListedId: id |
|
}, true).then(res => { |
|
if (res&&res.data&&res.data.length > 0) { |
|
if (res.data[0].centerPoint) { |
|
let centerPoint = res.data[0].centerPoint; |
|
this.setData({ |
|
longitude: centerPoint[0], |
|
latitude: centerPoint[1], |
|
}) |
|
gisUtil.setWKT(this, res, 2) |
|
} |
|
} |
|
}) |
|
|
|
$api.getLandDetail(this.data.landListedId).then(res => { |
|
for (let key in res.data) { |
|
if (!res.data[key]) { |
|
res.data[key] = '' |
|
} |
|
} |
|
if(res.data.totalConsArea&&res.data.totalConsArea!=''&&res.data.totalConsArea!=0){ |
|
res.data.bizSpaceRatio=((res.data.bizSpace/res.data.totalConsArea)*100).toFixed(2); |
|
res.data.commerceSpaceRatio=((res.data.commerceSpace/res.data.totalConsArea)*100).toFixed(2); |
|
}else{ |
|
res.data.bizSpaceRatio=0; |
|
res.data.commerceSpaceRatio=0; |
|
} |
|
|
|
this.setData({ |
|
myData: res.data |
|
}) |
|
let totalConsArea = res.data.totalConsArea; |
|
|
|
$api.AJAX('GET', 'applets/landlistedconstructionplan/list/' + this.data.landListedId, true).then(res => { |
|
let plan = 0; |
|
let planRatio = 0; |
|
let unplan = 0; |
|
|
|
for(let i in res.data){ |
|
if(res.data[i].constructionType=='1'){ |
|
plan+=res.data[i].constructionArea |
|
}else if(res.data[i].constructionType=='2'){ |
|
unplan+=res.data[i].constructionArea |
|
} |
|
} |
|
if (totalConsArea&&totalConsArea!=''&&totalConsArea!=0){ |
|
planRatio = (plan/totalConsArea*100).toFixed(2); |
|
} |
|
|
|
this.setData({ |
|
'myData.plan': plan, |
|
'myData.planRatio': planRatio, |
|
'myData.unplan': unplan, |
|
}) |
|
}) |
|
$api.AJAX('GET', 'applets/landlistedconductenterprise/list/' + this.data.landListedId, true).then(res => { |
|
this.setData({ |
|
'myData.enterprise': res.data |
|
}) |
|
}) |
|
|
|
$api.getPreSaleDetailList({landListedId: this.data.landListedId}).then(res => { |
|
this.setData({ |
|
'presentInfo.more': res.data |
|
}) |
|
}) |
|
$api.getPreSaleTotal({landListedId: this.data.landListedId}).then(res => { |
|
this.setData({ |
|
'presentInfo.list': res.data |
|
}) |
|
}) |
|
|
|
}) |
|
}, |
|
goCalculate() { |
|
if (this.data.active === 4) { |
|
let basis = this.selectComponent('#basis'); |
|
basis.calculate() |
|
} else { |
|
let senior = this.selectComponent('#senior'); |
|
senior.calculate() |
|
} |
|
|
|
}, |
|
clearData() { |
|
if (this.data.active === 4) { |
|
let basis = this.selectComponent('#basis'); |
|
basis.clearData() |
|
} else { |
|
let senior = this.selectComponent('#senior'); |
|
senior.clearData() |
|
} |
|
}, |
|
save() { |
|
if (this.data.active === 4) { |
|
let basis = this.selectComponent('#basis'); |
|
basis.save() |
|
} else { |
|
let senior = this.selectComponent('#senior'); |
|
senior.save() |
|
} |
|
}, |
|
submit() { |
|
if (this.data.active === 4) { |
|
let basis = this.selectComponent('#basis'); |
|
console.log(basis); |
|
basis.submit() |
|
} else { |
|
let senior = this.selectComponent('#senior'); |
|
senior.submit() |
|
} |
|
|
|
}, |
|
/** |
|
* 生命周期函数--监听页面加载 |
|
*/ |
|
onLoad: function (options) { |
|
let active = options.active; |
|
this.setData({ |
|
landListedId: options.id, |
|
mid: options.mid |
|
}) |
|
this.getData(options.id) |
|
if (active) { |
|
active = Number(active); |
|
if (active > 3) { |
|
this.setData({ |
|
state: false, |
|
active |
|
}) |
|
} else { |
|
this.setData({ |
|
active |
|
}) |
|
} |
|
} |
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面初次渲染完成 |
|
*/ |
|
onReady: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面显示 |
|
*/ |
|
onShow: function () { |
|
if (typeof this.getTabBar === 'function' && |
|
this.getTabBar()) { |
|
this.getTabBar().setData({ |
|
selected: 1 |
|
}) |
|
} |
|
}, |
|
}) |