diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index a35f239..87b6e7a 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -27,11 +27,10 @@ Component({ switchTab(e) { const data = e.currentTarget.dataset const url = data.path - console.log(data) wx.switchTab({url}) - this.setData({ - selected: data.index - }) + // this.setData({ + // selected: data.index + // }) } } }) \ No newline at end of file diff --git a/pages/calendar/calendar.js b/pages/calendar/calendar.js index bf285e5..5fa6f20 100644 --- a/pages/calendar/calendar.js +++ b/pages/calendar/calendar.js @@ -136,9 +136,11 @@ Page({ }) } $api.getCityList().then(res => { - let index = res.data.indexOf(CITY) + let city = wx.getStorageSync('city') + let index = res.data.indexOf(city) if (index !== -1) { this.setData({ + cityName: city, cityIndex: index }) } diff --git a/pages/look-list/look-list.js b/pages/look-list/look-list.js index 0497c04..b153fc0 100644 --- a/pages/look-list/look-list.js +++ b/pages/look-list/look-list.js @@ -167,12 +167,14 @@ Page({ this.setData({ multiRegion: [data, ['全部']] }) - let index = data.indexOf(CITY); - if (CITY && CITY !== '' && index !== -1) { - $api.getAreaList(CITY).then(res => { + let city = wx.getStorageSync('city') + let index = data.indexOf(city); + if (city && city !== '' && index !== -1) { + $api.getAreaList(city).then(res => { let data = res.data data.unshift('全部') this.setData({ + 'page.city': city, multiIndex: [index], 'multiRegion[1]': data }) @@ -186,7 +188,7 @@ Page({ this.setData({ 'multiRegion[1]': ['全部'] }) - } else if (e.detail.column === 0){ + } else if (e.detail.column === 0) { let city = this.data.multiRegion[e.detail.column][e.detail.value]; $api.getAreaList(city).then(res => { let data = res.data diff --git a/pages/look-list/look-list.wxml b/pages/look-list/look-list.wxml index 4860315..4cb6ea2 100644 --- a/pages/look-list/look-list.wxml +++ b/pages/look-list/look-list.wxml @@ -17,12 +17,12 @@ sname: 'lp', text: '流拍' } - }else if (state === 'dealDone'){ + } else if (state === 'dealDone') { obj = { sname: 'ycj', text: '已成交' } - }else { + } else { obj = false } return obj @@ -38,10 +38,13 @@ class="form-input" bindinput="vmodel" type="text" /> --> - - - - + + + + @@ -50,10 +53,10 @@ - + - + {{page.city}}{{page.canton?page.canton:'全部'}} @@ -81,7 +84,7 @@ bindchange="bindTimeChange" data-type="start"> 开始时间: - + @@ -90,7 +93,7 @@ bindchange="bindTimeChange"> 结束时间: - + @@ -103,7 +106,7 @@ - {{item.label}} @@ -116,7 +119,7 @@ - {{item.label}} @@ -132,14 +135,17 @@ - + - - - - + + + + @@ -147,12 +153,12 @@ - + {{filter.setTag(item.transactionStatus).text}} {{item.landCode}} - {{item.annoId}}-{{item.landCode}} + {{item.annoId}}-{{item.landCode}} 计容建筑面积:{{item.totalConsArea}}㎡ diff --git a/pages/look/look.js b/pages/look/look.js index a750acb..0ded33f 100644 --- a/pages/look/look.js +++ b/pages/look/look.js @@ -7,7 +7,6 @@ const gisUtil = require('../../utils/gitUtil') const util = require('../../utils/util') let qqmapsdk; - const global = {}; //年份范围 const date = new Date(); @@ -23,8 +22,8 @@ for (let idx = min; idx < max; idx++) { label: '' + idx + '年' }); }; - const CITY = wx.getStorageSync('city') + Page({ /** * 页面的初始数据 @@ -32,7 +31,7 @@ Page({ data: { cityList: [], cityIndex: 0, - cityName: '', + cityName: CITY, switchYear: true, satellite: 2, scale: 13, @@ -156,11 +155,9 @@ Page({ this.inputFun(); }, inputFun() { //输入框输入内容 - console.log(this.data.land_name); $apiT.AJAX('get', 'applets/landlisted/page', { landCode: this.data.land_name, }, true).then(data => { - console.log(data); if (data.code == 0) { this.setData({ list_arr: data.data.records, @@ -169,7 +166,6 @@ Page({ }) }, chooseFun(e) { //选择看地列表 - console.log(e) let item = e.currentTarget.dataset.item; this.setData({ land_name: item.landCode, @@ -183,23 +179,19 @@ Page({ getLatitude(landListedId) { $apiT.AJAX('GET', 'applets/landlistedlonlat/list/' + landListedId, { landListedId: landListedId, - }, true).then(data => { - console.log(data); - if (data.code == 0) { - let number = data.data[0].centerPoint; - console.log(number) - let l = number.indexOf('(') + 1; - let z = number.indexOf(' '); - let r = number.indexOf(')'); - let log = number.substr(l, z - l); - let lag = number.substr(z, r - z); - this.setWKT1(data, 2) - this.setData({ - // polygons, - latitude: lag, - longitude: log, - }) - this.addFeaturesToList(data, 2); + }, true).then(res => { + if (res && res.data && res.data.length > 0) { + this.setWKT1(res, 3); + if (res.data[0].centerPoint) { + let centerPoint = res.data[0].centerPoint; + let point = WKT.parse(centerPoint); + this.setData({ + latitude: point.coordinates[1], + longitude: point.coordinates[0], + }) + this.setWKT1(res, 2) + this.addFeaturesToList(res, 2); + } } }) }, @@ -240,17 +232,10 @@ Page({ dialogVisible: true, }); global.selectFeature = feature; - console.log(555, feature) //tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。 let tid = feature.tid; //tid:1,2,3 //属性property 包含 地块id字段,按需使用。 let property = feature.properties; - //添加---接口对接---获取地块数据------以下全部替换 - console.log('添加---接口对接---获取地块数据------以下全部替换') - //变量 tid 代表地块类型,1:已出让,2:挂牌中;3:拟挂牌。 - //变量 property 包含 地块id字段,按需使用。 - console.log(121212, property); - // console.log(tid); if (tid == 1 || tid == 2) { $apiT.AJAX('GET', 'applets/landlisted/' + (property.land_listed_id || property.landListedId), true).then(res => { this.setData({ @@ -494,13 +479,9 @@ Page({ latitude, longitude } // 地图点击点的经纬度 - console.log(point); let features = that.selectFeatureList(point); - console.log(features); if (features && features.length > 0) { let f = features[0]; - // console.log(f); - // console.log(f); that.openLandInfo(f) } }, @@ -546,7 +527,6 @@ Page({ markers: markers }) } - // console.log(this.data.markers); }, // 清除标记 clearPoint(id) { @@ -931,7 +911,6 @@ Page({ } return polygon }); - // polygons = polygons.concat(newPolygons); this.setData({ polygons: polygons.concat(newPolygons) }) @@ -981,7 +960,6 @@ Page({ } return polygon }); - // polygons = polygons.concat(newPolygons); this.setData({ polygons: polygons.concat(newPolygons) }) @@ -990,11 +968,14 @@ Page({ bindAddressChange(e) { let city = this.data.cityList[e.detail.value] wx.setStorageSync('city', city) + this.setCity(city); + }, + setCity: function (city) { let index = this.data.cityList.indexOf(city) let that = this; qqmapsdk.geocoder({ address: city, - sig:'FvbPshzJis7X9P4A5wbkLVnnOuYdtv', + sig: 'FvbPshzJis7X9P4A5wbkLVnnOuYdtv', success: function (res) { var latitude = res.result.location.lat; var longitude = res.result.location.lng; @@ -1008,7 +989,19 @@ Page({ cityName: city, cityIndex: index }) - this.checkBtn(2) + this.setData({ + actives: [2] + }) + let { + latitude, + longitude, + } = this.data.centerLocation; + this.deletPolygon(2); + this.removeFeaturesToList(2); + this.inQuotation({ + latitude, + longitude + }, 2); }, /** * 生命周期函数--监听页面加载 @@ -1032,17 +1025,6 @@ Page({ end: arryList[eIdx].value, }) // this.scaleBack(); - $apiT.getCityList().then(res => { - let index = res.data.indexOf(CITY) - if (index !== -1) { - this.setData({ - cityIndex: index - }) - } - this.setData({ - cityList: res.data - }) - }) }, /** * 生命周期函数--监听页面显示 @@ -1054,5 +1036,12 @@ Page({ selected: 1 }) } + $apiT.getCityList().then(res => { + this.setData({ + cityList: res.data + }) + }) + let city = wx.getStorageSync('city') + this.setCity(city) } }) \ No newline at end of file diff --git a/pages/look/look.wxml b/pages/look/look.wxml index c99a22a..5567827 100644 --- a/pages/look/look.wxml +++ b/pages/look/look.wxml @@ -17,14 +17,14 @@ - - - 当前选择 - - - {{cityName?cityName:"重庆"}} - - + + + 当前选择 + + + {{cityName?cityName:"重庆"}} + + + wx:key="{{index}}"> {{item.landCode}} @@ -84,15 +84,15 @@ 已出让 - + {{start}}年 - - + {{end}}年 @@ -140,8 +140,7 @@ bindclose="closeVisionDialog" title="图层设置"> - + 卫星地图 @@ -149,8 +148,7 @@ - + 标准地图 @@ -161,16 +159,10 @@ - - - - + circles="{{circles}}" bindtap="onMapTaped" show-location> + + + - - \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index 2d8601a..4256143 100644 --- a/utils/api.js +++ b/utils/api.js @@ -11,7 +11,7 @@ const DELETE = 'DELETE'; function request(method, url, data, hasToke = true) { let token = wx.getStorageSync('access_token') let Authorization = token && hasToke ? `Bearer ${token}` : 'Basic YXBwOmFwcA=='; - if (method === GET) { + if (method.toUpperCase() === GET) { let city = wx.getStorageSync('city') city = city ? city : defaultCity if (url.indexOf('?') !== -1) {