Browse Source

修改BUG

master
王健 3 years ago
parent
commit
4150ce0950
  1. 40
      pages/look/look.js
  2. 4
      pages/look/look.wxml

40
pages/look/look.js

@ -9,11 +9,10 @@ const global = {};
//年份范围 //年份范围
const date = new Date(); const date = new Date();
const year = date.getFullYear(); const year = date.getFullYear();
const yearSpan = 3; const max = year
const max = year + yearSpan;
const min = 1949; const min = 1949;
const arryList = []; const arryList = [];
for (let idx = min; idx < max; idx++) { for (let idx = min; idx <= max; idx++) {
arryList.push({ arryList.push({
index: idx - min, index: idx - min,
value: idx, value: idx,
@ -121,6 +120,7 @@ Page({
is_focusing: true, is_focusing: true,
is_searchList: true, is_searchList: true,
}) })
this.inputFun();
}, },
escFun() { //关闭弹窗 escFun() { //关闭弹窗
@ -817,6 +817,12 @@ Page({
}, },
setCity: function (city) { setCity: function (city) {
let index = this.data.cityList.indexOf(city) let index = this.data.cityList.indexOf(city)
if (index !== -1) {
this.setData({
cityName: city,
cityIndex: index
})
}
let that = this; let that = this;
qqmapsdk.geocoder({ qqmapsdk.geocoder({
address: city, address: city,
@ -831,22 +837,20 @@ Page({
} }
}) })
this.setData({ this.setData({
cityName: city, polygons: [],
cityIndex: index actives: []
}) })
this.setData({ global.features = [];
actives: [2] $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: [], key2: [],
key3: [], key3: [],
}; };
let sIdx = year - yearSpan - min; let sIdx = year - min;
let eIdx = year - min; let eIdx = year - min;
this.setData({ this.setData({
indexStart: sIdx, indexStart: sIdx,

4
pages/look/look.wxml

@ -25,10 +25,10 @@
<text>{{cityName?cityName:"重庆"}}</text> <text>{{cityName?cityName:"重庆"}}</text>
<image class="tag" src="../../assets/images/arrow-down.png"></image> <image class="tag" src="../../assets/images/arrow-down.png"></image>
</view> </view>
<view class="look-search center {{is_search?'focusing':''}}" bindtap="searchFun"> <view class="look-search center focusing" bindtap="searchFun">
<image class="look-s-icon" src="../../assets/images/search.png"></image> <image class="look-s-icon" src="../../assets/images/search.png"></image>
<input type="text" focus="{{is_focusing}}" auto-focus="{{is_focusing}}" model:value="{{land_name}}" <input type="text" focus="{{is_focusing}}" auto-focus="{{is_focusing}}" model:value="{{land_name}}"
hold-keyboard="true" bindinput="inputFun" bindfocus="inputFun"/> hold-keyboard="true" bindconfirm="inputFun" bindinput="inputFun"/>
<image class="del ml10" bindtap="emptyFun" wx:if="{{land_name != '' && land_name}}" <image class="del ml10" bindtap="emptyFun" wx:if="{{land_name != '' && land_name}}"
src="../../assets/images/del-icon.png" mode="widthFix"></image> src="../../assets/images/del-icon.png" mode="widthFix"></image>
</view> </view>

Loading…
Cancel
Save