Authored by zhangxiaoru

Merge branch 'master' into feature/supportShipment

@@ -161,7 +161,7 @@ class BuyNowController { @@ -161,7 +161,7 @@ class BuyNowController {
161 sku_type: req.body.sku_type, 161 sku_type: req.body.sku_type,
162 buy_number: req.body.buy_number, 162 buy_number: req.body.buy_number,
163 coupon_code: req.body.coupon_code, 163 coupon_code: req.body.coupon_code,
164 - address_id: parseInt(crypto.decrypt('', req.body.address_id), 10), 164 + address_id: parseInt(crypto.decrypt('', req.body.address_id), 10) || 0,
165 delivery_time: req.body.delivery_time, 165 delivery_time: req.body.delivery_time,
166 delivery_way: req.body.delivery_way, 166 delivery_way: req.body.delivery_way,
167 use_yoho_coin: req.body.use_yoho_coin, 167 use_yoho_coin: req.body.use_yoho_coin,
@@ -58,6 +58,10 @@ const submitTicket = (req, res) => { @@ -58,6 +58,10 @@ const submitTicket = (req, res) => {
58 }; 58 };
59 59
60 indexModel.submitTicket(params).then(result => { 60 indexModel.submitTicket(params).then(result => {
  61 + if (result === {}) {
  62 + result.message = '人太多啦,稍后再试!';
  63 + }
  64 +
61 // 提交成功清除Cookie 65 // 提交成功清除Cookie
62 res.cookie('order-info', null, actCkOpthn); 66 res.cookie('order-info', null, actCkOpthn);
63 res.json(result); 67 res.json(result);
@@ -101,6 +101,18 @@ class BuyNowModel extends global.yoho.BaseModel { @@ -101,6 +101,18 @@ class BuyNowModel extends global.yoho.BaseModel {
101 * @param {*} params 101 * @param {*} params
102 */ 102 */
103 submit(params) { 103 submit(params) {
  104 + if (!params.address_id) {
  105 + return Promise.resolve({ code: 401, message: '配送地址不能为空' });
  106 + }
  107 +
  108 + if (!params.delivery_time) {
  109 + return Promise.resolve({ code: 402, message: '请选择配送时间' });
  110 + }
  111 +
  112 + if (!params.delivery_way) {
  113 + return Promise.resolve({ code: 403, message: '请选择配送方式' });
  114 + }
  115 +
104 let finalParams = { 116 let finalParams = {
105 method: 'app.Buynow.submit', 117 method: 'app.Buynow.submit',
106 uid: params.uid, 118 uid: params.uid,
1 <div class="order-ensure-page yoho-page tickets-confirm-page"> 1 <div class="order-ensure-page yoho-page tickets-confirm-page">
2 - <section class="dispatch block">  
3 - <!--<div class="sorry-tips">  
4 - <p>虚拟商品不支持退换货,抱歉!</p>  
5 - </div>-->  
6 - <div class="sub-block payment-type">  
7 - <h3>  
8 - <p>支付方式</p>  
9 - <span>在线支付</span>  
10 - </h3>  
11 - </div>  
12 - <div class="sub-block delivery-id">  
13 - <h3>  
14 - <p>发送时间</p>  
15 - <span>自动发货</span>  
16 - </h3>  
17 - <h4>在您支付成功后,系统将立即为您发送二维码,您可以在订单中查看。</h4>  
18 - </div>  
19 - </section> 2 + {{#unless goods.length}}
  3 + <p style="text-align: center;background-color: #fff;font-size: 20px;line-height: 60px;margin-top: 100px;}">人太多啦,稍后再试!</p>
  4 + {{else}}
  5 + <section class="dispatch block">
  6 + <!--<div class="sorry-tips">
  7 + <p>虚拟商品不支持退换货,抱歉!</p>
  8 + </div>-->
  9 + <div class="sub-block payment-type">
  10 + <h3>
  11 + <p>支付方式</p>
  12 + <span>在线支付</span>
  13 + </h3>
  14 + </div>
  15 + <div class="sub-block delivery-id">
  16 + <h3>
  17 + <p>发送时间</p>
  18 + <span>自动发货</span>
  19 + </h3>
  20 + <h4>在您支付成功后,系统将立即为您发送二维码,您可以在订单中查看。</h4>
  21 + </div>
  22 + </section>
20 23
21 - <section class="block tickets-mobile">  
22 - <input type="text" name="mobile" placeholder="手机号" id="mobile">  
23 - <span class="mobile-tips">(必填)</span>  
24 - </section> 24 + <section class="block tickets-mobile">
  25 + <input type="text" name="mobile" placeholder="手机号" id="mobile">
  26 + <span class="mobile-tips">(必填)</span>
  27 + </section>
25 28
26 - <section class="block goods-bottom">  
27 - {{#each goods}}  
28 - {{> tickets/good}}  
29 - {{/each}}  
30 - </section> 29 + <section class="block goods-bottom">
  30 + {{#each goods}}
  31 + {{> tickets/good}}
  32 + {{/each}}
  33 + </section>
31 34
32 - <section class="block dispatch">  
33 - <div class="yoho-coin">  
34 - <ul class="sale-invoice">  
35 - <li class="coin" data-yoho-coin="{{yohoCoinCompute.yohoCoin}}" data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>  
36 - <span class="title">有货币</span>  
37 - <span class="desc msg">{{yohoCoinCompute.yohoCoinMsg}}</span>  
38 - <span class="yoho-coin-help">?</span>  
39 - {{#if yohoCoinCompute.useYohoCoin}}  
40 - <span class="coin-check">  
41 - <i class="iconfont checkbox icon-cb-radio"></i>  
42 - </span>  
43 - {{else}}  
44 - <span class="coin-check">  
45 - <i class="iconfont checkbox icon-radio"></i>  
46 - </span>  
47 - {{/if}}  
48 - </li>  
49 - </ul>  
50 - </div>  
51 - <div class="sub-block delivery-id">  
52 - <h3>  
53 - <p>发票</p>  
54 - </h3>  
55 - <h4>  
56 - 如需开具发票,请于我们的客服联系<br>  
57 - 客服电话:400-889-9646。  
58 - </h4>  
59 - </div>  
60 - </section> 35 + <section class="block dispatch">
  36 + <div class="yoho-coin">
  37 + <ul class="sale-invoice">
  38 + <li class="coin" data-yoho-coin="{{yohoCoinCompute.yohoCoin}}" data-yoho-coin-click={{yohoCoinCompute.yohoCoinClick}}>
  39 + <span class="title">有货币</span>
  40 + <span class="desc msg">{{yohoCoinCompute.yohoCoinMsg}}</span>
  41 + <span class="yoho-coin-help">?</span>
  42 + {{#if yohoCoinCompute.useYohoCoin}}
  43 + <span class="coin-check">
  44 + <i class="iconfont checkbox icon-cb-radio"></i>
  45 + </span>
  46 + {{else}}
  47 + <span class="coin-check">
  48 + <i class="iconfont checkbox icon-radio"></i>
  49 + </span>
  50 + {{/if}}
  51 + </li>
  52 + </ul>
  53 + </div>
  54 + <div class="sub-block delivery-id">
  55 + <h3>
  56 + <p>发票</p>
  57 + </h3>
  58 + <h4>
  59 + 如需开具发票,请于我们的客服联系<br>
  60 + 客服电话:400-889-9646。
  61 + </h4>
  62 + </div>
  63 + </section>
61 64
62 - <section class="price-cal block">  
63 - <ul class="total">  
64 - {{#cartPayData}}  
65 - <li>  
66 - <p>{{promotion}}</p>  
67 - <span>{{promotion_amount}}</span>  
68 - </li>  
69 - {{/cartPayData}}  
70 - </ul>  
71 - <div class="price-cost">  
72 - 实付金额  
73 - <span>¥{{price}}</span> 65 + <section class="price-cal block">
  66 + <ul class="total">
  67 + {{#cartPayData}}
  68 + <li>
  69 + <p>{{promotion}}</p>
  70 + <span>{{promotion_amount}}</span>
  71 + </li>
  72 + {{/cartPayData}}
  73 + </ul>
  74 + <div class="price-cost">
  75 + 实付金额
  76 + <span>¥{{price}}</span>
  77 + </div>
  78 + </section>
  79 + <div class="bill">
  80 + 您需要支付:<span>¥{{price}}</span>
  81 + <a href="javascript:;" id="ticketsConfirm">确认</a>
74 </div> 82 </div>
75 - </section>  
76 - <div class="bill">  
77 - 您需要支付:<span>¥{{price}}</span>  
78 - <a href="javascript:;" id="ticketsConfirm">确认</a>  
79 - </div>  
80 - <!--有货币使用弹框提示-->  
81 - <div class="yoho-coin-help-dialog-bg hide"></div>  
82 - <div class="yoho-coin-help-dialog hide">  
83 - <div class="yoho-coin-title">有货币使用条件:</div>  
84 - <div class="yoho-coin-content">  
85 - <p>1.订单金额大于20元(含)</p>  
86 - <p>2.有货币数量大于{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}个(含)</p>  
87 - <p>3.有货币支付不得超过每笔订单应付金额的{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</p>  
88 - <p>备注:使用有货币数量为{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}的整数倍,100有货币抵1元。</p> 83 + <!--有货币使用弹框提示-->
  84 + <div class="yoho-coin-help-dialog-bg hide"></div>
  85 + <div class="yoho-coin-help-dialog hide">
  86 + <div class="yoho-coin-title">有货币使用条件:</div>
  87 + <div class="yoho-coin-content">
  88 + <p>1.订单金额大于20元(含)</p>
  89 + <p>2.有货币数量大于{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}个(含)</p>
  90 + <p>3.有货币支付不得超过每笔订单应付金额的{{yohoCoinCompute.yoho_coin_pay_rule.max_pay_rate_desc}}</p>
  91 + <p>备注:使用有货币数量为{{yohoCoinCompute.yoho_coin_pay_rule.num_limit}}的整数倍,100有货币抵1元。</p>
  92 + </div>
  93 + <div class="yoho-coin-footer">知道了</div>
89 </div> 94 </div>
90 - <div class="yoho-coin-footer">知道了</div>  
91 - </div>  
92 95
93 - <input type="hidden" name="ticketsPage" id="ticketsPage" value="1">  
94 - <input type="hidden" name="productSku" id="productSku" value="{{productSku}}">  
95 - <input type="hidden" name="buyNumber" id="buyNumber" value="{{buyNumber}}"> 96 + <input type="hidden" name="ticketsPage" id="ticketsPage" value="1">
  97 + <input type="hidden" name="productSku" id="productSku" value="{{productSku}}">
  98 + <input type="hidden" name="buyNumber" id="buyNumber" value="{{buyNumber}}">
  99 + {{/unless}}
96 </div> 100 </div>