| @@ -17,8 +17,8 @@ Page({ | |||||
| floor: null, | floor: null, | ||||
| teljpgUrl: imgurl.teljpg.url | teljpgUrl: imgurl.teljpg.url | ||||
| }, | }, | ||||
| lastSearch: Date.now(), | |||||
| onShow: function attached() { | |||||
| // lastSearch: Date.now(), | |||||
| onShow(){ | |||||
| this.getbuildingfloorlist(); | this.getbuildingfloorlist(); | ||||
| if (this.data.focus) { | if (this.data.focus) { | ||||
| this.setData({ | this.setData({ | ||||
| @@ -26,21 +26,6 @@ Page({ | |||||
| }); | }); | ||||
| } | } | ||||
| }, | }, | ||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| let that = this; | |||||
| that.data.page++; | |||||
| that.setData({ | |||||
| page: that.data.page | |||||
| }); | |||||
| // 如果是最后一页 | |||||
| //就不发送请求 | |||||
| if (!that.data.isLastPage || that.data.isFirstPage && that.data.isLastPage) { | |||||
| this.getList(this.data.building.id, this.data.floor.id, that.data.page) | |||||
| } | |||||
| }, | |||||
| phone: function (e) { | phone: function (e) { | ||||
| let that = this; | let that = this; | ||||
| if (e.currentTarget.dataset.merchantlinkphone) { | if (e.currentTarget.dataset.merchantlinkphone) { | ||||
| @@ -80,7 +65,9 @@ Page({ | |||||
| floor: this.data.multiArray[1][e.detail.value[1]], | floor: this.data.multiArray[1][e.detail.value[1]], | ||||
| }) | }) | ||||
| this.getList(this.data.building.id, this.data.floor.id, 1); | this.getList(this.data.building.id, this.data.floor.id, 1); | ||||
| this.setData({ | |||||
| page:1 | |||||
| }) | |||||
| this.setData({ | this.setData({ | ||||
| searchText: this.data.building.name + this.data.floor.floorName | searchText: this.data.building.name + this.data.floor.floorName | ||||
| }) | }) | ||||
| @@ -184,11 +171,25 @@ Page({ | |||||
| }, | }, | ||||
| selectResult: function selectResult(e) { | selectResult: function selectResult(e) { | ||||
| var index = e.currentTarget.dataset.index; | var index = e.currentTarget.dataset.index; | ||||
| var item = this.data.result[index]; | var item = this.data.result[index]; | ||||
| this.triggerEvent('selectresult', { | this.triggerEvent('selectresult', { | ||||
| index: index, | index: index, | ||||
| item: item | item: item | ||||
| }); | }); | ||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom: function () { | |||||
| let that = this; | |||||
| that.data.page++; | |||||
| that.setData({ | |||||
| page: that.data.page | |||||
| }); | |||||
| // 如果是最后一页 | |||||
| //就不发送请求 | |||||
| if (!that.data.isLastPage || that.data.isFirstPage && that.data.isLastPage) { | |||||
| this.getList(this.data.building.id, this.data.floor.id, that.data.page) | |||||
| } | |||||
| } | } | ||||
| }) | }) | ||||