Commit ac4392dba4b232660a07abde9c5fb24270f25222

Authored by vking
1 parent fa43a187

search

... ... @@ -9,6 +9,10 @@ Component({
type:Object,
value:{}
},
keyword:{
type:String,
value:"",
},
},
/**
... ... @@ -31,7 +35,17 @@ Component({
this.triggerEvent('click',{act:'reserve',data:this.data.item})
},
SetHistorySearch() {
let params=this.data.item
let item=this.data.item
console.log('SetHistorySearch',item)
let params={
keyword:this.data.keyword,
type:item.type==-1?1:2,
sid:item.id,
name:item.title,
openid:'',
longitude:item.longitude,
latitude:item.latitude,
}
App.Customer.SetHistorySearch(params)
},
}
... ...
... ... @@ -19,6 +19,7 @@ Page({
history:[],
suggestion:[],
hasSellerMore:false,
keyword:'',
},
/**
... ... @@ -57,6 +58,7 @@ Page({
},
getHistory(){
App.Customer.GetHistorySearch()
let ca=util.cache(search_history_cache_key);
if(ca){
this.setData({
... ... @@ -153,6 +155,7 @@ Page({
_this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
suggestion: sug,
hasSellerMore:hasSellerMore,
keyword:this.inputVal,
});
})
},
... ...
... ... @@ -14,7 +14,7 @@
<!--绑定回填事件-->
<block wx:for="{{suggestion}}" wx:key="index"
bindtap="backfill" id="{{index}}">
<search-item item="{{item}}" bindclick="searchItemClick"></search-item>
<search-item item="{{item}}" keyword="{{keyword}}" bindclick="searchItemClick"></search-item>
<view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view>
</block>
</view>
... ...
... ... @@ -325,10 +325,15 @@ export default {
},
//搜索相关
'App.Customer.SetHistorySearch':null,
'App.Customer.SetHistorySearch':{
openid:'openid'
},
//搜索相关
'App.Customer.DelHistorySearch':null,
//搜索相关
'App.Customer.GetHistorySearch':null,
'App.Customer.GetHistorySearch':{
openid:'openid',
cachetime: -1,
},
}
\ No newline at end of file
... ...