Browse Source

18.00 7.26

master
zhangjy 4 years ago
parent
commit
acf60c5949
  1. 75
      components/detail-basis/detail-basis.js
  2. 4
      components/detail-basis/detail-basis.wxml
  3. 96
      components/detail-senior/detail-senior.js
  4. 4
      pages/calendar/calendar.js
  5. 6
      pages/calendar/calendar.wxml
  6. 14
      pages/look-detail/look-detail.js
  7. 4
      pages/look-detail/look-detail.wxml
  8. 51
      pages/look-list/look-list.js
  9. 51
      pages/look-list/look-list.wxml
  10. 60
      pages/look-list/look-list.wxss
  11. 8
      pages/look/look.js
  12. 2
      utils/api.js
  13. 40
      utils/gitUtil.js

75
components/detail-basis/detail-basis.js

@ -167,6 +167,7 @@ Component({
//车位配比
$api.getDict('parking_sale_rate').then(res=>{
this.setData({
parking_sale_rate:res.data[0].value,
'priceData.parkingSaleRate':res.data[0].value
})
})
@ -189,6 +190,7 @@ Component({
}
console.log(this.data.priceData)
},
// 测算
calculate(){
let table=this.selectComponent('#table');
if(table.data.myData){
@ -236,6 +238,7 @@ Component({
// measure()
// console.log(this.data.dataInfo)
},
//保存
save(){
if(!this.data.isMeasure){
wx.showToast({
@ -245,6 +248,14 @@ Component({
})
return false;
}
if(this.data.orgiData&&this.data.orgiData.statusCd=='1100'){
wx.showToast({
title: '该测算数据已被保存',
icon: 'none',
duration: 2000
})
return false;
}
let data=JSON.parse(JSON.stringify(this.data.measureData))
if(this.data.measureDataId){
data.measureDataId=this.data.measureDataId
@ -257,6 +268,7 @@ Component({
// })
// console.log(this.data.measureData)
},
//提交
submit(){
if(!this.data.isMeasure){
wx.showToast({
@ -266,6 +278,14 @@ Component({
})
return false;
}
if(this.data.orgiData&&this.data.orgiData.statusCd=='1100'){
wx.showToast({
title: '该测算数据已被保存',
icon: 'none',
duration: 2000
})
return false;
}
let data=JSON.parse(JSON.stringify(this.data.measureData))
if(this.data.measureDataId){
data.measureDataId=this.data.measureDataId
@ -283,6 +303,61 @@ Component({
})
}
})
},
//重做
clearData(){
this.setData({
priceData:{
housingPrice:null,
commercePrice:null,
businessPrice:null,
parkingPrice:null,
parkingAllocation:null,
singleIndicator:null,
parkingSaleRate:this.data.parking_sale_rate,
singlePrimeCost:null,
commerceRate:(parseFloat(this.data.dataInfo.bizSpace)/parseFloat(this.data.dataInfo.totalConsArea)).toFixed(3),
businessRate:(parseFloat(this.data.dataInfo.bizSpace)/parseFloat(this.data.dataInfo.totalConsArea)).toFixed(3),
manageFeeRate:null,
salesRate:null,
financialRate:this.data.finance_rate,
financingRate:null,
loansRate:null,
financingInterest:null,
loansInterest:null,
financingPeriod:null,
loansPeriod:null,
freeHousingRate:null,
freeCommerceRate:null,
freeBusinessRate:null,
selfHousingRate:null,
selfHousingPrice:null,
selfCommerceRate:null,
selfCommercePrice:null,
selfBusinessRate:null,
selfBusinessPrice:null,
selfBusinessSale:null,
selfCommerceSale:null,
selfHousingSale:null,
forecastFloorPrice:null,//预测楼面价
},
rowData: [{
Tprice: '起拍价',
Lprice: this.data.dataInfo.floorPrice?parseFloat(this.data.dataInfo.floorPrice).toFixed(3):0,//transferPrice,
AllPrice: parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
Interest: 0,
PremiumRate: 0
},
{
Tprice: '预测成交价',
Lprice: null,
AllPrice: parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
Interest: 0,
PremiumRate: 0
},
],
isMeasure:false,
})
}
}
})

4
components/detail-basis/detail-basis.wxml

@ -56,12 +56,12 @@
<view class="table-form">
<view class="form-item">
<text class="form-lable">商业配比:</text>
<input class="form-input input-back" disabled="true" value="{{priceData.commerceRate}}" type="number" />
<input class="form-input input-back" disabled="true" value="{{priceData.commerceRate*100}}" type="number" />
<text class="unit">%</text>
</view>
<view class="form-item col-do">
<text class="form-lable">商务配比:</text>
<input class="form-input input-back" disabled="true" value="{{priceData.businessRate}}" type="number" />
<input class="form-input input-back" disabled="true" value="{{priceData.businessRate*100}}" type="number" />
<text class="unit">%</text>
</view>
</view>

96
components/detail-senior/detail-senior.js

@ -92,6 +92,8 @@ Component({
{label:'是',value:'1'},
],
measureDataId:'',
parking_sale_rate:'',
finance_rate:'',
measureData:{
"landListedId":null,
"businessPrice": 0,//商务定价
@ -151,7 +153,8 @@ Component({
})
if(this.data.orgiData&&this.data.orgiData.measureType===1){
let data=JSON.parse(JSON.stringify(this.data.orgiData))
this.data.measureDataId=data.measureDataId
this.data.measureDataId=data.measureDataId;
this.data.isMeasure=true;
this.setData({
params:{
selfHousingSale:data.selfHousingSale===1?'是':'否',
@ -196,12 +199,14 @@ Component({
//车位配比
$api.getDict('parking_sale_rate').then(res=>{
this.setData({
parking_sale_rate:res.data[0].value,
'priceData.parkingSaleRate':res.data[0].value
})
})
//财务费率
$api.getDict('finance_rate').then(res=>{
this.setData({
finance_rate:res.data[0].value,
'priceData.financialRate':res.data[0].value
})
})
@ -294,6 +299,14 @@ Component({
})
return false;
}
if(this.data.orgiData&&this.data.orgiData.statusCd=='1100'){
wx.showToast({
title: '该测算数据已被保存',
icon: 'none',
duration: 2000
})
return false;
}
let data=JSON.parse(JSON.stringify(this.data.measureData))
if(this.data.measureDataId){
data.measureDataId=this.data.measureDataId
@ -301,10 +314,16 @@ Component({
data.landListedId=this.data.dataInfo.landListedId;
data.statusCd=1100;
data.measureType=1;
// $api.measureData(data).then(res=>{
// console.log(res)
// })
// console.log(this.data.measureData)
$api.measureData(data).then(res=>{
if(res.msg=='ok'){
wx.showToast({
title: '保存成功',
icon: 'none',
duration: 2000
})
}
})
console.log(this.data.measureData)
},
submit(){
if(!this.data.isMeasure){
@ -315,6 +334,14 @@ Component({
})
return false;
}
if(this.data.orgiData&&this.data.orgiData.statusCd=='1100'){
wx.showToast({
title: '该测算数据已被保存',
icon: 'none',
duration: 2000
})
return false;
}
let data=JSON.parse(JSON.stringify(this.data.measureData))
if(this.data.measureDataId){
data.measureDataId=this.data.measureDataId
@ -332,6 +359,65 @@ Component({
})
}
})
},
//重做
clearData(){
this.setData({
priceData:{
housingPrice:null,
commercePrice:null,
businessPrice:null,
parkingPrice:null,
parkingAllocation:null,
singleIndicator:null,
parkingSaleRate:this.data.parking_sale_rate,
singlePrimeCost:null,
commerceRate:(parseFloat(this.data.dataInfo.bizSpace)/parseFloat(this.data.dataInfo.totalConsArea)).toFixed(3),
businessRate:(parseFloat(this.data.dataInfo.bizSpace)/parseFloat(this.data.dataInfo.totalConsArea)).toFixed(3),
manageFeeRate:null,
salesRate:null,
financialRate:this.data.finance_rate,
financingRate:null,
loansRate:null,
financingInterest:null,
loansInterest:null,
financingPeriod:null,
loansPeriod:null,
freeHousingRate:null,
freeCommerceRate:null,
freeBusinessRate:null,
selfHousingRate:null,
selfHousingPrice:null,
selfCommerceRate:null,
selfCommercePrice:null,
selfBusinessRate:null,
selfBusinessPrice:null,
selfBusinessSale:null,
selfCommerceSale:null,
selfHousingSale:null,
forecastFloorPrice:null,//预测楼面价
},
rowData: [{
Tprice: '起拍价',
Lprice: this.data.dataInfo.floorPrice?parseFloat(this.data.dataInfo.floorPrice).toFixed(3):0,//transferPrice,
AllPrice: parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
Interest: 0,
PremiumRate: 0
},
{
Tprice: '预测成交价',
Lprice: null,
AllPrice: parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
Interest: 0,
PremiumRate: 0
},
],
isMeasure:false,
params:{selfHousingSale:'',
selfCommerceSale:'',
selfBusinessSale:'',
},
})
}
}
})

4
pages/calendar/calendar.js

@ -134,10 +134,14 @@ Page({
// 日历点击跳转(请求接口获取列表数据)
onCalendarDayTap(res) {
console.log(res)
let timer = res.detail;
timer = `${timer.year}/${formatNumber(timer.month)}/${formatNumber(timer.day)}`
this.setData({
timer
})
},
calendarSelectedDate(e){
console.log(e)
}
})

6
pages/calendar/calendar.wxml

@ -26,10 +26,10 @@
<view class="cal-box">
<image class="cal-back" src="../../assets/images/cal-back.png"></image>
<view class="calendar-box">
<calendar bind:callSomeFun="onShow"></calendar>
<!-- <ui-calendar ex-class="calendar-cm-month" bindonDayTap="onCalendarDayTap"
<!-- <calendar bind:callSomeFun="onShow"></calendar> -->
<ui-calendar ex-class="calendar-cm-month" bindonDayTap="onCalendarDayTap"
displayTime="{{calendarDisplayTime}}" selectedDate="{{calendarSelectedDate}}"
displayMonthNum="{{calendarDisplayMonthNum}}" is-show="{{isCalendarShow}}"></ui-calendar> -->
displayMonthNum="{{calendarDisplayMonthNum}}" is-show="{{isCalendarShow}}"></ui-calendar>
</view>
</view>
</view>

14
pages/look-detail/look-detail.js

@ -41,7 +41,8 @@ Page({
basisInfo: {},
seniorInfo: {},
polygons: [],
orgiData:{}
orgiData:{},
isDone:false,
},
//定位当前
gotoLocation() {
@ -182,7 +183,16 @@ Page({
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){

4
pages/look-detail/look-detail.wxml

@ -87,8 +87,8 @@
<detail-present info="{{myData}}" presentInfo="{{presentInfo}}" wx:if="{{active===3}}"/>
<detail-basis id="basis" orgiData="{{orgiData}}" dataInfo="{{myData}}" info="{{basisInfo}}" wx:if="{{active===4}}"/>
<detail-senior id="senior" orgiData="{{orgiData}}" dataInfo="{{myData}}" info="{{seniorInfo}}" wx:if="{{active===5}}"/>
<view class="btn-box" wx:if="{{active>3}}">
<button class="btn btn-warning">重做</button>
<view class="btn-box" wx:if="{{active>3&&!isDone}}">
<button bindtap="clearData" class="btn btn-warning">重做</button>
<button bindtap="goCalculate" class="btn btn-primy">测算</button>
<button bindtap="save" class="btn btn-primy">保存</button>
<button bindtap="submit" class="btn btn-primy">提交</button>

51
pages/look-list/look-list.js

@ -19,11 +19,15 @@ Page({
size:10,
current:1,
startDate:'',
endDate:'',
city:'',
transactionStatus:'',
measureStatus:'',
landCode:''
},
searchNode:{
date:{height:0,bottom:0},
},
measureStatus:'',
transactionStatus:'',
arraySale:[],
@ -96,25 +100,42 @@ Page({
)
})
},
goSearch(){
this.setData({
'searchNode.date.height':0,
'searchNode.date.bottom':0,
})
this.refresh()
},
hideMark(){
this.setData({active:'',setScroll:true})
},
comeDetail(){
comeDetail(e){
let id=e.currentTarget.dataset.id;
console.log(e.currentTarget.dataset.id)
wx.navigateTo({
url: '/pages/look-detail/look-detail',
url: '/pages/look-detail/look-detail?id='+id,
})
},
bindTimeChange(res){
console.log(res)
let queryDate = res.detail.value
let t="page.queryDate"
if (queryDate) {
this.setData({
[t]:queryDate
})
this.refresh()
};
if(res.currentTarget.dataset.type=='start'){
let t="page.startDate"
if (queryDate) {
this.setData({
[t]:queryDate
})
};
}else{
let t="page.endDate"
if (queryDate) {
this.setData({
[t]:queryDate
})
};
}
},
bindAddressChange(res) {
let cityName = res.detail.value[1]
@ -150,6 +171,16 @@ Page({
this.refresh()
};
},
showDown(e){
console.log(e.currentTarget.dataset.type)
switch (e.currentTarget.dataset.type){
case 'date':
this.setData({'searchNode.date.height':200,'searchNode.date.bottom':-200,})
}
},
demo(){
console.log(999)
},
vmodel(e){
let t="page.landCode"
this.setData({

51
pages/look-list/look-list.wxml

@ -35,37 +35,54 @@
</view>
</view>
<view class="table">
<view class="table-item center">
<picker mode="date" value="{{nowTime}}" bindchange="bindTimeChange">
<text>{{page.startDate?page.startDate:'拍卖日期'}}</text>
</picker>
<view style="margin-left:30rpx" class="table-item center" bindtap="showDown" data-type="date">
<picker disabled="true"><text>拍卖日期</text></picker>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</view>
<view class="table-item center">
<picker value="{{index}}" bindchange="bindSaleChange" range="{{arraySale}}" range-key="label">
<text>{{transactionStatus?transactionStatus:'交易状态'}}</text>
</picker>
<view class="table-item center" bindtap="showDown" data-type="sale">
<picker disabled="true"><text>交易状态</text></picker>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</view>
<view class="table-item center">
<picker mode="selector" value="{{index}}" bindchange="bindCalcuChange" range="{{arrayCalcu}}">
<text>{{measureStatus?measureStatus:'测算状态'}}</text>
</picker>
<view class="table-item center" bindtap="showDown" data-type="calcu">
<picker disabled="true"><text>测算状态</text></picker>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</view>
<view class="table-item center">
<picker mode="region" value="{{region}}" bindchange="bindAddressChange">
<text>{{page.city?page.city:'城市'}}</text>
</picker>
<view class="table-item center" bindtap="showDown" data-type="city">
<picker disabled="true"><text>城市</text></picker>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</view>
<!-- 日期下拉 -->
<view class="displayDown" style="height:{{searchNode.date.height}}rpx;bottom:{{searchNode.date.bottom}}rpx">
<view class="searchDate">
<view>
<picker style="width:100%" mode="date" value="{{page.startDate}}" start="{{nowTime}}" end="2023-09-01" bindchange="bindTimeChange" data-type="start">
<view class="picker centerIn">
<text> 开始时间:</text>
<view class="searchInput">{{page.startDate}}</view>
</view>
</picker>
</view>
<view>
<picker style="width:100%" mode="date" value="{{page.endDate}}" start="{{nowTime}}" end="2023-09-01" bindchange="bindTimeChange">
<view class="picker centerIn">
<text> 结束时间:</text>
<view class="searchInput">{{page.endDate}}</view>
</view>
</picker>
</view>
</view>
<view class="btnGp">
<view class="clearSearch">清空</view>
<view class="toSearch" bindtap="goSearch">确定</view>
</view>
</view>
</view>
<view class="main">
<view class="mark" wx:if="{{active}}" bindtap="hideMark">
</view>
<scroll-view class="list" style="height:100%" scroll-y="{{setScroll}}" refresher-enabled refresher-triggered="{{refresher}}"
bindscrolltolower="getList" bindrefresherrefresh="refresh">
<view class="list-item" wx:for="{{list}}" wx:for-index="i" wx:for-item="item" bindtap="comeDetail">
<view class="list-item" wx:for="{{list}}" wx:for-index="i" wx:for-item="item" bindtap="comeDetail" data-id="{{item.landListedId}}">
<image class="item-img" src="../../assets/images/list-img.png"></image>
<view class="item-right">
<view class="list-info">

60
pages/look-list/look-list.wxss

@ -20,8 +20,9 @@
}
.table {
position: relative;
display: flex;
padding: 30rpx 30rpx 35rpx 30rpx;
padding: 30rpx 30rpx 35rpx 0rpx;
justify-content: space-between;
border: none;
}
@ -130,4 +131,61 @@
text-align: left;
padding-left: 5px;
font-size: 30rpx;
}
.displayDown{
padding: 0;
position: absolute;
overflow: hidden;
/* height: 200rpx; */
width: 100%;
background-color: rgb(248, 248, 248);
/* bottom: -200rpx; */
transition:all .3s ease-in-out;
z-index: 999999;
box-shadow:0 15px 10px -15px rgba(0,0,0,.2)
}
.btnGp{
position: absolute;
width: 100%;
display: flex;
justify-content: space-between;
height: 80rpx;
bottom: 0;
}
.clearSearch{
width: 40%;
text-align: center;
line-height: 80rpx;
/* border: 1px solid black; */
}
.toSearch{
width: 60%;
text-align: center;
line-height: 80rpx;
background-color: rgb(22, 155, 213);
color: #ffffff;
}
.searchDate{
padding: 0 30rpx;
display: flex;
width: 100%;
justify-content: space-between;
}
.searchDate>view{
/* line-height: 80rpx; */
display: flex;
align-items: center;
width: 50%;
margin-top: 20rpx;
}
.searchInput{
display: inline-block;
width: 50%;
border:1px solid gray;
padding-left: 10rpx;
height: 40rpx;
}
.centerIn{
display: flex;
align-items: center;
}

8
pages/look/look.js

@ -1,8 +1,8 @@
// pages/look/look.js
// const $api = require('../../utils/gisApi').API;
// const WKT = require('../../utils/terraformer-wkt-parser.min');
// const gisUtil = require('../../utils/gitUtil')
// const util = require('../../utils/util')
const $api = require('../../utils/gisApi').API;
const WKT = require('../../utils/terraformer-wkt-parser.min');
const gisUtil = require('../../utils/gitUtil')
const util = require('../../utils/util')
const global = {};

2
utils/api.js

@ -49,7 +49,7 @@ const API = {
getCalulaList:(data) => request(GET, `applets/measuredata/page?queryDate=${data.queryDate}&current=${data.current}&size=${data.size}&landListedId=${data.landListedId}`),//分页
getCalulaDeatail:(data) => request(GET, `applets/measuredata/getByLandListedId/${data}`),//通过地块ID获取测算详情
//看地
getLandlistedPage:(data) => request(GET, `applets/landlisted/page?startDate=${data.startDate}&current=${data.current}&size=${data.size}&measureStatus=${data.measureStatus}&transactionStatus=${data.transactionStatus}&city=${data.city}&landCode=${data.landCode}`),//分页
getLandlistedPage:(data) => request(GET, `applets/landlisted/page?startDate=${data.startDate}&current=${data.current}&size=${data.size}&measureStatus=${data.measureStatus}&transactionStatus=${data.transactionStatus}&city=${data.city}&landCode=${data.landCode}&endDate=${data.endDate}`),//分页
//消息管理
getMessage:(data) => request(GET, `applets/message/page?current=${data.current}&size=${data.size}&messageType=${data.messageType}`),//分页
//意见反馈

40
utils/gitUtil.js

@ -0,0 +1,40 @@
const isPointInPolygon =(aLat, aLon, pointList)=> {
/*
:param aLon: double 经度
:param aLat: double 纬度
:param pointList: list [{latitude: 22.22, longitude: 113.113}...] 多边形点的顺序需根据顺时针或逆时针不能乱
*/
var iSum = 0
var iCount = pointList.length
if(iCount < 3) {
return false
}
for(var i = 0; i < iCount;i++) {
var pLat1 = pointList[i][1]
var pLon1 = pointList[i][0]
if(i == iCount - 1) {
var pLat2 = pointList[0][1]
var pLon2 = pointList[0][0]
} else {
var pLat2 = pointList[i + 1][1]
var pLon2 = pointList[i + 1][0]
}
if (((aLat >= pLat1) && (aLat < pLat2)) || ((aLat>=pLat2) && (aLat < pLat1))) {
if (Math.abs(pLat1 - pLat2) > 0) {
var pLon = pLon1 - ((pLon1 - pLon2) * (pLat1 - aLat)) / (pLat1 - pLat2);
if(pLon < aLon) {
iSum += 1
}
}
}
}
if(iSum % 2 != 0) {
return true
}else {
return false
}
}
module.exports = {
isPointInPolygon,
};
Loading…
Cancel
Save