Showing
5 changed files
with
53 additions
and
5 deletions
| @@ -17,13 +17,14 @@ Component({ | @@ -17,13 +17,14 @@ Component({ | ||
| 17 | */ | 17 | */ |
| 18 | data: { | 18 | data: { |
| 19 | disp:false, | 19 | disp:false, |
| 20 | + animation:'', | ||
| 20 | background:[{ | 21 | background:[{ |
| 21 | url:'http://nosqn.colorcun.com/boots/1.png', | 22 | url:'http://nosqn.colorcun.com/boots/1.png', |
| 22 | txt:'1.戳选地图上的商家,开始预订', | 23 | txt:'1.戳选地图上的商家,开始预订', |
| 23 | },{ | 24 | },{ |
| 24 | url:'http://nosqn.colorcun.com/boots/3.png', | 25 | url:'http://nosqn.colorcun.com/boots/3.png', |
| 25 | txt:'2.搜索商家或位置,开始预订', | 26 | txt:'2.搜索商家或位置,开始预订', |
| 26 | - }] | 27 | + }], |
| 27 | }, | 28 | }, |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| @@ -37,6 +38,11 @@ Component({ | @@ -37,6 +38,11 @@ Component({ | ||
| 37 | this.setData({ | 38 | this.setData({ |
| 38 | disp:true, | 39 | disp:true, |
| 39 | }) | 40 | }) |
| 41 | + setTimeout(()=>{ | ||
| 42 | + this.setData({ | ||
| 43 | + animation:'discountShow', | ||
| 44 | + }) | ||
| 45 | + },300) | ||
| 40 | this.triggerEvent('event',{act:'show',txt:'新用户'}) | 46 | this.triggerEvent('event',{act:'show',txt:'新用户'}) |
| 41 | //wx.setStorage({key:cacheKey, data:new Date().toISOString()}) | 47 | //wx.setStorage({key:cacheKey, data:new Date().toISOString()}) |
| 42 | }, | 48 | }, |
| @@ -47,9 +53,29 @@ Component({ | @@ -47,9 +53,29 @@ Component({ | ||
| 47 | }, | 53 | }, |
| 48 | hide(){ | 54 | hide(){ |
| 49 | this.setData({ | 55 | this.setData({ |
| 50 | - disp:false, | 56 | + animation:'discountHide', |
| 51 | }) | 57 | }) |
| 52 | this.triggerEvent('event',{act:'hide',txt:'新用户'}) | 58 | this.triggerEvent('event',{act:'hide',txt:'新用户'}) |
| 59 | + setTimeout(()=>{ | ||
| 60 | + this.setData({ | ||
| 61 | + disp:false, | ||
| 62 | + }) | ||
| 63 | + },300) | ||
| 64 | + }, | ||
| 65 | + hasGoto:false, | ||
| 66 | + bindtransition(e){ | ||
| 67 | + console.log(e) | ||
| 68 | + if('change'==e.type){ | ||
| 69 | + this.hasGoto=false | ||
| 70 | + } | ||
| 71 | + if('animationfinish'==e.type){ | ||
| 72 | + if(this.hasGoto && (e.detail.current+1)==2){ | ||
| 73 | + this.hide() | ||
| 74 | + return; | ||
| 75 | + }else{ | ||
| 76 | + this.hasGoto=true | ||
| 77 | + } | ||
| 78 | + } | ||
| 53 | }, | 79 | }, |
| 54 | } | 80 | } |
| 55 | }) | 81 | }) |
| 1 | <!--components/tips/boost.wxml--> | 1 | <!--components/tips/boost.wxml--> |
| 2 | <view class="mask" bindtap="hide" wx:if="{{disp}}" style="z-index: 99999"> | 2 | <view class="mask" bindtap="hide" wx:if="{{disp}}" style="z-index: 99999"> |
| 3 | - <view class="boost" catchtap="catchtap"> | 3 | + <view class="boost {{animation}}" catchtap="catchtap" wx:if="{{animation}}"> |
| 4 | <view class="header flex-lr" bindtap="hide"> | 4 | <view class="header flex-lr" bindtap="hide"> |
| 5 | <view> </view> | 5 | <view> </view> |
| 6 | <view class="title">操作指引</view> | 6 | <view class="title">操作指引</view> |
| 7 | <view class="close"></view> | 7 | <view class="close"></view> |
| 8 | </view> | 8 | </view> |
| 9 | <view class="content"> | 9 | <view class="content"> |
| 10 | - <swiper indicator-dots style="height:496rpx;"> | 10 | + <swiper indicator-dots |
| 11 | + bindchange="bindtransition" bindanimationfinish="bindtransition" | ||
| 12 | + style="height:496rpx;"> | ||
| 11 | <block wx:for="{{background}}" wx:key="*this"> | 13 | <block wx:for="{{background}}" wx:key="*this"> |
| 12 | <swiper-item style="text-align: center"> | 14 | <swiper-item style="text-align: center"> |
| 13 | <image src="{{item.url}}" class="swiper-image"></image> | 15 | <image src="{{item.url}}" class="swiper-image"></image> |
| 1 | /* components/tips/boost.wxss */ | 1 | /* components/tips/boost.wxss */ |
| 2 | @import "../../app.wxss"; | 2 | @import "../../app.wxss"; |
| 3 | +@keyframes discountShow | ||
| 4 | +{ | ||
| 5 | + from {bottom: -738rpx;} | ||
| 6 | + to {bottom: 0rpx;} | ||
| 7 | +} | ||
| 8 | +@keyframes discountHide | ||
| 9 | +{ | ||
| 10 | + from {bottom: 0rpx;} | ||
| 11 | + to {bottom: -738rpx;} | ||
| 12 | +} | ||
| 3 | .boost{ | 13 | .boost{ |
| 4 | width:100%; | 14 | width:100%; |
| 5 | height:738rpx; | 15 | height:738rpx; |
| @@ -10,6 +20,13 @@ | @@ -10,6 +20,13 @@ | ||
| 10 | position: fixed; | 20 | position: fixed; |
| 11 | bottom: 0; | 21 | bottom: 0; |
| 12 | } | 22 | } |
| 23 | +.boost.discountShow{ | ||
| 24 | + animation: discountShow 0.6s; | ||
| 25 | +} | ||
| 26 | +.boost.discountHide{ | ||
| 27 | + animation: discountHide 0.6s; | ||
| 28 | + bottom: -738rpx; | ||
| 29 | +} | ||
| 13 | .title{ | 30 | .title{ |
| 14 | height:42rpx; | 31 | height:42rpx; |
| 15 | font-size:30rpx; | 32 | font-size:30rpx; |
| @@ -351,6 +351,9 @@ Page({ | @@ -351,6 +351,9 @@ Page({ | ||
| 351 | //this.timeoutGetMarkers(); | 351 | //this.timeoutGetMarkers(); |
| 352 | }, | 352 | }, |
| 353 | }) | 353 | }) |
| 354 | + this.setData({ | ||
| 355 | + hasBoost:true, | ||
| 356 | + }) | ||
| 354 | }, | 357 | }, |
| 355 | hasMarkertap:false, | 358 | hasMarkertap:false, |
| 356 | markertap(e,flag=true){ | 359 | markertap(e,flag=true){ |
| @@ -143,4 +143,4 @@ | @@ -143,4 +143,4 @@ | ||
| 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"></boost> | ||
| 146 | +<boost bindevent="boostEvent" wx:if="{{hasBoost}}"></boost> |
-
Please register or login to post a comment