diff --git a/app/controller/Wechat.php b/app/controller/Wechat.php index b600643..eb98351 100644 --- a/app/controller/Wechat.php +++ b/app/controller/Wechat.php @@ -101,6 +101,7 @@ class Wechat { $clientToken = Request::get('token'); $orderId = Request::get('order_id'); + $callback = Request::get('callback'); if ($clientToken) { $tk = json_decode(authcode($clientToken), true); $userId = $tk['userid']; @@ -150,7 +151,7 @@ class Wechat } $prepayId = $unify['prepay_id']; $jssdk = $payment->jssdk->bridgeConfig($prepayId, false); - return View::fetch('', ['jssdk' => $jssdk]); + return View::fetch('', ['jssdk' => $jssdk, 'callback' => $callback]); } /** diff --git a/app/view/wechat/payment.html b/app/view/wechat/payment.html index 211e2bf..34fe458 100644 --- a/app/view/wechat/payment.html +++ b/app/view/wechat/payment.html @@ -49,7 +49,8 @@ , btn: ['3秒后自动返回'] , time: 3 , end: function () { - window.history.back() + window.local.href = '{$callback}'; + // window.history.back() } }); }, 1000); @@ -60,7 +61,7 @@ , btn: ['3秒后自动返回'] , time: 3 , end: function () { - window.history.back() + window.local.href = '{$callback}'; } }); }