From c339623c7826c458d82fe3ebf5240fa45a00ba75 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 23 Nov 2020 10:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/View/PromoteCompany/add.html | 20 ++++++++++++++-- .../Admin/View/PromoteCompany/edit.html | 24 +++++++++++++++++-- .../Base/Service/PromoteService.class.php | 5 +++- Public/Admin/js/uploader.js | 12 ++++++---- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/Application/Admin/View/PromoteCompany/add.html b/Application/Admin/View/PromoteCompany/add.html index e86b6adb9..02c90526a 100644 --- a/Application/Admin/View/PromoteCompany/add.html +++ b/Application/Admin/View/PromoteCompany/add.html @@ -399,7 +399,7 @@ - 尺寸不得小于512*512px,圆角半径113px,不强制要求,可直接提供512*512方图 + 尺寸为16*16px,png图片 @@ -420,7 +420,7 @@ - 尺寸不得小于512*512px,圆角半径113px,不强制要求,可直接提供512*512方图 + 尺寸为210*60px,透明png图片 @@ -1273,7 +1273,15 @@ var iconUploader = new WmUploader({ selector: '#icon-uploader', url: uploadUrl, + accept: { + title: '图片', + extensions: 'png', + mimeTypes: 'image/*', + }, afterSuccess: function(file, response) { + if (response.status == 0) { + return layer.msg(response.info) + } $('#site-icon').val(response.id) }, afterDelete: function(file) { @@ -1283,7 +1291,15 @@ var logoUploader = new WmUploader({ selector: '#logo-uploader', url: uploadUrl, + accept: { + title: '图片', + extensions: 'png', + mimeTypes: 'image/*', + }, afterSuccess: function(file, response) { + if (response.status == 0) { + return layer.msg(response.info) + } $('#site-logo').val(response.id) }, afterDelete: function(file) { diff --git a/Application/Admin/View/PromoteCompany/edit.html b/Application/Admin/View/PromoteCompany/edit.html index 19b1f60fb..14b45c62c 100644 --- a/Application/Admin/View/PromoteCompany/edit.html +++ b/Application/Admin/View/PromoteCompany/edit.html @@ -404,16 +404,18 @@
+

删除

+
- 尺寸不得小于512*512px,圆角半径113px,不强制要求,可直接提供512*512方图 + 尺寸为16*16px,png图片 @@ -430,16 +432,18 @@
+

删除

+
- 尺寸不得小于512*512px,圆角半径113px,不强制要求,可直接提供512*512方图 + 尺寸为210*60px,透明png图片 @@ -1145,7 +1149,15 @@ var iconUploader = new WmUploader({ selector: '#icon-uploader', url: uploadUrl, + accept: { + title: '图片', + extensions: 'png,ico', + mimeTypes: 'image/*', + }, afterSuccess: function(file, response) { + if (response.status == 0) { + return layer.msg(response.info) + } $('#site-icon').val(response.id) }, afterDelete: function(file) { @@ -1155,7 +1167,15 @@ var logoUploader = new WmUploader({ selector: '#logo-uploader', url: uploadUrl, + accept: { + title: '图片', + extensions: 'png', + mimeTypes: 'image/*', + }, afterSuccess: function(file, response) { + if (response.status == 0) { + return layer.msg(response.info) + } $('#site-logo').val(response.id) }, afterDelete: function(file) { diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index dcd9363cb..41d7bfbfa 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1269,7 +1269,10 @@ class PromoteService { $url = str_replace('http://', '', $url); $url = str_replace('https://', '', $url); $url = str_replace($domain, '', $url); - $domainPrefix = str_replace('tg-', '', $url); + $domainPrefix = ''; + if ($url != 'tg') { + $domainPrefix = str_replace('tg-', '', $url); + } return M('promote_company', 'tab_')->where(['site_domain_prefix' => $domainPrefix])->find(); } diff --git a/Public/Admin/js/uploader.js b/Public/Admin/js/uploader.js index 4d406a3ea..5ddc31ffb 100644 --- a/Public/Admin/js/uploader.js +++ b/Public/Admin/js/uploader.js @@ -6,6 +6,12 @@ function WmUploader(options) { return num; } + this.accept = options.accept == undefined ? { + title: '图片', + extensions: 'png,gif,jpg,jpeg,bmp', + mimeTypes: 'image/*', + } : options.accept + // fileType: img file this.fileType = options.fileType == undefined ? 'img' : options.fileType this.uploadKey = options.uniqueCode == undefined ? this.randomNum(10000, 99999) : options.uniqueCode @@ -34,11 +40,7 @@ function WmUploader(options) { id: that.uploadSelector, multiple: false }, - accept: { - title: '图片', - extensions: 'png,gif,jpg,jpeg,bmp', - mimeTypes: '.png,.gif,.jpg,.jpeg,.bmp', - }, + accept: that.accept, resize: false, disableGlobalDnd: true, fileNumLimit: 1,