From 4150ce09500eb633d69766601eeb9b54edad1879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=81=A5?= Date: Tue, 28 Sep 2021 10:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/look/look.js | 40 ++++++++++++++++++++++------------------ pages/look/look.wxml | 4 ++-- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pages/look/look.js b/pages/look/look.js index 7a69707..1abbe68 100644 --- a/pages/look/look.js +++ b/pages/look/look.js @@ -9,11 +9,10 @@ const global = {}; //年份范围 const date = new Date(); const year = date.getFullYear(); -const yearSpan = 3; -const max = year + yearSpan; +const max = year const min = 1949; const arryList = []; -for (let idx = min; idx < max; idx++) { +for (let idx = min; idx <= max; idx++) { arryList.push({ index: idx - min, value: idx, @@ -121,6 +120,7 @@ Page({ is_focusing: true, is_searchList: true, }) + this.inputFun(); }, escFun() { //关闭弹窗 @@ -817,6 +817,12 @@ Page({ }, setCity: function (city) { let index = this.data.cityList.indexOf(city) + if (index !== -1) { + this.setData({ + cityName: city, + cityIndex: index + }) + } let that = this; qqmapsdk.geocoder({ address: city, @@ -831,22 +837,20 @@ Page({ } }) this.setData({ - cityName: city, - cityIndex: index + polygons: [], + actives: [] }) - this.setData({ - actives: [2] + global.features = []; + $api.getLandListing({ + lon: 0, + lat: 0 + }).then(data => { + if (data.data && data.data.length > 0) { + this.checkBtn(2) + } else { + this.checkBtn(1) + } }) - let { - latitude, - longitude, - } = this.data.centerLocation; - this.deletPolygon(2); - this.removeFeaturesToList(2); - this.inQuotation({ - latitude, - longitude - }, 2); }, /** * 生命周期函数--监听页面加载 @@ -861,7 +865,7 @@ Page({ key2: [], key3: [], }; - let sIdx = year - yearSpan - min; + let sIdx = year - min; let eIdx = year - min; this.setData({ indexStart: sIdx, diff --git a/pages/look/look.wxml b/pages/look/look.wxml index bd1933b..00c8860 100644 --- a/pages/look/look.wxml +++ b/pages/look/look.wxml @@ -25,10 +25,10 @@ {{cityName?cityName:"重庆"}} - + + hold-keyboard="true" bindconfirm="inputFun" bindinput="inputFun"/>