Commit 0658828d0d69178a26aa4126358cd2bef62ee176

Authored by vking
1 parent e1c5262d

search

@@ -189,7 +189,7 @@ Page({ @@ -189,7 +189,7 @@ Page({
189 if(/xiaomi/i.test(systemInfo.brand)){ 189 if(/xiaomi/i.test(systemInfo.brand)){
190 this.transverseViewHeight=transverseViewHeight+15; 190 this.transverseViewHeight=transverseViewHeight+15;
191 }else{ 191 }else{
192 - //this.transverseViewHeight=transverseViewHeight+20; 192 + this.transverseViewHeight=transverseViewHeight-15;
193 } 193 }
194 pt = systemInfo.statusBarHeight; 194 pt = systemInfo.statusBarHeight;
195 h = 48; 195 h = 48;
@@ -117,7 +117,9 @@ Page({ @@ -117,7 +117,9 @@ Page({
117 onUnload: function () { 117 onUnload: function () {
118 if(this.hasOneListPage()){ 118 if(this.hasOneListPage()){
119 PubSub.off('searchParamList') 119 PubSub.off('searchParamList')
120 - if(this.hasCleanSuggestion){ 120 + if(this.suggestion){
  121 + PubSub.emit('searchParam',{fun:'setSuggestion',suggestion:this.suggestion})
  122 + }else if(this.hasCleanSuggestion){
121 PubSub.emit('searchParam', {fun:'moveToLocation'}) 123 PubSub.emit('searchParam', {fun:'moveToLocation'})
122 } 124 }
123 } 125 }
@@ -95,9 +95,9 @@ Page({ @@ -95,9 +95,9 @@ Page({
95 this.setData({ 95 this.setData({
96 backfill: this.data.suggestion[i].title 96 backfill: this.data.suggestion[i].title
97 }); 97 });
98 - PubSub.emit('searchParam',{fun:'setSuggestion',suggestion:this.data.suggestion[i]})  
99 - PubSub.emit('searchParamList',{fun:'setSuggestion',suggestion:this.data.suggestion[i]}) 98 + this.setSuggestion({fun:'setSuggestion',suggestion:this.data.suggestion[i]})
100 wx.navigateBack(); 99 wx.navigateBack();
  100 + break;
101 } 101 }
102 } 102 }
103 }, 103 },
@@ -230,8 +230,7 @@ Page({ @@ -230,8 +230,7 @@ Page({
230 //let pages = getCurrentPages(); 230 //let pages = getCurrentPages();
231 //let p = pages[pages.length - 2]; 231 //let p = pages[pages.length - 2];
232 //p.setSuggestion(item) 232 //p.setSuggestion(item)
233 - PubSub.emit('searchParam',{fun:'setSuggestion',suggestion:item})  
234 - PubSub.emit('searchParamList',{fun:'setSuggestion',suggestion:item}) 233 + this.setSuggestion({fun:'setSuggestion',suggestion:item})
235 this.setData({ 234 this.setData({
236 backfill: item.title 235 backfill: item.title
237 }); 236 });
@@ -302,4 +301,13 @@ Page({ @@ -302,4 +301,13 @@ Page({
302 this.selectComponent('#as').show(e.detail.seller); 301 this.selectComponent('#as').show(e.detail.seller);
303 } 302 }
304 }, 303 },
  304 + setSuggestion(data){//只通知前页变更数据
  305 + let pages = getCurrentPages();
  306 + let p = pages[pages.length - 2];
  307 + if(p.route=='pages/reserve/index'){
  308 + PubSub.emit('searchParam',data)
  309 + }else{
  310 + PubSub.emit('searchParamList',data)
  311 + }
  312 + },
305 }) 313 })