Authored by 郝肖肖

店铺优惠券分离

... ... @@ -34,8 +34,7 @@ var $subNav = $('.home-sub-nav'),
appVersion = $('input[name="app_version"]').val(),
brand = $('input[name="brand"]').val(),
coverChannel = $('input[name="coverChannel"]').val(),
favId = $('input[name="favId"]').val(),
isCouponClick = true;;
favId = $('input[name="favId"]').val();
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
... ... @@ -956,44 +955,4 @@ $('#collect').on('touchstart', function(e) {
}
});
$(".coupon-content .receive-btn").on('touchstart', function(e) {
var that = this,
code = $(this).closest('.coupon-small').data('id') || '';
if (isCouponClick === false) {
return false;
}
isCouponClick = false;
$.ajax({
method: 'POST',
url: '/product/index/userCoupon',
// url: location.protocol + '//m.yohobuy.com/product/index/userCoupon',
data: {
couponID: code
},
xhrFields: {
withCredentials: true
},
success: function(data) {
isCouponClick = true;
if (data.code === 200) {
tip.show('领取成功');
$(that).addClass('padding-20').html('已领取');
$(that).unbind('touchstart');//移除绑定事件
return true;
} else if (data.code === 4401) {
document.location.href = data.url;
} else {
tip.show(data.message);
}
},
error: function() {
tip.show('网络断开连接了~');
isCouponClick = true;
}
});
});
\ No newline at end of file
require('./shop_coupon');
\ No newline at end of file
... ...
var $ = require('jquery'),
tip = require('../plugin/tip');
var isCouponClick = true;
$(".coupon-content .receive-btn").on('touchstart', function(e) {
var that = this,
code = $(this).closest('.coupon-small').data('id') || '';
if (isCouponClick === false) {
return false;
}
isCouponClick = false;
$.ajax({
method: 'POST',
url: '/product/index/userCoupon',
// url: location.protocol + '//m.yohobuy.com/product/index/userCoupon',
data: {
couponID: code
},
xhrFields: {
withCredentials: true
},
success: function(data) {
isCouponClick = true;
if (data.code === 200) {
tip.show('领取成功');
$(that).addClass('padding-20').html('已领取');
$(that).unbind('touchstart');//移除绑定事件
return true;
} else if (data.code === 4401) {
document.location.href = data.url;
} else {
tip.show(data.message);
}
},
error: function() {
tip.show('网络断开连接了~');
isCouponClick = true;
}
});
});
\ No newline at end of file
... ...
... ... @@ -9,5 +9,6 @@
@import "limit-help";
@import "shop-index";
@import "shop-index-coupon";
@import "shop-prodfile";
@import "product-category";
... ...
.coupon-content {
color: #fff;
height: 180px;
overflow: hidden;
overflow-x: scroll;
.coupon-scroll {
height: inherit;
}
.padding-20 {
padding: 20px 0 !important;
}
.coupon-big {
height: 120px;
width: 580px;
background: resolve('product/coupon-big.png') no-repeat;
background-size: 580px 120px;
margin: 30px;
.coupon-left {
position: absolute;
margin-top: 10px;
}
.coupon-left .coupon-left-price {
margin: 0 50px;
}
.coupon-left .coupon-left-price .coupon-sign{
font-size: 50px;
}
.coupon-left .coupon-left-price .coupon-price{
font-size: 72px;
font-weight: bold;
}
.coupon-left .coupon-left-name {
font-size: 22px;
line-height: 35px;
display: inline-block;
width: 210px;
}
.coupon-right {
width: 20px;
font-size: 22px;
right: 58px;
position: absolute;
height: inherit;
line-height: 25px;
padding: 10px 0;
}
}
.coupon-small {
height: 120px;
width: 245px;
background: resolve('product/coupon-small.png') no-repeat;
background-size: 245px 120px;
margin: 30px 0 30px 30px;
position: relative;
float: left;
.coupon-left {
position: absolute;
width: 165px;
overflow: hidden;
margin: 0 30px;
}
.coupon-left .coupon-left-price {
width: inherit;
display: inline-block;
}
.coupon-left .coupon-left-price .coupon-sign{
font-size: 42px;
}
.coupon-left .coupon-left-price .coupon-price{
font-size: 52px;
font-weight: bold;
}
.coupon-left .coupon-left-name {
font-size: 18px;
display: inline-block;
margin-top: -10px;
}
.coupon-right {
width: 20px;
font-size: 18px;
right: 17px;
position: absolute;
height: inherit;
line-height: 25px;
padding: 10px 0;
}
}
}
\ No newline at end of file
... ...
... ... @@ -587,111 +587,6 @@
border-top: none!important;
}
.coupon-content {
color: #fff;
height: 180px;
overflow: hidden;
overflow-x: scroll;
.coupon-scroll {
height: inherit;
}
.padding-20 {
padding: 20px 0 !important;
}
.coupon-big {
height: 120px;
width: 580px;
background: resolve('product/coupon-big.png') no-repeat;
background-size: 580px 120px;
margin: 30px;
.coupon-left {
position: absolute;
margin-top: 10px;
}
.coupon-left .coupon-left-price {
margin: 0 50px;
}
.coupon-left .coupon-left-price .coupon-sign{
font-size: 50px;
}
.coupon-left .coupon-left-price .coupon-price{
font-size: 72px;
font-weight: bold;
}
.coupon-left .coupon-left-name {
font-size: 22px;
line-height: 35px;
display: inline-block;
width: 210px;
}
.coupon-right {
width: 20px;
font-size: 22px;
right: 58px;
position: absolute;
height: inherit;
line-height: 25px;
padding: 10px 0;
}
}
.coupon-small {
height: 120px;
width: 245px;
background: resolve('product/coupon-small.png') no-repeat;
background-size: 245px 120px;
margin: 30px 0 30px 30px;
position: relative;
float: left;
.coupon-left {
position: absolute;
width: 165px;
overflow: hidden;
margin: 0 30px;
}
.coupon-left .coupon-left-price {
width: inherit;
display: inline-block;
}
.coupon-left .coupon-left-price .coupon-sign{
font-size: 42px;
}
.coupon-left .coupon-left-price .coupon-price{
font-size: 52px;
font-weight: bold;
}
.coupon-left .coupon-left-name {
font-size: 18px;
display: inline-block;
margin-top: -10px;
}
.coupon-right {
width: 20px;
font-size: 18px;
right: 17px;
position: absolute;
height: inherit;
line-height: 25px;
padding: 10px 0;
}
}
}
}
.shop-index + .filter-mask {
... ...