Commit ac4392dba4b232660a07abde9c5fb24270f25222

Authored by vking
1 parent fa43a187

search

@@ -9,6 +9,10 @@ Component({ @@ -9,6 +9,10 @@ Component({
9 type:Object, 9 type:Object,
10 value:{} 10 value:{}
11 }, 11 },
  12 + keyword:{
  13 + type:String,
  14 + value:"",
  15 + },
12 }, 16 },
13 17
14 /** 18 /**
@@ -31,7 +35,17 @@ Component({ @@ -31,7 +35,17 @@ Component({
31 this.triggerEvent('click',{act:'reserve',data:this.data.item}) 35 this.triggerEvent('click',{act:'reserve',data:this.data.item})
32 }, 36 },
33 SetHistorySearch() { 37 SetHistorySearch() {
34 - let params=this.data.item 38 + let item=this.data.item
  39 + console.log('SetHistorySearch',item)
  40 + let params={
  41 + keyword:this.data.keyword,
  42 + type:item.type==-1?1:2,
  43 + sid:item.id,
  44 + name:item.title,
  45 + openid:'',
  46 + longitude:item.longitude,
  47 + latitude:item.latitude,
  48 + }
35 App.Customer.SetHistorySearch(params) 49 App.Customer.SetHistorySearch(params)
36 }, 50 },
37 } 51 }
@@ -19,6 +19,7 @@ Page({ @@ -19,6 +19,7 @@ Page({
19 history:[], 19 history:[],
20 suggestion:[], 20 suggestion:[],
21 hasSellerMore:false, 21 hasSellerMore:false,
  22 + keyword:'',
22 }, 23 },
23 24
24 /** 25 /**
@@ -57,6 +58,7 @@ Page({ @@ -57,6 +58,7 @@ Page({
57 58
58 }, 59 },
59 getHistory(){ 60 getHistory(){
  61 + App.Customer.GetHistorySearch()
60 let ca=util.cache(search_history_cache_key); 62 let ca=util.cache(search_history_cache_key);
61 if(ca){ 63 if(ca){
62 this.setData({ 64 this.setData({
@@ -153,6 +155,7 @@ Page({ @@ -153,6 +155,7 @@ Page({
153 _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示 155 _this.setData({ //设置suggestion属性,将关键词搜索结果以列表形式展示
154 suggestion: sug, 156 suggestion: sug,
155 hasSellerMore:hasSellerMore, 157 hasSellerMore:hasSellerMore,
  158 + keyword:this.inputVal,
156 }); 159 });
157 }) 160 })
158 }, 161 },
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <!--绑定回填事件--> 14 <!--绑定回填事件-->
15 <block wx:for="{{suggestion}}" wx:key="index" 15 <block wx:for="{{suggestion}}" wx:key="index"
16 bindtap="backfill" id="{{index}}"> 16 bindtap="backfill" id="{{index}}">
17 - <search-item item="{{item}}" bindclick="searchItemClick"></search-item> 17 + <search-item item="{{item}}" keyword="{{keyword}}" bindclick="searchItemClick"></search-item>
18 <view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view> 18 <view wx:if="{{index==1 && hasSellerMore}}" class="see-more" bindtap="gotoList"></view>
19 </block> 19 </block>
20 </view> 20 </view>
@@ -325,10 +325,15 @@ export default { @@ -325,10 +325,15 @@ export default {
325 }, 325 },
326 326
327 //搜索相关 327 //搜索相关
328 - 'App.Customer.SetHistorySearch':null, 328 + 'App.Customer.SetHistorySearch':{
  329 + openid:'openid'
  330 + },
329 //搜索相关 331 //搜索相关
330 'App.Customer.DelHistorySearch':null, 332 'App.Customer.DelHistorySearch':null,
331 //搜索相关 333 //搜索相关
332 - 'App.Customer.GetHistorySearch':null, 334 + 'App.Customer.GetHistorySearch':{
  335 + openid:'openid',
  336 + cachetime: -1,
  337 + },
333 338
334 } 339 }