From 840b1ad51bc3b6278f76546e8fce10029c7133cb Mon Sep 17 00:00:00 2001 From: meo <18801474720@163.com> Date: Fri, 25 Oct 2019 13:16:50 +0800 Subject: [PATCH] =?UTF-8?q?C=E7=AB=AF-=E6=A0=B9=E6=8D=AE=E6=A5=BC=E5=B1=82?= =?UTF-8?q?=E6=A5=BC=E5=BA=A7=E6=9F=A5=E8=AF=A2=E5=95=86=E6=88=B7=E9=9C=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E9=A1=B5=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/searchbar/searchbar.js | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/pages/searchbar/searchbar.js b/pages/searchbar/searchbar.js index b00d1e5..4ff7ad9 100644 --- a/pages/searchbar/searchbar.js +++ b/pages/searchbar/searchbar.js @@ -17,8 +17,8 @@ Page({ floor: null, teljpgUrl: imgurl.teljpg.url }, - lastSearch: Date.now(), - onShow: function attached() { + // lastSearch: Date.now(), + onShow(){ this.getbuildingfloorlist(); if (this.data.focus) { 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) { let that = this; if (e.currentTarget.dataset.merchantlinkphone) { @@ -80,7 +65,9 @@ Page({ floor: this.data.multiArray[1][e.detail.value[1]], }) this.getList(this.data.building.id, this.data.floor.id, 1); - + this.setData({ + page:1 + }) this.setData({ searchText: this.data.building.name + this.data.floor.floorName }) @@ -184,11 +171,25 @@ Page({ }, selectResult: function selectResult(e) { var index = e.currentTarget.dataset.index; - var item = this.data.result[index]; this.triggerEvent('selectresult', { index: index, 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) + } } }) \ No newline at end of file