Browse Source

新增时间选择事件触发

master
王健 4 years ago
parent
commit
22c7157c6e
  1. 15
      pages/look/look.js
  2. 4
      pages/look/look.wxml

15
pages/look/look.js

@ -25,6 +25,7 @@ Page({
* 页面的初始数据
*/
data: {
switchYear:true,
satellite: 1,
scale: 13,
latitude: 29.543812,
@ -236,6 +237,12 @@ Page({
if (sIdx > this.data.indexEnd) {
sIdx = this.data.indexEnd;
}
this.deletPolygon(1);
this.removeFeaturesToList(1);
this.inWhich({
latitude:0,
longitude:0
}, 1);
this.setData({
start: arryList[sIdx].value,
indexStart: sIdx
@ -246,6 +253,12 @@ Page({
if (eIdx < this.data.indexStart) {
eIdx = this.data.indexStart;
}
this.deletPolygon(1);
this.removeFeaturesToList(1);
this.inWhich({
latitude:0,
longitude:0
}, 1);
this.setData({
end: arryList[eIdx].value,
indexEnd: eIdx,
@ -384,9 +397,11 @@ Page({
case 1:
// 已出让
if (state) {
this.setData({switchYear:true})
this.deletPolygon(id);
this.removeFeaturesToList(id);
} else {
this.setData({switchYear:false})
this.inWhich({
latitude,
longitude

4
pages/look/look.wxml

@ -75,14 +75,14 @@
已出让
</view>
<view class="timer timer-start">
<picker range="{{years}}" header-text="开始年份" value="{{indexStart}}" range-key="label"
<picker range="{{years}}" header-text="开始年份" value="{{indexStart}}" range-key="label" disabled="{{switchYear}}"
bindchange="bindPickerChangeStart">
<text>{{start}}年</text>
</picker>
</view>
<text class="timer-link">-</text>
<view class="timer timer-end">
<picker range="{{years}}" header-text="结束年份" value="{{indexEnd}}" range-key="label"
<picker range="{{years}}" header-text="结束年份" value="{{indexEnd}}" range-key="label" disabled="{{switchYear}}"
bindchange="bindPickerChangeEnd">
<text>{{end}}年</text>
</picker>

Loading…
Cancel
Save