From d3415d7c2bb5c6dddced1800e8ffedbf4176ae11 Mon Sep 17 00:00:00 2001
From: lcl598906773 <598906773@qq.com>
Date: Mon, 2 Nov 2026 10:21:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DEVUS=E5=AD=90=E7=9B=AE?=
=?UTF-8?q?=E5=BD=95=E8=AE=BF=E9=97=AE=E5=8F=8AH5=E6=94=AF=E4=BB=98?=
=?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/home/common.php | 1 +
app/home/controller/Base.php | 1 +
app/home/controller/Esta.php | 8 ++--
app/home/controller/Invoice.php | 4 +-
app/home/controller/Login.php | 2 +-
app/home/controller/Multiple.php | 2 +-
app/home/controller/Pay.php | 6 ++-
app/home/controller/Payesta.php | 8 +++-
app/home/controller/Update.php | 4 +-
app/home/controller/User.php | 6 +--
app/home/controller/Wechatpay.php | 16 +++----
app/home/view/pay/h5result.html | 1 +
app/home/view/payesta/h5result.html | 1 +
app/home/view/public/head.html | 58 ++++++++++++++++++++++-
app/home/view/public/payment_result.html | 18 +++++++
app/home/view/usvisa/index.html | 6 ++-
config/cookie.php | 2 +-
config/session.php | 2 +-
config/view.php | 6 +++
public/index.php | 2 +
public/static/home/css/payment-result.css | 10 ++++
public/static/home/css/style.css | 2 +-
public/static/home/css/usvisa.css | 2 +-
public/static/home/js/payment-result.js | 34 +++++++++++++
public/static/home/js/usvisa.js | 4 +-
25 files changed, 173 insertions(+), 33 deletions(-)
create mode 100644 app/home/view/pay/h5result.html
create mode 100644 app/home/view/payesta/h5result.html
create mode 100644 app/home/view/public/payment_result.html
create mode 100644 public/static/home/css/payment-result.css
create mode 100644 public/static/home/js/payment-result.js
diff --git a/app/home/common.php b/app/home/common.php
index 32b0f96..5a7b0e3 100644
--- a/app/home/common.php
+++ b/app/home/common.php
@@ -23,6 +23,7 @@ const ESTA_COUNTRY = 'ESTA登记';
const PAY_ESTA_MARK = 'estacn';
const ESTA_MODEL = 'esta';
const ESTA_INCOICETYPE = '6';
+const BASE_PATH = '/evus'; // 可后端模板注入
// 公共函数
diff --git a/app/home/controller/Base.php b/app/home/controller/Base.php
index 8ee2c44..63fec67 100644
--- a/app/home/controller/Base.php
+++ b/app/home/controller/Base.php
@@ -100,6 +100,7 @@ class Base extends BaseController
View::assign('order_kefu', $config_result['data']['visa_png']);
View::assign('invoice_url', $config_result['data']['invoice_url']);
View::assign('menu_url', strtolower(Request::controller() . '/' . Request::action()));
+ View::assign('base_path', BASE_PATH);
$this->assignSeo();
}
diff --git a/app/home/controller/Esta.php b/app/home/controller/Esta.php
index aed3d68..8b999ce 100644
--- a/app/home/controller/Esta.php
+++ b/app/home/controller/Esta.php
@@ -24,8 +24,8 @@ class Esta extends Base
View::assign('us', json_decode(file_get_contents('./json/us.json'), true));
View::assign('goods', config('app.ESTA_GOODS'));
View::assign('ismobile', isMobile() ? 1 : 0);
- View::assign('ppt_sample_url', '/new/assets/images/shili.jpg');
- View::assign('per_sample_url', '/new/assets/images/persion2.png');
+ View::assign('ppt_sample_url', BASE_PATH . '/new/assets/images/shili.jpg');
+ View::assign('per_sample_url', BASE_PATH . '/new/assets/images/persion2.png');
return View::fetch();
}
@@ -125,8 +125,8 @@ class Esta extends Base
View::assign('us', json_decode(file_get_contents('./json/us.json'), true));
View::assign('goods', config('app.ESTA_GOODS'));
View::assign('ismobile', isMobile() ? 1 : 0);
- View::assign('ppt_sample_url', '/new/assets/images/shili.jpg');
- View::assign('per_sample_url', '/new/assets/images/persion2.png');
+ View::assign('ppt_sample_url', BASE_PATH . '/new/assets/images/shili.jpg');
+ View::assign('per_sample_url', BASE_PATH . '/new/assets/images/persion2.png');
return View::fetch();
}
diff --git a/app/home/controller/Invoice.php b/app/home/controller/Invoice.php
index 910644e..c7479e8 100644
--- a/app/home/controller/Invoice.php
+++ b/app/home/controller/Invoice.php
@@ -15,7 +15,7 @@ class Invoice extends Base
{
parent::initialize();
if (!Session::has('user') || Session::get('user')['id'] <= 0) {
- throw new HttpResponseException(redirect('/home/login'));
+ throw new HttpResponseException(redirect(url('home/login/index')->build()));
}
}
@@ -81,7 +81,7 @@ class Invoice extends Base
}
$res['status'] = 1;
$res['msg'] = $pay_result['msg'];
- $res['url'] = '/home/user/order';
+ $res['url'] = url('home/user/order')->build();
return json($res);
}
diff --git a/app/home/controller/Login.php b/app/home/controller/Login.php
index 5cbf8e3..3283cd3 100644
--- a/app/home/controller/Login.php
+++ b/app/home/controller/Login.php
@@ -108,6 +108,6 @@ class Login extends Base
public function logout()
{
Session::delete('user');
- return redirect('/home/index');
+ return redirect(url('home/index/index')->build());
}
}
diff --git a/app/home/controller/Multiple.php b/app/home/controller/Multiple.php
index 63765ad..c27457a 100644
--- a/app/home/controller/Multiple.php
+++ b/app/home/controller/Multiple.php
@@ -208,7 +208,7 @@ class Multiple extends Base
$res = [
'status' => 1,
'msg' => '操作成功',
- 'url' => '/home/user/order'
+ 'url' => url('home/user/order')->build()
];
return json($res);
}
diff --git a/app/home/controller/Pay.php b/app/home/controller/Pay.php
index 4c05608..2485ef2 100644
--- a/app/home/controller/Pay.php
+++ b/app/home/controller/Pay.php
@@ -171,7 +171,7 @@ class Pay extends Base
]);
}
$pay_result = $pay_result['data'];
- if ($pay_result['pay_status']) {
+ if (in_array($pay_result['pay_status'] ?? null, [1, '1'], true)) {
return json([
'status' => 1,
'msg' => '支付成功',
@@ -184,6 +184,10 @@ class Pay extends Base
'url' => url('pay/h5pay', ['order_sn' => $order_sn])->build()
]);
}
+ View::assign('order_sn', $this->order_sn);
+ View::assign('payment_label', 'EVUS');
+ View::assign('payment_check_url', url('home/pay/h5result', ['order_sn' => $this->order_sn])->build());
+ View::assign('payment_success_url', url('home/pay/succ', ['order_sn' => $this->order_sn])->build());
return View::fetch();
}
diff --git a/app/home/controller/Payesta.php b/app/home/controller/Payesta.php
index 46d257a..bfc5c5f 100644
--- a/app/home/controller/Payesta.php
+++ b/app/home/controller/Payesta.php
@@ -78,7 +78,7 @@ class Payesta extends Base
}
$pay_result = $pay_result['data'];
if ($pay_result['pay_status']) {
- return $this->success('您已支付成功,请勿重复支付', url('detail/index'));
+ return redirect(url('home/payesta/succ', ['order_sn' => $order_sn])->build());
}
//微信pc
$cfg = config('app.wechatpcpay');
@@ -171,7 +171,7 @@ class Payesta extends Base
]);
}
$pay_result = $pay_result['data'];
- if ($pay_result['pay_status']) {
+ if (in_array($pay_result['pay_status'] ?? null, [1, '1'], true)) {
return json([
'status' => 1,
'msg' => '支付成功',
@@ -184,6 +184,10 @@ class Payesta extends Base
'url' => url('payesta/h5pay', ['order_sn' => $order_sn])->build()
]);
}
+ View::assign('order_sn', $this->order_sn);
+ View::assign('payment_label', 'ESTA');
+ View::assign('payment_check_url', url('home/payesta/h5result', ['order_sn' => $this->order_sn])->build());
+ View::assign('payment_success_url', url('home/payesta/succ', ['order_sn' => $this->order_sn])->build());
return View::fetch();
}
diff --git a/app/home/controller/Update.php b/app/home/controller/Update.php
index 8321bbf..108714d 100644
--- a/app/home/controller/Update.php
+++ b/app/home/controller/Update.php
@@ -169,8 +169,8 @@ class Update extends Base
View::assign('us', json_decode(file_get_contents('./json/us.json'), true));
View::assign('goods', config('app.ESTA_GOODS'));
View::assign('ismobile', isMobile() ? 1 : 0);
- View::assign('ppt_sample_url', '/new/assets/images/shili.jpg');
- View::assign('per_sample_url', '/new/assets/images/persion2.png');
+ View::assign('ppt_sample_url', BASE_PATH . '/new/assets/images/shili.jpg');
+ View::assign('per_sample_url', BASE_PATH . '/new/assets/images/persion2.png');
View::assign('data', $pay_result['data']);
View::assign('id', $pay_result['data']['id']);
return View::fetch();
diff --git a/app/home/controller/User.php b/app/home/controller/User.php
index cff696c..18d55b7 100644
--- a/app/home/controller/User.php
+++ b/app/home/controller/User.php
@@ -23,7 +23,7 @@ class User extends Base
{
parent::initialize();
if (!Session::has('user') || Session::get('user')['id'] <= 0) {
- throw new HttpResponseException(redirect('/home/login'));
+ throw new HttpResponseException(redirect(url('home/login/index')->build()));
}
$this->userinfo = Session::get('user');
View::assign('userinfo', $this->userinfo);
@@ -97,7 +97,7 @@ class User extends Base
public function logout()
{
Session::delete('user');
- return redirect('/home/index');
+ return redirect(url('home/index/index')->build());
}
public function checkInvoice()
@@ -165,7 +165,7 @@ class User extends Base
$res = [
'status' => 1,
'msg' => '操作成功',
- 'url' => '/home/invoice/index/order_sn/' . $order_sn
+ 'url' => url('home/invoice/index', ['order_sn' => $order_sn])->build()
];
return json($res);
diff --git a/app/home/controller/Wechatpay.php b/app/home/controller/Wechatpay.php
index 7772958..529f0d5 100644
--- a/app/home/controller/Wechatpay.php
+++ b/app/home/controller/Wechatpay.php
@@ -21,21 +21,21 @@ class Wechatpay extends Base
$order_url = Config::get('app.get_evus_detail_url');
$response = Httpcurl::request($order_url, 'post', ['order_sn'=>$order_sn,'model'=>MODEL]);
if ($response[3]) {
- return $this->error('支付失败,请稍后重试', '/home/detail/index');
+ return $this->error('支付失败,请稍后重试', url('home/detail/index')->build());
}
$pay_result = json_decode($response[0], true);
if (empty($pay_result)) {
- return $this->error('支付失败,请稍后重试', '/home/detail/index');
+ return $this->error('支付失败,请稍后重试', url('home/detail/index')->build());
}
if (!$pay_result['code']){
- return $this->error('支付失败,请稍后重试', '/home/detail/index');
+ return $this->error('支付失败,请稍后重试', url('home/detail/index')->build());
}
$pay_result = $pay_result['data'];
if ($pay_result['pay_status']) {
return redirect(url('home/pay/succ', ['order_sn' => $order_sn])->build());
}else{
- return $this->error('支付失败,请稍后重试', '/home/detail/index');
+ return $this->error('支付失败,请稍后重试', url('home/detail/index')->build());
}
}
@@ -49,21 +49,21 @@ class Wechatpay extends Base
$order_url = Config::get('app.get_order_detail_url');
$response = Httpcurl::request($order_url, 'post', ['order_sn'=>$order_sn,'model'=>ESTA_MODEL]);
if ($response[3]) {
- return $this->error('支付失败,请稍后重试', '/home/esta/index');
+ return $this->error('支付失败,请稍后重试', url('home/esta/index')->build());
}
$pay_result = json_decode($response[0], true);
if (empty($pay_result)) {
- return $this->error('支付失败,请稍后重试', '/home/esta/index');
+ return $this->error('支付失败,请稍后重试', url('home/esta/index')->build());
}
if (!$pay_result['code']){
- return $this->error('支付失败,请稍后重试', '/home/esta/index');
+ return $this->error('支付失败,请稍后重试', url('home/esta/index')->build());
}
$pay_result = $pay_result['data'];
if ($pay_result['pay_status']) {
return redirect(url('home/payesta/succ', ['order_sn' => $order_sn])->build());
}else{
- return $this->error('支付失败,请稍后重试', '/home/esta/index');
+ return $this->error('支付失败,请稍后重试', url('home/esta/index')->build());
}
}
diff --git a/app/home/view/pay/h5result.html b/app/home/view/pay/h5result.html
new file mode 100644
index 0000000..e633426
--- /dev/null
+++ b/app/home/view/pay/h5result.html
@@ -0,0 +1 @@
+{include file="public/payment_result" /}
diff --git a/app/home/view/payesta/h5result.html b/app/home/view/payesta/h5result.html
new file mode 100644
index 0000000..e633426
--- /dev/null
+++ b/app/home/view/payesta/h5result.html
@@ -0,0 +1 @@
+{include file="public/payment_result" /}
diff --git a/app/home/view/public/head.html b/app/home/view/public/head.html
index 7ab624f..f876b2b 100644
--- a/app/home/view/public/head.html
+++ b/app/home/view/public/head.html
@@ -19,7 +19,7 @@
-
+
@@ -28,6 +28,62 @@
+
+