Showing
7 changed files
with
99 additions
and
17 deletions
| 1 | <!--components/reserve/discount.wxml--> | 1 | <!--components/reserve/discount.wxml--> |
| 2 | +<wxs src="../../../utils/util.wxs" module="util" /> | ||
| 2 | <view class="toast" wx:if="{{red_envelopes_price>0}}"> | 3 | <view class="toast" wx:if="{{red_envelopes_price>0}}"> |
| 3 | <view class="toast-view"> | 4 | <view class="toast-view"> |
| 4 | <view class="toast-text">店家送您</view> | 5 | <view class="toast-text">店家送您</view> |
| @@ -19,11 +20,23 @@ | @@ -19,11 +20,23 @@ | ||
| 19 | </view> | 20 | </view> |
| 20 | <view class="discount-content"> | 21 | <view class="discount-content"> |
| 21 | <view class="activity"> | 22 | <view class="activity"> |
| 22 | - <view class="txt">活动</view> | 23 | + <block wx:for="{{seller.activity}}" wx:key="activity"> |
| 24 | + <view class="flex-ll activity-item" | ||
| 25 | + style="align-items: flex-start"> | ||
| 26 | + <view class="activity-left">{{util.activityName(item.type)}}</view> | ||
| 27 | + <view class="activity-right"> | ||
| 28 | + {{item.title}} | ||
| 29 | + <view class="activity-right-info" wx:if="{{item.desc}}">注:{{item.desc}}</view> | ||
| 30 | + </view> | ||
| 31 | + </view> | ||
| 32 | + </block> | ||
| 23 | <view class="flex-ll activity-item" wx:if="{{seller.receive_condition_2}}" | 33 | <view class="flex-ll activity-item" wx:if="{{seller.receive_condition_2}}" |
| 24 | style="align-items: flex-start"> | 34 | style="align-items: flex-start"> |
| 25 | <view class="activity-left">消费返</view> | 35 | <view class="activity-left">消费返</view> |
| 26 | - <view class="activity-right">在线买单{{seller.receive_condition_str}}红包</view> | 36 | + <view class="activity-right"> |
| 37 | + 在线买单{{seller.receive_condition_str}}红包 | ||
| 38 | + <view class="activity-right-info">注:仅可以线上买单时使用</view> | ||
| 39 | + </view> | ||
| 27 | </view> | 40 | </view> |
| 28 | <view class="flex-ll activity-item" wx:if="{{seller.isopen_md==1}}" | 41 | <view class="flex-ll activity-item" wx:if="{{seller.isopen_md==1}}" |
| 29 | style="align-items: flex-start"> | 42 | style="align-items: flex-start"> |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | .discount{ | 3 | .discount{ |
| 4 | position: fixed; | 4 | position: fixed; |
| 5 | bottom: 0; | 5 | bottom: 0; |
| 6 | - background-color: #ffffff; | 6 | + background-color: #fefefe; |
| 7 | border-radius: 40rpx 40rpx 0rpx 0rpx; | 7 | border-radius: 40rpx 40rpx 0rpx 0rpx; |
| 8 | color: #353535; | 8 | color: #353535; |
| 9 | width: 100%; | 9 | width: 100%; |
| @@ -52,6 +52,13 @@ | @@ -52,6 +52,13 @@ | ||
| 52 | } | 52 | } |
| 53 | .activity-item{ | 53 | .activity-item{ |
| 54 | margin-top: 20rpx; | 54 | margin-top: 20rpx; |
| 55 | + | ||
| 56 | + background: #FFFFFF; | ||
| 57 | + box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(228, 228, 228, 0.5); | ||
| 58 | + border-radius: 10rpx; | ||
| 59 | + | ||
| 60 | + box-sizing: border-box; | ||
| 61 | + padding: 26rpx 40rpx; | ||
| 55 | } | 62 | } |
| 56 | .activity-left{ | 63 | .activity-left{ |
| 57 | height:28rpx; | 64 | height:28rpx; |
| @@ -63,7 +70,7 @@ | @@ -63,7 +70,7 @@ | ||
| 63 | color:rgba(240,88,36,1); | 70 | color:rgba(240,88,36,1); |
| 64 | line-height:28rpx; | 71 | line-height:28rpx; |
| 65 | padding: 0 6rpx; | 72 | padding: 0 6rpx; |
| 66 | - min-width: 60rpx; | 73 | + /*min-width: 60rpx;*/ |
| 67 | text-align: center; | 74 | text-align: center; |
| 68 | } | 75 | } |
| 69 | .activity-right{ | 76 | .activity-right{ |
| @@ -251,4 +258,14 @@ | @@ -251,4 +258,14 @@ | ||
| 251 | 258 | ||
| 252 | .seller-reserve{ | 259 | .seller-reserve{ |
| 253 | display: none; | 260 | display: none; |
| 261 | +} | ||
| 262 | + | ||
| 263 | +.activity-right-info{ | ||
| 264 | + height: 34rpx; | ||
| 265 | + font-size: 24rpx; | ||
| 266 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 267 | + font-weight: 400; | ||
| 268 | + color: #999999; | ||
| 269 | + line-height: 34rpx; | ||
| 270 | + margin-top: 10rpx; | ||
| 254 | } | 271 | } |
| @@ -12,7 +12,6 @@ Page({ | @@ -12,7 +12,6 @@ Page({ | ||
| 12 | data: { | 12 | data: { |
| 13 | seller:null, | 13 | seller:null, |
| 14 | IsCollectionSeller:false, | 14 | IsCollectionSeller:false, |
| 15 | - pagesHeight:'auto', | ||
| 16 | current:0, | 15 | current:0, |
| 17 | currentView:1, | 16 | currentView:1, |
| 18 | hasOnlineReserve:false, | 17 | hasOnlineReserve:false, |
| @@ -115,6 +114,15 @@ Page({ | @@ -115,6 +114,15 @@ Page({ | ||
| 115 | seller.receive_condition_str=xff.join('/') | 114 | seller.receive_condition_str=xff.join('/') |
| 116 | } | 115 | } |
| 117 | } | 116 | } |
| 117 | + seller.activityStr=[]; | ||
| 118 | + if(seller.activity.length>0){ | ||
| 119 | + seller.activity.forEach(a=>{ | ||
| 120 | + seller.activityStr.push(a.title) | ||
| 121 | + }) | ||
| 122 | + } | ||
| 123 | + seller.activityStr=seller.activityStr.join(';') | ||
| 124 | + //seller.isopen_md=0; | ||
| 125 | + //seller.card_info=[] | ||
| 118 | let obj={ | 126 | let obj={ |
| 119 | seller:seller, | 127 | seller:seller, |
| 120 | hasDishesImage:hasDishesImage, | 128 | hasDishesImage:hasDishesImage, |
| @@ -309,12 +317,12 @@ Page({ | @@ -309,12 +317,12 @@ Page({ | ||
| 309 | }, | 317 | }, |
| 310 | discountHide(){ | 318 | discountHide(){ |
| 311 | this.setData({ | 319 | this.setData({ |
| 312 | - pagesHeight:'auto' | 320 | + hasDisplayDiscount:false |
| 313 | }) | 321 | }) |
| 314 | }, | 322 | }, |
| 315 | discountShow(){ | 323 | discountShow(){ |
| 316 | this.setData({ | 324 | this.setData({ |
| 317 | - pagesHeight:'500rpx' | 325 | + hasDisplayDiscount:true |
| 318 | }) | 326 | }) |
| 319 | }, | 327 | }, |
| 320 | shareUserinfo(){ | 328 | shareUserinfo(){ |
| 1 | <!--pages/reserve/detail.wxml--> | 1 | <!--pages/reserve/detail.wxml--> |
| 2 | <include src="detail.skeleton.wxml" wx:if="{{!seller}}"/> | 2 | <include src="detail.skeleton.wxml" wx:if="{{!seller}}"/> |
| 3 | -<layout wx:else=""> | 3 | +<layout wx:else="" style="position: {{hasDisplayDiscount?'fixed':''}};"> |
| 4 | <nav hasHome>{{seller.sellername}}</nav> | 4 | <nav hasHome>{{seller.sellername}}</nav> |
| 5 | <!-- 包间预定 --> | 5 | <!-- 包间预定 --> |
| 6 | <view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}"> | 6 | <view class="tabs flex-lr" wx:if="{{hasOnlineReserve}}"> |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | </view> | 12 | </view> |
| 13 | </view> | 13 | </view> |
| 14 | <view hidden="{{activeTab!='detail'}}"> | 14 | <view hidden="{{activeTab!='detail'}}"> |
| 15 | - <view class="seller-banner" style="{{pagesHeight!='auto'?'position: fixed;':''}}{{hasOnlineReserve?'margin-top: 80rpx;':''}}"> | 15 | + <view class="seller-banner" style="{{hasOnlineReserve?'margin-top: 80rpx;':''}}"> |
| 16 | <swiper | 16 | <swiper |
| 17 | indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" | 17 | indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}" |
| 18 | interval="2000" duration="500" | 18 | interval="2000" duration="500" |
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | </view> | 33 | </view> |
| 34 | <view class="swiper-num" wx:if="{{seller.envi_image.length>0}}">{{currentView}} / {{seller.envi_image.length}}</view> | 34 | <view class="swiper-num" wx:if="{{seller.envi_image.length>0}}">{{currentView}} / {{seller.envi_image.length}}</view> |
| 35 | </view> | 35 | </view> |
| 36 | - <view class="pages" style="height: {{pagesHeight}};overflow:{{pagesHeight=='auto'?'visible':'hidden'}}"> | 36 | + <view class="pages"> |
| 37 | <view class="seller"> | 37 | <view class="seller"> |
| 38 | <view class="base"> | 38 | <view class="base"> |
| 39 | <view class="name Semibold flex-lr"> | 39 | <view class="name Semibold flex-lr"> |
| @@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
| 56 | <text class="label_text" >{{seller.label_cstr}}</text> | 56 | <text class="label_text" >{{seller.label_cstr}}</text> |
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | - <view style="display:{{pagesHeight=='auto'?'block':'none'}}"> | 59 | + <view> |
| 60 | <view class="addr flex-lr" wx:if="{{hasOnlineReserve}}"> | 60 | <view class="addr flex-lr" wx:if="{{hasOnlineReserve}}"> |
| 61 | <view class="addr-view" bindtap="lookLocation"> | 61 | <view class="addr-view" bindtap="lookLocation"> |
| 62 | <view class="addr-text flex-ll"> | 62 | <view class="addr-text flex-ll"> |
| @@ -79,10 +79,10 @@ | @@ -79,10 +79,10 @@ | ||
| 79 | </view> | 79 | </view> |
| 80 | </view> | 80 | </view> |
| 81 | </view> | 81 | </view> |
| 82 | - <view style="display:{{pagesHeight=='auto'?'block':'none'}}" wx:if="{{seller}}"> | 82 | + <view wx:if="{{seller}}"> |
| 83 | <view class="black20line"></view> | 83 | <view class="black20line"></view> |
| 84 | - <block wx:if="{{seller.isopen_md==1 || seller.card_info.length>0}}"> | ||
| 85 | - <view class="activity-view-easy flex-lr" bindtap="showDiscount"> | 84 | + <view wx:if="{{seller.isopen_md==1 || seller.card_info.length>0}}" bindtap="showDiscount"> |
| 85 | + <view class="activity-view-easy flex-lr"> | ||
| 86 | <view class="activity-left flex-ll"> | 86 | <view class="activity-left flex-ll"> |
| 87 | <view class="activity-view-tit">优惠</view> | 87 | <view class="activity-view-tit">优惠</view> |
| 88 | <view class="activity-view-blk" wx:if="{{seller.receive_condition_1}}">进店赠红包</view> | 88 | <view class="activity-view-blk" wx:if="{{seller.receive_condition_1}}">进店赠红包</view> |
| @@ -93,7 +93,30 @@ | @@ -93,7 +93,30 @@ | ||
| 93 | <view class="more"></view> | 93 | <view class="more"></view> |
| 94 | </view> | 94 | </view> |
| 95 | </view> | 95 | </view> |
| 96 | + <view class="activityStr" wx:if="{{seller.activityStr}}"> | ||
| 97 | + {{seller.activityStr}} | ||
| 98 | + </view> | ||
| 96 | <view class="black20line"></view> | 99 | <view class="black20line"></view> |
| 100 | + </view> | ||
| 101 | + <block wx:else=""> | ||
| 102 | + <view class="seller" wx:if="{{seller.activity.length>0}}"> | ||
| 103 | + <formids bindclick="showDiscount"> | ||
| 104 | + <view class="activity-view-easy activity-view-easy-old flex-lr" > | ||
| 105 | + <view class="activity-left flex-ll"> | ||
| 106 | + <view class="icon"></view> | ||
| 107 | + <block wx:for="{{seller.activity}}" | ||
| 108 | + wx:key="seller.activity.key" | ||
| 109 | + wx:if="{{index<2}}"> | ||
| 110 | + <view class="discount" >{{item.title}}</view> | ||
| 111 | + </block> | ||
| 112 | + </view> | ||
| 113 | + <view class="flex-rr activity-right"> | ||
| 114 | + <view class="more-text">更多</view> | ||
| 115 | + <view class="more"></view> | ||
| 116 | + </view> | ||
| 117 | + </view> | ||
| 118 | + </formids> | ||
| 119 | + </view> | ||
| 97 | </block> | 120 | </block> |
| 98 | <block wx:if="{{seller.isopen_md!=1}}"> | 121 | <block wx:if="{{seller.isopen_md!=1}}"> |
| 99 | <view class="seller" > | 122 | <view class="seller" > |
| @@ -412,7 +412,7 @@ | @@ -412,7 +412,7 @@ | ||
| 412 | .average{ | 412 | .average{ |
| 413 | color: #C0A369; | 413 | color: #C0A369; |
| 414 | min-width: 135rpx; | 414 | min-width: 135rpx; |
| 415 | - margin-left: 120rpx; | 415 | + margin-left: 40rpx; |
| 416 | text-align: right; | 416 | text-align: right; |
| 417 | white-space: nowrap; | 417 | white-space: nowrap; |
| 418 | } | 418 | } |
| @@ -487,6 +487,9 @@ | @@ -487,6 +487,9 @@ | ||
| 487 | .activity-view-easy .discount:last-child{ | 487 | .activity-view-easy .discount:last-child{ |
| 488 | border-right-width: 0; | 488 | border-right-width: 0; |
| 489 | } | 489 | } |
| 490 | +.activity-view-easy-old .activity-right{ | ||
| 491 | + min-width: 100rpx; | ||
| 492 | +} | ||
| 490 | /* 包间预定 */ | 493 | /* 包间预定 */ |
| 491 | .room-booking { | 494 | .room-booking { |
| 492 | width:100%; | 495 | width:100%; |
| @@ -603,6 +606,21 @@ | @@ -603,6 +606,21 @@ | ||
| 603 | right:0; | 606 | right:0; |
| 604 | left:auto; | 607 | left:auto; |
| 605 | } | 608 | } |
| 606 | -.as-phone{ | 609 | +.activityStr{ |
| 610 | + width: calc(100% - 140rpx); | ||
| 611 | + padding-left: 100rpx; | ||
| 612 | + | ||
| 613 | + height: 36rpx; | ||
| 614 | + font-size: 26rpx; | ||
| 615 | + font-family: PingFangSC-Regular, PingFang SC; | ||
| 616 | + font-weight: 400; | ||
| 617 | + color: #353535; | ||
| 618 | + line-height: 36rpx; | ||
| 619 | + margin-top: -30rpx; | ||
| 620 | + margin-bottom: 40rpx; | ||
| 621 | + | ||
| 622 | + white-space:nowrap; | ||
| 623 | + text-overflow: ellipsis; | ||
| 624 | + overflow: hidden; | ||
| 607 | 625 | ||
| 608 | } | 626 | } |
| @@ -621,7 +621,7 @@ | @@ -621,7 +621,7 @@ | ||
| 621 | "id": 71, | 621 | "id": 71, |
| 622 | "name": "pages/reserve/detail", | 622 | "name": "pages/reserve/detail", |
| 623 | "pathName": "pages/reserve/detail", | 623 | "pathName": "pages/reserve/detail", |
| 624 | - "query": "id=4645&_activeTab=reserve&date=2020-02-16&pnum=6", | 624 | + "query": "id=1001&_activeTab=reserve&date=2020-02-16&pnum=6", |
| 625 | "scene": null | 625 | "scene": null |
| 626 | }, | 626 | }, |
| 627 | { | 627 | { |
| @@ -99,4 +99,7 @@ module.exports = { | @@ -99,4 +99,7 @@ module.exports = { | ||
| 99 | toFixed:function(num,limit){ | 99 | toFixed:function(num,limit){ |
| 100 | return parseFloat(num).toFixed(limit) | 100 | return parseFloat(num).toFixed(limit) |
| 101 | }, | 101 | }, |
| 102 | + activityName:function(typeId){ | ||
| 103 | + return ['','满减','满赠','折扣','代金券'][parseInt(typeId)]||'会员价'; | ||
| 104 | + } | ||
| 102 | }; | 105 | }; |
-
Please register or login to post a comment