Commit e1c5262daaa79ff69247f36071a28d9e05b491c2

Authored by vking
1 parent 03b7a48b

search

Showing 1 changed file with 7 additions and 3 deletions
@@ -117,6 +117,9 @@ Page({ @@ -117,6 +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){
  121 + PubSub.emit('searchParam', {fun:'moveToLocation'})
  122 + }
120 } 123 }
121 }, 124 },
122 125
@@ -246,8 +249,8 @@ Page({ @@ -246,8 +249,8 @@ Page({
246 hasLoading:false, 249 hasLoading:false,
247 hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData) 250 hasDisabled:this.getHasDisabled(res.data.length>0,this.data.multiIndex[0]>0 || tags.length>0 || this.findSellerData)
248 }) 251 })
249 - this.triggerEvent('event',{type:'getListEnd',total:res.data.length})  
250 this.hasGetSellerEnd=true 252 this.hasGetSellerEnd=true
  253 + this.triggerEvent('event',{type:'getListEnd',total:res.data.length})
251 if(res.data.length==0 && this.offset==1 && this.location){ 254 if(res.data.length==0 && this.offset==1 && this.location){
252 this.onpos({detail:this.location}) 255 this.onpos({detail:this.location})
253 } 256 }
@@ -425,6 +428,7 @@ Page({ @@ -425,6 +428,7 @@ Page({
425 suggestion:null, 428 suggestion:null,
426 setSuggestion(suggestion){ 429 setSuggestion(suggestion){
427 this.suggestion=suggestion 430 this.suggestion=suggestion
  431 + this.hasCleanSuggestion=false
428 this.setData({ 432 this.setData({
429 suggestion:suggestion, 433 suggestion:suggestion,
430 hasSuggestion:true, 434 hasSuggestion:true,
@@ -433,13 +437,13 @@ Page({ @@ -433,13 +437,13 @@ Page({
433 }, 437 },
434 moveToLocation(){ 438 moveToLocation(){
435 this.suggestion=null 439 this.suggestion=null
436 - this.hasCleanSuggestion=true, 440 + this.hasCleanSuggestion=true
437 this.setData({ 441 this.setData({
438 suggestion:null, 442 suggestion:null,
439 hasSuggestion:false, 443 hasSuggestion:false,
440 keyword:'', 444 keyword:'',
441 }) 445 })
442 - PubSub.emit('searchParam', {fun:'moveToLocation'}) 446 + //PubSub.emit('searchParam', {fun:'moveToLocation'})
443 setTimeout(()=>{this.getList()},0) 447 setTimeout(()=>{this.getList()},0)
444 }, 448 },
445 }) 449 })