Authored by 毕凯

增加发票

... ... @@ -40,3 +40,14 @@ $('.checkbox').on('touchstart', function() {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
});
$('.invoice').on('touchend', '.checkbox', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
$('.invoice').addClass('focus');
}
if ($this.hasClass('icon-checkbox')) {
$('.invoice').removeClass('focus');
}
});
... ...
... ... @@ -31,28 +31,7 @@ $('#search-coupon').on('submit', function() {
return false;
});
function getCouponDate() {
if (!canGetCoupon) {
return;
}
if (isGetData) {
return;
}
loading.showLoadingMask();
page += 1;
isGetData = true;
$.ajax({
type: 'POST',
url: '/home/couponData',
dataType: 'html',
data: {
statuss: status,
page: page
}
}).then(function(coupons) {
function getCouponHandle(coupons) {
var notAvailableCoupons = [];
// 后端需要返回一个 coupons 列表,如下
... ... @@ -109,7 +88,30 @@ function getCouponDate() {
notAvailableCoupons: notAvailableCoupons
}));
window.rePosFooter();
}).fail(function() {
}
function getCouponDate() {
if (!canGetCoupon) {
return;
}
if (isGetData) {
return;
}
loading.showLoadingMask();
page += 1;
isGetData = true;
$.ajax({
type: 'POST',
url: '/home/couponData',
dataType: 'html',
data: {
statuss: status,
page: page
}
}).then(getCouponHandle).fail(function() {
page -= 1;
tip.show('加载优惠券失败');
}).always(function() {
... ...
... ... @@ -85,6 +85,7 @@
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
border-bottom: 1px solid #f7f7f7;
overflow: hidden;
a {
display: block;
... ... @@ -120,15 +121,48 @@
color: #ccc;
}
.invoice .checkbox {
.invoice {
.checkbox {
float: right;
}
&.focus {
height: auto;
}
}
.desc {
color: #999;
}
}
#invoice {
input {
width: 100%;
height: pxToRem(90px);
outline: 0;
border: 0;
border-top: 1px solid #f7f7f7;
border-bottom: 1px solid #f7f7f7;
}
label {
position: relative;
width: 100%;
height: pxToRem(90px);
border-bottom: 1px solid #f7f7f7;
}
select {
position: relative;
float: right;
width: 40%;
height: pxToRem(50px);
top: pxToRem(20px);
border: 1px solid #f7f7f7;
}
}
.total {
font-size: 22rem / $pxConvertRem;
margin-top: 20rem / $pxConvertRem;
... ...
... ... @@ -2,7 +2,7 @@
margin-top: pxToRem(30px);
margin-bottom: pxToRem(30px);
#new-coupon {
#search-coupon {
margin-bottom: pxToRem(30px);
padding-left: pxToRem(30px);
padding-right: pxToRem(30px);
... ...
... ... @@ -82,6 +82,16 @@
<li class="invoice">
<span class="title">发票</span>
<span class="iconfont checkbox icon-checkbox"></span>
<form id="invoice">
<input type="text" name="invoice-title" value="" placeholder="发票抬头">
<label>
发票类型
<select class="invoice-type" name="invoice-type">
<option value ="A">服装</option>
<option value ="B">图书</option>
</select>
</label>
</form>
</li>
{{/ invoice}}
</ul>
... ...
{{> layout/header}}
<div class="yoho-page select-coupon-page my-coupon-page">
<form id="new-coupon" method="POST" action="">
<form id="search-coupon" method="POST" action="">
<input type="text" name="coupon-code" value="" placeholder="输入优惠券码">
<button type="submit" class="submit">确定</button>
</form>
... ...