Showing
5 changed files
with
153 additions
and
148 deletions
@@ -34,8 +34,7 @@ var $subNav = $('.home-sub-nav'), | @@ -34,8 +34,7 @@ var $subNav = $('.home-sub-nav'), | ||
34 | appVersion = $('input[name="app_version"]').val(), | 34 | appVersion = $('input[name="app_version"]').val(), |
35 | brand = $('input[name="brand"]').val(), | 35 | brand = $('input[name="brand"]').val(), |
36 | coverChannel = $('input[name="coverChannel"]').val(), | 36 | coverChannel = $('input[name="coverChannel"]').val(), |
37 | - favId = $('input[name="favId"]').val(), | ||
38 | - isCouponClick = true;; | 37 | + favId = $('input[name="favId"]').val(); |
39 | 38 | ||
40 | var winH = $(window).height(), | 39 | var winH = $(window).height(), |
41 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 40 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
@@ -956,44 +955,4 @@ $('#collect').on('touchstart', function(e) { | @@ -956,44 +955,4 @@ $('#collect').on('touchstart', function(e) { | ||
956 | } | 955 | } |
957 | }); | 956 | }); |
958 | 957 | ||
959 | -$(".coupon-content .receive-btn").on('touchstart', function(e) { | ||
960 | - var that = this, | ||
961 | - code = $(this).closest('.coupon-small').data('id') || ''; | ||
962 | - | ||
963 | - if (isCouponClick === false) { | ||
964 | - return false; | ||
965 | - } | ||
966 | - | ||
967 | - isCouponClick = false; | ||
968 | - | ||
969 | - $.ajax({ | ||
970 | - method: 'POST', | ||
971 | - url: '/product/index/userCoupon', | ||
972 | - // url: location.protocol + '//m.yohobuy.com/product/index/userCoupon', | ||
973 | - data: { | ||
974 | - couponID: code | ||
975 | - }, | ||
976 | - xhrFields: { | ||
977 | - withCredentials: true | ||
978 | - }, | ||
979 | - success: function(data) { | ||
980 | - | ||
981 | - isCouponClick = true; | ||
982 | - | ||
983 | - if (data.code === 200) { | ||
984 | - tip.show('领取成功'); | ||
985 | - $(that).addClass('padding-20').html('已领取'); | ||
986 | - $(that).unbind('touchstart');//移除绑定事件 | ||
987 | - return true; | ||
988 | - } else if (data.code === 4401) { | ||
989 | - document.location.href = data.url; | ||
990 | - } else { | ||
991 | - tip.show(data.message); | ||
992 | - } | ||
993 | - }, | ||
994 | - error: function() { | ||
995 | - tip.show('网络断开连接了~'); | ||
996 | - isCouponClick = true; | ||
997 | - } | ||
998 | - }); | ||
999 | -}); | ||
958 | +require('./shop_coupon'); |
static/js/product/shop_coupon.js
0 → 100644
1 | +var $ = require('jquery'), | ||
2 | + tip = require('../plugin/tip'); | ||
3 | + | ||
4 | +var isCouponClick = true; | ||
5 | + | ||
6 | +$(".coupon-content .receive-btn").on('touchstart', function(e) { | ||
7 | + var that = this, | ||
8 | + code = $(this).closest('.coupon-small').data('id') || ''; | ||
9 | + | ||
10 | + if (isCouponClick === false) { | ||
11 | + return false; | ||
12 | + } | ||
13 | + | ||
14 | + isCouponClick = false; | ||
15 | + | ||
16 | + $.ajax({ | ||
17 | + method: 'POST', | ||
18 | + url: '/product/index/userCoupon', | ||
19 | + // url: location.protocol + '//m.yohobuy.com/product/index/userCoupon', | ||
20 | + data: { | ||
21 | + couponID: code | ||
22 | + }, | ||
23 | + xhrFields: { | ||
24 | + withCredentials: true | ||
25 | + }, | ||
26 | + success: function(data) { | ||
27 | + | ||
28 | + isCouponClick = true; | ||
29 | + | ||
30 | + if (data.code === 200) { | ||
31 | + tip.show('领取成功'); | ||
32 | + $(that).addClass('padding-20').html('已领取'); | ||
33 | + $(that).unbind('touchstart');//移除绑定事件 | ||
34 | + return true; | ||
35 | + } else if (data.code === 4401) { | ||
36 | + document.location.href = data.url; | ||
37 | + } else { | ||
38 | + tip.show(data.message); | ||
39 | + } | ||
40 | + }, | ||
41 | + error: function() { | ||
42 | + tip.show('网络断开连接了~'); | ||
43 | + isCouponClick = true; | ||
44 | + } | ||
45 | + }); | ||
46 | +}); |
static/sass/product/_shop-index-coupon.css
0 → 100644
1 | +.coupon-content { | ||
2 | + color: #fff; | ||
3 | + height: 180px; | ||
4 | + overflow: hidden; | ||
5 | + overflow-x: scroll; | ||
6 | + | ||
7 | + .coupon-scroll { | ||
8 | + height: inherit; | ||
9 | + } | ||
10 | + | ||
11 | + .padding-20 { | ||
12 | + padding: 20px 0 !important; | ||
13 | + } | ||
14 | + | ||
15 | + .coupon-big { | ||
16 | + height: 120px; | ||
17 | + width: 580px; | ||
18 | + background: resolve('product/coupon-big.png') no-repeat; | ||
19 | + background-size: 580px 120px; | ||
20 | + margin: 30px; | ||
21 | + | ||
22 | + .coupon-left { | ||
23 | + position: absolute; | ||
24 | + margin-top: 10px; | ||
25 | + } | ||
26 | + | ||
27 | + .coupon-left .coupon-left-price { | ||
28 | + margin: 0 50px; | ||
29 | + } | ||
30 | + | ||
31 | + .coupon-left .coupon-left-price .coupon-sign{ | ||
32 | + font-size: 50px; | ||
33 | + } | ||
34 | + | ||
35 | + .coupon-left .coupon-left-price .coupon-price{ | ||
36 | + font-size: 72px; | ||
37 | + font-weight: bold; | ||
38 | + } | ||
39 | + | ||
40 | + .coupon-left .coupon-left-name { | ||
41 | + font-size: 22px; | ||
42 | + line-height: 35px; | ||
43 | + display: inline-block; | ||
44 | + width: 210px; | ||
45 | + } | ||
46 | + | ||
47 | + .coupon-right { | ||
48 | + width: 20px; | ||
49 | + font-size: 22px; | ||
50 | + right: 58px; | ||
51 | + position: absolute; | ||
52 | + height: inherit; | ||
53 | + line-height: 25px; | ||
54 | + padding: 10px 0; | ||
55 | + } | ||
56 | + } | ||
57 | + | ||
58 | + .coupon-small { | ||
59 | + height: 120px; | ||
60 | + width: 245px; | ||
61 | + background: resolve('product/coupon-small.png') no-repeat; | ||
62 | + background-size: 245px 120px; | ||
63 | + margin: 30px 0 30px 30px; | ||
64 | + position: relative; | ||
65 | + float: left; | ||
66 | + | ||
67 | + .coupon-left { | ||
68 | + position: absolute; | ||
69 | + width: 165px; | ||
70 | + overflow: hidden; | ||
71 | + margin: 0 30px; | ||
72 | + } | ||
73 | + | ||
74 | + .coupon-left .coupon-left-price { | ||
75 | + width: inherit; | ||
76 | + display: inline-block; | ||
77 | + } | ||
78 | + | ||
79 | + .coupon-left .coupon-left-price .coupon-sign{ | ||
80 | + font-size: 42px; | ||
81 | + } | ||
82 | + | ||
83 | + .coupon-left .coupon-left-price .coupon-price{ | ||
84 | + font-size: 52px; | ||
85 | + font-weight: bold; | ||
86 | + } | ||
87 | + | ||
88 | + .coupon-left .coupon-left-name { | ||
89 | + font-size: 18px; | ||
90 | + display: inline-block; | ||
91 | + margin-top: -10px; | ||
92 | + } | ||
93 | + | ||
94 | + .coupon-right { | ||
95 | + width: 20px; | ||
96 | + font-size: 18px; | ||
97 | + right: 17px; | ||
98 | + position: absolute; | ||
99 | + height: inherit; | ||
100 | + line-height: 25px; | ||
101 | + padding: 10px 0; | ||
102 | + } | ||
103 | + } | ||
104 | +} |
@@ -587,111 +587,6 @@ | @@ -587,111 +587,6 @@ | ||
587 | border-top: none!important; | 587 | border-top: none!important; |
588 | } | 588 | } |
589 | 589 | ||
590 | - .coupon-content { | ||
591 | - color: #fff; | ||
592 | - height: 180px; | ||
593 | - overflow: hidden; | ||
594 | - overflow-x: scroll; | ||
595 | - | ||
596 | - .coupon-scroll { | ||
597 | - height: inherit; | ||
598 | - } | ||
599 | - | ||
600 | - .padding-20 { | ||
601 | - padding: 20px 0 !important; | ||
602 | - } | ||
603 | - | ||
604 | - .coupon-big { | ||
605 | - height: 120px; | ||
606 | - width: 580px; | ||
607 | - background: resolve('product/coupon-big.png') no-repeat; | ||
608 | - background-size: 580px 120px; | ||
609 | - margin: 30px; | ||
610 | - | ||
611 | - .coupon-left { | ||
612 | - position: absolute; | ||
613 | - margin-top: 10px; | ||
614 | - } | ||
615 | - | ||
616 | - .coupon-left .coupon-left-price { | ||
617 | - margin: 0 50px; | ||
618 | - } | ||
619 | - | ||
620 | - .coupon-left .coupon-left-price .coupon-sign{ | ||
621 | - font-size: 50px; | ||
622 | - } | ||
623 | - | ||
624 | - .coupon-left .coupon-left-price .coupon-price{ | ||
625 | - font-size: 72px; | ||
626 | - font-weight: bold; | ||
627 | - } | ||
628 | - | ||
629 | - .coupon-left .coupon-left-name { | ||
630 | - font-size: 22px; | ||
631 | - line-height: 35px; | ||
632 | - display: inline-block; | ||
633 | - width: 210px; | ||
634 | - } | ||
635 | - | ||
636 | - .coupon-right { | ||
637 | - width: 20px; | ||
638 | - font-size: 22px; | ||
639 | - right: 58px; | ||
640 | - position: absolute; | ||
641 | - height: inherit; | ||
642 | - line-height: 25px; | ||
643 | - padding: 10px 0; | ||
644 | - } | ||
645 | - } | ||
646 | - | ||
647 | - .coupon-small { | ||
648 | - height: 120px; | ||
649 | - width: 245px; | ||
650 | - background: resolve('product/coupon-small.png') no-repeat; | ||
651 | - background-size: 245px 120px; | ||
652 | - margin: 30px 0 30px 30px; | ||
653 | - position: relative; | ||
654 | - float: left; | ||
655 | - | ||
656 | - .coupon-left { | ||
657 | - position: absolute; | ||
658 | - width: 165px; | ||
659 | - overflow: hidden; | ||
660 | - margin: 0 30px; | ||
661 | - } | ||
662 | - | ||
663 | - .coupon-left .coupon-left-price { | ||
664 | - width: inherit; | ||
665 | - display: inline-block; | ||
666 | - } | ||
667 | - | ||
668 | - .coupon-left .coupon-left-price .coupon-sign{ | ||
669 | - font-size: 42px; | ||
670 | - } | ||
671 | - | ||
672 | - .coupon-left .coupon-left-price .coupon-price{ | ||
673 | - font-size: 52px; | ||
674 | - font-weight: bold; | ||
675 | - } | ||
676 | - | ||
677 | - .coupon-left .coupon-left-name { | ||
678 | - font-size: 18px; | ||
679 | - display: inline-block; | ||
680 | - margin-top: -10px; | ||
681 | - } | ||
682 | - | ||
683 | - .coupon-right { | ||
684 | - width: 20px; | ||
685 | - font-size: 18px; | ||
686 | - right: 17px; | ||
687 | - position: absolute; | ||
688 | - height: inherit; | ||
689 | - line-height: 25px; | ||
690 | - padding: 10px 0; | ||
691 | - } | ||
692 | - } | ||
693 | - } | ||
694 | - | ||
695 | } | 590 | } |
696 | 591 | ||
697 | .shop-index + .filter-mask { | 592 | .shop-index + .filter-mask { |
-
Please register or login to post a comment