Commit 5e1d778bbfbafa0f624faa4745913ef13c13705c

Authored by vking
1 parent 7ff8add7

search

@@ -60,6 +60,7 @@ Component({ @@ -60,6 +60,7 @@ Component({
60 }) 60 })
61 }, 61 },
62 event(data){ 62 event(data){
  63 + data.position=this.position
63 this.triggerEvent('event',data) 64 this.triggerEvent('event',data)
64 util.cache('CACHE_LOCALTION_KEY',data) 65 util.cache('CACHE_LOCALTION_KEY',data)
65 }, 66 },
@@ -89,12 +89,28 @@ Page({ @@ -89,12 +89,28 @@ Page({
89 meLocation(){ 89 meLocation(){
90 this.selectComponent('#location').rePos({currentTarget:{dataset:{isAddr:true}}}); 90 this.selectComponent('#location').rePos({currentTarget:{dataset:{isAddr:true}}});
91 }, 91 },
  92 + GetRecomList(){
  93 + App.Customer.GetRecomList({
  94 + pid:this.city.pid,
  95 + code:this.city.code,
  96 + lat:this.position.latitude,
  97 + lng:this.position.longitude,
  98 + offset:1,
  99 + size:50
  100 + }).then(res=>{
  101 + this.setData({
  102 + sellers:res.data,
  103 + })
  104 + })
  105 + },
92 locationEvent(e){ 106 locationEvent(e){
93 console.log('locationEvent',e.detail) 107 console.log('locationEvent',e.detail)
94 this.city=e.detail.city 108 this.city=e.detail.city
  109 + this.position=e.detail.position
95 this.setData({ 110 this.setData({
96 location:e.detail.isAddr?e.detail.address:e.detail.city.name, 111 location:e.detail.isAddr?e.detail.address:e.detail.city.name,
97 IsSetActivityByFoods:false, 112 IsSetActivityByFoods:false,
  113 + sellers:[],
98 }) 114 })
99 App.Customer.IsSetActivityByFoods({ 115 App.Customer.IsSetActivityByFoods({
100 pid:this.city.pid, 116 pid:this.city.pid,
@@ -104,6 +120,7 @@ Page({ @@ -104,6 +120,7 @@ Page({
104 IsSetActivityByFoods:res.data, 120 IsSetActivityByFoods:res.data,
105 }) 121 })
106 }) 122 })
  123 + this.GetRecomList()
107 }, 124 },
108 filterParams:null, 125 filterParams:null,
109 displayFilter(){ 126 displayFilter(){
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "usingComponents": { 5 "usingComponents": {
6 "search-how":"/components/2.0/filter/how/index", 6 "search-how":"/components/2.0/filter/how/index",
7 "location":"/components/2.0/filter/location", 7 "location":"/components/2.0/filter/location",
8 - "filter":"/components/2.0/filter/filter" 8 + "filter":"/components/2.0/filter/filter",
  9 + "seller-card":"/components/2.0/seller/card"
9 } 10 }
10 } 11 }
@@ -46,6 +46,17 @@ @@ -46,6 +46,17 @@
46 </view> 46 </view>
47 </view> 47 </view>
48 </view> 48 </view>
  49 +<view wx:if="{{sellers.length>0}}" class="margin-tb-lg" bindtap="goPath"
  50 + data-path="/pages/reserve/discount">
  51 + <view class="txt-40-h text-bold margin-bottom margin-lr-lg">为你推荐</view>
  52 + <view wx:for="{{sellers}}" wx:key="sellers" class="margin-lr-sm" >
  53 + <navigator url="/pages/reserve/detail?id={{item.id}}" hover-class="navigator-hover">
  54 + <seller-card class="seller-card" id="seller-{{item.id}}"
  55 + activeSellerID="{{activeSellerID}}"
  56 + seller="{{item}}" bindevent="sellerCardEvent" ></seller-card>
  57 + </navigator>
  58 + </view>
  59 +</view>
49 <view style="height: 150rpx;"></view> 60 <view style="height: 150rpx;"></view>
50 <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> 61 <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
51 <location id="location" bindevent="locationEvent"></location> 62 <location id="location" bindevent="locationEvent"></location>
@@ -523,6 +523,9 @@ export default { @@ -523,6 +523,9 @@ export default {
523 //根据地理位置获取相应的商家活动列表 523 //根据地理位置获取相应的商家活动列表
524 'App.Customer.GetActivitySellerListByFoods':null, 524 'App.Customer.GetActivitySellerListByFoods':null,
525 525
  526 + //根据code获取指定区域下面的推介的商家列表
  527 + 'App.Customer.GetRecomList':null,
  528 +
526 //根据账单ID获取账单详情 529 //根据账单ID获取账单详情
527 'App.Foodset.GetFoodOrdersDetail':null, 530 'App.Foodset.GetFoodOrdersDetail':null,
528 531