diff --git a/application/plugins/commongobacktop/Hook.php b/application/plugins/commongobacktop/Hook.php index 4cc87dd7d..6ae036a64 100755 --- a/application/plugins/commongobacktop/Hook.php +++ b/application/plugins/commongobacktop/Hook.php @@ -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 ''; } } diff --git a/application/plugins/touristbuy/Hook.php b/application/plugins/touristbuy/Hook.php index beee671a2..f487cc80a 100644 --- a/application/plugins/touristbuy/Hook.php +++ b/application/plugins/touristbuy/Hook.php @@ -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 ''; } @@ -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 = '游客登录'; + $login_name = empty($ret['data']['login_name']) ? '游客登录' : $ret['data']['login_name']; + return ''.$ret['data']['login_name'].''; } - 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 = '游客登录'; + $login_name = empty($ret['data']['login_name']) ? '游客登录' : $ret['data']['login_name']; + return ''.$login_name.''; } - return $html; + return ''; } } ?> \ No newline at end of file diff --git a/application/plugins/touristbuy/Index.php b/application/plugins/touristbuy/Index.php index bd7255c62..ae77a767b 100644 --- a/application/plugins/touristbuy/Index.php +++ b/application/plugins/touristbuy/Index.php @@ -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 ''; + } else { + return $this->redirect(__MY_URL__); + } } else { $this->assign('msg', $ret['msg']); return $this->fetch('public/error'); } } - } ?> \ No newline at end of file diff --git a/application/plugins/touristbuy/Service.php b/application/plugins/touristbuy/Service.php index 5d81c46eb..1a9997950 100644 --- a/application/plugins/touristbuy/Service.php +++ b/application/plugins/touristbuy/Service.php @@ -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 diff --git a/application/plugins/view/touristbuy/admin/index.html b/application/plugins/view/touristbuy/admin/index.html index 16402e479..3ae512bf3 100755 --- a/application/plugins/view/touristbuy/admin/index.html +++ b/application/plugins/view/touristbuy/admin/index.html @@ -10,39 +10,53 @@
- +
- {{if !empty($data['content'])}} - {{$data.content}} + {{if !empty($data['application_name'])}} + {{$data.application_name}} {{else /}} 无 {{/if}}
- +
- {{if isset($data['is_overall']) and $data['is_overall'] eq 1}} - 是 + {{if !empty($data['login_name'])}} + {{$data.login_name}} {{else /}} - 否 + 游客登录 {{/if}}
- +
- {{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}}
+
+ +
+ {{if !empty($data['query_tips'])}} + {{$data.query_tips}} + {{else /}} + 无 + {{/if}} +
+
+ +
+ +
+ {{:PluginsHomeUrl('touristbuy', 'index', 'index')}} +
+
+ 编辑
diff --git a/application/plugins/view/touristbuy/admin/saveinfo.html b/application/plugins/view/touristbuy/admin/saveinfo.html index 9fe21ae3e..24568104f 100755 --- a/application/plugins/view/touristbuy/admin/saveinfo.html +++ b/application/plugins/view/touristbuy/admin/saveinfo.html @@ -10,29 +10,24 @@ 返回 -
- - +
+ +
- -
- {{foreach $is_whether_list as $v}} - - {{/foreach}} -
+ +
- -
- - ~ - -
+ + +
+ +
+ +
diff --git a/application/plugins/view/touristbuy/index/detail.html b/application/plugins/view/touristbuy/index/detail.html index 87b558743..84d27d9eb 100644 --- a/application/plugins/view/touristbuy/index/detail.html +++ b/application/plugins/view/touristbuy/index/detail.html @@ -183,6 +183,19 @@
+ + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_service_order_handle_operation_html +
+ {{/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}}
{{if in_array($data['status'], [3,4])}}
diff --git a/application/plugins/view/touristbuy/index/index.html b/application/plugins/view/touristbuy/index/index.html index 9bd20e9e3..92150a001 100644 --- a/application/plugins/view/touristbuy/index/index.html +++ b/application/plugins/view/touristbuy/index/index.html @@ -19,10 +19,12 @@
-
- -

请输入订单号,收件人姓名,收件人电话即可查看订单详情

-
+ {{if !empty($data['query_tips'])}} +
+ +

{{$data.query_tips}}

+
+ {{/if}}
@@ -32,12 +34,12 @@
- +
- +
diff --git a/public/static/plugins/css/touristbuy/index.css b/public/static/plugins/css/touristbuy/index.css index 05bc22523..d846fed82 100644 --- a/public/static/plugins/css/touristbuy/index.css +++ b/public/static/plugins/css/touristbuy/index.css @@ -1,7 +1,3 @@ -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