Commit cdd94f8d8ae80c3d25ec67f2261e243cc635e0b5

Authored by vking
1 parent 971a4c2c

search

@@ -94,9 +94,10 @@ Page({ @@ -94,9 +94,10 @@ Page({
94 size:10, 94 size:10,
95 hasMore:true, 95 hasMore:true,
96 GetCollectionSellerList(){ 96 GetCollectionSellerList(){
97 - App.Customer.GetActivitySellerList({  
98 - lat:this.options.latitude,  
99 - lng:this.options.longitude, 97 + this.city=JSON.parse(this.options.city)
  98 + App.Customer.GetActivitySellerListByFoods({
  99 + code:this.city.code,
  100 + pid:this.city.pid,
100 offset:this.offset, 101 offset:this.offset,
101 size:this.size, 102 size:this.size,
102 distance:50, 103 distance:50,
1 // pages/reserve/home.js 1 // pages/reserve/home.js
  2 +import App from '../../utils/api';
2 import util from '../../utils/util' 3 import util from '../../utils/util'
3 import PubSub from '../../utils/PubSub' 4 import PubSub from '../../utils/PubSub'
4 const {regeneratorRuntime} = global 5 const {regeneratorRuntime} = global
@@ -92,7 +93,16 @@ Page({ @@ -92,7 +93,16 @@ Page({
92 console.log('locationEvent',e.detail) 93 console.log('locationEvent',e.detail)
93 this.city=e.detail.city 94 this.city=e.detail.city
94 this.setData({ 95 this.setData({
95 - location:e.detail.isAddr?e.detail.address:e.detail.city.name 96 + location:e.detail.isAddr?e.detail.address:e.detail.city.name,
  97 + IsSetActivityByFoods:false,
  98 + })
  99 + App.Customer.IsSetActivityByFoods({
  100 + pid:this.city.pid,
  101 + code:this.city.code,
  102 + }).then(res=>{
  103 + this.setData({
  104 + IsSetActivityByFoods:res.data,
  105 + })
96 }) 106 })
97 }, 107 },
98 filterParams:null, 108 filterParams:null,
@@ -35,6 +35,18 @@ @@ -35,6 +35,18 @@
35 查找包间 35 查找包间
36 </view> 36 </view>
37 </view> 37 </view>
  38 +<view wx:if="{{IsSetActivityByFoods}}" class="margin-top-lg padding-lg" bindtap="goPath"
  39 + data-path="/pages/reserve/discount">
  40 + <view class="txt-40-h text-bold margin-bottom">精选特惠</view>
  41 + <view class="flex justify-center align-center">
  42 + <view class="view youhui-image image1" style=""></view>
  43 + <view class="margin-left-xs">
  44 + <view class="view youhui-image image2"></view>
  45 + <view class="view youhui-image image3 margin-top-xs"></view>
  46 + </view>
  47 + </view>
  48 +</view>
  49 +<view style="height: 150rpx;"></view>
38 <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how> 50 <search-how id="search-how" findSellerData="{{findSellerData}}" bindevent="howEvent"></search-how>
39 <location id="location" bindevent="locationEvent"></location> 51 <location id="location" bindevent="locationEvent"></location>
40 <view class="view filter-mask" hidden="{{!hasFilter}}"> 52 <view class="view filter-mask" hidden="{{!hasFilter}}">
@@ -58,4 +58,68 @@ @@ -58,4 +58,68 @@
58 .filter{ 58 .filter{
59 position: relative; 59 position: relative;
60 margin-top: calc(100% + 30rpx); 60 margin-top: calc(100% + 30rpx);
  61 +}
  62 +.image1{
  63 + background-image: url("http://nosqn.colorcun.com/search/s%20%285%29.png");
  64 + width: 330rpx;
  65 + height: 346rpx;
  66 +}
  67 +.image2{
  68 + background-image: url("http://nosqn.colorcun.com/search/s%20%286%29.png");
  69 + width: 330rpx;
  70 + height: 168rpx;
  71 +}
  72 +.image3{
  73 + background-image: url("http://nosqn.colorcun.com/search/s%20%287%29.png");
  74 + width: 330rpx;
  75 + height: 168rpx;
  76 +}
  77 +.youhui-image{
  78 + position: relative;
  79 +}
  80 +.youhui-image:before{
  81 + position: absolute;
  82 + height: 50rpx;
  83 + font-size: 36rpx;
  84 + font-family: PingFangSC-Semibold, PingFang SC;
  85 + font-weight: 600;
  86 + color: #FFFFFF;
  87 + line-height: 50rpx;
  88 + top:20rpx;
  89 + left: 20rpx;
  90 + content: "";
  91 + display: block;
  92 +}
  93 +.youhui-image:after{
  94 + position: absolute;
  95 + height: 34rpx;
  96 + font-size: 24rpx;
  97 + font-family: PingFangSC-Regular, PingFang SC;
  98 + font-weight: 400;
  99 + color: #FFFFFF;
  100 + line-height: 34rpx;
  101 + top:70rpx;
  102 + left: 20rpx;
  103 + content: "";
  104 + display: block;
  105 +}
  106 +.image1:before{
  107 + content: "预订买单更优惠";
  108 +}
  109 +.image1:after{
  110 + content: "100+优质餐厅";
  111 +}
  112 +
  113 +.image2:before{
  114 + content: "百万补贴来袭";
  115 +}
  116 +.image2:after{
  117 + content: "限时特惠";
  118 +}
  119 +
  120 +.image3:before{
  121 + content: "超值套餐";
  122 +}
  123 +.image3:after{
  124 + content: "包间可用";
61 } 125 }
@@ -517,6 +517,12 @@ export default { @@ -517,6 +517,12 @@ export default {
517 //根据区域查询指定条件下的商家列表 517 //根据区域查询指定条件下的商家列表
518 'App.Customer.GetSellerListByFoods':null, 518 'App.Customer.GetSellerListByFoods':null,
519 519
  520 + //用来检测找包间首页优惠板块是否显示
  521 + 'App.Customer.IsSetActivityByFoods':null,
  522 +
  523 + //根据地理位置获取相应的商家活动列表
  524 + 'App.Customer.GetActivitySellerListByFoods':null,
  525 +
520 //根据账单ID获取账单详情 526 //根据账单ID获取账单详情
521 'App.Foodset.GetFoodOrdersDetail':null, 527 'App.Foodset.GetFoodOrdersDetail':null,
522 528