mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-08-07 14:19:46 +08:00
[更新]修改微信支付demo
This commit is contained in:
parent
68d9633780
commit
4ca54aa7ef
@ -70,6 +70,7 @@ class Wap extends BasicWechat {
|
|||||||
if ($options === false) {
|
if ($options === false) {
|
||||||
$options = ['code' => 3, 'msg' => "创建支付失败,{$pay->errMsg}[$pay->errCode]"];
|
$options = ['code' => 3, 'msg' => "创建支付失败,{$pay->errMsg}[$pay->errCode]"];
|
||||||
}
|
}
|
||||||
|
$options['order_no'] = $order_no;
|
||||||
return json($options);
|
return json($options);
|
||||||
case 'reset':
|
case 'reset':
|
||||||
session('pay-test-order-no', null);
|
session('pay-test-order-no', null);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<hr/>
|
<hr/>
|
||||||
<p class="price">金额: 0.01元</p>
|
<p class="price">金额: 0.01元</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<p class="orderno">订单号:13412341234</p>
|
<p class="orderno"></p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-offset-2 col-sm-10" id="test">
|
<div class="col-sm-offset-2 col-sm-10" id="test">
|
||||||
@ -36,6 +36,7 @@
|
|||||||
wx.ready(function () {
|
wx.ready(function () {
|
||||||
$('[type="submit"]').on('click', function () {
|
$('[type="submit"]').on('click', function () {
|
||||||
$.get('{:url("payjs")}', {'action': 'options'}, function (ret) {
|
$.get('{:url("payjs")}', {'action': 'options'}, function (ret) {
|
||||||
|
$('.orderno').html('订单号:' + ret.order_no);
|
||||||
if (ret.code && ret.code === 2) {
|
if (ret.code && ret.code === 2) {
|
||||||
$('#test').append('<button type="button" class="btn btn-success">已支付,刷新支付号</button>');
|
$('#test').append('<button type="button" class="btn btn-success">已支付,刷新支付号</button>');
|
||||||
return $('[type="submit"]').remove();
|
return $('[type="submit"]').remove();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user