Authored by 毕凯

添加优惠券搜索

@@ -19,7 +19,14 @@ $('#new-coupon').on('submit', function() { @@ -19,7 +19,14 @@ $('#new-coupon').on('submit', function() {
19 url: '', 19 url: '',
20 data: $(this).serialize() 20 data: $(this).serialize()
21 }).then(function(res) { 21 }).then(function(res) {
22 - 22 + if (res.avaliable) {
  23 + $('#coupon-list').html(conponTmpl({
  24 + coupons: res.coupons
  25 + }));
  26 + $('#coupon-list-not').html('');
  27 + } else {
  28 + tip.show(res.msg);
  29 + }
23 }); 30 });
24 return false; 31 return false;
25 }); 32 });
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 9
10 input { 10 input {
11 padding: 0 pxToRem(12px); 11 padding: 0 pxToRem(12px);
12 - width: pxToRem(380px); 12 + width: pxToRem(384px);
13 height: pxToRem(80px); 13 height: pxToRem(80px);
14 border: 1px solid #b0b0b0; 14 border: 1px solid #b0b0b0;
15 border-radius: .1rem; 15 border-radius: .1rem;
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 18
19 .submit { 19 .submit {
20 margin-left: pxToRem(30px); 20 margin-left: pxToRem(30px);
21 - width: pxToRem(120px); 21 + width: pxToRem(130px);
22 height: pxToRem(80px); 22 height: pxToRem(80px);
23 color: #fff; 23 color: #fff;
24 background: #b0b0b0; 24 background: #b0b0b0;
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="yoho-page select-coupon-page my-coupon-page"> 2 <div class="yoho-page select-coupon-page my-coupon-page">
3 <form id="new-coupon" method="POST" action=""> 3 <form id="new-coupon" method="POST" action="">
4 - <input type="text" name="coupon-code" value="" placeholder="输入优惠券码"> 4 + <input type="text" name="coupon-code" value="" placeholder="输入优惠券码">
5 <button type="submit" class="submit">确定</button> 5 <button type="submit" class="submit">确定</button>
6 </form> 6 </form>
7 <div id="coupon-list" class="coupon-list"></div> 7 <div id="coupon-list" class="coupon-list"></div>