Authored by 郝肖肖

'立即购买错误提示'

@@ -90,7 +90,11 @@ class BuyNowController { @@ -90,7 +90,11 @@ class BuyNowController {
90 let mobile = _.get(userProfile, 'data.mobile', ''); 90 let mobile = _.get(userProfile, 'data.mobile', '');
91 let orderAddress = _.get(result, 'address', []); 91 let orderAddress = _.get(result, 'address', []);
92 let addressList = _.get(address, 'data', []); 92 let addressList = _.get(address, 'data', []);
  93 + let orderEnsure = {};
93 94
  95 + if (result.code !== 200 && result.message) {
  96 + orderEnsure = {message: result.message};
  97 + } else {
94 orderAddress.length && _.forEach(addressList, address => { //eslint-disable-line 98 orderAddress.length && _.forEach(addressList, address => { //eslint-disable-line
95 if (address.address_id === orderAddress.address_id) { 99 if (address.address_id === orderAddress.address_id) {
96 mobile = address.mobile; 100 mobile = address.mobile;
@@ -105,7 +109,7 @@ class BuyNowController { @@ -105,7 +109,7 @@ class BuyNowController {
105 orderInfo.yohoCoin = orderInfo.use_yoho_coin; 109 orderInfo.yohoCoin = orderInfo.use_yoho_coin;
106 orderInfo.paymentType = orderInfo.payment_type; 110 orderInfo.paymentType = orderInfo.payment_type;
107 111
108 - let orderEnsure = _.assign( 112 + orderEnsure = _.assign(
109 paymentProcess.tranformPayment(_.get(result, 'data', {}), orderInfo, null, null, computeData.data), 113 paymentProcess.tranformPayment(_.get(result, 'data', {}), orderInfo, null, null, computeData.data),
110 { 114 {
111 coupon: paymentProcess.coupon( 115 coupon: paymentProcess.coupon(
@@ -129,6 +133,7 @@ class BuyNowController { @@ -129,6 +133,7 @@ class BuyNowController {
129 }) 133 })
130 } 134 }
131 ); 135 );
  136 + }
132 137
133 return res.render('buynow/order-ensure', { 138 return res.render('buynow/order-ensure', {
134 pageHeader: headerModel.setNav({ 139 pageHeader: headerModel.setNav({
1 <div class="order-ensure-page yoho-page"> 1 <div class="order-ensure-page yoho-page">
2 - <input id="cart-token" type="hidden" name="token" value="{{cartToken}}">  
3 - {{# orderEnsure}} 2 +<input id="cart-token" type="hidden" name="token" value="{{cartToken}}">
  3 +{{# orderEnsure}}
  4 + {{#if message}}
  5 + <div class="order-ensure-error">
  6 + {{message}}
  7 + </div>
  8 + {{else}}
4 {{#if addressInfo}} 9 {{#if addressInfo}}
5 <div class="address block address-wrap {{#if @root.pageChannel.boys}} boys{{/if}}{{#if @root.pageChannel.girls}} girls{{/if}}{{#if @root.pageChannel.kids}} kids{{/if}}{{#if @root.pageChannel.lifeStyle}} life-style{{/if}}" data-id ="{{addressId}}"> 10 <div class="address block address-wrap {{#if @root.pageChannel.boys}} boys{{/if}}{{#if @root.pageChannel.girls}} girls{{/if}}{{#if @root.pageChannel.kids}} kids{{/if}}{{#if @root.pageChannel.lifeStyle}} life-style{{/if}}" data-id ="{{addressId}}">
6 <div class="info"> 11 <div class="info">
@@ -212,15 +217,19 @@ @@ -212,15 +217,19 @@
212 </div> 217 </div>
213 <div class="yoho-coin-footer">知道了</div> 218 <div class="yoho-coin-footer">知道了</div>
214 </div> 219 </div>
  220 + {{#if errorMsg}}
  221 + <div class="yoho-coin-help-dialog-bg"></div>
  222 + <div class="yoho-coin-help-dialog">
  223 + <div class="yoho-coin-content">{{errorMsg}}</div>
  224 + <div class="yoho-coin-footer">返回</div>
  225 + </div>
  226 + {{/if}}
215 227
216 <input type="hidden" id="product-sku" name="product-sku" value="{{sku}}"> 228 <input type="hidden" id="product-sku" name="product-sku" value="{{sku}}">
217 {{#with seckill}} 229 {{#with seckill}}
218 <input type="hidden" id="activity-id" name="activity-id" value="{{activityId}}"> 230 <input type="hidden" id="activity-id" name="activity-id" value="{{activityId}}">
219 {{/with}} 231 {{/with}}
220 - {{else}}  
221 - <div class="order-ensure-error">  
222 - {{message}}  
223 - </div>  
224 - {{/ orderEnsure}} 232 + {{/if}}
  233 +{{/ orderEnsure}}
225 </div> 234 </div>
226 {{> rich_tip}} 235 {{> rich_tip}}
@@ -768,7 +768,7 @@ @@ -768,7 +768,7 @@
768 width: 100%; 768 width: 100%;
769 height: 100%; 769 height: 100%;
770 position: fixed; 770 position: fixed;
771 - z-index: 1; 771 + z-index: 3;
772 left: 0; 772 left: 0;
773 top: 0; 773 top: 0;
774 opacity: 0.3; 774 opacity: 0.3;
@@ -780,7 +780,7 @@ @@ -780,7 +780,7 @@
780 width: 540px; 780 width: 540px;
781 height: 510px; 781 height: 510px;
782 background-color: #fff; 782 background-color: #fff;
783 - z-index: 2; 783 + z-index: 4;
784 border-radius: 10px; 784 border-radius: 10px;
785 left: 50%; 785 left: 50%;
786 margin-left: -270px; 786 margin-left: -270px;