Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
a87e55e2
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,发现更多精彩内容 >>
提交
a87e55e2
编写于
3月 16, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
游客购买应用
上级
2a690119
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
135 addition
and
103 deletion
+135
-103
application/plugins/commongobacktop/Hook.php
application/plugins/commongobacktop/Hook.php
+16
-29
application/plugins/touristbuy/Hook.php
application/plugins/touristbuy/Hook.php
+16
-16
application/plugins/touristbuy/Index.php
application/plugins/touristbuy/Index.php
+16
-4
application/plugins/touristbuy/Service.php
application/plugins/touristbuy/Service.php
+22
-9
application/plugins/view/touristbuy/admin/index.html
application/plugins/view/touristbuy/admin/index.html
+29
-15
application/plugins/view/touristbuy/admin/saveinfo.html
application/plugins/view/touristbuy/admin/saveinfo.html
+12
-17
application/plugins/view/touristbuy/index/detail.html
application/plugins/view/touristbuy/index/detail.html
+13
-0
application/plugins/view/touristbuy/index/index.html
application/plugins/view/touristbuy/index/index.html
+8
-6
public/static/plugins/css/touristbuy/index.css
public/static/plugins/css/touristbuy/index.css
+3
-7
未找到文件。
application/plugins/commongobacktop/Hook.php
浏览文件 @
a87e55e2
...
...
@@ -32,41 +32,28 @@ class Hook extends Controller
*/
public
function
run
(
$params
=
[])
{
// 是否控制器钩子
// is_backend 当前为后端业务处理
// hook_name 钩子名称
if
(
isset
(
$params
[
'is_backend'
])
&&
$params
[
'is_backend'
]
===
true
&&
!
empty
(
$params
[
'hook_name'
]))
if
(
!
empty
(
$params
[
'hook_name'
]))
{
// 参数一 描述
// 参数二 0 为处理成功, 负数为失败
// 参数三 返回数据
return
DataReturn
(
'返回描述'
,
0
);
// 默认返回视图
}
else
{
if
(
!
empty
(
$params
[
'hook_name'
]))
switch
(
$params
[
'hook_name'
])
{
switch
(
$params
[
'hook_name'
])
{
case
'plugins_view_common_bottom'
:
$ret
=
$this
->
html
(
$params
);
break
;
case
'plugins_view_common_bottom'
:
$ret
=
$this
->
html
(
$params
);
break
;
case
'plugins_common_page_bottom'
:
$ret
=
$this
->
js
(
$params
);
break
;
case
'plugins_common_page_bottom'
:
$ret
=
$this
->
js
(
$params
);
break
;
case
'plugins_common_header'
:
$ret
=
$this
->
css
(
$params
);
break
;
case
'plugins_common_header'
:
$ret
=
$this
->
css
(
$params
);
break
;
default
:
$ret
=
''
;
}
return
$ret
;
}
else
{
return
''
;
default
:
$ret
=
''
;
}
return
$ret
;
}
else
{
return
''
;
}
}
...
...
application/plugins/touristbuy/Hook.php
浏览文件 @
a87e55e2
...
...
@@ -84,7 +84,6 @@ class Hook extends Controller
{
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$ret
[
'data'
][
'application_name'
]
=
'订单查询'
;
if
(
$ret
[
'code'
]
==
0
&&
!
empty
(
$ret
[
'data'
][
'application_name'
]))
{
$params
[
'header'
][]
=
[
...
...
@@ -114,9 +113,6 @@ class Hook extends Controller
return
'<style type="text/css">
.plugins-touristbuy-nav-top, .plugins-touristbuy-login-info-btn { margin-left: 10px; }
.plugins-touristbuy-nav-top { color: #FF5722; }
.plugins-touristbuy-index { margin-top: 5%; }
.plugins-touristbuy-index form.am-form { margin-top: 20px; }
.plugins-touristbuy-index form.am-form .am-form-group { padding: 0 !important; }
</style>'
;
}
...
...
@@ -130,18 +126,24 @@ class Hook extends Controller
*/
public
function
UserLoginInfoHtml
(
$params
=
[])
{
// html
$html
=
''
;
// 获取已登录用户信息,已登录则不展示入口
$user
=
UserService
::
LoginUserInfo
();
if
(
empty
(
$user
))
{
// 获取插件信息
// 当前模块/控制器/方法
$module_name
=
strtolower
(
request
()
->
module
());
$controller_name
=
strtolower
(
request
()
->
controller
());
$action_name
=
strtolower
(
request
()
->
action
());
// 当前窗口登录父级
$is_parent
=
(
$module_name
.
$controller_name
.
$action_name
==
'indexusermodallogininfo'
)
?
1
:
0
;
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$html
=
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
)
.
'" target="_blank" class="am-btn am-btn-secondary am-btn-xs am-radius plugins-touristbuy-login-info-btn">游客登录</a>'
;
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客登录'
:
$ret
[
'data'
][
'login_name'
];
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
,
[
'is_parent'
=>
$is_parent
])
.
'" class="am-btn am-btn-warning am-btn-xs am-radius plugins-touristbuy-login-info-btn">'
.
$ret
[
'data'
][
'login_name'
]
.
'</a>'
;
}
return
$html
;
return
''
;
}
/**
...
...
@@ -154,18 +156,16 @@ class Hook extends Controller
*/
public
function
LoginNavTopHtml
(
$params
=
[])
{
// html
$html
=
''
;
// 获取已登录用户信息,已登录则不展示入口
$user
=
UserService
::
LoginUserInfo
();
if
(
empty
(
$user
))
{
// 获取
插件信息
// 获取
应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$html
=
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
)
.
'" class="plugins-touristbuy-nav-top">游客登录</a>'
;
$login_name
=
empty
(
$ret
[
'data'
][
'login_name'
])
?
'游客登录'
:
$ret
[
'data'
][
'login_name'
];
return
'<a href="'
.
PluginsHomeUrl
(
'touristbuy'
,
'index'
,
'login'
)
.
'" class="plugins-touristbuy-nav-top">'
.
$login_name
.
'</a>'
;
}
return
$html
;
return
''
;
}
}
?>
\ No newline at end of file
application/plugins/touristbuy/Index.php
浏览文件 @
a87e55e2
...
...
@@ -14,6 +14,7 @@ use think\Controller;
use
app\plugins\touristbuy\Service
;
use
app\service\SeoService
;
use
app\service\OrderService
;
use
app\service\PluginsService
;
/**
* 游客购买 - 前端独立页面入口
...
...
@@ -34,8 +35,15 @@ class Index extends Controller
*/
public
function
index
(
$params
=
[])
{
$this
->
assign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
'订单查询'
,
1
));
return
$this
->
fetch
(
'../../../plugins/view/touristbuy/index/index'
);
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
$this
->
assign
(
'home_seo_site_title'
,
SeoService
::
BrowserSeoTitle
(
'订单查询'
,
1
));
return
$this
->
fetch
(
'../../../plugins/view/touristbuy/index/index'
);
}
else
{
return
$ret
[
'msg'
];
}
}
/**
...
...
@@ -116,12 +124,16 @@ class Index extends Controller
$ret
=
Service
::
TouristReg
();
if
(
$ret
[
'code'
]
==
0
)
{
return
$this
->
redirect
(
__MY_URL__
);
if
(
isset
(
$params
[
'is_parent'
])
&&
$params
[
'is_parent'
]
==
1
)
{
return
'<script type="text/javascript">if(self.frameElement && self.frameElement.tagName == "IFRAME"){parent.location.reload();}else{window.location.href="'
.
__MY_URL__
.
'";}</script>'
;
}
else
{
return
$this
->
redirect
(
__MY_URL__
);
}
}
else
{
$this
->
assign
(
'msg'
,
$ret
[
'msg'
]);
return
$this
->
fetch
(
'public/error'
);
}
}
}
?>
\ No newline at end of file
application/plugins/touristbuy/Service.php
浏览文件 @
a87e55e2
...
...
@@ -12,6 +12,7 @@ namespace app\plugins\touristbuy;
use
think\Db
;
use
app\service\UserService
;
use
app\service\PluginsService
;
/**
* 问答系统服务层
...
...
@@ -40,23 +41,35 @@ class Service
return
DataReturn
(
'已登录,请先退出'
,
-
1
);
}
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'touristbuy'
);
$nickname
=
empty
(
$ret
[
'data'
][
'nickname'
])
?
'游客'
:
$ret
[
'data'
][
'nickname'
];
// 是否重复注册
$tourist_user_id
=
session
(
'tourist_user_id'
);
if
(
!
empty
(
$tourist_user_id
))
{
// 用户登录session纪录
if
(
UserService
::
UserLoginRecord
(
$tourist_user_id
))
// 更新用户信息
$upd_data
=
[
'username'
=>
$nickname
,
'nickname'
=>
$nickname
,
'upd_time'
=>
time
(),
];
if
(
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$tourist_user_id
])
->
update
(
$upd_data
))
{
return
DataReturn
(
'游客登录成功'
,
0
);
}
else
{
session
(
'tourist_user_id'
,
null
);
// 用户登录session纪录
if
(
UserService
::
UserLoginRecord
(
$tourist_user_id
))
{
return
DataReturn
(
$nickname
.
'登录成功'
,
0
);
}
}
session
(
'tourist_user_id'
,
null
);
}
// 游客数据
$data
=
[
'username'
=>
'游客'
,
'nickname'
=>
'游客'
,
'username'
=>
$nickname
,
'nickname'
=>
$nickname
,
'status'
=>
0
,
'add_time'
=>
time
(),
'upd_time'
=>
time
(),
...
...
@@ -72,10 +85,10 @@ class Service
// 用户登录session纪录
if
(
UserService
::
UserLoginRecord
(
$user_id
))
{
return
DataReturn
(
'游客
登录成功'
,
0
);
return
DataReturn
(
$nickname
.
'
登录成功'
,
0
);
}
}
return
DataReturn
(
'游客
登录失败'
,
-
100
);
return
DataReturn
(
$nickname
.
'
登录失败'
,
-
100
);
}
}
?>
\ No newline at end of file
application/plugins/view/touristbuy/admin/index.html
浏览文件 @
a87e55e2
...
...
@@ -10,39 +10,53 @@
<div
class=
"touristbuy-content"
>
<div
class=
"items"
>
<label>
公告内容
</label>
<label>
应用导航名称
</label>
<div>
{{if !empty($data['
content
'])}}
{{$data.
content
}}
{{if !empty($data['
application_name
'])}}
{{$data.
application_name
}}
{{else /}}
无
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
是否全局
</label>
<label>
登录入口名称
</label>
<div>
{{if
isset($data['is_overall']) and $data['is_overall'] eq 1
}}
是
{{if
!empty($data['login_name'])
}}
{{$data.login_name}}
{{else /}}
否
游客登录
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
有效时间
</label>
<label>
游客用户名
</label>
<div>
{{if !empty($data['time_start']) and !empty($data['time_end'])}}
{{$data.time_start}} ~ {{$data.time_end}}
{{elseif !empty($data['time_start']) and empty($data['time_end'])}}
{{$data.time_start}} ~ 长期有效
{{elseif empty($data['time_start']) and !empty($data['time_end'])}}
立即生效 ~ {{$data.time_end}}
{{if !empty($data['nickname'])}}
{{$data.nickname}}
{{else /}}
无限制
游客
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
订单查询提示
</label>
<div>
{{if !empty($data['query_tips'])}}
{{$data.query_tips}}
{{else /}}
无
{{/if}}
</div>
</div>
<div
class=
"items"
>
<label>
订单查询地址
</label>
<div>
<a
href=
"{{:PluginsHomeUrl('touristbuy', 'index', 'index')}}"
target=
"_blank"
>
{{:PluginsHomeUrl('touristbuy', 'index', 'index')}}
</a>
</div>
</div>
<a
href=
"{{:PluginsAdminUrl('touristbuy', 'admin', 'saveinfo')}}"
class=
"am-btn am-btn-secondary am-radius btn-loading-example am-btn-sm am-btn-block edit-submit"
>
编辑
</a>
</div>
</div>
...
...
application/plugins/view/touristbuy/admin/saveinfo.html
浏览文件 @
a87e55e2
...
...
@@ -10,29 +10,24 @@
<a
href=
"{{:PluginsAdminUrl('touristbuy', 'admin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
<div
class=
"am-form-group am-form-file"
>
<label
class=
"block"
>
公告内容
<span
class=
"am-form-group-label-tips"
>
空则不显示
</span></label>
<textarea
rows=
"3"
name=
"content"
class=
"am-radius am-field-valid"
placeholder=
"公告内容"
data-validation-message=
"请填写公告内容"
>
{{if !empty($data['content'])}}{{$data.content}}{{/if}}
</textarea>
<div
class=
"am-form-group"
>
<label>
应用导航名称
<span
class=
"am-form-group-label-tips"
>
空则不显示,订单查询入口
</span></label>
<input
type=
"text"
name=
"application_name"
placeholder=
"应用导航名称"
maxlength=
"30"
data-validation-message=
"应用导航名称格式最多 30 个字符"
class=
"am-radius"
{{
if
!
empty
($
data
['
application_name
'])}}
value=
"{{$data.application_name}}"
{{/
if
}}
/>
</div>
<div
class=
"am-form-group"
>
<label>
登录入口名称
<span
class=
"am-form-group-label-tips"
>
默认 游客登录
</span></label>
<input
type=
"text"
name=
"login_name"
placeholder=
"登录入口名称"
maxlength=
"30"
data-validation-message=
"登录入口名称格式最多 30 个字符"
class=
"am-radius"
value=
"{{if !empty($data['login_name'])}}{{$data.login_name}}{{else /}}游客登录{{/if}}"
/>
</div>
<div
class=
"am-form-group"
>
<label>
是否全局
<span
class=
"am-form-group-label-tips"
>
默认首页
</span></label>
<div>
{{foreach $is_whether_list as $v}}
<label
class=
"am-radio-inline m-r-10"
>
<input
type=
"radio"
name=
"is_overall"
value=
"{{$v.id}}"
{{
if
isset
($
data
['
is_overall
'])
and
$
data
['
is_overall
']
eq
$
v
['
id
']}}
checked=
"checked"
{{
else
/}}{{
if
!
isset
($
data
['
is_overall
'])
and
isset
($
v
['
checked
'])
and
$
v
['
checked
']
eq
true
}}
checked=
"checked"
{{/
if
}}{{/
if
}}
data-am-ucheck
/>
{{$v.name}}
</label>
{{/foreach}}
</div>
<label>
游客用户名
<span
class=
"am-form-group-label-tips"
>
默认 游客
</span></label>
<input
type=
"text"
name=
"nickname"
placeholder=
"游客用户名"
maxlength=
"16"
data-validation-message=
"游客用户名格式最多 16 个字符"
class=
"am-radius"
value=
"{{if !empty($data['nickname'])}}{{$data.nickname}}{{else /}}游客{{/if}}"
/>
</div>
<div
class=
"am-form-group"
>
<label>
有效时间
<span
class=
"am-form-group-label-tips"
>
留空则不限制
</span></label>
<div
class=
"form-date"
>
<input
type=
"text"
autocomplete=
"off"
name=
"time_start"
class=
"Wdate am-radius"
placeholder=
"起始时间"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
{{
if
!
empty
($
data
['
time_start
'])}}
value=
"{{$data.time_start}}"
{{/
if
}}
/>
<span>
~
</span>
<input
type=
"text"
autocomplete=
"off"
class=
"Wdate am-radius"
placeholder=
"结束时间"
name=
"time_end"
onclick=
"WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
{{
if
!
empty
($
data
['
time_end
'])}}
value=
"{{$data.time_end}}"
{{/
if
}}
/>
</div>
<label
class=
"block"
>
订单查询提示
<span
class=
"am-form-group-label-tips"
>
空则不显示
</span></label>
<textarea
rows=
"3"
name=
"query_tips"
class=
"am-radius am-field-valid"
placeholder=
"公告内容"
data-validation-message=
"请填写订单查询提示"
>
{{if !empty($data['query_tips'])}}{{$data.query_tips}}{{/if}}
</textarea>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
...
...
application/plugins/view/touristbuy/index/detail.html
浏览文件 @
a87e55e2
...
...
@@ -183,6 +183,19 @@
</div>
<div
class=
"operation"
>
<!-- 0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭 -->
<!-- 钩子订单操作 -->
{{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($data['plugins_service_order_handle_operation_html']) and is_array($data['plugins_service_order_handle_operation_html'])}}
{{foreach $data.plugins_service_order_handle_operation_html as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
</div>
{{if in_array($data['status'], [3,4])}}
<div
class=
"logistics"
>
...
...
application/plugins/view/touristbuy/index/index.html
浏览文件 @
a87e55e2
...
...
@@ -19,10 +19,12 @@
<!-- content start -->
<div
class=
"am-g my-content"
>
<div
class=
"am-u-md-6 am-u-sm-centered plugins-touristbuy-index"
>
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
请输入订单号,收件人姓名,收件人电话即可查看订单详情
</p>
</div>
{{if !empty($data['query_tips'])}}
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
{{$data.query_tips}}
</p>
</div>
{{/if}}
<!-- form start -->
<form
class=
"am-form form-validation"
method=
"post"
action=
"{{:PluginsHomeUrl('touristbuy', 'index', 'detail')}}"
request-type=
"form"
>
...
...
@@ -32,12 +34,12 @@
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<label>
收件人
-
姓名
</label>
<label>
收件人姓名
</label>
<input
type=
"text"
name=
"name"
class=
"am-radius"
minlength=
"1"
placeholder=
"订单号"
data-validation-message=
"请输入收件人姓名"
required
/>
</div>
<div
class=
"am-form-group am-form-group-refreshing"
>
<label>
收件人
-
电话
</label>
<label>
收件人电话
</label>
<input
type=
"text"
name=
"tel"
class=
"am-radius"
minlength=
"1"
placeholder=
"订单号"
data-validation-message=
"请输入收件人电话"
required
/>
</div>
...
...
public/static/plugins/css/touristbuy/index.css
浏览文件 @
a87e55e2
h1
{
font-size
:
60px
;
}
.msg
{
font-size
:
68px
;
color
:
#4CAF50
;
}
\ No newline at end of file
.plugins-touristbuy-index
{
margin-top
:
5%
;
}
.plugins-touristbuy-index
form
.am-form
{
margin-top
:
20px
;
}
.plugins-touristbuy-index
form
.am-form
.am-form-group
{
padding
:
0
!important
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录