Authored by lijing

修改图片,增加410,411,错误提示

@@ -55,10 +55,17 @@ const _getBirthCouponById = (uid) => { @@ -55,10 +55,17 @@ const _getBirthCouponById = (uid) => {
55 uid: uid, 55 uid: uid,
56 couponType: 4, 56 couponType: 4,
57 }).then(result => { 57 }).then(result => {
  58 + console.log(result.code);
58 if (result && result.data) { 59 if (result && result.data) {
59 return result.data; 60 return result.data;
60 } else { 61 } else {
61 - return []; 62 + if (result.code === 410) {
  63 + return [{err: result.message}];
  64 + } else if (result.code === 411) {
  65 + return [{err: result.message}];
  66 + } else {
  67 + return [];
  68 + }
62 } 69 }
63 }); 70 });
64 }; 71 };
@@ -89,15 +96,21 @@ const _detail = (result, id, couponData) => { @@ -89,15 +96,21 @@ const _detail = (result, id, couponData) => {
89 }; 96 };
90 97
91 } else { 98 } else {
92 - for (let coupon of couponData) {  
93 - final.ticket.push({  
94 - id: coupon.id ? coupon.id : '',  
95 - couponAmount: coupon.couponAmount,  
96 - couponName: coupon.couponName.split('-')[0],  
97 - startTime: _formatDay(coupon.startTime),  
98 - endTime: _formatDay(coupon.endTime),  
99 - useLimit: coupon.useLimit  
100 - }); 99 + if (couponData && !couponData[0].err) {
  100 + for (let coupon of couponData) {
  101 + final.ticket.push({
  102 + id: coupon.id ? coupon.id : '',
  103 + couponAmount: coupon.couponAmount,
  104 + couponName: coupon.couponName.split('-')[0],
  105 + startTime: _formatDay(coupon.startTime),
  106 + endTime: _formatDay(coupon.endTime),
  107 + useLimit: coupon.useLimit
  108 + });
  109 + }
  110 + } else {
  111 + final = {
  112 + err: couponData[0].err
  113 + };
101 } 114 }
102 } 115 }
103 116
1 <div class="massage-page yoho-page"> 1 <div class="massage-page yoho-page">
2 {{#info}} 2 {{#info}}
3 - {{#if birthType}} 3 + {{#if err}}
  4 + <div class="err">{{err}}</div>
  5 + {{else if birthType}}
4 <div class="birth-type-c"> 6 <div class="birth-type-c">
5 <div class="title">以下优惠券任选其一</span></div> 7 <div class="title">以下优惠券任选其一</span></div>
6 <div class="ticket-list"> 8 <div class="ticket-list">

130 KB | W: | H:

130 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
1 .massage-page { 1 .massage-page {
2 margin-top: 16px; 2 margin-top: 16px;
3 padding-bottom: 24px; 3 padding-bottom: 24px;
  4 + .err {
  5 + text-align: center;
  6 + line-height: 40px;
  7 + font-size: 30px;
  8 + margin-top: 200px;
  9 + }
4 10
5 .massage-list { 11 .massage-list {
6 padding: 12px 100px 12px 24px; 12 padding: 12px 100px 12px 24px;