feat/task1-c-wallet
gongfuxiang 2018-09-27 00:51:37 +08:00
parent 077b4dbcc0
commit 3c7907bcdd
3 changed files with 35 additions and 5 deletions

View File

@ -259,4 +259,33 @@
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->
<!-- footer end -->
<script type="text/javascript">
// 提交订单回调
function BuySubmitBack(e)
{
if(e.code == 0)
{
$.AMUI.progress.done();
if($(window).width() < 640)
{
PromptBottom(e.msg, 'success', null, 50);
} else {
PromptCenter(e.msg, 'success');
}
setTimeout(function()
{
alert(e.data.id);
}, 1500);
} else {
$('form.form-validation').find('button[type="submit"]').button('reset');
$.AMUI.progress.done();
if($(window).width() < 640)
{
PromptBottom(e.msg, null, null, 50);
} else {
PromptCenter(e.msg);
}
}
}
</script>

View File

@ -31,7 +31,7 @@ class OrderService
$m = M('Order');
$where = ['id'=>intval($params['id']), 'user_id' => $this->user['id']];
$data = $m->where($where)->field('id,status,total_price')->find();
$data = $m->where($where)->field('id,status,total_price,payment_id')->find();
if(empty($data))
{
return DataReturn(L('common_data_no_exist_error'), -1);
@ -49,13 +49,13 @@ class OrderService
// 发起支付
$notify_url = __MY_URL__.'Notify/order.php';
$pay_data = array(
'out_user' => md5($this->user['id']),
'order_sn' => $data['id'].GetNumberCode(6),
'out_user' => md5($params['user']['id']),
'order_sn' => date('YmdHis').$data['id'],
'name' => '订单支付',
'total_price' => $data['total_price'],
'notify_url' => $notify_url,
);
$pay = (new \Library\Alipay())->SoonPay($pay_data, C("alipay_key_secret"));
$pay = (new \Library\Payment\Alipay())->Pay($pay_data);
if(empty($pay))
{
return DataReturn('支付接口异常', -1);

View File

@ -48,6 +48,7 @@ ul.logistics-list li img, ul.payment-list li img { width: 36px; height: 36px; }
.link-list h3 { padding: 0 0 5px 5px; }
ul.address-list, .business-item ul { overflow: hidden; }
.nav-buy .btn-go.am-disabled { background-color: #efa4af; }
/**
*