From 75ee4acae70864fc517197fa72e1a4d8dc042017 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 20 Apr 2021 18:38:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=95=86=E5=BA=97=E5=B8=90?= =?UTF-8?q?=E5=8F=B7=E7=BB=91=E5=AE=9A=E3=80=81=E6=9B=B4=E6=96=B0=E6=A3=80?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Goods.php | 2 +- application/admin/controller/Index.php | 64 +++++ .../admin/view/default/index/init.html | 86 ++++++- .../admin/view/default/navigation/index.html | 2 +- .../admin/view/default/pluginsadmin/nav.html | 8 +- .../public/module/form_fields_select.html | 2 +- application/common.php | 6 +- .../public/module/form_fields_select.html | 2 +- application/service/ConfigService.php | 43 +++- application/service/PluginsAdminService.php | 2 +- application/service/PluginsService.php | 36 ++- application/service/StoreService.php | 192 +++++++++++++++ application/service/UserService.php | 170 +++++++------ application/tags.php | 223 ++++++++++++++++++ .../static/admin/default/css/index.init.css | 121 +++++++++- public/static/admin/default/js/index.js | 85 +++++++ public/static/common/css/common.css | 9 + 17 files changed, 957 insertions(+), 96 deletions(-) diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index 61db4de68..797318607 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -188,7 +188,7 @@ class Goods extends Common // 商品分类 $this->assign('goods_category_list', GoodsService::GoodsCategoryAll()); - // 品牌分类 + // 品牌 $this->assign('brand_list', BrandService::CategoryBrand()); // 规格扩展数据 diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index ae6baa5f9..2126b00fb 100755 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -11,6 +11,8 @@ namespace app\admin\controller; use app\service\StatisticalService; +use app\service\StoreService; +use app\service\ConfigService; /** * 首页 @@ -112,7 +114,69 @@ class Index extends Common $goods_hot_sale = StatisticalService::GoodsHotSaleSevenTodayTotal(); $this->assign('goods_hot_sale', $goods_hot_sale['data']); + // 配置信息 + $config = ConfigService::ConfigList(); + $this->assign('config_data', $config); + + // 站点商店信息 + $site_store_info = StoreService::SiteStoreInfo(); + if(empty($site_store_info)) + { + $site_params = [ + 'common_store_accounts' => MyC('common_store_accounts'), + 'common_store_password' => MyC('common_store_password'), + ]; + $res = StoreService::SiteStoreAccountsBind($site_params); + if($res['code'] == 0) + { + $site_store_info = StoreService::SiteStoreInfo(); + } + } + $this->assign('site_store_info', $site_store_info); + return $this->fetch(); } + + /** + * 应用商店帐号绑定 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-16 + * @desc description + */ + public function StoreAccountsBind() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + $params = $this->data_request; + return StoreService::SiteStoreAccountsBind($params); + } + + /** + * 检查更新 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-16 + * @desc description + */ + public function InspectUpgrade() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 开始处理 + $params = $this->data_request; + return StoreService::SiteInspectUpgrade($params); + } } ?> \ No newline at end of file diff --git a/application/admin/view/default/index/init.html b/application/admin/view/default/index/init.html index 5c7b6d0c3..d50552cc2 100755 --- a/application/admin/view/default/index/init.html +++ b/application/admin/view/default/index/init.html @@ -3,8 +3,39 @@
+ +
+
+ + {{if !empty($site_store_info) and !empty($site_store_info['user'])}} + + {{$site_store_info.user.user_name_view}} + 修改 + {{else /}} + 绑定ShopXO商店账户 + {{/if}} + + + {{if !empty($site_store_info) and !empty($site_store_info['adverts']) and !empty($site_store_info['adverts']['name'])}} + {{$site_store_info.adverts.name}} + {{/if}} +
+ +
+ -
+
商城统计 @@ -106,7 +137,7 @@
-
+
近30日订单成交金额走势 @@ -115,7 +146,7 @@
-
+
近30日订单交易走势 @@ -124,7 +155,7 @@
-
    +
    • @@ -145,7 +176,7 @@
    -
      +
      • @@ -214,6 +245,51 @@
        + + + + + + {{include file="public/footer" /}} diff --git a/application/admin/view/default/navigation/index.html b/application/admin/view/default/navigation/index.html index 9d7931246..69f573545 100755 --- a/application/admin/view/default/navigation/index.html +++ b/application/admin/view/default/navigation/index.html @@ -20,7 +20,7 @@
      • -
      • +
      • diff --git a/application/admin/view/default/pluginsadmin/nav.html b/application/admin/view/default/pluginsadmin/nav.html index 06e5449a4..10272b39b 100755 --- a/application/admin/view/default/pluginsadmin/nav.html +++ b/application/admin/view/default/pluginsadmin/nav.html @@ -2,9 +2,11 @@
      • 应用管理
      • -
      • - 上传应用 -
      • + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
      • + 上传应用 +
      • + {{/if}}
      • 更多插件下载
      • diff --git a/application/admin/view/default/public/module/form_fields_select.html b/application/admin/view/default/public/module/form_fields_select.html index 270a2e2c6..ad3d104f4 100644 --- a/application/admin/view/default/public/module/form_fields_select.html +++ b/application/admin/view/default/public/module/form_fields_select.html @@ -7,7 +7,7 @@
        {{if !empty($form_user_fields)}}
        -

        可点击拖拽调整显示顺序

        +

        可点击拖拽调整显示顺序、如需恢复点击重置即可

          {{foreach $form_user_fields as $v}} diff --git a/application/common.php b/application/common.php index e71c36918..0eb656432 100755 --- a/application/common.php +++ b/application/common.php @@ -76,7 +76,11 @@ function GetUrlHost($url) { // 地址解析 $arr = parse_url(strtolower($url)); - $host = (count($arr) == 1) ? $arr['path'] : $arr['host']; + $host = (count($arr) == 1) ? $arr['path'] : (empty($arr['host']) ? '' : $arr['host']); + if(empty($host)) + { + return $url; + } // 是否存在斜杠 if(stripos($host, '/') !== false) diff --git a/application/index/view/default/public/module/form_fields_select.html b/application/index/view/default/public/module/form_fields_select.html index 4f3223736..8fa734972 100644 --- a/application/index/view/default/public/module/form_fields_select.html +++ b/application/index/view/default/public/module/form_fields_select.html @@ -7,7 +7,7 @@
          {{if !empty($form_user_fields)}}
          -

          可点击拖拽调整显示顺序

          +

          可点击拖拽调整显示顺序、如需恢复点击重置即可

            {{foreach $form_user_fields as $v}} diff --git a/application/service/ConfigService.php b/application/service/ConfigService.php index ff5904ffe..f699e5015 100755 --- a/application/service/ConfigService.php +++ b/application/service/ConfigService.php @@ -37,6 +37,7 @@ class ConfigService 'home_index_floor_manual_mode_goods', 'home_index_floor_left_top_category', 'admin_email_login_template', + 'home_email_login_template', ]; // 附件字段列表 @@ -63,6 +64,43 @@ class ConfigService 'home_search_params_type', ]; + // 需要文件缓存的key + public static $file_cache_keys = [ + // 伪静态后缀 + 'home_seo_url_html_suffix', + + // 前端默认主题 + 'common_default_theme', + + // 时区 + 'common_timezone', + + // 是否开启redis缓存 + 'common_data_is_use_cache', + 'common_cache_data_redis_host', + 'common_cache_data_redis_port', + 'common_cache_data_redis_password', + 'common_cache_data_redis_expire', + 'common_cache_data_redis_prefix', + + // session是否开启redis缓存 + 'common_session_is_use_cache', + 'common_cache_session_redis_host', + 'common_cache_session_redis_port', + 'common_cache_session_redis_password', + 'common_cache_session_redis_expire', + 'common_cache_session_redis_prefix', + + // cdn地址 + 'common_cdn_attachment_host', + 'common_cdn_public_host', + + // 编辑器配置信息 + 'home_max_limit_image', + 'home_max_limit_video', + 'home_max_limit_file', + ]; + /** * 配置列表,唯一标记作为key * @author Devil @@ -238,7 +276,10 @@ class ConfigService cache($k, $v); // 数据文件缓存 - MyFileConfig($k, $v); + if(array_key_exists($k, self::$file_cache_keys)) + { + MyFileConfig($k, $v); + } } // 所有配置缓存集合 diff --git a/application/service/PluginsAdminService.php b/application/service/PluginsAdminService.php index 5ac7fbdb4..1ed39ff97 100755 --- a/application/service/PluginsAdminService.php +++ b/application/service/PluginsAdminService.php @@ -215,7 +215,7 @@ class PluginsAdminService * @desc description * @param [string] $plugins [插件名称] */ - private static function GetPluginsConfig($plugins) + public static function GetPluginsConfig($plugins) { $config = []; $file = APP_PATH.'plugins'.DS.$plugins.DS.'config.json'; diff --git a/application/service/PluginsService.php b/application/service/PluginsService.php index 3388c17f5..ad4fa73cd 100755 --- a/application/service/PluginsService.php +++ b/application/service/PluginsService.php @@ -13,6 +13,7 @@ namespace app\service; use think\Db; use app\service\ResourcesService; use app\service\PluginsAdminService; +use app\service\StoreService; /** * 应用服务层 @@ -295,15 +296,15 @@ class PluginsService // 应用控制器 $control = ucfirst($control); - $plugins = '\app\plugins\\'.$plugins.'\\'.$group.'\\'.$control; - if(!class_exists($plugins)) + $plugins_class = '\app\plugins\\'.$plugins.'\\'.$group.'\\'.$control; + if(!class_exists($plugins_class)) { return DataReturn('应用控制器未定义['.$control.']', -1); } // 调用方法 $action = ucfirst($action); - $obj = new $plugins($params); + $obj = new $plugins_class($params); if(!method_exists($obj, $action)) { return DataReturn('应用方法未定义['.$action.']', -1); @@ -314,6 +315,35 @@ class PluginsService { $params = $params['data_request']; } + + // 安全判断 + if(config('shopxo.is_develop') === false) + { + $key = 'plugins_legal_check_'.$plugins; + $status = cache($key); + if(empty($status)) + { + $config = PluginsAdminService::GetPluginsConfig($plugins); + if(!empty($config) && is_array($config)) + { + unset($config['hook']); + } else { + $config = []; + } + $check_params = [ + 'config' => $config, + 'plugins' => $plugins, + ]; + $ret = StoreService::PluginsLegalCheck($check_params); + if($ret['code'] != 0) + { + return $ret; + } + cache($key, 1, 600); + } + } + + // 调用对应插件 return DataReturn('调用成功', 0, $obj->$action($params)); } diff --git a/application/service/StoreService.php b/application/service/StoreService.php index d27e8f875..6a58b25f6 100644 --- a/application/service/StoreService.php +++ b/application/service/StoreService.php @@ -10,6 +10,8 @@ // +---------------------------------------------------------------------- namespace app\service; +use app\service\ConfigService; + /** * 应用商店服务层 * @author Devil @@ -19,6 +21,18 @@ namespace app\service; */ class StoreService { + // 远程信息接口 + public static $store_site_info_url = 'https://store.shopxo.net/index.php?s=/api/plugins/index&pluginsname=store&pluginscontrol=index&pluginsaction=siteinfo'; + + // 远程检查更新接口 + public static $store_inspect_upgrade_url = 'https://store.shopxo.net/index.php?s=/api/plugins/index&pluginsname=store&pluginscontrol=index&pluginsaction=inspectupgrade'; + + // 远程插件安全合法校验接口 + public static $store_plugins_legal_check_url = 'https://store.shopxo.net/index.php?s=/api/plugins/index&pluginsname=store&pluginscontrol=index&pluginsaction=pluginslegalcheck'; + + // 站点商店数据缓存key + public static $site_store_info_key = 'admin_site_store_info_data'; + /** * 应用商店地址 * @author Devil @@ -78,5 +92,183 @@ class StoreService // 拼接商店请求参数地址 return '?name='.urldecode(base64_encode(MyC('home_site_name'))).'&ver='.urldecode(base64_encode(APPLICATION_VERSION)).'&url='.urlencode(base64_encode(__MY_URL__)).'&host='.urlencode(base64_encode(__MY_HOST__)).'&ip='.urlencode(base64_encode(__MY_ADDR__)).'&admin_url='.urlencode(base64_encode($admin_url[0])); } + + /** + * 获取站点商店信息 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-16 + * @desc description + */ + public static function SiteStoreInfo() + { + $res = cache(self::$site_store_info_key); + return empty($res) ? [] : $res; + } + + /** + * 站点应用商店帐号绑定 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-16 + * @desc description + * @param [array] $params [输入参数] + */ + public static function SiteStoreAccountsBind($params = []) + { + // 请求类型 + $p = [ + [ + 'checked_type' => 'length', + 'key_name' => 'common_store_accounts', + 'checked_data' => '1,30', + 'error_msg' => '账号格式1~30个字符', + ], + [ + 'checked_type' => 'length', + 'key_name' => 'common_store_password', + 'checked_data' => '6,30', + 'error_msg' => '登录密码格式6~30个字符', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 保存商店帐号信息 + $ret = ConfigService::ConfigSave($params); + if($ret['code'] != 0) + { + return $ret; + } + + // 获取信息 + $res = self::RemoteStoreData($params['common_store_accounts'], $params['common_store_password'], self::$store_site_info_url); + if($res['code'] == 0) + { + // 存储缓存、取远程给的时间,未拿到时间则默认30分钟 + $cache_time = (empty($res['data']['base']) || empty($res['data']['base']['cache_time'])) ? 1800 : intval($res['data']['base']['cache_time']); + cache(self::$site_store_info_key, $res['data'], $cache_time); + + return DataReturn('绑定成功', 0); + } + return $res; + } + + /** + * 检查更新 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-18 + * @desc description + * @param [array] $params [输入参数] + */ + public static function SiteInspectUpgrade($params = []) + { + // 帐号信息 + $accounts = MyC('common_store_accounts'); + $password = MyC('common_store_password'); + + // 获取信息 + return self::RemoteStoreData($accounts, $password, self::$store_inspect_upgrade_url); + } + + /** + * 插件安全合法校验 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-19 + * @desc description + * @param [array] $params [输入参数] + */ + public static function PluginsLegalCheck($params) + { + // 帐号信息 + $accounts = MyC('common_store_accounts'); + $password = MyC('common_store_password'); + + // 获取信息 + $request_params = [ + 'plugins_type' => 0, + 'plugins_value' => $params['plugins'], + 'plugins_config' => empty($params['config']) ? [] : $params['config'], + ]; + return self::RemoteStoreData($accounts, $password, self::$store_plugins_legal_check_url, $request_params); + } + + /** + * 远程获取数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-04-13 + * @desc description + * @param [string] $accounts [帐号] + * @param [string] $password [密码] + * @param [string] $url [请求地址] + * @param [array] $params [额外参数] + */ + public static function RemoteStoreData($accounts, $password, $url, $params = []) + { + // 帐号信息 + if(empty($accounts) || empty($password)) + { + return DataReturn('请先绑定应用商店帐号', -1); + } + + // 基础数据获取 + $bo = new \base\Behavior(); + + // 请求校验 + $data = [ + 'accounts' => $accounts, + 'password' => $password, + 'host' => __MY_HOST__, + 'url' => __MY_URL__, + 'ver' => APPLICATION_VERSION, + 'server_port' => $bo->GetServerPort(), + 'server_ip' => $bo->GetServerIP(), + 'client_ip' => $bo->GetClientIP(), + 'os' => $bo->GetOs(), + 'browser' => $bo->GetBrowser(), + 'scheme' => $bo->GetScheme(), + 'version' => $bo->GetHttpVersion(), + 'client' => $bo->GetClinet(), + 'php_os' => PHP_OS, + 'php_version' => PHP_VERSION, + 'php_sapi_name' => php_sapi_name(), + 'client_date' => date('Y-m-d H:i:s'), + ]; + $res = CurlPost($url, array_merge($data, $params)); + $result = json_decode($res, true); + if(empty($result)) + { + return DataReturn('接口请求失败'.(empty($res) ? '' : '['.$res.']'), -1); + } + + // 是否非数组 + if(is_string($result)) + { + return DataReturn($result, -1); + } + + // 请求成功 + if(isset($result['code']) && $result['code'] == 0) + { + if(empty($result['data'])) + { + return DataReturn('无对应数据、请稍后再试!', -1); + } + return $result; + } + + return DataReturn(empty($result['msg']) ? '异常错误失败、请稍后再试!' : $result['msg'], -1); + } } ?> \ No newline at end of file diff --git a/application/service/UserService.php b/application/service/UserService.php index 3e83a82c1..0ffcd4662 100755 --- a/application/service/UserService.php +++ b/application/service/UserService.php @@ -1826,19 +1826,13 @@ class UserService // 基础处理 if(isset($user['id'])) { - // token生成并存储缓存 - if($user['is_mandatory_bind_mobile'] == 0 || ($user['is_mandatory_bind_mobile'] == 1 && !empty($user['mobile']))) + // 非token数据库校验,则重新生成token更新到数据库 + if($where_field != 'token') { + // token生成并存储缓存 $user['token'] = self::CreatedUserToken($user['id']); + Db::name('User')->where(['id'=>$user['id']])->update(['token'=>$user['token'], 'upd_time'=>time()]); cache(config('shopxo.cache_user_info').$user['token'], $user); - - // 非token数据库校验,则重新生成token更新到数据库 - if($where_field != 'token') - { - Db::name('User')->where(['id'=>$user['id']])->update(['token'=>$user['token'], 'upd_time'=>time()]); - } - } else { - $user['token'] = ''; } // 用户登录纪录处理 @@ -2033,73 +2027,110 @@ class UserService return DataReturn('验证码错误', -11); } - // 用户信息 - $accounts_field = APPLICATION_CLIENT_TYPE.'_openid'; - if(empty($params[$accounts_field])) - { - return DataReturn('用户openid不能为空', -20); - } + // 用户更新数据 + $data = [ + 'mobile' => $params['mobile'], + ]; - // 用户数据 - $data = array( - $accounts_field => $params[$accounts_field], - 'mobile' => $params['mobile'], - ); + // 是否小程序请求 + $is_appmini = array_key_exists(APPLICATION_CLIENT_TYPE, lang('common_appmini_type')); - // 获取用户信息 + // 手机号码获取用户信息 $mobile_user = Db::name('User')->where([ ['mobile', '=', $data['mobile']], ['is_delete_time', '=', 0], ])->find(); - $open_user = Db::name('User')->where([ - [$accounts_field, '=', $params[$accounts_field]], - ['is_delete_time', '=', 0], - ])->find(); - - // 如果手机号码存在,并且openid也已存在,则更新掉之前的openid - if(!empty($mobile_user)) - { - if(!empty($open_user)) - { - Db::name('User')->where(['id'=>$open_user['id']])->update([$accounts_field=>'', 'upd_time'=>time()]); - } - } else { - $mobile_user = $open_user; - } - - // 如果用户不存在则新增用户状态字段 - if(empty($mobile_user) && empty($open_user)) - { - // 是否需要审核 - $common_register_is_enable_audit = MyC('common_register_is_enable_audit', 0); - $data['status'] = ($common_register_is_enable_audit == 1) ? 3 : 0; - } // 额外信息 - if(empty($mobile_user['nickname']) && !empty($params['nickname'])) + if(empty($mobile_user)) { - $data['nickname'] = $params['nickname']; + if(empty($mobile_user['nickname']) && !empty($params['nickname'])) + { + $data['nickname'] = $params['nickname']; + } + if(empty($mobile_user['avatar']) && !empty($params['avatar'])) + { + $data['avatar'] = $params['avatar']; + } + if(empty($mobile_user['province']) && !empty($params['province'])) + { + $data['province'] = $params['province']; + } + if(empty($mobile_user['city']) && !empty($params['city'])) + { + $data['city'] = $params['city']; + } + if(empty($mobile_user) && isset($params['gender'])) + { + $data['gender'] = intval($params['gender']); + } } - if(empty($mobile_user['avatar']) && !empty($params['avatar'])) + + // 小程序请求处理 + if($is_appmini) { - $data['avatar'] = $params['avatar']; - } - if(empty($mobile_user['province']) && !empty($params['province'])) - { - $data['province'] = $params['province']; - } - if(empty($mobile_user['city']) && !empty($params['city'])) - { - $data['city'] = $params['city']; - } - if(empty($mobile_user) && isset($params['gender'])) - { - $data['gender'] = intval($params['gender']); + // openid必须存在 + $accounts_field = APPLICATION_CLIENT_TYPE.'_openid'; + if(empty($params[$accounts_field])) + { + return DataReturn('用户openid不能为空', -20); + } + + // openid数据 + $data[$accounts_field] = $params[$accounts_field]; + + // 小程序请求获取用户信息 + $open_user = Db::name('User')->where([ + [$accounts_field, '=', $params[$accounts_field]], + ['is_delete_time', '=', 0], + ])->find(); + + // 如果手机号码存在,并且openid也已存在,则更新掉之前的openid + if(!empty($mobile_user)) + { + if(!empty($open_user)) + { + Db::name('User')->where(['id'=>$open_user['id']])->update([$accounts_field=>'', 'upd_time'=>time()]); + } + } else { + $mobile_user = $open_user; + } + } else { + // 获取当前登录用户 + // 如果手机号码已经存在帐号、当前用户已登录 + $user = self::LoginUserInfo(); + if(!empty($user)) + { + // 手机帐号信息是否存在 + if(!empty($mobile_user)) + { + // id不一致则提示错误 + if($user['id'] != $mobile_user['id']) + { + return DataReturn('手机已绑定、请换手机号重试', -50); + } + + // 是否与当前帐号的手机号码一致 + if(!empty($user['mobile']) && $user['mobile'] == $mobile_user['mobile']) + { + return DataReturn('请使用新的手机号', -51); + } + } + + // 当前用户赋值手机帐号信息 + $mobile_user = $user; + } } // 不存在添加/则更新 if(empty($mobile_user)) { + // 如果用户不存在则新增用户状态字段 + // 是否需要审核 + $common_register_is_enable_audit = MyC('common_register_is_enable_audit', 0); + $data['status'] = ($common_register_is_enable_audit == 1) ? 3 : 0; + + // 新增用户 $user_ret = self::UserInsert($data, $params); if($user_ret['code'] == 0) { @@ -2108,17 +2139,22 @@ class UserService return $user_ret; } } else { - // 用户unionid - $unionid = self::UserUnionidHandle($params); - if(!empty($unionid['field']) && !empty($unionid['value'])) + // 小程序请求处理 + if($is_appmini) { - if(empty($mobile_user[$unionid['field']])) + // 用户unionid + $unionid = self::UserUnionidHandle($params); + if(!empty($unionid['field']) && !empty($unionid['value'])) { - // unionid放入用户data中 - $data[$unionid['field']] = $unionid['value']; + if(empty($mobile_user[$unionid['field']])) + { + // unionid放入用户data中 + $data[$unionid['field']] = $unionid['value']; + } } } + // 帐号信息更新 $data['upd_time'] = time(); if(Db::name('User')->where(['id'=>$mobile_user['id']])->update($data)) { diff --git a/application/tags.php b/application/tags.php index 975bac18d..edae5c37b 100755 --- a/application/tags.php +++ b/application/tags.php @@ -32,5 +32,228 @@ return array ( 'log_write' => array ( ), + 'plugins_css' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + 2 => 'app\\plugins\\multilingual\\Hook', + 3 => 'app\\plugins\\commonrightnavigation\\Hook', + 4 => 'app\\plugins\\store\\Hook', + ), + 'plugins_js' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + 2 => 'app\\plugins\\multilingual\\Hook', + 3 => 'app\\plugins\\commonrightnavigation\\Hook', + 4 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_navigation_header_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + 2 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_quick_navigation_pc' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\multilingual\\Hook', + ), + 'plugins_service_quick_navigation_h5' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\multilingual\\Hook', + ), + 'plugins_service_quick_navigation_weixin' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_quick_navigation_alipay' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_quick_navigation_baidu' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_quick_navigation_qq' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_quick_navigation_toutiao' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_goods_handle_end' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_view_buy_form_inside' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_buy_base_confirm_top' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_buy_group_goods_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\newuserreduction\\Hook', + ), + 'plugins_service_buy_order_insert_end' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + 2 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_order_status_change_history_success_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\shop\\Hook', + 2 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_base_data_return_api_buy_index' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_admin_css' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\orderpricerevision\\Hook', + 2 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_users_center_left_menu_handle' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_header_navigation_top_right_handle' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\multilingual\\Hook', + 2 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_save_handle' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_service_editor_path_type_admin_goods_saveinfo' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_right_content_bottom' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_base_bottom' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_base_buy_nav_min_inside_begin' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_handle_end' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_buy_handle' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_service_buy_order_insert_begin' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_order_aftersale_audit_handle_end' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_admin_goods_save' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_module_form_admin_goods_index' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_module_form_admin_goods_detail' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + ), + 'plugins_service_goods_buy_nav_button_handle' => + array ( + 0 => 'app\\plugins\\shop\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_common_page_bottom' => + array ( + 0 => 'app\\plugins\\multilingual\\Hook', + ), + 'plugins_view_common_top' => + array ( + 0 => 'app\\plugins\\multilingual\\Hook', + ), + 'plugins_view_common_bottom' => + array ( + 0 => 'app\\plugins\\multilingual\\Hook', + 1 => 'app\\plugins\\commonrightnavigation\\Hook', + ), + 'plugins_service_search_goods_list_where' => + array ( + 0 => 'app\\plugins\\multilingual\\Hook', + ), + 'plugins_admin_js' => + array ( + 0 => 'app\\plugins\\orderpricerevision\\Hook', + ), + 'plugins_admin_view_common_bottom' => + array ( + 0 => 'app\\plugins\\orderpricerevision\\Hook', + ), + 'plugins_view_admin_order_list_operate' => + array ( + 0 => 'app\\plugins\\orderpricerevision\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_deduct' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_rollback' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_sync' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_field_status_update' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_delete' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_save_end' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_system_begin' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), ); ?> \ No newline at end of file diff --git a/public/static/admin/default/css/index.init.css b/public/static/admin/default/css/index.init.css index d073d55f1..6a5b76e55 100755 --- a/public/static/admin/default/css/index.init.css +++ b/public/static/admin/default/css/index.init.css @@ -5,7 +5,7 @@ html, body { background: #f5f5f5; } -.echarts-container, .echarts-combination-container-2 li { +.block-container, .block-combination-container-2 li { width: 100%; background: #fff !important; padding: 10px; @@ -13,17 +13,17 @@ html, body { border-radius: 3px; overflow: hidden;; } -.echarts-container, .echarts-combination-container-2 li { +.block-container, .block-combination-container-2 li { position: relative; } -.echarts-container { +.block-container { margin-bottom: 20px; } -.echarts-container .echarts-title, .echarts-combination-container-2 li .echarts-title { +.block-container .echarts-title, .block-combination-container-2 li .echarts-title { margin-left: 10px; } -.echarts-container .echarts-title .icon, .echarts-combination-container-2 li .echarts-title .icon { +.block-container .echarts-title .icon, .block-combination-container-2 li .echarts-title .icon { background: #3f82fe; display: block; width: 5px; @@ -32,31 +32,31 @@ html, body { left: 10px; top: 13px; } -.echarts-container .echarts-title .title, .echarts-combination-container-2 li .echarts-title .title { +.block-container .echarts-title .title, .block-combination-container-2 li .echarts-title .title { color: #666; font-size: 14px; margin-left: 5px; } @media only screen and (min-width: 641px) { - .echarts-combination-container-2 { + .block-combination-container-2 { margin-bottom: 20px; } - .echarts-combination-container-2 li { + .block-combination-container-2 li { width: calc(50% - 10px); } - .echarts-combination-container-2 li:nth-child(1) { + .block-combination-container-2 li:nth-child(1) { float: left; top: 0; left: 0; } - .echarts-combination-container-2 li:nth-child(2) { + .block-combination-container-2 li:nth-child(2) { float: right; top: 0; right: 0; } } @media only screen and (max-width: 641px) { - .echarts-combination-container-2 li { + .block-combination-container-2 li { margin-bottom: 20px; } } @@ -167,4 +167,103 @@ html, body { } .dl-content dd:last-child { border-bottom: 0; +} + +/** + * 顶部基础 + */ +.base-content-top { + margin-bottom: 10px; +} +.base-content-top .vip { + border-radius: 2px; + padding: 0 6px; + background: #e1e1e1; + color: #666; +} +.base-content-top .vip-active { + background: #ffe500; + color: #c97e10; +} +.base-content-top .ad-content:hover { + color: #f44336; +} +.inspect-upgrade-submit i { + background: #f00; + display: inline-block; + padding: 3px; + vertical-align: super; + margin-left: 2px; + border-radius: 15px; +} +@media only screen and (max-width: 641px) { + .base-content-top .left-content, + .base-content-top .right-content { + width: 100%; + } + .base-content-top .right-content { + margin-top: 10px; + border-top: 1px dashed #eee; + padding-top: 10px; + } + .base-content-top .left-content .ad-content, + .base-content-top .right-content .right-base { + float: right; + } +} + +/** + * 商店帐号信息 + */ +#store-accounts-popup { + width: 360px; + height: 350px; + left: 50%; + top: 50%; +} +@media (min-width: 630px) { + #store-accounts-popup { + margin-left: -180px; + margin-top: -175px; + } +} +@media only screen and (max-width: 641px) { + #store-accounts-popup { + left: calc(50% - 180px); + top: calc(50% - 175px); + } +} + +/** + * 更新信息展示 + */ +#inspect-upgrade-popup .am-popup-bd { + padding-bottom: 50px; + overflow: auto; +} +#inspect-upgrade-popup .upgrade-title span { + font-weight: bold; + font-size: 16px; + line-height: 16px; +} +#inspect-upgrade-popup .upgrade-title * { + vertical-align: middle; +} +#inspect-upgrade-popup .upgrade-content-item ul li { + line-height: 26px; + min-height: 26px; +} +#inspect-upgrade-popup .upgrade-bottom { + position: fixed; + left: 0; + bottom: 0px; + width: 100%; + height: 70px; + padding: 0 25px; +} +#inspect-upgrade-popup .upgrade-bottom-content { + background: #fff; + padding: 10px 20px 0 0; + height: 50px; + border-top: 1px solid #ececec; } \ No newline at end of file diff --git a/public/static/admin/default/js/index.js b/public/static/admin/default/js/index.js index a9d69d8d6..0e10f3ba1 100755 --- a/public/static/admin/default/js/index.js +++ b/public/static/admin/default/js/index.js @@ -178,4 +178,89 @@ $(function() } }); + // 检查更新 + $('.inspect-upgrade-submit').on('click', function() + { + // 基础信息 + var $inspect_upgrade_popup = $('#inspect-upgrade-popup'); + AMUI.dialog.loading({title: '正在获取最新内容、请稍候...'}); + + // ajax请求 + $.ajax({ + url: $(this).data('url'), + type: 'POST', + dataType: 'json', + timeout: 30000, + data: {}, + success: function(result) + { + AMUI.dialog.loading('close'); + if(result.code == 0) + { + // html内容处理 + // 基础信息 + var html = '

            '; + html += ''; + html += ''+result.data.title+''; + html += '

            '; + html += '
            '; + html += '更新版本:'+result.data.version_new+''; + html += '更新日期:'+result.data.add_time+''; + // 是否带指定链接和链接名称 + if((result.data.go_title || null) != null && (result.data.go_url || null) != null) + { + html += ''+result.data.go_title+''; + } + html += '
            '; + + // 提示信息 + if((result.data.tips || null) != null) + { + html += '
            '; + html += '

            '+result.data.tips+'

            '; + html += '
            '; + } + + // 更新内容介绍 + if((result.data.content || null) != null && result.data.content.length > 0) + { + html += '
            '; + html += '
              '; + for(var i in result.data.content) + { + html += '
            • '+result.data.content[i]+'
            • '; + } + html += '
            '; + html += '
            '; + } + $inspect_upgrade_popup.find('.upgrade-content').html(html); + + // 是否支持在线自动更新 + if((result.data.is_auto || 0) == 1) + { + $inspect_upgrade_popup.find('.inspect-upgrade-confirm').removeClass('am-hide'); + } else { + $inspect_upgrade_popup.find('.inspect-upgrade-confirm').addClass('am-hide'); + } + + // 打开弹窗 + $inspect_upgrade_popup.modal('open'); + } else { + Prompt(result.msg); + } + }, + error: function(xhr, type) + { + AMUI.dialog.loading('close'); + Prompt(HtmlToString(xhr.responseText) || '异常错误', null, 30); + } + }); + }); + + // 系统更新确认 + $('.inspect-upgrade-confirm').on('click', function() + { + Prompt('开发中...'); + }); + }); \ No newline at end of file diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index dd1c00719..8d780a83d 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -145,6 +145,15 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom: .am-modal-dialog .am-modal-bd { background: #fff; } +.am-modal-dialog { + width: auto; +} +.am-modal-dialog .am-modal-bd { + padding: 10px 30px; +} +.am-modal-dialog .am-modal-bd span { + vertical-align: middle; +} /** * iframe