Merge branch 'feature/wap4.3' into develop
Showing
6 changed files
with
71 additions
and
3 deletions
@@ -439,4 +439,23 @@ class CartData | @@ -439,4 +439,23 @@ class CartData | ||
439 | return Yohobuy::get(Yohobuy::API_URL, $param); | 439 | return Yohobuy::get(Yohobuy::API_URL, $param); |
440 | } | 440 | } |
441 | 441 | ||
442 | + /** | ||
443 | + * 选择支付,校验时间间隔,插入数据 | ||
444 | + * @param string $uid | ||
445 | + * @param string $orderCode | ||
446 | + * @param int $payment 14:银联手机支付 15:支付宝手机 18:支付宝wap(wap) 19:微信支付 22:微信wap(wap) 26:QQ钱包手机支付 | ||
447 | + * @return type | ||
448 | + */ | ||
449 | + public static function savePrePayInfo($uid, $orderCode, $payment) | ||
450 | + { | ||
451 | + $param = Yohobuy::param(); | ||
452 | + $param['method'] = 'app.order.savePrePayInfo'; | ||
453 | + $param['uid'] = $uid; | ||
454 | + $param['orderCode'] = $orderCode; | ||
455 | + $param['payment'] = $payment; | ||
456 | + $param['client_secret'] = Sign::getSign($param); | ||
457 | + | ||
458 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
459 | + } | ||
460 | + | ||
442 | } | 461 | } |
No preview for this file type
@@ -165,3 +165,21 @@ loading.showLoadingMask(); | @@ -165,3 +165,21 @@ loading.showLoadingMask(); | ||
165 | 165 | ||
166 | $(document).ready(main); | 166 | $(document).ready(main); |
167 | 167 | ||
168 | +$('.box').on('click', function() { | ||
169 | + var url = $('.payapp-list a').attr('href'), | ||
170 | + theRequest = [], | ||
171 | + orderCode, | ||
172 | + payment; | ||
173 | + | ||
174 | + if (url.indexOf("?") != -1) { | ||
175 | + theRequest = url.split('?')[1].split("&"); | ||
176 | + orderCode=theRequest[0].split('=')[1]; | ||
177 | + payment=theRequest[1].split('=')[1]; | ||
178 | + } | ||
179 | + | ||
180 | + $.ajax({ | ||
181 | + url:'/shopping/pay/addPaymentInterval?orderCode=' + orderCode + '&payment=' + payment, | ||
182 | + method:'get' | ||
183 | + }); | ||
184 | +}); | ||
185 | + |
@@ -76,16 +76,15 @@ | @@ -76,16 +76,15 @@ | ||
76 | </div> | 76 | </div> |
77 | </section> | 77 | </section> |
78 | 78 | ||
79 | - | 79 | + <section class="block goods-bottom"> |
80 | {{#if isJit}} | 80 | {{#if isJit}} |
81 | {{> me/order/jit-more}} | 81 | {{> me/order/jit-more}} |
82 | {{/if}} | 82 | {{/if}} |
83 | - <section class="block mt0" style="margin-bottom: 0;"> | ||
84 | {{#each goods}} | 83 | {{#each goods}} |
85 | {{> me/order/good}} | 84 | {{> me/order/good}} |
86 | {{/each}} | 85 | {{/each}} |
87 | - </section> | ||
88 | <div class="goods-num">共{{num}}件商品 合计<span>¥{{goodsPrice}}</span></div> | 86 | <div class="goods-num">共{{num}}件商品 合计<span>¥{{goodsPrice}}</span></div> |
87 | + </section> | ||
89 | 88 | ||
90 | <section class="block"> | 89 | <section class="block"> |
91 | <ul class="sale-invoice"> | 90 | <ul class="sale-invoice"> |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | use Action\AbstractAction; | 3 | use Action\AbstractAction; |
4 | use Plugin\Helpers; | 4 | use Plugin\Helpers; |
5 | use LibModels\Wap\Home\OrderData; | 5 | use LibModels\Wap\Home\OrderData; |
6 | +use LibModels\Wap\Home\CartData; | ||
6 | use Plugin\Pay\weixin\JsApiPay; | 7 | use Plugin\Pay\weixin\JsApiPay; |
7 | use Plugin\Pay\weixin\lib\WxPayUnifiedOrder; | 8 | use Plugin\Pay\weixin\lib\WxPayUnifiedOrder; |
8 | use Plugin\Pay\weixin\lib\WxPayApi; | 9 | use Plugin\Pay\weixin\lib\WxPayApi; |
@@ -131,5 +132,33 @@ class PayController extends AbstractAction | @@ -131,5 +132,33 @@ class PayController extends AbstractAction | ||
131 | } while (false); | 132 | } while (false); |
132 | } | 133 | } |
133 | 134 | ||
135 | + /** | ||
136 | + * 选择支付时,时间间隔校验插入 | ||
137 | + */ | ||
138 | + public function addPaymentIntervalAction() | ||
139 | + { | ||
140 | + $data = array('code'=>400,'message'=>'','data'=>''); | ||
141 | + | ||
142 | + do { | ||
143 | + if (!$this->isAjax()) { | ||
144 | + break; | ||
145 | + } | ||
146 | + | ||
147 | + $uid = $this->getUid(TRUE); | ||
148 | + $orderCode = $this->get('orderCode',''); | ||
149 | + $payment = $this->get('payment',0); | ||
150 | + | ||
151 | + if (!$uid || !$orderCode || !$payment) { | ||
152 | + break; | ||
153 | + } | ||
154 | + | ||
155 | + $res = CartData::savePrePayInfo($uid, $orderCode, $payment); | ||
156 | + $data = array('code'=>$res['code'],'message'=>$res['message'],'data'=>$res['data']); | ||
157 | + | ||
158 | + } while (false); | ||
159 | + | ||
160 | + $this->echoJson($data); | ||
161 | + } | ||
162 | + | ||
134 | 163 | ||
135 | } | 164 | } |
-
Please register or login to post a comment