diff --git a/application/admin/controller/Admin.php b/application/admin/controller/Admin.php index 4fb0d7de6..ac9b46225 100755 --- a/application/admin/controller/Admin.php +++ b/application/admin/controller/Admin.php @@ -12,6 +12,7 @@ namespace app\admin\controller; use think\facade\Hook; use app\service\AdminService; +use app\service\SystemBaseService; /** * 管理员 @@ -263,7 +264,7 @@ class Admin extends Common $this->assign('admin_login_type', MyC('admin_login_type', [], true)); // 背景图片 - $host = config('shopxo.attachment_host'); + $host = SystemBaseService::AttachmentHost(); $bg_images_list = [ $host.'/static/admin/default/images/login/1.jpg', $host.'/static/admin/default/images/login/2.jpg', diff --git a/application/admin/controller/Common.php b/application/admin/controller/Common.php index 408cbf61d..3b8ca67b5 100755 --- a/application/admin/controller/Common.php +++ b/application/admin/controller/Common.php @@ -18,6 +18,7 @@ use app\service\AdminPowerService; use app\service\ConfigService; use app\service\ResourcesService; use app\service\StoreService; +use app\service\SystemBaseService; /** * 管理员公共控制器 @@ -248,7 +249,7 @@ class Common extends Controller $this->assign('default_price_regex', lang('common_regex_price')); // 附件host地址 - $this->assign('attachment_host', config('shopxo.attachment_host')); + $this->assign('attachment_host', SystemBaseService::AttachmentHost()); // css/js引入host地址 $this->assign('public_host', config('shopxo.public_host')); diff --git a/application/admin/view/default/order/module/goods.html b/application/admin/view/default/order/module/goods.html index 49834cbdc..f845efe69 100644 --- a/application/admin/view/default/order/module/goods.html +++ b/application/admin/view/default/order/module/goods.html @@ -38,7 +38,13 @@ {{if !empty($module_data['warehouse_name'])}} - {{if !empty($module_data['warehouse_icon'])}}{{/if}} + {{if !empty($module_data['warehouse_icon'])}} + {{if IsUrl($module_data['warehouse_icon'])}} + {{$module_data.warehouse_name}} + {{else /}} + + {{/if}} + {{/if}} {{if empty($module_data['warehouse_url'])}} {{$module_data.warehouse_name}} {{else /}} diff --git a/application/common.php b/application/common.php index 5cf2935cd..a8cc8c5f3 100755 --- a/application/common.php +++ b/application/common.php @@ -11,6 +11,11 @@ // 应用公共文件 +function IsUrl($value) +{ + return in_array(substr($value, 0, 6), ['https:', 'http:/']); +} + /** * 文件快速排序 * @author Devil diff --git a/application/index/controller/Common.php b/application/index/controller/Common.php index bd630fd70..39b8137bd 100755 --- a/application/index/controller/Common.php +++ b/application/index/controller/Common.php @@ -363,7 +363,7 @@ class Common extends Controller $this->assign('default_price_regex', lang('common_regex_price')); // 附件host地址 - $this->assign('attachment_host', config('shopxo.attachment_host')); + $this->assign('attachment_host', SystemBaseService::AttachmentHost()); // css/js引入host地址 $this->assign('public_host', config('shopxo.public_host')); diff --git a/application/index/view/default/buy/index.html b/application/index/view/default/buy/index.html index b158fbaa6..4306578c6 100755 --- a/application/index/view/default/buy/index.html +++ b/application/index/view/default/buy/index.html @@ -264,7 +264,13 @@ - {{if !empty($v['icon'])}}{{/if}} + {{if !empty($v['icon'])}} + {{if IsUrl($v['icon'])}} + {{$v.name}} + {{else /}} + + {{/if}} + {{/if}} {{if empty($v['url'])}} {{$v.name}} {{else /}} diff --git a/application/index/view/default/order/detail.html b/application/index/view/default/order/detail.html index 6f5296333..426f0771d 100755 --- a/application/index/view/default/order/detail.html +++ b/application/index/view/default/order/detail.html @@ -142,7 +142,13 @@
出货服务:
- {{if !empty($data['warehouse_icon'])}}{{/if}} + {{if !empty($data['warehouse_icon'])}} + {{if IsUrl($data['warehouse_icon'])}} + {{$data.warehouse_name}} + {{else /}} + + {{/if}} + {{/if}} {{if empty($data['warehouse_url'])}} {{$data.warehouse_name}} {{else /}} diff --git a/application/index/view/default/order/module/goods.html b/application/index/view/default/order/module/goods.html index a57df74c8..6969cf28f 100644 --- a/application/index/view/default/order/module/goods.html +++ b/application/index/view/default/order/module/goods.html @@ -30,7 +30,13 @@ {{if !empty($module_data['warehouse_name'])}} - {{if !empty($module_data['warehouse_icon'])}}{{/if}} + {{if !empty($module_data['warehouse_icon'])}} + {{if IsUrl($module_data['warehouse_icon'])}} + {{$module_data.warehouse_name}} + {{else /}} + + {{/if}} + {{/if}} {{if empty($module_data['warehouse_url'])}} {{$module_data.warehouse_name}} {{else /}} diff --git a/application/service/ResourcesService.php b/application/service/ResourcesService.php index c881d1390..88668e9d3 100755 --- a/application/service/ResourcesService.php +++ b/application/service/ResourcesService.php @@ -13,6 +13,7 @@ namespace app\service; use think\Db; use think\facade\Hook; use app\service\UserService; +use app\service\SystemBaseService; /** * 资源服务层 @@ -36,7 +37,7 @@ class ResourcesService public static function ContentStaticReplace($content, $type = 'get') { // 配置文件附件url地址 - $attachment_host = config('shopxo.attachment_host'); + $attachment_host = SystemBaseService::AttachmentHost(); if(empty($attachment_host)) { $attachment_host = substr(__MY_PUBLIC_URL__, 0, -1); @@ -75,7 +76,7 @@ class ResourcesService public static function AttachmentPathHandle($value) { // 配置文件附件url地址 - $attachment_host = config('shopxo.attachment_host'); + $attachment_host = SystemBaseService::AttachmentHost(); $attachment_host_path = empty($attachment_host) ? __MY_PUBLIC_URL__ : $attachment_host.DS; // 替换处理 @@ -125,7 +126,7 @@ class ResourcesService { if(substr($value, 0, 4) != 'http') { - return config('shopxo.attachment_host').$value; + return SystemBaseService::AttachmentHost().$value; } return $value; } diff --git a/application/service/SystemBaseService.php b/application/service/SystemBaseService.php index 9f7cf2b49..21e29144b 100644 --- a/application/service/SystemBaseService.php +++ b/application/service/SystemBaseService.php @@ -474,5 +474,18 @@ class SystemBaseService // 获取内容 return ConfigService::ConfigContentRow('common_agreement_'.$params['document']); } + + /** + * 附件地址 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-07-06 + * @desc description + */ + public static function AttachmentHost() + { + return config('shopxo.attachment_host'); + } } ?> \ No newline at end of file diff --git a/application/service/UeditorService.php b/application/service/UeditorService.php index e5d8095bd..29006289b 100644 --- a/application/service/UeditorService.php +++ b/application/service/UeditorService.php @@ -11,6 +11,7 @@ namespace app\service; use app\service\ResourcesService; +use app\service\SystemBaseService; /** * 百度编辑器附件服务层 @@ -275,7 +276,7 @@ class UeditorService $field_name = self::$current_config['catcherFieldName']; // 当前站点域名或者附件域名不下载 - $attachment_host = GetUrlHost(config('shopxo.attachment_host')); + $attachment_host = GetUrlHost(SystemBaseService::AttachmentHost()); // 抓取远程图片 $list = array(); diff --git a/application/service/UserService.php b/application/service/UserService.php index 605d9bbbd..3732a70b8 100755 --- a/application/service/UserService.php +++ b/application/service/UserService.php @@ -15,6 +15,7 @@ use think\facade\Hook; use app\service\RegionService; use app\service\SafetyService; use app\service\ResourcesService; +use app\service\SystemBaseService; /** * 用户服务层 @@ -156,7 +157,7 @@ class UserService { $v['avatar'] = ResourcesService::AttachmentPathViewHandle($v['avatar']); } else { - $v['avatar'] = config('shopxo.attachment_host').'/static/index/'.strtolower(MyC('common_default_theme', 'default', true)).'/images/default-user-avatar.jpg'; + $v['avatar'] = SystemBaseService::AttachmentHost().'/static/index/'.strtolower(MyC('common_default_theme', 'default', true)).'/images/default-user-avatar.jpg'; } } @@ -512,7 +513,7 @@ class UserService { $user['avatar'] = ResourcesService::AttachmentPathViewHandle($user['avatar']); } else { - $user['avatar'] = config('shopxo.attachment_host').'/static/index/'.strtolower(config('DEFAULT_THEME', 'default')).'/images/default-user-avatar.jpg'; + $user['avatar'] = SystemBaseService::AttachmentHost().'/static/index/'.strtolower(config('DEFAULT_THEME', 'default')).'/images/default-user-avatar.jpg'; } // 移除特殊数据 diff --git a/application/service/WarehouseService.php b/application/service/WarehouseService.php index 1b2144a2c..6a7a3a350 100644 --- a/application/service/WarehouseService.php +++ b/application/service/WarehouseService.php @@ -14,6 +14,7 @@ use think\Db; use think\facade\Hook; use app\service\RegionService; use app\service\WarehouseGoodsService; +use app\service\SystemBaseService; /** * 仓库服务层 @@ -71,6 +72,12 @@ class WarehouseService $region = Db::name('Region')->where(['id'=>$ids])->column('name', 'id'); } + // 附件地址 + $host = SystemBaseService::AttachmentHost(); + + // 仓库icon + $warehouse_icon = $host.'/static/common/images/default-warehouse-icon.png'; + // 循环处理数据 foreach($data as &$v) { @@ -87,10 +94,8 @@ class WarehouseService 'warehouse_id' => $data_id, ]); - // icon - $v['icon'] = 'am-icon-cube'; - - // url地址 + // icon、url地址 + $v['icon'] = $warehouse_icon; $v['url'] = ''; // 地区 diff --git a/extend/base/Qrcode.php b/extend/base/Qrcode.php index badbef7d1..0ccfcca2f 100644 --- a/extend/base/Qrcode.php +++ b/extend/base/Qrcode.php @@ -11,6 +11,7 @@ namespace base; use app\service\ResourcesService; +use app\service\SystemBaseService; /** * 二维码驱动 @@ -188,7 +189,7 @@ class Qrcode // 验证下载地址域名 $domain_arr = [ - GetUrlHost(config('shopxo.attachment_host')), + GetUrlHost(SystemBaseService::AttachmentHost()), GetUrlHost(__MY_HOST__), ]; if(!in_array(GetUrlHost($url), $domain_arr)) diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index 12bf64f19..028650708 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -834,4 +834,15 @@ button.colorpicker-submit img { form .am-panel .am-form-group:last-child, form .am-panel .business-form-group:last-child { border-bottom: 0; +} + +/** + * 仓库信息 + */ +.warehouse-item-container * { + vertical-align: middle; +} +.warehouse-item-container .warehouse-icon { + widows: 14px; + height: 14px; } \ No newline at end of file diff --git a/public/static/common/images/default-warehouse-icon.png b/public/static/common/images/default-warehouse-icon.png new file mode 100644 index 000000000..a1a5af961 Binary files /dev/null and b/public/static/common/images/default-warehouse-icon.png differ