Commit cb4ce841853c8e89914e3e2e48ab579c0c28b6f1

Authored by vking
1 parent fb9717f8

活动入口调整

@@ -56,6 +56,7 @@ Component({ @@ -56,6 +56,7 @@ Component({
56 type: Boolean, 56 type: Boolean,
57 value: false, 57 value: false,
58 }, 58 },
  59 + hasNewActivityList:Boolean,//新的活动商家列表
59 }, 60 },
60 61
61 /** 62 /**
@@ -15,15 +15,30 @@ @@ -15,15 +15,30 @@
15 <view class="isopen_md flex-vc" wx:if="{{hasActivityShort && seller.isopen_md==1}}">在线买单</view> 15 <view class="isopen_md flex-vc" wx:if="{{hasActivityShort && seller.isopen_md==1}}">在线买单</view>
16 </view> 16 </view>
17 <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view> 17 <view wx:if="{{hasSlogan && seller.slogan}}" class="slogan">“{{seller.slogan}}”</view>
18 - <view class="text flex-ll" wx:if="{{seller.cate.length>0}}">  
19 - <view class="text-item" wx:for="{{seller.cate}}" wx:key="sellercatekey" wx:if="{{index<3}}">{{item.name}}</view>  
20 - </view>  
21 - <view class="text flex-ll">  
22 - <view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>  
23 - <block wx:if="{{hasSuggestion || location.latitude}}">  
24 - <view class="text-item" wx:if="{{seller.distance>=0 && seller.distance!==''}}">{{hasSuggestion?'距搜索地':'距您'}}{{util.distance(seller.distance_centre||seller.distance)}}</view>  
25 - </block>  
26 - </view> 18 + <block wx:if="{{hasNewActivityList}}">
  19 + <view class="flex-lr hasNewActivityList">
  20 + <view class="flex-ll">
  21 + <view class="text-item" wx:if="{{seller.cate.length>0}}">{{seller.cate[0].name}}</view>
  22 + <block wx:if="{{hasSuggestion || location.latitude}}">
  23 + <view class="text-item" wx:if="{{seller.distance>=0 && seller.distance!==''}}">{{hasSuggestion?'距搜索地':'距您'}}{{util.distance(seller.distance_centre||seller.distance)}}</view>
  24 + </block>
  25 + </view>
  26 + <view class="number Semibold average">
  27 + <block wx:if="{{seller.average>0 && hasAverage}}">¥{{seller.average}}元/人</block>
  28 + </view>
  29 + </view>
  30 + </block>
  31 + <block wx:else="">
  32 + <view class="text flex-ll" wx:if="{{seller.cate.length>0}}">
  33 + <view class="text-item" wx:for="{{seller.cate}}" wx:key="sellercatekey" wx:if="{{index<3}}">{{item.name}}</view>
  34 + </view>
  35 + <view class="text flex-ll">
  36 + <view class="text-item" wx:if="{{seller.room_num>0}}">{{seller.room_num}}个包间</view>
  37 + <block wx:if="{{hasSuggestion || location.latitude}}">
  38 + <view class="text-item" wx:if="{{seller.distance>=0 && seller.distance!==''}}">{{hasSuggestion?'距搜索地':'距您'}}{{util.distance(seller.distance_centre||seller.distance)}}</view>
  39 + </block>
  40 + </view>
  41 + </block>
27 <view wx:if="{{hasStat}}" class="stat"> 42 <view wx:if="{{hasStat}}" class="stat">
28 <stat stat="{{seller.score}}"></stat> 43 <stat stat="{{seller.score}}"></stat>
29 </view> 44 </view>
@@ -57,10 +72,12 @@ @@ -57,10 +72,12 @@
57 </view> 72 </view>
58 <view wx:if="{{hasActivityRed && se.label_carr.length>0}}" class="activity flex-ll"> 73 <view wx:if="{{hasActivityRed && se.label_carr.length>0}}" class="activity flex-ll">
59 <view wx:for="{{se.label_carr}}" class="activity-item flex-vc activity-item-{{item.type}}" wx:key="selleractivitykey">{{item.name}}</view> 74 <view wx:for="{{se.label_carr}}" class="activity-item flex-vc activity-item-{{item.type}}" wx:key="selleractivitykey">{{item.name}}</view>
  75 + <view class="activity-item flex-vc activity-item-0" wx:if="{{hasNewActivityList}}">商家补贴</view>
60 </view> 76 </view>
61 </view> 77 </view>
62 <view class="price flex-lr"> 78 <view class="price flex-lr">
63 - <view class="number Semibold"> 79 + <view class="hasNewActivityList-txt" wx:if="{{hasNewActivityList}}">“预订买单最高立减{{seller.optimal_price}}”</view>
  80 + <view class="number Semibold" wx:else="">
64 <block wx:if="{{seller.average>0 && hasAverage}}">¥{{seller.average}}元/人</block> 81 <block wx:if="{{seller.average>0 && hasAverage}}">¥{{seller.average}}元/人</block>
65 </view> 82 </view>
66 <!-- 83 <!--
@@ -269,4 +269,68 @@ @@ -269,4 +269,68 @@
269 font-family:PingFangSC-Semibold,PingFang SC; 269 font-family:PingFangSC-Semibold,PingFang SC;
270 font-weight:600; 270 font-weight:600;
271 color:rgba(255,255,255,1); 271 color:rgba(255,255,255,1);
  272 +}
  273 +
  274 +.activity-list{
  275 + box-sizing: border-box;
  276 + padding: 30rpx;
  277 + height: 280rpx;
  278 + position: relative;
  279 +}
  280 +.activity-list .image{
  281 + width:190rpx;
  282 + height:220rpx;
  283 + background:rgba(216,216,216,1);
  284 + border-radius:10rpx;
  285 + overflow: hidden;
  286 + min-width: 190rpx;
  287 +}
  288 +.activity-list .info{
  289 + height:220rpx;
  290 + margin-left: 20rpx;
  291 + padding: 0;
  292 + width: 100%;
  293 + overflow: hidden;
  294 +}
  295 +.activity-list .price{
  296 + height: 62rpx;
  297 + line-height: 62rpx;
  298 +}
  299 +.hasNewActivityList{
  300 + height:40rpx;
  301 + line-height:40rpx;
  302 + margin-top: 10rpx;
  303 + margin-bottom: 14rpx;
  304 + font-size:28rpx;
  305 + font-family:PingFangSC-Regular,PingFang SC;
  306 + font-weight:400;
  307 + color:rgba(153,153,153,1);
  308 +}
  309 +.hasNewActivityList .text-item{
  310 + height:40rpx;
  311 + line-height:40rpx;
  312 + border-right: 2rpx solid #999999;
  313 + height: 24rpx;
  314 + line-height: 24rpx;
  315 + padding-right: 10rpx;
  316 +}
  317 +.hasNewActivityList .text-item:last-child{
  318 + border-width: 0;
  319 + padding-left: 10rpx;
  320 +}
  321 +.activity-list .average{
  322 + height:40rpx;
  323 + font-size:28rpx;
  324 + font-family:PingFangSC-Semibold,PingFang SC;
  325 + font-weight:600;
  326 + color:rgba(240,85,34,1);
  327 + line-height:40rpx;
  328 +}
  329 +.hasNewActivityList-txt{
  330 + height:34rpx;
  331 + font-size:24rpx;
  332 + font-family:PingFangSC-Regular,PingFang SC;
  333 + font-weight:400;
  334 + color:rgba(231,42,38,1);
  335 + line-height:34rpx;
272 } 336 }
@@ -2,7 +2,8 @@ @@ -2,7 +2,8 @@
2 <view class="discount" style="top:{{statusBarHeightFull+a2lHeight}}px;width:{{hidden?'100rpx':'720rpx'}};" bindtap="gotoDiscount"> 2 <view class="discount" style="top:{{statusBarHeightFull+a2lHeight}}px;width:{{hidden?'100rpx':'720rpx'}};" bindtap="gotoDiscount">
3 <view style="position: relative;height: 100%;"> 3 <view style="position: relative;height: 100%;">
4 <image class="discount-img" src="http://nosqn.colorcun.com/reserve/images/%E6%83%A03.png"></image> 4 <image class="discount-img" src="http://nosqn.colorcun.com/reserve/images/%E6%83%A03.png"></image>
5 - <view style="position: relative;" wx:if="{{!hidden}}"> 5 + <!--
  6 + <view style="position: relative;" wx:if="{{false}}">
6 <image class="discount-imgmax" 7 <image class="discount-imgmax"
7 src="http://nosqn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0%E6%B4%BB%E5%8A%A83.png"></image> 8 src="http://nosqn.colorcun.com/reserve/images/%E4%BC%98%E6%83%A0%E6%B4%BB%E5%8A%A83.png"></image>
8 <view class="discount-view"> 9 <view class="discount-view">
@@ -10,5 +11,6 @@ @@ -10,5 +11,6 @@
10 <view class="close" catchtap="hide"></view> 11 <view class="close" catchtap="hide"></view>
11 </view> 12 </view>
12 </view> 13 </view>
  14 + -->
13 </view> 15 </view>
14 </view> 16 </view>
@@ -36,8 +36,12 @@ @@ -36,8 +36,12 @@
36 </view> 36 </view>
37 </view> 37 </view>
38 </view> 38 </view>
39 - <view class="share-but">  
40 - <button class="button-none" open-type="share">分享活动</button>  
41 - </view> 39 + <navigator url="/pages/reserve/discount?latitude=39.684670&longitude=118.176300"
  40 + wx:if="{{activity}}"
  41 + open-type="redirect" hover-class="other-navigator-hover">
  42 + <view class="share-but">
  43 + 查看活动商家
  44 + </view>
  45 + </navigator>
42 </view> 46 </view>
43 </view> 47 </view>
@@ -10,6 +10,7 @@ Page({ @@ -10,6 +10,7 @@ Page({
10 data: { 10 data: {
11 sellers:[], 11 sellers:[],
12 hasMore:true, 12 hasMore:true,
  13 + activity:null,
13 }, 14 },
14 sellers:[], 15 sellers:[],
15 /** 16 /**
@@ -142,4 +143,16 @@ Page({ @@ -142,4 +143,16 @@ Page({
142 this.location=e.detail 143 this.location=e.detail
143 this.GetCollectionSellerList(); 144 this.GetCollectionSellerList();
144 }, 145 },
  146 + hasActivityEvent(e){
  147 + console.log('hasActivityEvent',e);
  148 + App.Task.GetTaskInfo({pos:'home'}).then(res=>{
  149 + let activity=res.data.activity
  150 + let time=new Date()/1000
  151 + if(activity.status==1 && activity.starttime<time && time<activity.endtime){
  152 + this.setData({
  153 + activity:activity,
  154 + })
  155 + }
  156 + })
  157 + }
145 }) 158 })
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 "formids":"/components/formids/formids", 6 "formids":"/components/formids/formids",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "getpos":"/components/userinfo/getpos", 8 "getpos":"/components/userinfo/getpos",
9 - "sb-tr":"/components/reserve/seller-box-transverse/seller-box" 9 + "sb-tr":"/components/reserve/seller-box-transverse/seller-box",
  10 + "hasActivity":"/components/activity/hasActivity"
10 } 11 }
11 } 12 }
@@ -2,16 +2,26 @@ @@ -2,16 +2,26 @@
2 <nav>特惠榜</nav> 2 <nav>特惠榜</nav>
3 3
4 <view class="pages"> 4 <view class="pages">
5 - <image class="banner"  
6 - src="http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191120112403.png"></image>  
7 - <view class="follow"> 5 + <view class="banner">
  6 + <image class="banner-image" mode="widthFix"
  7 + src="http://nosqn.colorcun.com/activity/a1.png"></image>
  8 + <navigator url="/pack-activity/pages/index?id={{activity.id}}"
  9 + wx:if="{{activity}}"
  10 + open-type="redirect" hover-class="other-navigator-hover">
  11 + <view class="banner-image-bottom"></view>
  12 + </navigator>
  13 + </view>
  14 + <view class="follow" style="margin-top: {{activity?96:32}}rpx;">
  15 + <view class="biaoyu">先预订再就餐 优惠又安心</view>
8 <view class="seller" wx:for="{{sellers}}" wx:key="sellers.key" 16 <view class="seller" wx:for="{{sellers}}" wx:key="sellers.key"
9 bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.hasFollow}}"> 17 bindtap="gotoDetail" data-sid="{{item.id}}" wx:if="{{item.hasFollow}}">
10 <sb-tr seller="{{item}}" 18 <sb-tr seller="{{item}}"
11 - hasActivity="{{true}}" hasAverage="{{false}}"  
12 - hasSlogan="{{true}}" sellerStyle="noborder noshadow"></sb-tr> 19 + hasActivity="{{false}}" hasAverage="{{true}}"
  20 + hasBrand hasActivityRed hasActivityShort hasNewActivityList
  21 + hasSlogan="{{false}}" sellerStyle="noborder noshadow activity-list"></sb-tr>
13 </view> 22 </view>
14 <view class="flex-vc" wx:if="{{!hasMore}}">没有更多了</view> 23 <view class="flex-vc" wx:if="{{!hasMore}}">没有更多了</view>
15 </view> 24 </view>
16 </view> 25 </view>
17 -<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>  
  26 +<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
  27 +<hasActivity bindevent="hasActivityEvent"></hasActivity>
1 /* pages/reserve/discount.wxss */ 1 /* pages/reserve/discount.wxss */
  2 +page{
  3 + background-color: #F5F5F5;
  4 +}
