From acf60c59491aa3b7880d47e8ad454637477911a5 Mon Sep 17 00:00:00 2001 From: zhangjy Date: Mon, 26 Jul 2021 18:00:39 +0800 Subject: [PATCH] 18.00 7.26 --- components/detail-basis/detail-basis.js | 75 ++++++++++++++++++ components/detail-basis/detail-basis.wxml | 4 +- components/detail-senior/detail-senior.js | 96 +++++++++++++++++++++-- pages/calendar/calendar.js | 4 + pages/calendar/calendar.wxml | 6 +- pages/look-detail/look-detail.js | 14 +++- pages/look-detail/look-detail.wxml | 4 +- pages/look-list/look-list.js | 51 +++++++++--- pages/look-list/look-list.wxml | 51 ++++++++---- pages/look-list/look-list.wxss | 60 +++++++++++++- pages/look/look.js | 8 +- utils/api.js | 2 +- utils/gitUtil.js | 40 ++++++++++ 13 files changed, 368 insertions(+), 47 deletions(-) create mode 100644 utils/gitUtil.js diff --git a/components/detail-basis/detail-basis.js b/components/detail-basis/detail-basis.js index 7e5a0d1..798f5d5 100644 --- a/components/detail-basis/detail-basis.js +++ b/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, + }) } } }) \ No newline at end of file diff --git a/components/detail-basis/detail-basis.wxml b/components/detail-basis/detail-basis.wxml index a4b72e5..aacab11 100644 --- a/components/detail-basis/detail-basis.wxml +++ b/components/detail-basis/detail-basis.wxml @@ -56,12 +56,12 @@ 商业配比: - + % 商务配比: - + % diff --git a/components/detail-senior/detail-senior.js b/components/detail-senior/detail-senior.js index c5ccc6e..e5b45f8 100644 --- a/components/detail-senior/detail-senior.js +++ b/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:'', + }, + }) } } }) diff --git a/pages/calendar/calendar.js b/pages/calendar/calendar.js index 8f831e4..e31f2f4 100644 --- a/pages/calendar/calendar.js +++ b/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) } }) \ No newline at end of file diff --git a/pages/calendar/calendar.wxml b/pages/calendar/calendar.wxml index c7b0f04..d110328 100644 --- a/pages/calendar/calendar.wxml +++ b/pages/calendar/calendar.wxml @@ -26,10 +26,10 @@ - - + --> + displayMonthNum="{{calendarDisplayMonthNum}}" is-show="{{isCalendarShow}}"> diff --git a/pages/look-detail/look-detail.js b/pages/look-detail/look-detail.js index c3602df..4749adb 100644 --- a/pages/look-detail/look-detail.js +++ b/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){ diff --git a/pages/look-detail/look-detail.wxml b/pages/look-detail/look-detail.wxml index cc70015..5fef687 100644 --- a/pages/look-detail/look-detail.wxml +++ b/pages/look-detail/look-detail.wxml @@ -87,8 +87,8 @@ - - + + diff --git a/pages/look-list/look-list.js b/pages/look-list/look-list.js index ddf8815..dbf1e11 100644 --- a/pages/look-list/look-list.js +++ b/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({ diff --git a/pages/look-list/look-list.wxml b/pages/look-list/look-list.wxml index 7806996..250e9c7 100644 --- a/pages/look-list/look-list.wxml +++ b/pages/look-list/look-list.wxml @@ -35,37 +35,54 @@ - - - {{page.startDate?page.startDate:'拍卖日期'}} - + + 拍卖日期 - - - {{transactionStatus?transactionStatus:'交易状态'}} - + + 交易状态 - - - {{measureStatus?measureStatus:'测算状态'}} - + + 测算状态 - - - {{page.city?page.city:'城市'}} - + + 城市 + + + + + + + 开始时间: + {{page.startDate}} + + + + + + + 结束时间: + {{page.endDate}} + + + + + + 清空 + 确定 + + - + diff --git a/pages/look-list/look-list.wxss b/pages/look-list/look-list.wxss index 8c4344b..13a97a3 100644 --- a/pages/look-list/look-list.wxss +++ b/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; } \ No newline at end of file diff --git a/pages/look/look.js b/pages/look/look.js index c919e75..ff9c05e 100644 --- a/pages/look/look.js +++ b/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 = {}; diff --git a/utils/api.js b/utils/api.js index a54881f..5497246 100644 --- a/utils/api.js +++ b/utils/api.js @@ -49,7 +49,7 @@ const API = { getCalulaList:(data) => request(GET, `applets/measuredata/page?queryDate=${data.queryDate}¤t=${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}¤t=${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}¤t=${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}`),//分页 //意见反馈 diff --git a/utils/gitUtil.js b/utils/gitUtil.js new file mode 100644 index 0000000..e815377 --- /dev/null +++ b/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, +}; \ No newline at end of file