Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
ae87b20f
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae87b20f
编写于
1月 08, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pay debug
上级
c3c0419a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
125 addition
and
2 deletion
+125
-2
application/index/controller/Order.php
application/index/controller/Order.php
+20
-0
application/index/view/default/order/qrcode_pay.html
application/index/view/default/order/qrcode_pay.html
+3
-2
application/service/OrderService.php
application/service/OrderService.php
+44
-0
public/static/index/default/css/order.css
public/static/index/default/css/order.css
+17
-0
public/static/index/default/js/order.qrcodepay.js
public/static/index/default/js/order.qrcodepay.js
+41
-0
未找到文件。
application/index/controller/Order.php
浏览文件 @
ae87b20f
...
...
@@ -333,5 +333,25 @@ class Order extends Common
}
}
/**
* 支付状态校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-01-08
* @desc description
*/
public
function
PayCheck
()
{
if
(
input
(
'post.'
))
{
$params
=
input
(
'post.'
);
$params
[
'user'
]
=
$this
->
user
;
return
OrderService
::
OrderPayCheck
(
$params
);
}
else
{
$this
->
assign
(
'msg'
,
'非法访问'
);
return
$this
->
fetch
(
'public/tips_error'
);
}
}
}
?>
\ No newline at end of file
application/index/view/default/order/qrcode_pay.html
浏览文件 @
ae87b20f
...
...
@@ -19,11 +19,12 @@
<!-- conntent start -->
<div
class=
"am-g my-content"
>
<div
class=
"am-u-md-6 am-u-sm-centered"
>
<div
class=
"am-panel am-radius
tips-success tips-pay-success
"
>
<div
class=
"am-panel am-radius
qrcode-pay"
data-ajax-url=
"{{:MyUrl('index/order/paycheck', ['order_no'=>$params['order_no']])}}"
data-order-no=
"{{$params['order_no']}}
"
>
<div
class=
"am-panel-bd"
>
<div
class=
"name"
>
{{:urldecode($params['name'])}}
</div>
<img
class=
"qrcode-images am-img-thumbnail"
src=
"{{:MyUrl('index/qrcode/index', ['content'=>$params['url']])}}"
>
</div>
<div
class=
"
tips"
>
扫码支付
</div>
<div
class=
"
msg"
>
{{:urldecode($params['msg'])}}
</div>
</div>
</div>
</div>
...
...
application/service/OrderService.php
浏览文件 @
ae87b20f
...
...
@@ -1355,5 +1355,49 @@ class OrderService
}
}
/**
* 支付状态校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-01-08
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
OrderPayCheck
(
$params
=
[])
{
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'order_no'
,
'error_msg'
=>
'订单号有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'user'
,
'error_msg'
=>
'用户信息有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
);
}
// 获取订单状态
$where
=
[
'order_no'
=>
$params
[
'order_no'
],
'user_id'
=>
$params
[
'user'
][
'id'
]];
$order
=
Db
::
name
(
'Order'
)
->
where
(
$where
)
->
field
(
'id,pay_status'
)
->
find
();
if
(
empty
(
$order
))
{
return
DataReturn
(
'订单不存在'
,
-
400
,
[
'url'
=>
__MY_URL__
]);
}
if
(
$order
[
'pay_status'
]
==
1
)
{
return
DataReturn
(
'支付成功'
,
0
,
[
'url'
=>
MyUrl
(
'index/order/detail'
,
[
'id'
=>
$order
[
'id'
]])]);
}
return
DataReturn
(
'支付中'
,
-
300
);
}
}
?>
\ No newline at end of file
public/static/index/default/css/order.css
浏览文件 @
ae87b20f
...
...
@@ -107,4 +107,21 @@ strong.total-price-content { color: #d2364c; font-size: 16px; }
.goods-base
{
margin-left
:
45px
;
}
table
.data-list
td
.row-status
{
border-left
:
1px
solid
#eee
;
}
table
.data-ongoing
td
.row-status
{
border-left
:
1px
solid
#fff1f5
;
}
}
/**
* 订单二维码支付页面
*/
.qrcode-pay
{
text-align
:
center
;
box-shadow
:
none
;
}
.qrcode-pay
.name
{
font-size
:
18px
;
font-weight
:
500
;
margin
:
20px
0
10px
0
;
}
.qrcode-pay
.msg
{
color
:
#F44336
;
}
\ No newline at end of file
public/static/index/default/js/order.qrcodepay.js
0 → 100644
浏览文件 @
ae87b20f
$
(
function
()
{
// 定时查询订单是否已支付
setInterval
(
function
()
{
// ajax请求
$
.
ajax
({
url
:
$
(
'
.qrcode-pay
'
).
data
(
'
ajax-url
'
),
type
:
'
post
'
,
dataType
:
"
json
"
,
timeout
:
10000
,
data
:
{
"
order_no
"
:
$
(
'
.qrcode-pay
'
).
data
(
'
order-no
'
)},
success
:
function
(
result
)
{
if
(
result
.
code
==
0
&&
(
result
.
data
.
url
||
null
)
!=
null
)
{
Prompt
(
result
.
msg
,
'
success
'
);
setTimeout
(
function
()
{
window
.
location
.
href
=
result
.
data
.
url
;
},
1500
);
}
else
if
(
result
.
code
==
-
400
&&
(
result
.
data
.
url
||
null
)
!=
null
)
{
Prompt
(
result
.
msg
);
setTimeout
(
function
()
{
window
.
location
.
href
=
result
.
data
.
url
;
},
1500
);
}
else
{
if
(
result
.
code
!=
-
300
)
{
Prompt
(
result
.
msg
);
}
}
},
error
:
function
(
xhr
,
type
)
{
Prompt
(
'
网络异常错误
'
);
}
});
},
2000
);
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录