Browse Source

提交测算、日历、列表筛选

master
1191151619 4 years ago
parent
commit
d78ab31401
  1. 4
      components/detail-basis/detail-basis.js
  2. 2
      components/detail-basis/detail-basis.wxml
  3. 13
      components/ec-canvas/ec-canvas.js
  4. 2
      components/ui-calendar/ui-calendar.wxml
  5. 198
      pages/calculation-detail/calculation-detail.js
  6. 13
      pages/calculation-detail/calculation-detail.wxml
  7. 10
      pages/calendar/calendar.js
  8. 2
      pages/calendar/calendar.wxml
  9. 15
      pages/history/history.js
  10. 9
      pages/history/history.wxml
  11. 4
      pages/look-detail/look-detail.wxml
  12. 40
      pages/look-list/look-list.js
  13. 20
      pages/look-list/look-list.wxml
  14. 10
      pages/look-list/look-list.wxss
  15. 12
      project.private.config.json
  16. 2
      utils/api.js

4
components/detail-basis/detail-basis.js

@ -128,6 +128,8 @@ Component({
'rowData[0].AllPrice':parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
'rowData[1].AllPrice':parseFloat(this.data.dataInfo.transferPrice).toFixed(3),
})
console.log(this.data.priceData);
if(this.data.orgiData&&this.data.orgiData.measureType===0){
let data=JSON.parse(JSON.stringify(this.data.orgiData))
this.data.measureDataId=data.measureDataId
@ -193,6 +195,7 @@ Component({
// 测算
calculate(){
let table=this.selectComponent('#table');
console.log(table.data.myData)
if(table.data.myData){
this.setData({
'priceData.forecastFloorPrice':table.data.myData
@ -204,6 +207,7 @@ Component({
'priceData.forecastFloorPrice':this.data.measureData.forecastFloorPrice
})
}
console.log(this.data.priceData);
for(let key in this.data.priceData){
if(!this.data.priceData[key]){
wx.showToast({

2
components/detail-basis/detail-basis.wxml

@ -20,7 +20,7 @@
<view class="form-item">
<text class="form-lable">车位定价:</text>
<input class="form-input" bindinput="vmodel" placeholder="请输入" placeholder-style="font-size:17rpx" value="{{priceData.parkingPrice}}" data-type='parkingPrice' type="number" />
<text class="unit">元/m</text>
<text class="unit">元/</text>
</view>
</view>
</view>

13
components/ec-canvas/ec-canvas.js

@ -50,8 +50,15 @@ Component({
},
ready: function () {
// Disable prograssive because drawImage doesn't support DOM as parameter
},
methods: {
initFun(){
// Disable prograssive because drawImage doesn't support DOM as parameter
// See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
console.log('------------')
console.log(this.data.ec)
echarts.registerPreprocessor(option => {
if (option && option.series) {
if (option.series.length > 0) {
@ -74,9 +81,7 @@ Component({
if (!this.data.ec.lazyLoad) {
this.init();
}
},
methods: {
},
init: function (callback) {
const version = wx.getSystemInfoSync().SDKVersion

2
components/ui-calendar/ui-calendar.wxml

@ -62,7 +62,7 @@
var changedMonth = parseInt(timer[1])-1
var my_month = parseInt(timer[1])
return {
str_month: monthClapFn(changedYear, changedMonth)
str_month: monthClapFn(changedYear, changedMonth),
date: getDate(changedYear, changedMonth),
year: changedYear,
month: changedMonth,

198
pages/calculation-detail/calculation-detail.js

@ -2,7 +2,70 @@
import * as echarts from '../../components/ec-canvas/echarts';
const app = getApp();
const $api = require('../../utils/api').API;
var option = {
title: {
text: '我的预测与成交溢价率的差异',
left: 'center'
},
legend: {
data: ['溢价率差异', '平均差异', '我的净利率'],
bottom: 50,
left: 'center',
z: 100
},
grid: {
containLabel: true
},
tooltip: {
show: true,
trigger: 'axis'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['21001', '21002', '21003', '21004', '21005', '21006', '21007', '21008', '21009', '210010'],
show: false
},
yAxis: {
x: 'center',
type: 'value',
position: 'right',
offset: 5,
axisLabel: {
formatter: '{value}.00%'
}
},
series: [{
name: '溢价率差异',
type: 'bar',
smooth: true,
data: [],
itemStyle: {
color: '#9BBB59'
}
}, {
name: '平均差异',
type: 'line',
data: [],
showSymbol: false,
lineStyle: {
color: '#76589B',
width: 5
}
}, {
name: '我的净利率',
type: 'line',
showSymbol: false,
data: [],
lineStyle: {
color: '#4BACC6',
width: 5
}
}]
};
function initChart(canvas, width, height, dpr) {
const chart = echarts.init(canvas, null, {
width: width,
@ -11,67 +74,7 @@ function initChart(canvas, width, height, dpr) {
});
canvas.setChart(chart);
var option = {
title: {
text: '我的预测与成交溢价率的差异',
left: 'center'
},
legend: {
data: ['溢价率差异', '平均差异', '我的净利率'],
bottom: 50,
left: 'center',
z: 100
},
grid: {
containLabel: true
},
tooltip: {
show: true,
trigger: 'axis'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['21001', '21002', '21003', '21004', '21005', '21006', '21007', '21008', '21009', '210010'],
show: false
},
yAxis: {
x: 'center',
type: 'value',
position: 'right',
offset: 5,
axisLabel: {
formatter: '{value}.00%'
}
},
series: [{
name: '溢价率差异',
type: 'bar',
smooth: true,
data: [17, 19, -16, -2, 8, 10, 5, 3, 2, 6],
itemStyle: {
color: '#9BBB59'
}
}, {
name: '平均差异',
type: 'line',
data: [3, 11, 13, -2, 8, 16, 3, 3, 2, 6],
showSymbol: false,
lineStyle: {
color: '#76589B',
width: 5
}
}, {
name: '我的净利率',
type: 'line',
showSymbol: false,
data: [17, 19, -16, -2, 8, 10, 5, 3, 2, 6],
lineStyle: {
color: '#4BACC6',
width: 5
}
}]
};
chart.setOption(option);
return chart;
@ -82,26 +85,77 @@ Page({
return {
title: 'ECharts 可以在微信小程序中使用啦!',
path: '/pages/index/index',
success: function () {},
fail: function () {}
success: function () { },
fail: function () { }
}
},
data: {
ec: {
onInit: initChart
}
onInit: {},
},
totle: 0,
precision: 0,
error: 0,
},
// 测算结果统计
getStatistics() {
$api.AJAX("GET", '/applets/measuredata/statistics', {}, true).then(res => {
this.setData({
totle: res.data.totle,
precision: res.data.precision,
error: res.data.error,
})
})
},
// 测算趋势统计
getTrend() {
console.log(option);
let premiumSpread = option.series[0].data;
let average = option.series[1].data;
let interestRate = option.series[2].data;
$api.AJAX("GET", '/applets/measuredata/trend', {}, true).then(res => {
res.data.map(liem => {
average.push(
liem.average
)
interestRate.push(
liem.interestRate
)
premiumSpread.push(
liem.premiumSpread
)
})
option.series[0].data = premiumSpread;
option.series[1].data = average;
option.series[2].data = interestRate;
onShow(){
this.setData({
['ec.onInit']: initChart
})
this.instance();
})
},
instance() {//实例图表
console.log('实例图表')
let myComponent = this.selectComponent('#mychart-dom-line');
console.log(myComponent)
myComponent.initFun() // 调用自定义组件中的方法
},
onShow() {
if (typeof this.getTabBar === 'function' &&
this.getTabBar()) {
this.getTabBar().setData({
selected: 3
})
}
this.getTabBar()) {
this.getTabBar().setData({
selected: 3
})
}
this.getStatistics();
this.getTrend();
},
comeHistory(){
comeHistory() {
wx.navigateTo({
url: '../../pages/history/history',
})

13
pages/calculation-detail/calculation-detail.wxml

@ -2,33 +2,33 @@
<view class="pages">
<mp-navigation-bar ext-class="set-bar" title="测算监控"></mp-navigation-bar>
<view class="main">
<view class="top">
<!-- <view class="top">
<view class="top-box center" bindtap="comeHistory">
<image class="top-icon" src="../../assets/images/history.png"></image>
<text>历史记录</text>
</view>
</view>
</view> -->
<view class="content">
<view class="info">
<view class="tab">
<view class="tab-item">
<view class="tab-surf">
<image class="my-pos" src="../../assets/images/bg2.png"></image>
<text class="tab-num">128</text>
<text class="tab-num">{{totle}}</text>
</view>
<text class="tab-title">测算宗数</text>
</view>
<view class="tab-item">
<view class="tab-surf">
<image class="my-pos" src="../../assets/images/bg3.png"></image>
<text class="tab-num">39%</text>
<text class="tab-num">{{precision}}% </text>
</view>
<text class="tab-title">准确率</text>
</view>
<view class="tab-item">
<view class="tab-surf">
<image class="my-pos" src="../../assets/images/bg1.png"></image>
<text class="tab-num">2.43%</text>
<text class="tab-num">{{error}}%</text>
</view>
<text class="tab-title">预测误差</text>
</view>
@ -53,7 +53,8 @@
</view>
</view>
<view class="map">
<ec-canvas id="mychart-dom-line" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
<ec-canvas id="mychart-dom-line"
canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
</view>
</view>
</view>

10
pages/calendar/calendar.js

@ -37,7 +37,9 @@ Page({
calendarSelectedDateStr: '',
region: ["500000", "500100"],
cityName: '重庆',
info: []
info: [],
statistics:{},//日历展示数据
},
bindDateChange(res) {
@ -130,6 +132,12 @@ Page({
selected: 0
})
}
// 获取日历列表数据
$api.AJAX("GET",'/applets/landlisted/statistics',{
date: moment().format('YYYY-MM')
},true).then(res=>{
this.statistics = res.data;
})
},
// 日历点击跳转(请求接口获取列表数据)

2
pages/calendar/calendar.wxml

@ -20,6 +20,8 @@
当前选择
</view>
</picker>
<text>{{cityName}}</text>
<image class="tag" src="../../assets/images/arrow-down.png"></image>
</view>

15
pages/history/history.js

@ -1,11 +1,13 @@
// pages/history/history.js
const $api = require('../../utils/api').API;
Page({
/**
* 页面的初始数据
*/
data: {
list:null,
},
/**
@ -14,6 +16,15 @@ Page({
onLoad: function (options) {
},
getList(){
$api.AJAX("GET", '/applets/measuredata/page', {
}, true).then(res => {
this.setData({
list:res.data.records
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
@ -26,7 +37,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getList();
},
/**

9
pages/history/history.wxml

@ -1,11 +1,14 @@
<view class="pages">
<mp-navigation-bar ext-class="set-bar" title="历史记录"></mp-navigation-bar>
<view class="main">
<view class="info" wx:for="{{10}}" wx:for-index="i" wx:key="i">
<view class="info" wx:for="{{list}}" wx:for-index="i" wx:key="i">
<view class="text">
CQ210003-九龙坡区大桥石区大桥石区大桥石S区十组245-2
{{item.landCode}}
</view>
<text class="timer">测算日期:2021/01/01</text>
<text class="timer">测算日期:{{item.createDate}}</text>
</view>
<view class="info flex_center" wx:if="{{list.length<=0}}">
暂无数据
</view>
</view>
</view>

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

@ -25,7 +25,7 @@
<view class="pages">
<mp-navigation-bar ext-class="set-bar" title="看地"></mp-navigation-bar>
<view class="main">
<view class="look-top">
<!-- <view class="look-top">
<view class="look-search center">
<image class="look-s-icon" src="../../assets/images/search.png"></image>
</view>
@ -33,7 +33,7 @@
<image class="look-top-tag" src="../../assets/images/s-icon.png"></image>
<text class="look-top-text">土地池</text>
</view>
</view>
</view> -->
<map class="map" polygons="{{polygons}}" latitude="{{latitude}}" longitude="{{longitude}}" >
<cover-view slot="callout">
<cover-view marker-id="1"></cover-view>

40
pages/look-list/look-list.js

@ -20,7 +20,7 @@ Page({
current:1,
startDate:'',
endDate:'',
city:'',
city:'重庆',
transactionStatus:'',
measureStatus:'',
landCode:''
@ -37,8 +37,22 @@ Page({
saleList:[],
calcuList:[],
saleNum:null,
calcuNum:null
calcuNum:null,
region: ["500000", "500100"],
},
// 选择城市
bindAddressChangeCity(res) {
let cityName = res.detail.value[1];
if (cityName) {
this.setData({
['page.city']:cityName
})
};
this.refresh()
},
changeRadio(e){
let type=e.currentTarget.dataset.type;
switch (type){
@ -85,7 +99,26 @@ Page({
onReady: function () {
this.refresh()
},
// 清空
empty(e){
let name = e.currentTarget.dataset.name;
if(name == 'time'){
this.setData({
['page.startDate']:'',
['page.endDate']:'',
})
}else if(name == 'saleNum'){
this.setData({
['page.transactionStatus']:'',
[name]:null
})
}else{
this.setData({
[name]:null
})
}
},
tabDowm(e){
let active = e.currentTarget.dataset.id
if(active===this.data.active){
@ -205,6 +238,7 @@ Page({
},
showDown(e){
const _this=this;
console.log(this.data.searchNode)
for(let key in this.data.searchNode){
if(this.data.searchNode[key].height>0){
this.setData({

20
pages/look-list/look-list.wxml

@ -47,9 +47,11 @@
<picker disabled="true"><text>测算状态</text></picker>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</view>
<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 class="table-item center" >
<picker class="flex_center flex_items" mode="region" value="{{region}}" bindchange="bindAddressChangeCity">
<text>{{page.city}}</text>
<image class="table-icon" src="../../assets/images/tab-icon.png"></image>
</picker>
</view>
<!-- 日期下拉 -->
<view class="displayDown" style="height:{{searchNode.date.height}}rpx;bottom:{{searchNode.date.bottom}}rpx">
@ -72,7 +74,7 @@
</view>
</view>
<view class="btnGp">
<view class="clearSearch">清空</view>
<view class="clearSearch" data-name="time" bindtap="empty">清空</view>
<view class="toSearch" bindtap="goSearch">确定</view>
</view>
</view>
@ -84,7 +86,7 @@
</view>
</view>
<view class="btnGp">
<view class="clearSearch">清空</view>
<view class="clearSearch" data-name="saleNum" bindtap="empty">清空</view>
<view class="toSearch" bindtap="goSearch">确定</view>
</view>
</view>
@ -96,7 +98,7 @@
</view>
</view>
<view class="btnGp">
<view class="clearSearch">清空</view>
<view class="clearSearch" data-name="calcuNum" bindtap="empty">清空</view>
<view class="toSearch" bindtap="goSearch">确定</view>
</view>
</view>
@ -116,12 +118,12 @@
<text class="list-title one-title">{{item.landCode}}</text>
</view>
<view class="list-detail">
<view class="detail-item" style="width:60%">计容建筑面积:{{item.totalConsArea}}m</view>
<view class="detail-item" style="width:55%">计容建筑面积:{{item.totalConsArea}}m</view>
<view class="detail-item" style="width:40%">起始总价:{{item.transferPrice}}万</view>
<view class="detail-item" style="width:60%">起始楼面价:{{item.startingFloorPrice}}元/m</view>
<view class="detail-item" style="width:55%">起始楼面价:{{item.startingFloorPrice}}元/m</view>
<view class="detail-item" style="width:40%">竞拍时间:{{item.auctionDate}}</view>
</view>
<view class="list-timer">{{item.annoDate}}</view>
<!-- <view class="list-timer">{{item.annoDate}}</view> -->
</view>
</view>
<view class="list" wx:if="{{list.length<=0}}">

10
pages/look-list/look-list.wxss

@ -51,7 +51,7 @@
.list-item {
width: 690rpx;
height: 218rpx;
height: 180rpx;
background: #FFFFFF;
box-shadow: 0 2rpx 23rpx 0 rgba(191, 191, 191, 0.15);
border-radius: 18rpx;
@ -64,8 +64,8 @@
}
.item-img {
width: 166rpx;
height: 100%;
width: 120rpx;
height: 120rpx;
}
.item-right {
@ -106,9 +106,9 @@
}
.detail-item {
width: 50%;
/* width: 100% !important; */
line-height: 36rpx;
font-size: 22rpx;
font-size: 20rpx;
color: #565A6B;
white-space: nowrap;
}

12
project.private.config.json

@ -89,6 +89,18 @@
"pathName": "pages/ucenter/ucenter",
"query": "",
"scene": null
},
{
"name": "测试统计",
"pathName": "pages/calculation-detail/calculation-detail",
"query": "",
"scene": null
},
{
"name": "测算历史记录",
"pathName": "pages/history/history",
"query": "",
"scene": null
}
]
}

2
utils/api.js

@ -7,7 +7,7 @@ const FORM = 'FORM';
const DELETE = 'DELETE';
function request(method, url, data,hasToke) {
function request(method, url, data,hasToke=true) {
let token = wx.getStorageSync('access_token')
let Authorization =token&&hasToke?`Bearer ${token}`:'Basic YXBwOmFwcA==';

Loading…
Cancel
Save