2 .banner{ 5 .banner{
3 - width: 750rpx;  
4 - height: 360rpx;  
5 - margin: 0 auto; 6 + position: relative;
  7 +}
  8 +.banner-image{
  9 + width: 100%;
  10 +}
  11 +.banner-image-bottom{
  12 + position: absolute;
  13 + bottom: -64rpx;
  14 + left:calc(50% - 243rpx);
  15 + width:486rpx;
  16 + height: 104rpx;
  17 + background-image: url("http://nosqn.colorcun.com/activity/a2.png");
  18 + background-size: 100% 100%;
6 } 19 }
7 .pages{ 20 .pages{
8 width: 100%; 21 width: 100%;
9 margin: 0 auto; 22 margin: 0 auto;
10 - color:#fff; 23 + color:#ccc;
11 font-size: 28rpx; 24 font-size: 28rpx;
12 - background:linear-gradient(1deg,rgba(249,142,71,1) 0%,rgba(183,22,26,1) 100%);  
13 box-sizing: border-box; 25 box-sizing: border-box;
14 } 26 }
15 .follow { 27 .follow {
16 padding-bottom: 50rpx; 28 padding-bottom: 50rpx;
17 width: calc(100% - 40rpx); 29 width: calc(100% - 40rpx);
18 - margin: 0 auto; 30 + margin: 104rpx auto;
19 } 31 }
20 .follow .seller{ 32 .follow .seller{
21 margin-bottom:20rpx; 33 margin-bottom:20rpx;
22 background-color: #ffffff; 34 background-color: #ffffff;
23 border-radius: 6rpx; 35 border-radius: 6rpx;
24 overflow: hidden; 36 overflow: hidden;
  37 +}
  38 +.biaoyu{
  39 + height:44rpx;
  40 + font-size:32rpx;
  41 + font-family:PingFangSC-Semibold,PingFang SC;
  42 + font-weight:600;
  43 + color:rgba(53,53,53,1);
  44 + line-height:44rpx;
  45 + width: 528rpx;
  46 + text-align: center;
  47 + margin-left: calc(50% - 264rpx);
  48 + position: relative;
  49 + margin-bottom: 30rpx;
  50 +}
  51 +.biaoyu:after,.biaoyu:before{
  52 + content:"";
  53 + display: block;
  54 + position: absolute;
  55 + width:52rpx;
  56 + height: 20rpx;
  57 + left:0;
  58 + top:12rpx;
  59 + background-image: url("http://nosqn.colorcun.com/activity/al.png");
  60 + background-size: 100% 100%;
  61 +}
  62 +.biaoyu:before{
  63 + background-image: url("http://nosqn.colorcun.com/activity/ar.png");
  64 + right:0;
  65 + left: auto;
25 } 66 }
@@ -606,7 +606,7 @@ Page({ @@ -606,7 +606,7 @@ Page({
606 }, true) 606 }, true)
607 }, 100) 607 }, 100)
608 } 608 }
609 - //this.IsSetActivity(); 609 + this.IsSetActivity();
610 }) 610 })
611 611
612 }, 612 },
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 "boost":"/components/tips/boost", 11 "boost":"/components/tips/boost",
12 "caixi":"/components/reserve/caixi", 12 "caixi":"/components/reserve/caixi",
13 "list":"/components/reserve/seller-box-transverse-cview/list", 13 "list":"/components/reserve/seller-box-transverse-cview/list",
14 - "activity-enter":"/components/activity/enter" 14 + "activity-enter":"/components/activity/enter",
  15 + "activity-tips":"/components/tips/discount"
15 } 16 }
16 } 17 }
@@ -143,4 +143,5 @@ @@ -143,4 +143,5 @@
143 bindactive="caixiActive" id="caixi" 143 bindactive="caixiActive" id="caixi"
144 ></caixi> 144 ></caixi>
145 <activity-enter hasInHome wx:if="{{hasGetPos}}"></activity-enter> 145 <activity-enter hasInHome wx:if="{{hasGetPos}}"></activity-enter>
146 -<boost bindevent="boostEvent" wx:if="{{hasBoost}}"></boost>  
  146 +<boost bindevent="boostEvent" wx:if="{{hasBoost}}"></boost>
  147 +<activity-tips wx:if="{{hasSetActivity}}" map="{{map}}"></activity-tips>