Showing
3 changed files
with
63 additions
and
62 deletions
@@ -2,13 +2,13 @@ | @@ -2,13 +2,13 @@ | ||
2 | * Created by Administrator on 2016/4/13. | 2 | * Created by Administrator on 2016/4/13. |
3 | */ | 3 | */ |
4 | var $ = require('jquery'); | 4 | var $ = require('jquery'); |
5 | -var $receive = $('.coupon-right-reBox'); | ||
6 | -var $mask = $('.coupon-mask'); | ||
7 | -var $message = $('.coupon-message'); | ||
8 | -var $tooltip = $('.coupon-tooltip'); | ||
9 | -var $right = $('.coupon-right-reBox'); | 5 | +var $receive = $('.main-right-receive'); |
6 | +var $mask = $('.floor-mask'); | ||
7 | +var $message = $('.floor-message'); | ||
8 | +var $tooltip = $('.floor-tooltip'); | ||
10 | 9 | ||
11 | -$receive.on('touchend',function(){console.log('s'); | 10 | +$receive.on('touchend',function(){ |
11 | + var curDom=$(this); | ||
12 | $.ajax({ | 12 | $.ajax({ |
13 | url:'/coupon/receiveCoupon', | 13 | url:'/coupon/receiveCoupon', |
14 | dataType:'json', | 14 | dataType:'json', |
@@ -17,8 +17,9 @@ $receive.on('touchend',function(){console.log('s'); | @@ -17,8 +17,9 @@ $receive.on('touchend',function(){console.log('s'); | ||
17 | var msg=data.msg; | 17 | var msg=data.msg; |
18 | var status=data.status; | 18 | var status=data.status; |
19 | if(!status){ | 19 | if(!status){ |
20 | + curDom.hide(); | ||
21 | + curDom.next().show(); | ||
20 | $tooltip.show(); | 22 | $tooltip.show(); |
21 | - $right.css({"background":"url('http://static.dev.yohobuy.com/img/test/received.png')","background-repeat:":"no-repeat","background-size":"100%"}); | ||
22 | setTimeout(function(){ | 23 | setTimeout(function(){ |
23 | $tooltip.hide(); | 24 | $tooltip.hide(); |
24 | },3000); | 25 | },3000); |
@@ -33,4 +34,10 @@ $receive.on('touchend',function(){console.log('s'); | @@ -33,4 +34,10 @@ $receive.on('touchend',function(){console.log('s'); | ||
33 | }, | 34 | }, |
34 | error:function(){} | 35 | error:function(){} |
35 | }); | 36 | }); |
36 | -}); | ||
37 | +}); | ||
38 | + | ||
39 | +$('.coupon-floor a').on('click', function () { | ||
40 | + if($(this).attr('href').length <= 0) { | ||
41 | + return false; | ||
42 | + } | ||
43 | +}) |
1 | .coupon-floor { | 1 | .coupon-floor { |
2 | float: left; | 2 | float: left; |
3 | 3 | ||
4 | - .coupon-title { | 4 | + .floor-title { |
5 | background-color: #fff; | 5 | background-color: #fff; |
6 | text-align: center; | 6 | text-align: center; |
7 | height: 96rem/$pxConvertRem; | 7 | height: 96rem/$pxConvertRem; |
@@ -9,44 +9,41 @@ | @@ -9,44 +9,41 @@ | ||
9 | font-size: 30rem / $pxConvertRem; | 9 | font-size: 30rem / $pxConvertRem; |
10 | } | 10 | } |
11 | 11 | ||
12 | - .coupon-box { | 12 | + .floor-main { |
13 | height: 180rem /$pxConvertRem; | 13 | height: 180rem /$pxConvertRem; |
14 | width: 100%; | 14 | width: 100%; |
15 | background-size: 100%; | 15 | background-size: 100%; |
16 | background-repeat: no-repeat; | 16 | background-repeat: no-repeat; |
17 | + background-image: url('http://static.dev.yohobuy.com/img/test/coupon.png'); | ||
17 | float: left; | 18 | float: left; |
18 | 19 | ||
19 | - .coupon-left { | ||
20 | - float: left; | ||
21 | - width: 497rem/$pxConvertRem; | ||
22 | - height: 180rem/$pxConvertRem; | ||
23 | - } | 20 | + .main-left { |
21 | + float: left; | ||
22 | + width: 497rem/$pxConvertRem; | ||
23 | + height: 180rem/$pxConvertRem; | ||
24 | + } | ||
24 | 25 | ||
25 | - .coupon-right { | ||
26 | - float: left; | ||
27 | - width: 143rem/$pxConvertRem; | ||
28 | - text-align: center; | ||
29 | - height: 180rem/$pxConvertRem; | ||
30 | - background-size: 100%; | ||
31 | - background-repeat: no-repeat; | ||
32 | - // background: url("http://static.dev.yohobuy.com/img/test/received.png"); | 26 | + .main-right-receive { |
27 | + float: left; | ||
28 | + width: 143rem/$pxConvertRem; | ||
29 | + height: 180rem/$pxConvertRem; | ||
30 | + background-size: 100%; | ||
31 | + background-repeat: no-repeat; | ||
32 | + } | ||
33 | 33 | ||
34 | - .coupon-right-reBox { | ||
35 | - height: 100%; | ||
36 | - width: 100%; | ||
37 | - color:#fff; | ||
38 | - } | 34 | + .main-right-use { |
35 | + @extend .main-right-receive; | ||
36 | + background-image: url('http://static.dev.yohobuy.com/img/test/received.png'); | ||
37 | + } | ||
39 | 38 | ||
40 | - .coupon-right-goBox { | ||
41 | - height: 100%; | ||
42 | - width: 100%; | ||
43 | - color:#fff; | ||
44 | - } | ||
45 | - } | 39 | + .main-right-go { |
40 | + @extend .main-right-receive; | ||
41 | + background-image: url("http://static.dev.yohobuy.com/img/test/zero.png"); | ||
42 | + } | ||
46 | } | 43 | } |
47 | } | 44 | } |
48 | 45 | ||
49 | -.coupon-mask { | 46 | +.floor-mask { |
50 | position: absolute; | 47 | position: absolute; |
51 | top: 0; | 48 | top: 0; |
52 | left: 0; | 49 | left: 0; |
@@ -57,7 +54,7 @@ | @@ -57,7 +54,7 @@ | ||
57 | z-index: 9; | 54 | z-index: 9; |
58 | } | 55 | } |
59 | 56 | ||
60 | -.coupon-message { | 57 | +.floor-message { |
61 | position: fixed; | 58 | position: fixed; |
62 | top: 50%; | 59 | top: 50%; |
63 | left: 50%; | 60 | left: 50%; |
@@ -87,7 +84,7 @@ | @@ -87,7 +84,7 @@ | ||
87 | } | 84 | } |
88 | } | 85 | } |
89 | 86 | ||
90 | -.coupon-tooltip{ | 87 | +.floor-tooltip{ |
91 | position: fixed; | 88 | position: fixed; |
92 | top: 50%; | 89 | top: 50%; |
93 | left: 50%; | 90 | left: 50%; |
1 | {{>layout/header}} | 1 | {{>layout/header}} |
2 | {{# floor}} | 2 | {{# floor}} |
3 | {{#if isCoupon}} | 3 | {{#if isCoupon}} |
4 | - {{# list}} | 4 | + {{#each list}} |
5 | <div class="coupon-floor"> | 5 | <div class="coupon-floor"> |
6 | {{#if title}} | 6 | {{#if title}} |
7 | - <div class="coupon-title">{{title}} | 7 | + <div class="floor-title">{{title}} |
8 | </div> | 8 | </div> |
9 | {{/if}} | 9 | {{/if}} |
10 | - <div class="coupon-box" style="background-image: url('http://static.dev.yohobuy.com/img/test/coupon.png')"> | ||
11 | - {{#if image.src}} | 10 | + <div class="floor-main"> |
12 | <a href="{{goShopping}}"> | 11 | <a href="{{goShopping}}"> |
13 | - <div class="coupon-left"></div> | 12 | + <div class="main-left"></div> |
13 | + </a> | ||
14 | + {{#if isGet}} | ||
15 | + <div class="main-right-receive"></div> | ||
16 | + <a href="{{goShopping}}" style="display: none"> | ||
17 | + <div class="main-right-use"></div> | ||
18 | + </a> | ||
19 | + {{/if}} | ||
20 | + {{#if isGeted}} | ||
21 | + <a href="{{goShopping}}"> | ||
22 | + <div class="main-right-use"></div> | ||
23 | + </a> | ||
24 | + {{/if}} | ||
25 | + {{#if isZero}} | ||
26 | + <a href="{{goShopping}}"> | ||
27 | + <div class="main-right-go"></div> | ||
14 | </a> | 28 | </a> |
15 | - {{^}} | ||
16 | - <div class="coupon-left"></div> | ||
17 | {{/if}} | 29 | {{/if}} |
18 | - <div class="coupon-right"> | ||
19 | - {{#if isGet}} | ||
20 | - <div class="coupon-right-reBox"></div> | ||
21 | - {{/if}} | ||
22 | - {{#if isGeted}} | ||
23 | - <a href="{{goShopping}}"> | ||
24 | - <div class="coupon-right-goBox"></div> | ||
25 | - </a> | ||
26 | - {{/if}} | ||
27 | - {{#if isZero}} | ||
28 | - <a href="{{goShopping}}"> | ||
29 | - <div style="height: 100%;width:100%" class="coupon-right-goBox"></div> | ||
30 | - </a> | ||
31 | - {{/if}} | ||
32 | - </div> | ||
33 | </div> | 30 | </div> |
34 | </div> | 31 | </div> |
35 | {{/ list}} | 32 | {{/ list}} |
36 | {{/if}} | 33 | {{/if}} |
37 | {{/ floor}} | 34 | {{/ floor}} |
38 | -<div class="coupon-mask"></div> | ||
39 | -<div class="coupon-message"> | 35 | +<div class="floor-mask"></div> |
36 | +<div class="floor-message"> | ||
40 | <div class="coupon-message-content"></div> | 37 | <div class="coupon-message-content"></div> |
41 | <div class="coupon-message-op"> | 38 | <div class="coupon-message-op"> |
42 | <a href="http://m.dev.yohobuy.com/coupon/floor"> | 39 | <a href="http://m.dev.yohobuy.com/coupon/floor"> |
@@ -44,7 +41,7 @@ | @@ -44,7 +41,7 @@ | ||
44 | </a> | 41 | </a> |
45 | </div> | 42 | </div> |
46 | </div> | 43 | </div> |
47 | -<div class="coupon-tooltip"> | 44 | +<div class="floor-tooltip"> |
48 | <div class="iconfont icon-box"></div> | 45 | <div class="iconfont icon-box"></div> |
49 | <div class="icon-msg">领取成功</div> | 46 | <div class="icon-msg">领取成功</div> |
50 | </div> | 47 | </div> |
-
Please register or login to post a comment