Authored by 毕凯

新优惠券 提交按钮变色

... ... @@ -16,11 +16,12 @@ var page = 1,
isGetData;
var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()),
conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html());
conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()),
$newCoupon = $('#new-coupon');
ellipsis.init();
$('#search-coupon').on('submit', function() {
$newCoupon.on('submit', function() {
$.ajax({
method: 'POST',
url: '/shoppingCart/coupon',
... ... @@ -43,6 +44,14 @@ $('#coupon-list').on('touchend', 'employ-main', function() {
orderInfo('couponCode', $(this).data('coupon-code'));
});
$newCoupon.find('input').on('input', function() {
if ($(this).val() !== '') {
$newCoupon.find('.submit').css('background', '#444');
} else {
$newCoupon.find('.submit').css('background', '#b0b0b0');
}
});
function getCouponHandle(coupons) {
var notAvailableCoupons = [];
... ...
... ... @@ -2,7 +2,7 @@
margin-top: pxToRem(30px);
margin-bottom: pxToRem(30px);
#search-coupon {
#new-coupon {
margin-bottom: pxToRem(30px);
padding-left: pxToRem(30px);
padding-right: pxToRem(30px);
... ...
{{> layout/header}}
<div class="yoho-page select-coupon-page my-coupon-page">
<form id="search-coupon" method="POST" action="">
<form id="new-coupon" method="POST" action="">
<input type="text" name="couponCode" value="" placeholder="输入优惠券码">
<button type="submit" class="submit">确定</button>
</form>
... ...