Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
6d420f5b
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,发现更多精彩内容 >>
提交
6d420f5b
编写于
3月 12, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
快递查询
上级
a3833e41
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
745 addition
and
3 deletion
+745
-3
application/admin/controller/Common.php
application/admin/controller/Common.php
+33
-0
application/admin/view/default/order/index.html
application/admin/view/default/order/index.html
+9
-0
application/admin/view/default/public/footer.html
application/admin/view/default/public/footer.html
+34
-0
application/admin/view/default/public/header.html
application/admin/view/default/public/header.html
+33
-1
application/index/view/default/order/index.html
application/index/view/default/order/index.html
+14
-0
application/plugins/expressforkdn/Admin.php
application/plugins/expressforkdn/Admin.php
+65
-0
application/plugins/expressforkdn/Hook.php
application/plugins/expressforkdn/Hook.php
+317
-0
application/plugins/expressforkdn/config.json
application/plugins/expressforkdn/config.json
+42
-0
application/plugins/view/expressforkdn/admin/content.html
application/plugins/view/expressforkdn/admin/content.html
+10
-0
application/plugins/view/expressforkdn/admin/index.html
application/plugins/view/expressforkdn/admin/index.html
+54
-0
application/plugins/view/expressforkdn/admin/saveinfo.html
application/plugins/view/expressforkdn/admin/saveinfo.html
+44
-0
application/service/OrderService.php
application/service/OrderService.php
+30
-0
application/tags.php
application/tags.php
+25
-0
changelog.txt
changelog.txt
+3
-2
public/static/plugins/css/expressforkdn/admin.css
public/static/plugins/css/expressforkdn/admin.css
+32
-0
public/static/upload/images/plugins_expressforkdn/2019/03/11/1552286675575734.png
...ges/plugins_expressforkdn/2019/03/11/1552286675575734.png
+0
-0
未找到文件。
application/admin/controller/Common.php
浏览文件 @
6d420f5b
...
...
@@ -10,6 +10,7 @@
// +----------------------------------------------------------------------
namespace
app\admin\controller
;
use
think\facade\Hook
;
use
think\Controller
;
use
app\service\AdminPowerService
;
use
app\service\ConfigService
;
...
...
@@ -59,8 +60,40 @@ class Common extends Controller
// 视图初始化
$this
->
ViewInit
();
// 公共钩子初始化
$this
->
CommonPluginsInit
();
}
/**
* 公共钩子初始化
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-07
* @desc description
*/
private
function
CommonPluginsInit
()
{
// css钩子
$this
->
assign
(
'plugins_admin_css_data'
,
Hook
::
listen
(
'plugins_admin_css'
,
[
'hook_name'
=>
'plugins_admin_css'
,
'is_backend'
=>
false
]));
// js钩子
$this
->
assign
(
'plugins_admin_js_data'
,
Hook
::
listen
(
'plugins_admin_js'
,
[
'hook_name'
=>
'plugins_admin_js'
,
'is_backend'
=>
false
]));
// 公共header内钩子
$this
->
assign
(
'plugins_admin_common_header_data'
,
Hook
::
listen
(
'plugins_admin_common_header'
,
[
'hook_name'
=>
'plugins_admin_common_header'
,
'is_backend'
=>
false
,
'admin'
=>
$this
->
admin
]));
// 公共页面底部钩子
$this
->
assign
(
'plugins_admin_common_page_bottom_data'
,
Hook
::
listen
(
'plugins_admin_common_page_bottom'
,
[
'hook_name'
=>
'plugins_admin_common_page_bottom'
,
'is_backend'
=>
false
,
'admin'
=>
$this
->
admin
]));
// 公共顶部钩子
$this
->
assign
(
'plugins_admin_view_common_top_data'
,
Hook
::
listen
(
'plugins_admin_view_common_top'
,
[
'hook_name'
=>
'plugins_admin_view_common_top'
,
'is_backend'
=>
false
,
'admin'
=>
$this
->
admin
]));
// 公共底部钩子
$this
->
assign
(
'plugins_admin_view_common_bottom_data'
,
Hook
::
listen
(
'plugins_admin_view_common_bottom'
,
[
'hook_name'
=>
'plugins_admin_view_common_bottom'
,
'is_backend'
=>
false
,
'admin'
=>
$this
->
admin
]));
}
/**
* 系统初始化
* @author Devil
...
...
application/admin/view/default/order/index.html
浏览文件 @
6d420f5b
...
...
@@ -259,6 +259,15 @@
{{if in_array($v['status'], [5,6])}}
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/order/delete')}}"
data-id=
"{{$v.id}}"
data-value=
"{{$v.user_id}}"
data-view=
"delete"
data-msg=
"删除后无法恢复,确定继续吗?"
>
删除
</button>
{{/if}}
<!-- 钩子订单操作 -->
{{if !empty($v['plugins_service_order_handle_operation_html']) and is_array($v['plugins_service_order_handle_operation_html'])}}
{{foreach $v.plugins_service_order_handle_operation_html as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</td>
</tr>
{{/foreach}}
...
...
application/admin/view/default/public/footer.html
浏览文件 @
6d420f5b
<!-- commom html -->
<textarea
id=
"upload-editor-view"
data-url=
"{{:MyUrl('admin/ueditor/index', ['path_type'=>empty($editor_path_type) ? 'common' : $editor_path_type])}}"
style=
"display: none;"
></textarea>
<!-- 公共底部钩子 -->
{{if !empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data) and (!isset($is_footer) or $is_footer eq 1)}}
{{foreach $plugins_admin_view_common_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</body>
</html>
...
...
@@ -55,4 +65,28 @@
<!-- 控制器 -->
{{if !empty($module_js)}}
<script
type=
'text/javascript'
src=
"{{$Think.__MY_ROOT_PUBLIC__}}static/{{$module_js}}"
></script>
{{/if}}
<!-- js钩子 -->
{{if !empty($plugins_admin_js_data) and is_array($plugins_admin_js_data)}}
{{foreach $plugins_admin_js_data as $hook}}
{{if is_string($hook)}}
<script
type=
'text/javascript'
src=
"{{$hook}}"
></script>
{{elseif is_array($hook) /}}
{{foreach $hook as $hook_js}}
{{if is_string($hook_js)}}
<script
type=
'text/javascript'
src=
"{{$hook_js}}"
></script>
{{/if}}
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 公共页面底部钩子 -->
{{if !empty($plugins_admin_common_page_bottom_data) and is_array($plugins_admin_common_page_bottom_data)}}
{{foreach $plugins_admin_common_page_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
\ No newline at end of file
application/admin/view/default/public/header.html
浏览文件 @
6d420f5b
...
...
@@ -15,8 +15,40 @@
{{if !empty($module_css)}}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{$Think.__MY_ROOT_PUBLIC__}}static/{{$module_css}}"
/>
{{/if}}
<!-- css钩子 -->
{{if !empty($plugins_admin_css_data) and is_array($plugins_admin_css_data)}}
{{foreach $plugins_admin_css_data as $hook}}
{{if is_string($hook)}}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{$hook}}?v={{:MyC('home_static_cache_version')}}"
/>
{{elseif is_array($hook) /}}
{{foreach $hook as $hook_css}}
{{if is_string($hook_css)}}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{{$hook_css}}?v={{:MyC('home_static_cache_version')}}"
/>
{{/if}}
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
<!-- 公共header内钩子 -->
{{if !empty($plugins_admin_common_header_data) and is_array($plugins_admin_common_header_data)}}
{{foreach $plugins_admin_common_header_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</head>
<script
type=
"text/javascript"
>
var
__attachment_host__
=
'
{{$attachment_host}}
'
;
</script>
<body>
\ No newline at end of file
<body>
<!-- 公共顶部钩子 -->
{{if !empty($plugins_admin_view_common_top_data) and is_array($plugins_admin_view_common_top_data) and (!isset($is_header) or $is_header eq 1)}}
{{foreach $plugins_admin_view_common_top_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
\ No newline at end of file
application/index/view/default/order/index.html
浏览文件 @
6d420f5b
...
...
@@ -204,6 +204,20 @@
{{if in_array($order['status'], [4,5,6])}}
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('index/order/delete')}}"
data-id=
"{{$order.id}}"
data-view=
"reload"
>
删除
</button>
{{/if}}
<!-- 钩子订单操作 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<div
class=
"plugins-tag"
>
<span>
plugins_service_order_handle_operation_html
</span>
</div>
{{/if}}
{{if !empty($order['plugins_service_order_handle_operation_html']) and is_array($order['plugins_service_order_handle_operation_html'])}}
{{foreach $order.plugins_service_order_handle_operation_html as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</td>
{{/if}}
</tr>
...
...
application/plugins/expressforkdn/Admin.php
0 → 100644
浏览文件 @
6d420f5b
<?php
namespace
app\plugins\expressforkdn
;
use
think\Controller
;
use
app\service\PluginsService
;
use
think\facade\Hook
;
use
app\service\ExpressService
;
/**
* 快递鸟API接口 - 后台管理
* @author GuoGuo
* @blog http://gadmin.cojz8.com/
* @version 1.0.0
* @datetime 2016-12-01T21:51:08+0800
*/
class
Admin
extends
Controller
{
// 后台管理入口
public
function
index
(
$params
=
[])
{
$ret
=
PluginsService
::
PluginsData
(
'expressforkdn'
);
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'express_list'
,
ExpressService
::
ExpressList
());
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/expressforkdn/admin/index'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 编辑页面
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
saveinfo
(
$params
=
[])
{
$ret
=
PluginsService
::
PluginsData
(
'expressforkdn'
);
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'express_list'
,
ExpressService
::
ExpressList
());
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/expressforkdn/admin/saveinfo'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 数据保存
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-07T08:21:54+0800
* @param [array] $params [输入参数]
*/
public
function
save
(
$params
=
[])
{
return
PluginsService
::
PluginsDataSave
([
'plugins'
=>
'expressforkdn'
,
'data'
=>
$params
]);
}
}
?>
\ No newline at end of file
application/plugins/expressforkdn/Hook.php
0 → 100644
浏览文件 @
6d420f5b
<?php
namespace
app\plugins\expressforkdn
;
use
think\Controller
;
use
app\service\PluginsService
;
/**
* 快递鸟API接口 - 钩子入口
* @author GuoGuo
* @blog http://gadmin.cojz8.com/
* @version 1.0.0
* @datetime 2016-12-01T21:51:08+0800
*/
class
Hook
extends
Controller
{
// 应用响应入口
public
function
run
(
$params
=
[])
{
if
(
!
empty
(
$params
[
'hook_name'
]))
{
switch
(
$params
[
'hook_name'
])
{
// 操作按钮
case
'plugins_service_order_handle_begin'
:
$ret
=
$this
->
operation
(
$params
);
break
;
// 弹窗代码
case
'plugins_view_common_bottom'
:
case
'plugins_admin_view_common_bottom'
:
$ret
=
$this
->
html
(
$params
);
break
;
// 页面底部
case
'plugins_common_page_bottom'
:
case
'plugins_admin_common_page_bottom'
:
$ret
=
$this
->
js
(
$params
);
break
;
// header代码
case
'plugins_common_header'
:
case
'plugins_admin_common_header'
:
$ret
=
$this
->
css
(
$params
);
break
;
default
:
$ret
=
''
;
}
return
$ret
;
}
return
''
;
}
/**
* css
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public
function
css
(
$params
=
[])
{
return
'<style type="text/css">
#plugins-expressforkdn-popup p { font-size: 16px; color: #FF9800; font-weight: 500; padding: 1rem; text-align: center; margin: 0; }
#plugins-expressforkdn-popup .am-list-static > li { padding: .8rem 1rem; }
#plugins-expressforkdn-popup .am-popup-bd { padding: 0; }
#plugins-expressforkdn-popup .am-list > li { border: 1px dashed #dedede; border-width: 1px 0; }
</style>'
;
}
/**
* js
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public
function
js
(
$params
=
[])
{
return
'<script type="text/javascript">
$(function()
{
$(".plugins-expressforkdn-submit").on("click", function()
{
$.ajax({
url:"'
.
PluginsAdminUrl
(
'expressforkdn'
,
'hook'
,
'getexpinfo'
)
.
'",
type:"POST",
dataType:"json",
data: {express_id: $(this).data("exp-id"), express_number: $(this).data("exp-num")},
success:function(result)
{
$("#plugins-expressforkdn-popup").modal();
if(result.code == 0)
{
$("#plugins-expressforkdn-popup .am-popup-bd").html(result.data);
} else {
$("#plugins-expressforkdn-popup .am-popup-bd").html(result.data || result.msg);
}
}
});
});
});
</script>'
;
}
/**
* 视图
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public
function
html
(
$params
=
[])
{
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'expressforkdn'
,
[
'images'
]);
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/expressforkdn/admin/content'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
* 操作
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-02-06T16:16:34+0800
* @param [array] $params [输入参数]
*/
public
function
operation
(
$params
=
[])
{
if
(
empty
(
$params
[
'order'
]))
{
return
DataReturn
(
'订单为空'
,
-
1
);
}
// 钩子html
if
(
isset
(
$params
[
'order'
][
'status'
])
&&
in_array
(
$params
[
'order'
][
'status'
],
[
3
,
4
]))
{
$params
[
'order'
][
'plugins_service_order_handle_operation_html'
][]
=
'<button class="am-btn am-btn-warning am-btn-xs am-radius am-icon-cube am-btn-block plugins-expressforkdn-submit" data-exp-id="'
.
$params
[
'order'
][
'express_id'
]
.
'" data-exp-num="'
.
$params
[
'order'
][
'express_number'
]
.
'"> 物流</button>'
;
}
return
DataReturn
(
'处理成功'
,
0
);
}
/**
* 获取物流信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-12
* @desc description
* @param [array] $params [输入参数]
* @return [type] [description]
*/
public
function
getexpinfo
(
$params
=
[])
{
// html
$html
=
''
;
// 请求参数
$p
=
[
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'express_id'
,
'error_msg'
=>
'快递id有误'
,
],
[
'checked_type'
=>
'empty'
,
'key_name'
=>
'express_number'
,
'error_msg'
=>
'快递单号有误'
,
],
];
$ret
=
ParamsChecked
(
$params
,
$p
);
if
(
$ret
!==
true
)
{
return
DataReturn
(
$ret
,
-
1
,
'<p>'
.
$ret
.
'</p>'
);
}
// 获取配置数据
$ret
=
PluginsService
::
PluginsData
(
'expressforkdn'
);
if
(
$ret
[
'code'
]
==
0
)
{
// 是否配置物流代码
if
(
empty
(
$ret
[
'data'
][
'express_ids'
][
$params
[
'express_id'
]]))
{
return
DataReturn
(
'请先再后台配置物流代码'
,
-
1
,
'<p>请先再后台配置物流代码</p>'
);
}
// 获取快递信息
$data
=
$this
->
expresstraces
([
'shipper_code'
=>
$ret
[
'data'
][
'express_ids'
][
$params
[
'express_id'
]],
'logistic_code'
=>
$params
[
'express_number'
],
'config'
=>
$ret
[
'data'
]]);
// 状态列表
$status_arr
=
[
0
=>
'暂无物流信息'
,
1
=>
'快递公司已揽收'
,
2
=>
'快递正在配送途中...'
,
3
=>
'该物流已被签收'
,
4
=>
'该物流问题件,请咨询物流商处理!'
,
];
if
(
!
isset
(
$data
[
'State'
])
||
!
isset
(
$status_arr
[
$data
[
'State'
]]))
{
return
DataReturn
(
'查询失败'
,
-
1
,
'<p>查询失败</p>'
);
}
// 开始处理
$html
.
=
'<p>'
.
$status_arr
[
$data
[
'State'
]]
.
'</p>'
;
$html
.
=
'<ul class="am-list am-list-static">'
;
// 快递信息
if
(
in_array
(
$data
[
'State'
],
[
2
,
3
])
&&
!
empty
(
$data
[
'Traces'
])
&&
is_array
(
$data
[
'Traces'
]))
{
foreach
(
$data
[
'Traces'
]
as
$k
=>
$v
)
{
$html
.
=
'<li class="items">'
.
$v
[
'AcceptTime'
]
.
''
.
$v
[
'AcceptStation'
]
.
'</li>'
;
}
}
return
DataReturn
(
'处理成功'
,
0
,
$html
);
}
else
{
return
DataReturn
(
$ret
[
'msg'
],
-
100
);
}
}
/**
* 获取物流信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-03-12
* @desc description
* @param [array] $params [输入参数]
* @return [type] [description]
*/
public
function
expresstraces
(
$params
=
[])
{
// 参数
if
(
empty
(
$params
[
'shipper_code'
])
||
empty
(
$params
[
'logistic_code'
])
||
empty
(
$params
[
'config'
]))
{
return
[
'State'
=>
0
,
'Reason'
=>
'请求参数有误'
];
}
// 请求数据
$url
=
'http://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx'
;
$request_data
=
json_encode
([
'OrderCode'
=>
''
,
'ShipperCode'
=>
$params
[
'shipper_code'
],
'LogisticCode'
=>
$params
[
'logistic_code'
],
]);
$data
=
array
(
'EBusinessID'
=>
$params
[
'config'
][
'ebid'
],
'RequestType'
=>
'1002'
,
'RequestData'
=>
urlencode
(
$request_data
)
,
'DataType'
=>
'2'
,
);
$data
[
'DataSign'
]
=
$this
->
encrypt
(
$request_data
,
$params
[
'config'
][
'appkey'
]);
return
$this
->
request_post
(
$url
,
$data
);
}
/**
* post提交数据
* @param string $url 请求Url
* @param array $data 提交的数据
* @return url响应返回的html
*/
public
function
request_post
(
$url
,
$data
)
{
$temps
=
array
();
foreach
(
$data
as
$key
=>
$value
)
{
$temps
[]
=
sprintf
(
'%s=%s'
,
$key
,
$value
);
}
$post_data
=
implode
(
'&'
,
$temps
);
$url_info
=
parse_url
(
$url
);
if
(
empty
(
$url_info
[
'port'
]))
{
$url_info
[
'port'
]
=
80
;
}
$httpheader
=
"POST "
.
$url_info
[
'path'
]
.
" HTTP/1.0
\r\n
"
;
$httpheader
.
=
"Host:"
.
$url_info
[
'host'
]
.
"
\r\n
"
;
$httpheader
.
=
"Content-Type:application/x-www-form-urlencoded
\r\n
"
;
$httpheader
.
=
"Content-Length:"
.
strlen
(
$post_data
)
.
"
\r\n
"
;
$httpheader
.
=
"Connection:close
\r\n\r\n
"
;
$httpheader
.
=
$post_data
;
$fd
=
fsockopen
(
$url_info
[
'host'
],
$url_info
[
'port'
]);
fwrite
(
$fd
,
$httpheader
);
$gets
=
""
;
$headerFlag
=
true
;
while
(
!
feof
(
$fd
))
{
if
((
$header
=
@
fgets
(
$fd
))
&&
(
$header
==
"
\r\n
"
||
$header
==
"
\n
"
))
{
break
;
}
}
while
(
!
feof
(
$fd
))
{
$gets
.
=
fread
(
$fd
,
128
);
}
fclose
(
$fd
);
return
json_decode
(
$gets
,
true
);
}
/**
* 电商Sign签名生成
* @param data 内容
* @param appkey Appkey
* @return DataSign签名
*/
public
function
encrypt
(
$data
,
$appkey
)
{
return
urlencode
(
base64_encode
(
md5
(
$data
.
$appkey
)));
}
}
?>
\ No newline at end of file
application/plugins/expressforkdn/config.json
0 → 100644
浏览文件 @
6d420f5b
{
"base"
:{
"plugins"
:
"expressforkdn"
,
"name"
:
"快递鸟API接口"
,
"logo"
:
"
\/
static
\/
upload
\/
images
\/
plugins_expressforkdn
\/
2019
\/
03
\/
11
\/
1552286675575734.png"
,
"author"
:
"guoguo"
,
"author_url"
:
"http:
\/\/
gadmin.cojz8.com"
,
"version"
:
"1.0.0"
,
"desc"
:
"集成快递鸟第三方后台查询接口"
,
"apply_terminal"
:[
"pc"
,
"h5"
],
"apply_version"
:[
"1.4.0"
],
"is_home"
:
false
},
"hook"
:{
"plugins_view_common_bottom"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_admin_view_common_bottom"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_common_page_bottom"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_admin_common_page_bottom"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_common_header"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_admin_common_header"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
],
"plugins_service_order_handle_begin"
:[
"app
\\
plugins
\\
expressforkdn
\\
Hook"
]
}
}
\ No newline at end of file
application/plugins/view/expressforkdn/admin/content.html
0 → 100644
浏览文件 @
6d420f5b
<!-- 物流信息 -->
<div
class=
"am-popup"
id=
"plugins-expressforkdn-popup"
>
<div
class=
"am-popup-inner"
>
<div
class=
"am-popup-hd"
>
<h4
class=
"am-popup-title"
>
物流信息
</h4>
<span
data-am-modal-close
class=
"am-close"
>
×
</span>
</div>
<div
class=
"am-popup-bd"
>
...
</div>
</div>
</div>
\ No newline at end of file
application/plugins/view/expressforkdn/admin/index.html
0 → 100644
浏览文件 @
6d420f5b
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<legend>
<span
class=
"fs-16"
>
快递鸟API接口
</span>
<a
href=
"{{:MyUrl('admin/pluginsadmin/index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"expressforkdn-content"
>
<div
class=
"items"
>
<label>
EBusinessID
</label>
<div>
{{if empty($data['ebid'])}}
未填写
{{else /}}
{{$data.ebid}}
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
AppKey
</label>
<div>
{{if empty($data['appkey'])}}
未填写
{{else /}}
{{$data.appkey}}
{{/if}}
</div>
</div>
<div
class=
"am-form-group"
>
<label>
快递对应代码
</label>
<div
class=
"express-items"
>
{{if !empty($express_list)}}
{{foreach $express_list as $express}}
{{if $express.is_enable eq 1}}
<p>
{{$express.name}} {{if !empty($data['express_ids'][$express['id']])}}({{$data.express_ids[$express.id]}}){{/if}}
</p>
{{/if}}
{{/foreach}}
{{/if}}
</div>
</div>
<a
href=
"{{:PluginsAdminUrl('expressforkdn', 'admin', 'saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit"
>
编辑
</a>
</div>
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/plugins/view/expressforkdn/admin/saveinfo.html
0 → 100644
浏览文件 @
6d420f5b
{{include file="public/header" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content expressforkdn-content"
>
<!-- form start -->
<form
class=
"am-form form-validation view-save"
action=
"{{:PluginsAdminUrl('expressforkdn', 'admin', 'save')}}"
method=
"POST"
request-type=
"ajax-url"
request-value=
"{{:PluginsAdminUrl('expressforkdn', 'admin', 'index')}}"
enctype=
"multipart/form-data"
>
<legend>
<span
class=
"fs-16"
>
快递鸟API接口
</span>
<a
href=
"{{:PluginsAdminUrl('expressforkdn', 'admin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group"
>
<label>
EBusinessID
</label>
<input
type=
"text"
name=
"ebid"
placeholder=
"商户ID"
maxlength=
"16"
class=
"am-radius"
value=
"{{if !empty($data['ebid'])}}{{$data.ebid}}{{/if}}"
/>
</div>
<div
class=
"am-form-group"
>
<label
class=
"block"
>
AppKey
</label>
<input
type=
"text"
name=
"appkey"
placeholder=
"AppKey"
maxlength=
"80"
class=
"am-radius"
value=
"{{if !empty($data['appkey'])}}{{$data.appkey}}{{/if}}"
/>
</div>
<div
class=
"am-form-group express-items"
>
<label
class=
"block"
>
快递代码
<span
class=
"am-form-group-label-tips"
>
下面应对应快递代号
<a
href=
'http://www.kdniao.com/file/2019%E5%BF%AB%E9%80%92%E9%B8%9F%E6%8E%A5%E5%8F%A3%E6%94%AF%E6%8C%81%E5%BF%AB%E9%80%92%E5%85%AC%E5%8F%B8%E7%BC%96%E7%A0%81.xlsx'
>
点击下载
</a></span></label>
{{if !empty($express_list)}}
{{foreach $express_list as $express}}
{{if $express.is_enable eq 1}}
<p>
{{$express.name}}
<input
type=
"text"
name=
"express_ids[{{$express.id}}]"
placeholder=
"快递代号"
class=
"am-radius"
value=
"{{if !empty($data['express_ids'])}}{{$data.express_ids[$express.id]}}{{/if}}"
/></p>
{{/if}}
{{/foreach}}
{{/if}}
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<button
type=
"submit"
class=
"am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100"
data-am-loading=
"{loadingText:'处理中...'}"
>
保存
</button>
</div>
</form>
<!-- form end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
application/service/OrderService.php
浏览文件 @
6d420f5b
...
...
@@ -11,6 +11,7 @@
namespace
app\service
;
use
think\Db
;
use
think\facade\Hook
;
use
app\service\PaymentService
;
use
app\service\BuyService
;
use
app\service\IntegralService
;
...
...
@@ -578,6 +579,20 @@ class OrderService
$order_pay_status
=
lang
(
'common_order_pay_status'
);
foreach
(
$data
as
&
$v
)
{
// 订单处理前钩子
$hook_name
=
'plugins_service_order_handle_begin'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'params'
=>
&
$params
,
'order'
=>
&
$v
,
'order_id'
=>
$v
[
'id'
]
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 状态
$v
[
'status_name'
]
=
$order_status_list
[
$v
[
'status'
]][
'name'
];
...
...
@@ -692,8 +707,23 @@ class OrderService
// 描述
$v
[
'describe'
]
=
'共'
.
$v
[
'items_count'
]
.
'件 合计:¥'
.
$v
[
'total_price'
]
.
'元'
;
}
// 订单处理后钩子
$hook_name
=
'plugins_service_order_handle_end'
;
$ret
=
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'params'
=>
&
$params
,
'order'
=>
&
$v
,
'order_id'
=>
$v
[
'id'
]
]);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
}
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
...
...
application/tags.php
浏览文件 @
6d420f5b
...
...
@@ -59,6 +59,7 @@ return array (
array
(
0
=>
'app\\plugins\\commonrightnavigation\\Hook'
,
1
=>
'app\\plugins\\commononlineservice\\Hook'
,
2
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_service_goods_handle_end'
=>
array
(
...
...
@@ -72,5 +73,29 @@ return array (
array
(
0
=>
'app\\plugins\\answers\\Hook'
,
),
'plugins_admin_view_common_bottom'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_common_page_bottom'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_admin_common_page_bottom'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_common_header'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_admin_common_header'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
'plugins_service_order_handle_begin'
=>
array
(
0
=>
'app\\plugins\\expressforkdn\\Hook'
,
),
);
?>
\ No newline at end of file
changelog.txt
浏览文件 @
6d420f5b
...
...
@@ -5,8 +5,9 @@
1. 后台管理菜单优化、部分细节优化及BUG修复
2. 新增商品价格配置显隐应用
3. 新增问答增强版应用
4. 新增码支付模块 - 开发中
5. 新增游客购物应用 - 开发中
4. 新增物流查询应用
5. 新增码支付模块 - 开发中
6. 新增游客购物应用 - 开发中
前端功能列表
1. 新增商品价格配置显隐应用
...
...
public/static/plugins/css/expressforkdn/admin.css
0 → 100755
浏览文件 @
6d420f5b
/**
* 首页
*/
.expressforkdn-content
.items
{
margin
:
10px
0
20px
0
;
border-bottom
:
1px
dashed
#f1f1f1
;
padding-bottom
:
20px
;
}
.expressforkdn-content
.express-items
{
overflow
:
hidden
;
}
.expressforkdn-content
.express-items
p
{
border
:
1px
dashed
#ccc
;
padding
:
6px
;
float
:
left
;
margin
:
0
;
}
.expressforkdn-content
.express-items
p
input
{
display
:
-webkit-inline-box
;
width
:
80px
;
font-size
:
12px
!important
;
}
.expressforkdn-content
.express-items
p
:not
(
:last-child
)
{
margin
:
0
20px
10px
0
;
}
.expressforkdn-content
.edit-submit
{
margin-bottom
:
20px
;
}
/**
* 编辑页面
*/
public/static/upload/images/plugins_expressforkdn/2019/03/11/1552286675575734.png
0 → 100644
浏览文件 @
6d420f5b
16.9 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录