Authored by cailing

Merge branch 'feature/wap4.3' into develop/wap

... ... @@ -438,5 +438,24 @@ class CartData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 选择支付,校验时间间隔,插入数据
* @param string $uid
* @param string $orderCode
* @param int $payment 14:银联手机支付 15:支付宝手机 18:支付宝wap(wap) 19:微信支付 22:微信wap(wap) 26:QQ钱包手机支付
* @return type
*/
public static function savePrePayInfo($uid, $orderCode, $payment)
{
$param = Yohobuy::param();
$param['method'] = 'app.order.savePrePayInfo';
$param['uid'] = $uid;
$param['orderCode'] = $orderCode;
$param['payment'] = $payment;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -165,3 +165,21 @@ loading.showLoadingMask();
$(document).ready(main);
$('.box').on('click', function() {
var url = $('.payapp-list a').attr('href'),
theRequest = [],
orderCode,
payment;
if (url.indexOf("?") != -1) {
theRequest = url.split('?')[1].split("&");
orderCode=theRequest[0].split('=')[1];
payment=theRequest[1].split('=')[1];
}
$.ajax({
url:'/shopping/pay/addPaymentInterval?orderCode=' + orderCode + '&payment=' + payment,
method:'get'
});
});
... ...
... ... @@ -19,6 +19,9 @@
color: #f00;
}
}
.goods-bottom{
padding-bottom: 0;
}
.border-none{
border-bottom:none !important;
}
... ...
... ... @@ -75,12 +75,12 @@
</ul>
</div>
</section>
<section class="block" style="margin-bottom: 0;">
{{#each goods}}
{{> me/order/good}}
{{/each}}
<section class="block goods-bottom">
{{#each goods}}
{{> me/order/good}}
{{/each}}
<div class="goods-num">共{{num}}件商品 合计<span>¥{{goodsPrice}}</span></div>
</section>
<div class="goods-num">共{{num}}件商品 合计<span>¥{{goodsPrice}}</span></div>
<section class="block">
<ul class="sale-invoice">
... ...
... ... @@ -3,6 +3,7 @@
use Action\AbstractAction;
use Plugin\Helpers;
use LibModels\Wap\Home\OrderData;
use LibModels\Wap\Home\CartData;
use Plugin\Pay\weixin\JsApiPay;
use Plugin\Pay\weixin\lib\WxPayUnifiedOrder;
use Plugin\Pay\weixin\lib\WxPayApi;
... ... @@ -131,5 +132,33 @@ class PayController extends AbstractAction
} while (false);
}
/**
* 选择支付时,时间间隔校验插入
*/
public function addPaymentIntervalAction()
{
$data = array('code'=>400,'message'=>'','data'=>'');
do {
if (!$this->isAjax()) {
break;
}
$uid = $this->getUid(TRUE);
$orderCode = $this->get('orderCode','');
$payment = $this->get('payment',0);
if (!$uid || !$orderCode || !$payment) {
break;
}
$res = CartData::savePrePayInfo($uid, $orderCode, $payment);
$data = array('code'=>$res['code'],'message'=>$res['message'],'data'=>$res['data']);
} while (false);
$this->echoJson($data);
}
}
... ...