From edce97e987c9ee32213065bf597acee9d06cde34 Mon Sep 17 00:00:00 2001 From: JianWeie Date: Mon, 3 Jan 2022 03:11:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?##=201.2.7=EF=BC=882022-01-1=EF=BC=89=20?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E8=B0=83=E6=95=B4=EF=BC=9A=20=E3=80=90?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=91=E5=90=AF=E7=94=A8SqlSugar.Ioc?= =?UTF-8?q?=E5=8F=8ASqlSugarCore=EF=BC=8C=E5=BC=83=E7=94=A8SqlSugarClient?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E8=AF=81=E7=BA=BF=E7=A8=8B=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E5=8F=8A=E6=8F=90=E9=AB=98=E5=AF=B9=E8=B1=A1=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=AE=B9=E9=94=99=E7=8E=87=E3=80=82=E5=87=8F=E5=B0=91mysql?= =?UTF-8?q?=E4=B8=8B=E5=81=B6=E5=8F=91=E6=80=A7=E9=97=AE=E9=A2=98=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=90=E5=90=8E=E5=8F=B0=E7=94=9F=E6=88=90=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=A0=81=E3=80=91=E3=80=90=E5=90=8E=E5=8F=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=A2=84=E8=A7=88=E9=A1=B5=E9=9D=A2=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=A0=81=E3=80=91=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=BF=AE=E5=A4=8D=E3=80=90=E4=B8=83=E7=89=9B?= =?UTF-8?q?=E4=BA=91=E3=80=91=E4=B8=8A=E4=BC=A0=E6=96=B9=E5=BC=8F=E3=80=82?= =?UTF-8?q?#I4OHP9=20=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DtreeTable=E7=9A=84=E6=8A=98=E5=8F=A0=E5=88=97=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E5=AD=97=E7=AC=A6=E8=BF=87=E9=95=BF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20=E3=80=90=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E3=80=91=E5=BA=94=E4=BC=9A=E5=91=98=E9=9C=80=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E5=BC=80=E6=BA=90=E7=A4=BE=E5=8C=BA=E7=89=88=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A2=9E=E5=8A=A0=E4=BD=BF=E7=94=A8=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E5=AF=86=E7=A0=81=E7=99=BB=E5=BD=95=EF=BC=8C=E5=8F=96?= =?UTF-8?q?=E5=9B=9E=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E7=9A=84=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E6=96=87=E6=A1=A3=E3=80=82=E8=AF=A6=E6=83=85=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E3=80=90CoreCms.Net.Uni-App\CoreShop\pages\login?= =?UTF-8?q?=E3=80=91=E4=B8=8B=E6=96=87=E4=BB=B6=E3=80=82#I4O4H4=20?= =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E8=B0=83=E6=95=B4=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=95=86=E5=93=81=E3=80=90goods=E3=80=91=E5=9C=A8?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=A0=8F=E7=9B=AE=E9=80=89=E6=8B=A9=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=97=B6=E5=80=99=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E4=B8=BA=E3=80=90sort=20desc,id=20d?= =?UTF-8?q?esc=E3=80=91=E6=8C=89=E7=85=A7=E5=85=88=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=8E=92=E5=BA=8F=EF=BC=8C=E5=90=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E6=8E=92=E5=BA=8F=E3=80=82=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E3=80=90creattime=20desc=E3=80=91=E6=8E=92=E5=BA=8F=E3=80=82#I?= =?UTF-8?q?4NW4F=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E8=AE=BE=E8=AE=A1=E4=BD=BF=E7=94=A8=E3=80=90?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=A8=A1=E5=9D=97=E3=80=91=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=B5=AE=E5=8A=A8=E9=81=AE=E6=8C=A1=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E6=8C=89=E9=92=AE=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82#I4NPZL=20=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=AE=BE=E7=BD=AE=EF=BC=8C=E5=BD=93=E6=9C=AA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=BC=B9=E5=87=BA=E9=94=99=E8=AF=AF=E9=A1=B9?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=8B=E5=8D=95=E6=97=B6=E5=88=B0=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2=E4=B8=8D=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E3=80=82#I4N4UL=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 0.0.3 会员版/商业版: 【修复】修复下单界面【添加收货地址】按钮宽度及不居中的问题。 【优化】去除接口生成海报不需要的字体,只保留思源标准字体。 【修复】修复弹窗登录报【checkbox未嵌套的问题】,导致授权页有报错。#I4OYPR 【修复】移除【Microsoft.IdentityModel.Tokens】组件,防止更新组件导致对jwt token校验的影响。 【优化】移除【http.interceptor.js】遗留的前端请求拦截器。 --- CoreCms.Net.Auth/CoreCms.Net.Auth.csproj | 1 - CoreCms.Net.Core/Config/SqlSugarSetup.cs | 94 +++--- CoreCms.Net.Core/CoreCms.Net.Core.csproj | 1 + .../UnitOfWork/IUnitOfWork.cs | 2 +- CoreCms.Net.Repository/BaseRepository.cs | 2 +- .../CoreCms.Net.Repository.csproj | 1 + .../Good/CoreCmsGoodsRepository.cs | 4 +- .../UnitOfWork/UnitOfWork.cs | 15 +- .../Shop/CoreCmsPagesServices.cs | 2 +- .../coreshop-page/coreshop-imgSingle.vue | 2 +- .../CoreShop/pages/login/forget/forget.vue | 203 ++++++++++++ .../login/loginByAccount/loginByAccount.vue | 309 ++++++++++++++++++ .../CoreShop/pages/placeOrder/index/index.vue | 3 - .../Controllers/Com/ToolsController.cs | 214 +++--------- .../wwwroot/static/css/overWrite.css | 12 + .../wwwroot/static/css/overWrite.less | 5 +- .../wwwroot/static/css/overWrite.min.css | 2 +- 17 files changed, 629 insertions(+), 243 deletions(-) create mode 100644 CoreCms.Net.Uni-App/CoreShop/pages/login/forget/forget.vue create mode 100644 CoreCms.Net.Uni-App/CoreShop/pages/login/loginByAccount/loginByAccount.vue diff --git a/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj b/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj index a9a3b2e..1133bd1 100644 --- a/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj +++ b/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj @@ -7,7 +7,6 @@ - diff --git a/CoreCms.Net.Core/Config/SqlSugarSetup.cs b/CoreCms.Net.Core/Config/SqlSugarSetup.cs index 4e45849..52a2ff5 100644 --- a/CoreCms.Net.Core/Config/SqlSugarSetup.cs +++ b/CoreCms.Net.Core/Config/SqlSugarSetup.cs @@ -17,6 +17,7 @@ using CoreCms.Net.Configuration; using CoreCms.Net.Loging; using Microsoft.Extensions.DependencyInjection; using SqlSugar; +using SqlSugar.IOC; namespace CoreCms.Net.Core.Config { @@ -25,70 +26,49 @@ namespace CoreCms.Net.Core.Config /// public static class SqlSugarSetup { + public static void AddSqlSugarSetup(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); - string connectionString = AppSettingsConstVars.DbSqlConnection; - string dbTypeString = AppSettingsConstVars.DbDbType; - - //获取数据类型 - var dbType = dbTypeString == DbType.MySql.ToString() ? DbType.MySql : DbType.SqlServer; - //判断是否开启redis设置二级缓存方式 - ICacheService myCache = AppSettingsConstVars.RedisUseCache - ? (ICacheService)new SqlSugarRedisCache() - : new SqlSugarMemoryCache(); - var connectionConfig = new ConnectionConfig() + //注入 ORM + SugarIocServices.AddSqlSugar(new IocConfig() { - ConnectionString = connectionString, //必填 - DbType = dbType, //必填 - IsAutoCloseConnection = false, - InitKeyType = InitKeyType.Attribute, - - ConfigureExternalServices = new ConfigureExternalServices() + //数据库连接 + ConnectionString = AppSettingsConstVars.DbSqlConnection, + //判断数据库类型 + DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, + //是否开启自动关闭数据库连接-//不设成true要手动close + IsAutoCloseConnection = true, + }); + + //设置参数 + services.ConfigurationSugar(db => + { + db.CurrentConnectionConfig.InitKeyType = InitKeyType.Attribute; + db.CurrentConnectionConfig.ConfigureExternalServices = new ConfigureExternalServices() { - DataInfoCacheService = myCache - }, - }; - - - services.AddScoped(o => + //判断是否开启redis设置二级缓存方式 + DataInfoCacheService = AppSettingsConstVars.RedisUseCache ? (ICacheService)new SqlSugarRedisCache() : new SqlSugarMemoryCache() + }; + + //执行SQL 错误事件,可监控sql(暂时屏蔽,需要可开启) + //db.Aop.OnLogExecuting = (sql, p) => + //{ + // NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.Other, "SqlSugar执行SQL错误事件打印Sql", sql); + //}; + + //执行SQL 错误事件 + db.Aop.OnError = (exp) => { - - var db = new SqlSugarClient(connectionConfig); //默认SystemTable - - //日志处理 - ////SQL执行前 可以修改SQL - //db.Aop.OnLogExecuting = (sql, pars) => - //{ - // //获取sql - // Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); - // Console.WriteLine(); - - // //通过TempItems这个变量来算出这个SQL执行时间(1) - // if (db.TempItems == null) db.TempItems = new Dictionary(); - // db.TempItems.Add("logTime", DateTime.Now); - // //通过TempItems这个变量来算出这个SQL执行时间(2) - // var startingTime = db.TempItems["logTime"]; - // db.TempItems.Remove("time"); - // var completedTime = DateTime.Now; - - - //}; - //db.Aop.OnLogExecuted = (sql, pars) => //SQL执行完事件 - //{ - - //}; - //db.Aop.OnLogExecuting = (sql, pars) => //SQL执行前事件 - //{ - - //}; - db.Aop.OnError = (exp) =>//执行SQL 错误事件 - { - NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.Other, "SqlSugar", "执行SQL错误事件", exp); - }; - return db; - }); + NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.Other, "SqlSugar", "执行SQL错误事件", exp); + }; + + //设置更多连接参数 + //db.CurrentConnectionConfig.XXXX=XXXX + //db.CurrentConnectionConfig.MoreSetting=new MoreSetting(){} + //读写分离等都在这儿设置 + }); } } diff --git a/CoreCms.Net.Core/CoreCms.Net.Core.csproj b/CoreCms.Net.Core/CoreCms.Net.Core.csproj index b405e9b..292b649 100644 --- a/CoreCms.Net.Core/CoreCms.Net.Core.csproj +++ b/CoreCms.Net.Core/CoreCms.Net.Core.csproj @@ -25,6 +25,7 @@ + diff --git a/CoreCms.Net.IRepository/UnitOfWork/IUnitOfWork.cs b/CoreCms.Net.IRepository/UnitOfWork/IUnitOfWork.cs index 11cab48..0c2cb40 100644 --- a/CoreCms.Net.IRepository/UnitOfWork/IUnitOfWork.cs +++ b/CoreCms.Net.IRepository/UnitOfWork/IUnitOfWork.cs @@ -15,7 +15,7 @@ namespace CoreCms.Net.IRepository.UnitOfWork { public interface IUnitOfWork { - SqlSugarClient GetDbClient(); + SqlSugarScope GetDbClient(); void BeginTran(); diff --git a/CoreCms.Net.Repository/BaseRepository.cs b/CoreCms.Net.Repository/BaseRepository.cs index c170af1..1b6bedc 100644 --- a/CoreCms.Net.Repository/BaseRepository.cs +++ b/CoreCms.Net.Repository/BaseRepository.cs @@ -22,7 +22,7 @@ namespace CoreCms.Net.Repository public abstract class BaseRepository : IBaseRepository where T : class, new() { //private readonly IUnitOfWork _unitOfWork; - private readonly SqlSugarClient _dbBase; + private readonly SqlSugarScope _dbBase; protected BaseRepository(IUnitOfWork unitOfWork) { diff --git a/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj b/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj index ae24f2b..5ed53be 100644 --- a/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj +++ b/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj @@ -7,6 +7,7 @@ + diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs index 29d26e5..a1d2c72 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs @@ -919,8 +919,8 @@ namespace CoreCms.Net.Repository } else { - var ids = DbClient.Queryable().Where(p => p.isDel == false && p.isMarketable == true) - .Select(p => p.id).ToArray(); + var ids = await DbClient.Queryable().Where(p => p.isDel == false && p.isMarketable == true) + .Select(p => p.id).ToArrayAsync(); var dbIds = new List(); if (ids.Any()) { diff --git a/CoreCms.Net.Repository/UnitOfWork/UnitOfWork.cs b/CoreCms.Net.Repository/UnitOfWork/UnitOfWork.cs index c713cad..acceee6 100644 --- a/CoreCms.Net.Repository/UnitOfWork/UnitOfWork.cs +++ b/CoreCms.Net.Repository/UnitOfWork/UnitOfWork.cs @@ -14,6 +14,7 @@ using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.Loging; using NLog; using SqlSugar; +using SqlSugar.IOC; namespace CoreCms.Net.Repository.UnitOfWork { @@ -21,19 +22,25 @@ namespace CoreCms.Net.Repository.UnitOfWork { private readonly ISqlSugarClient _sqlSugarClient; - public UnitOfWork(ISqlSugarClient sqlSugarClient) + //public UnitOfWork(ISqlSugarClient sqlSugarClient) + //{ + // _sqlSugarClient = sqlSugarClient; + //} + + + public UnitOfWork() { - _sqlSugarClient = sqlSugarClient; + _sqlSugarClient = DbScoped.SugarScope; } /// /// 获取DB,保证唯一性 /// /// - public SqlSugarClient GetDbClient() + public SqlSugarScope GetDbClient() { // 必须要as,后边会用到切换数据库操作 - return _sqlSugarClient as SqlSugarClient; + return _sqlSugarClient as SqlSugarScope; } public void BeginTran() diff --git a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs index 5b6774e..fe14348 100644 --- a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs +++ b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs @@ -421,7 +421,7 @@ namespace CoreCms.Net.Services } limit = limit > 0 ? limit : 10; - var goods = await _goodsServices.QueryListByClauseAsync(where, limit, p => p.createTime, OrderByType.Desc, false); + var goods = await _goodsServices.QueryPageAsync(where, " sort desc,id desc ", 1, limit, true); if (goods != null && goods.Any()) { JArray result = JArray.FromObject(goods); diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-imgSingle.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-imgSingle.vue index 6af63be..50eba26 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-imgSingle.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-imgSingle.vue @@ -137,7 +137,7 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/login/loginByAccount/loginByAccount.vue b/CoreCms.Net.Uni-App/CoreShop/pages/login/loginByAccount/loginByAccount.vue new file mode 100644 index 0000000..61d65c7 --- /dev/null +++ b/CoreCms.Net.Uni-App/CoreShop/pages/login/loginByAccount/loginByAccount.vue @@ -0,0 +1,309 @@ + + + + + diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue index a185dbd..dac663b 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue @@ -676,11 +676,8 @@ success(ress) { if (res.errMsg == "requestSubscribeMessage:ok") { console.log(ress); - } else { - } }, fail(ress) { - _this.$u.toast(ress.errMsg); console.log(ress); } }); diff --git a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs index 7b806ab..df8cea0 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs @@ -591,7 +591,7 @@ namespace CoreCms.Net.Web.Admin.Controllers //返回数据 var jm = new AdminUiCallBack { code = 0 }; - var _filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions(); + var filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions(); var formModel = await _coreCmsFormServices.QueryByIdAsync(entity.id); @@ -615,100 +615,37 @@ namespace CoreCms.Net.Web.Admin.Controllers { var memStream = new MemoryStream(response.RawBytes); - var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo) + ".jpg"; - var today = DateTime.Now.ToString("yyyyMMdd"); - - if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString()) + string url = string.Empty; + if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString()) { - var saveUrl = "/Upload/QrCode/" + today + "/"; - var dirPath = _webHostEnvironment.WebRootPath + saveUrl; - string bucketBindDomain = AppSettingsConstVars.AppConfigAppUrl; + url = _toolsServices.UpLoadBase64ForLocalStorage(filesStorageOptions, memStream); - if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); - var filePath = dirPath + newFileName; - var fileUrl = saveUrl + newFileName; - - //储存图片 - System.IO.File.Delete(filePath); - await using (var fs = new FileStream(filePath, FileMode.CreateNew)) - { - await memStream.CopyToAsync(fs).ConfigureAwait(false); - await fs.FlushAsync().ConfigureAwait(false); - } - - jm.code = 0; - jm.msg = "上传成功!"; - jm.data = new - { - fileUrl, - src = bucketBindDomain + fileUrl - }; } - else if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.AliYunOSS.ToString()) + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.AliYunOSS.ToString()) { //上传到阿里云 - - // 设置当前流的位置为流的开始 - memStream.Seek(0, SeekOrigin.Begin); - - await using var fileStream = memStream; - - var md5 = OssUtils.ComputeContentMd5(fileStream, memStream.Length); - - var filePath = "Upload/QrCode/" + today + "/" + newFileName; //云文件保存路径 - //初始化阿里云配置--外网Endpoint、访问ID、访问password - var aliyun = new OssClient(_filesStorageOptions.Endpoint, _filesStorageOptions.AccessKeyId, _filesStorageOptions.AccessKeySecret); - //将文件md5值赋值给meat头信息,服务器验证文件MD5 - var objectMeta = new ObjectMetadata - { - ContentMd5 = md5 - }; - //文件上传--空间名、文件保存路径、文件流、meta头信息(文件md5) //返回meta头信息(文件md5) - aliyun.PutObject(_filesStorageOptions.BucketName, filePath, fileStream, objectMeta); - //返回给UEditor的插入编辑器的图片的src - jm.code = 0; - jm.msg = "上传成功"; - jm.data = new - { - fileUrl = _filesStorageOptions.BucketBindUrl + filePath, - src = _filesStorageOptions.BucketBindUrl + filePath - }; + url = await _toolsServices.UpLoadBase64ForAliYunOSS(filesStorageOptions, memStream); } - else if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QCloudOSS.ToString()) + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QCloudOSS.ToString()) { //上传到腾讯云OSS - //初始化 CosXmlConfig - string appid = _filesStorageOptions.AccountId;//设置腾讯云账户的账户标识 APPID - string region = _filesStorageOptions.CosRegion; //设置一个默认的存储桶地域 - CosXmlConfig config = new CosXmlConfig.Builder() - //.SetAppid(appid) - .IsHttps(true) //设置默认 HTTPS 请求 - .SetRegion(region) //设置一个默认的存储桶地域 - .SetDebugLog(true) //显示日志 - .Build(); //创建 CosXmlConfig 对象 - - long durationSecond = 600; //每次请求签名有效时长,单位为秒 - QCloudCredentialProvider qCloudCredentialProvider = new DefaultQCloudCredentialProvider( - _filesStorageOptions.AccessKeyId, _filesStorageOptions.AccessKeySecret, durationSecond); - - - var cosXml = new CosXmlServer(config, qCloudCredentialProvider); - - byte[] bytes = memStream.ToArray(); - - var filePath = "Upload/QrCode/" + today + "/" + newFileName; //云文件保存路径 - COSXML.Model.Object.PutObjectRequest putObjectRequest = new COSXML.Model.Object.PutObjectRequest(_filesStorageOptions.TencentBucketName, filePath, bytes); + url = _toolsServices.UpLoadBase64ForQCloudOSS(filesStorageOptions, response.RawBytes); + } + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QiNiuKoDo.ToString()) + { + //上传到七牛云kodo + url = _toolsServices.UpLoadBase64ForQiNiuKoDo(filesStorageOptions, response.RawBytes); + } - cosXml.PutObject(putObjectRequest); + var bl = !string.IsNullOrEmpty(url); + jm.code = bl ? 0 : 1; + jm.msg = bl ? "上传成功!" : "上传失败"; + jm.data = new + { + fileUrl = url, + src = url + }; - jm.code = 0; - jm.msg = "上传成功"; - jm.data = new - { - fileUrl = _filesStorageOptions.BucketBindUrl + filePath, - src = _filesStorageOptions.BucketBindUrl + filePath - }; - } } else { @@ -737,7 +674,7 @@ namespace CoreCms.Net.Web.Admin.Controllers //返回数据 var jm = new AdminUiCallBack { code = 0 }; - var _filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions(); + var filesStorageOptions = await _coreCmsSettingServices.GetFilesStorageOptions(); var pageModel = await _pagesServices.QueryByClauseAsync(p => p.code == entity.id); @@ -761,100 +698,37 @@ namespace CoreCms.Net.Web.Admin.Controllers { var memStream = new MemoryStream(response.RawBytes); - var newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo) + ".jpg"; - var today = DateTime.Now.ToString("yyyyMMdd"); - - if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString()) + string url = string.Empty; + if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.LocalStorage.ToString()) { - var saveUrl = "/Upload/QrCode/" + today + "/"; - var dirPath = _webHostEnvironment.WebRootPath + saveUrl; - string bucketBindDomain = AppSettingsConstVars.AppConfigAppUrl; + url = _toolsServices.UpLoadBase64ForLocalStorage(filesStorageOptions, memStream); - if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); - var filePath = dirPath + newFileName; - var fileUrl = saveUrl + newFileName; - - //储存图片 - System.IO.File.Delete(filePath); - await using (var fs = new FileStream(filePath, FileMode.CreateNew)) - { - await memStream.CopyToAsync(fs).ConfigureAwait(false); - await fs.FlushAsync().ConfigureAwait(false); - } - - jm.code = 0; - jm.msg = "上传成功!"; - jm.data = new - { - fileUrl, - src = bucketBindDomain + fileUrl - }; } - else if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.AliYunOSS.ToString()) + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.AliYunOSS.ToString()) { //上传到阿里云 - - // 设置当前流的位置为流的开始 - memStream.Seek(0, SeekOrigin.Begin); - - await using var fileStream = memStream; - - var md5 = OssUtils.ComputeContentMd5(fileStream, memStream.Length); - - var filePath = "Upload/QrCode/" + today + "/" + newFileName; //云文件保存路径 - //初始化阿里云配置--外网Endpoint、访问ID、访问password - var aliyun = new OssClient(_filesStorageOptions.Endpoint, _filesStorageOptions.AccessKeyId, _filesStorageOptions.AccessKeySecret); - //将文件md5值赋值给meat头信息,服务器验证文件MD5 - var objectMeta = new ObjectMetadata - { - ContentMd5 = md5 - }; - //文件上传--空间名、文件保存路径、文件流、meta头信息(文件md5) //返回meta头信息(文件md5) - aliyun.PutObject(_filesStorageOptions.BucketName, filePath, fileStream, objectMeta); - //返回给UEditor的插入编辑器的图片的src - jm.code = 0; - jm.msg = "上传成功"; - jm.data = new - { - fileUrl = _filesStorageOptions.BucketBindUrl + filePath, - src = _filesStorageOptions.BucketBindUrl + filePath - }; + url = await _toolsServices.UpLoadBase64ForAliYunOSS(filesStorageOptions, memStream); } - else if (_filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QCloudOSS.ToString()) + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QCloudOSS.ToString()) { //上传到腾讯云OSS - //初始化 CosXmlConfig - string appid = _filesStorageOptions.AccountId;//设置腾讯云账户的账户标识 APPID - string region = _filesStorageOptions.CosRegion; //设置一个默认的存储桶地域 - CosXmlConfig config = new CosXmlConfig.Builder() - //.SetAppid(appid) - .IsHttps(true) //设置默认 HTTPS 请求 - .SetRegion(region) //设置一个默认的存储桶地域 - .SetDebugLog(true) //显示日志 - .Build(); //创建 CosXmlConfig 对象 - - long durationSecond = 600; //每次请求签名有效时长,单位为秒 - QCloudCredentialProvider qCloudCredentialProvider = new DefaultQCloudCredentialProvider( - _filesStorageOptions.AccessKeyId, _filesStorageOptions.AccessKeySecret, durationSecond); - - - var cosXml = new CosXmlServer(config, qCloudCredentialProvider); - - byte[] bytes = memStream.ToArray(); - - var filePath = "Upload/QrCode/" + today + "/" + newFileName; //云文件保存路径 - COSXML.Model.Object.PutObjectRequest putObjectRequest = new COSXML.Model.Object.PutObjectRequest(_filesStorageOptions.TencentBucketName, filePath, bytes); + url = _toolsServices.UpLoadBase64ForQCloudOSS(filesStorageOptions, response.RawBytes); + } + else if (filesStorageOptions.StorageType == GlobalEnumVars.FilesStorageOptionsType.QiNiuKoDo.ToString()) + { + //上传到七牛云kodo + url = _toolsServices.UpLoadBase64ForQiNiuKoDo(filesStorageOptions, response.RawBytes); + } - cosXml.PutObject(putObjectRequest); + var bl = !string.IsNullOrEmpty(url); + jm.code = bl ? 0 : 1; + jm.msg = bl ? "上传成功!" : "上传失败"; + jm.data = new + { + fileUrl = url, + src = url + }; - jm.code = 0; - jm.msg = "上传成功"; - jm.data = new - { - fileUrl = _filesStorageOptions.BucketBindUrl + filePath, - src = _filesStorageOptions.BucketBindUrl + filePath - }; - } } else { diff --git a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.css b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.css index eaab3ca..ee2036b 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.css +++ b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.css @@ -1052,4 +1052,16 @@ xm-select .xm-body .xm-option.hide-icon.selected { .layadmin-side-shrink .layui-layout-admin .layui-logo { width: 60px; background-image: url(../images/common/logoMin.png); +} +.ew-tree-table .ew-tree-pack { + cursor: pointer; + line-height: 16px; + display: inline; + vertical-align: middle; +} +.ew-tree-table .ew-tree-pack > span { + height: 16px; + line-height: 16px; + display: inline; + vertical-align: middle; } \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.less b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.less index 4a2f952..757bb27 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.less +++ b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.less @@ -358,4 +358,7 @@ xm-select .xm-label .xm-label-block, xm-select .xm-body .xm-option.hide-icon.sel .longLogo { height: 50px; width: 220px; display: none; } } - .layadmin-side-shrink .layui-layout-admin .layui-logo { width: 60px; background-image: url(../images/common/logoMin.png); } \ No newline at end of file + .layadmin-side-shrink .layui-layout-admin .layui-logo { width: 60px; background-image: url(../images/common/logoMin.png); } + +.ew-tree-table .ew-tree-pack { cursor: pointer; line-height: 16px; display: inline; vertical-align: middle; } + .ew-tree-table .ew-tree-pack > span { height: 16px; line-height: 16px; display: inline; vertical-align: middle; } \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.min.css b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.min.css index 942b174..93d16e0 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.min.css +++ b/CoreCms.Net.Web.Admin/wwwroot/static/css/overWrite.min.css @@ -1 +1 @@ -::-webkit-scrollbar{width:6px;height:6px;background-color:#f5f5f5;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);border-radius:6px;background-color:#f5f5f5;}::-webkit-scrollbar-thumb{border-radius:6px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#009688;}a{cursor:pointer;}.cursor:hover{cursor:pointer;}.layui-nav *{font-size:13.5px;}.layui-breadcrumb>*{font-size:12px;}.layui-input,.layui-textarea{display:block;width:100%;padding-left:5px;}.coreshop-search-form,.layui-table-box,.layui-table-view,.coreshop-form{background-color:#fff;}.layui-side-menu .layui-nav .layui-nav-item .layui-icon{font-size:14px;}.layui-nav-tree .layui-nav-more{right:15px;padding:0;}.table-body{background-color:#fff;margin:10px;padding:0 10px;border:1px solid #e6e6e6;}.layadmin-shortcut li cite{font-size:13px;}.layui-tab-title li{font-size:13px;}.layui-elem-field legend{font-size:13px;}.coreshop-form .layui-form-item{margin-bottom:10px;font-size:12px;}.coreshop-form .order-ship-btn{margin:0 auto;margin-top:25px;display:block;}.coreshop-form .layui-btn-fluid{width:50%;}.coreshop-form .layui-tab-content{padding:10px;}.coreshop-form .add-save-btn{width:100%;}.coreshop-form .layui-form-pane .layui-form-label{padding:8px 5px;}.coreshop-form .layui-form-mid{padding:8px 10px !important;border-bottom:1px dashed #eee;min-height:21px;color:#999 !important;}.coreshop-form .layui-form-mid .layui-form-switch{margin-top:-3px;}.coreshop-form .layui-form-label{font-size:12px;}.required-color{color:#f00;}.select-address{display:inline-block !important;width:30%;margin-right:2%;padding:10px 0;border:1px solid #e6e6e6;margin-bottom:0;}.sellect_seller_brands_list li,.sellect_seller_goods_list li{background-color:#f9f9f9;padding:4px;margin:4px;}.sellect_seller_brands_list li span,.sellect_seller_goods_list li span{color:#f00;margin-right:7px;cursor:pointer;}.list-tag{float:right;margin-right:0;}.link-hot{color:#009688;cursor:pointer;}.layui-btn+.layui-btn{margin-left:5px;}.have-add .layui-form-switch,.have-add-td .layui-form-switch{margin-top:0;}.help-tip{float:right;}.icon-wenhao{color:#9e9e9e;font-size:16px !important;position:relative;top:11px;}.layui-iconpicker{margin-bottom:10px;}.layui-field-title{margin:10px 0 10px;}.noDefaultToolbar .layui-table-tool .layui-table-tool-temp{padding-right:0;}.coreshop-toolbar-search-form,.coreshop-search-form{border:1px solid #e6e6e6;padding:10px;margin:10px 10px 0 10px;}.coreshop-toolbar-search-form .layui-input-wrap,.coreshop-search-form .layui-input-wrap{line-height:30px;}.coreshop-toolbar-search-form .layui-input,.coreshop-search-form .layui-input,.coreshop-toolbar-search-form .layui-select,.coreshop-search-form .layui-select,.coreshop-toolbar-search-form .layui-textarea,.coreshop-search-form .layui-textarea{height:30px;line-height:1.3;line-height:30px\9;border-width:1px;border-style:solid;background-color:#fff;border-radius:2px;}.coreshop-toolbar-search-form .layui-form-label,.coreshop-search-form .layui-form-label{float:left;display:block;padding:5px 5px 5px 2px;width:auto;min-width:60px;max-width:120px;font-weight:400;line-height:20px;text-align:center;font-size:12px;}.coreshop-toolbar-search-form .layui-input-block,.coreshop-search-form .layui-input-block{margin-left:74px;min-height:26px;}.coreshop-toolbar-search-form .layui-form-select dl,.coreshop-search-form .layui-form-select dl{top:29px;}.coreshop-toolbar-search-form .layui-form-end-item,.coreshop-search-form .layui-form-end-item{margin-bottom:0;}.coreshop-toolbar-search-form .layui-form-item,.coreshop-search-form .layui-form-item{margin-bottom:0;}.coreshop-toolbar-search-form .layui-form-item .layui-inline,.coreshop-search-form .layui-form-item .layui-inline{margin-bottom:0;margin-right:0;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline{margin-right:5px;width:150px;font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input::-webkit-input-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input::-webkit-input-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input::-moz-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input::-moz-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input:-ms-input-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input:-ms-input-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input:-moz-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input:-moz-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .core-time-input,.coreshop-search-form .layui-form-item .layui-inline .core-time-input{width:308px;}.coreshop-toolbar-search-form xm-select,.coreshop-search-form xm-select{min-height:28px;line-height:28px;}.coreshop-toolbar-search-form xm-select *,.coreshop-search-form xm-select *{font-size:12px;}.coreshop-toolbar-search-form .xm-body .xm-tree .xm-option-content,.coreshop-search-form .xm-body .xm-tree .xm-option-content{padding-left:6px;font-size:12px;}.coreshop-toolbar-search-form xm-select .xm-label .scroll .label-content,.coreshop-search-form xm-select .xm-label .scroll .label-content{line-height:28px;}.coreshop-toolbar-search-form xm-select>.xm-label .scroll .label-content,.coreshop-search-form xm-select>.xm-label .scroll .label-content{display:flex;padding:0 20px 0 10px;font-size:12px;}.coreshop-toolbar-search-form .layui-form-mid,.coreshop-search-form .layui-form-mid{padding:4px 0 !important;}.coreshop-toolbar-search-form .layui-input-inline.core-time-input,.coreshop-search-form .layui-input-inline.core-time-input{width:300px;}.coreshop-toolbar-search-form{border:0;padding:0;margin:0;}.order-form .layui-form-item .layui-inline{margin-bottom:5px;margin-right:0;}.order-table .layui-table-tool-temp{padding-right:0;}.order-table table th{padding:0;}.order-table .layui-table-cell{height:auto;line-height:28px;padding:0 5px;position:relative;box-sizing:border-box;}.order-table .layui-table-cell,.order-table .layui-table-tool-panel li{overflow:inherit;text-overflow:ellipsis;white-space:inherit;}.order-table .orderShip{padding:0 5px;}.order-min-table{background:#fafafa;}.order-min-table .layui-table{border-width:1px;border-style:solid;border-color:#eee;}.order-min-table .layui-table th{text-align:center;font-weight:400;}.order-min-table .layui-table tr td{text-align:center;}.order-min-table .layui-table tr td .title{padding:0 5px;}.order-tab-card .layui-tab-title{padding-left:25px;padding-top:5px;}.order-tab-card .layui-tab-title .layui-this:after{border-top:1px solid #eee;}.layui-elem-quote{border-radius:0 2px 2px 0;background-color:#f2f2f2;font-size:12px;padding:10px;}.layui-layout-admin .layui-side{overflow-x:hidden;}.layui-layout-admin .layui-side::-webkit-scrollbar{display:none;}.layui-layout-admin .layui-layer-title{height:40px;line-height:40px;border:0;background-color:#20222a;color:#fff;}.layui-layout-admin i[close]{top:5px;}.layui-layer-admin .layui-layer-title{font-size:13px;}.layui-layer-admin .layui-layer-title{height:40px;line-height:40px;border:0;background-color:#20222a;color:#fff;}.layui-layer-admin i[close]{top:8px;}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn,.layui-layer-dialog .layui-layer-btn{padding-top:10px;}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{border-top:1px dashed #eee;}.layui-layer-btn .layui-layer-btn0{border-color:#009688;background-color:#009688;color:#fff;}.layui-layer-btn a{height:32px;line-height:32px;padding:0 25px;margin:5px 0 0 10px;border-radius:100px;}.layui-upload-img{height:90px;max-height:90px;width:auto;}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:4px 5px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff;}.layui-badge-green{color:#52c41a;background:#f6ffed;border:1px solid #b7eb8f;}.layui-badge-blue{color:#1890ff;background:#e6f7ff;border:1px solid #91d5ff;}.layui-badge-red{color:#f5222d;background:#fff1f0;border:1px solid #ffa39e;}.layui-badge-yellow{color:#faad14;background:#fffbe6;border:1px solid #ffe58f;}.layui-badge-gray{color:#8c8c8c;background:#fafafa;border:1px solid #ccc;}xm-select>.xm-body{margin-left:-2px;}xm-select>.xm-body .xm-option{background-color:transparent !important;}xm-select>.xm-body .xm-option.hide-icon.selected{background-color:#5fb878 !important;}xm-select>.xm-body .xm-option:hover{background-color:#f2f2f2 !important;}.xm-body .xm-tree{min-width:200px;}.xm-body .xm-tree .xm-option-content{padding-left:6px;}xm-select{border-color:#e6e6e6 !important;}xm-select:hover{border-color:#d2d2d2 !important;}xm-select[style="border-color: rgb(229, 77, 66);"]{border-color:#e54d42 !important;}body .ew-xmselect-tree xm-select .xm-body .xm-option .xm-option-icon{position:absolute;left:30px;top:0;right:0;bottom:0;width:auto;height:auto;border:none !important;z-index:1;}body .ew-xmselect-tree xm-select .xm-body .xm-option .xm-option-icon:before{display:none;}body .ew-xmselect-tree xm-select .xm-body .xm-option.selected{background-color:#f2f2f2 !important;}body .ew-xmselect-tree xm-select .xm-body .xm-option.selected .xm-option-content{color:#5fb878 !important;}xm-select .xm-body .xm-option .xm-option-icon{border-color:#2d8cf0 !important;}xm-select .xm-label .xm-label-block,xm-select .xm-body .xm-option.hide-icon.selected{background-color:#2d8cf0 !important;}.layui-form-required:before{content:"*";display:inline-block;font-family:SimSun;margin-right:4px;font-size:14px;line-height:1;color:#ed4014;}.layui-form-radio *{font-size:12px;}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:12px;}.layui-table-cell{height:28px;line-height:28px;padding:0 8px;position:relative;box-sizing:border-box;}.layui-table{word-break:break-all;word-wrap:break-word;}.layui-layer-admin .layui-layer-content{padding:10px;line-height:22px;}.layui-layer-admin .layui-layer-setwin{position:absolute;right:15px;*right:0;top:8px;font-size:0;line-height:initial;}.layui-layer-admin .layui-layer-setwin a{position:relative;width:31px;height:31px;margin-left:10px;font-size:12px;_overflow:hidden;color:#fff;}.layui-layer-admin .layui-layer-setwin .layui-layer-close1{background-position:-149px -31px;cursor:pointer;}.layadmin-header{display:none;height:35px;line-height:35px;margin-bottom:0;border-radius:0;}.layui-btn{font-size:12px;}.ew-crop-img-preview{float:left;margin-bottom:10px;margin-right:15px;overflow:hidden;background:#e6e6e6;}.preview-lg{width:256px;height:144px;}.preview-md{width:128px;height:72px;}.preview-sm{width:64px;height:36px;}.preview-xs{width:32px;height:18px;margin-right:0;}.docs-data{width:100%;float:left;text-align:left;}.myCropperBox .layui-form-label{width:70px;padding:2px 5px;height:25px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#fbfbfb;overflow:hidden;box-sizing:border-box;}.myCropperBox .layui-form-item{margin-bottom:5px;clear:both;*zoom:1;}.myCropperBox .layui-input{height:25px;line-height:1.3;border-width:1px;border-style:solid;background-color:#fff;}.myCropperBox .layui-input-inline{margin-left:-1px;margin-right:10px;}.myCropperBox .layui-form-mid{float:left;display:block;padding:2px 0 !important;height:25px;line-height:20px;text-align:left;overflow:hidden;box-sizing:border-box;}.addGoods .layui-form-pane xm-select,.editGoodsTypes .layui-form-pane xm-select,.editGoodsParameters .layui-form-pane xm-select{margin:0 -1px -1px 0;}.addGoods .grade_price,.editGoodsTypes .grade_price,.editGoodsParameters .grade_price{width:80% !important;float:left;display:inline;}.addGoods .grade_price input,.editGoodsTypes .grade_price input,.editGoodsParameters .grade_price input{display:inline;width:100px;}.addGoods .spec-item,.editGoodsTypes .spec-item,.editGoodsParameters .spec-item{float:left;margin:5px;}.addGoods .spec-item .layui-form-checkbox,.editGoodsTypes .spec-item .layui-form-checkbox,.editGoodsParameters .spec-item .layui-form-checkbox{margin-top:0 !important;}.addGoods .spec-item .checkboxBox,.editGoodsTypes .spec-item .checkboxBox,.editGoodsParameters .spec-item .checkboxBox{float:left;display:block;line-height:20px;width:75px;}.addGoods .layui-form-pane .layui-form-item[pane] .layui-input-inline,.editGoodsTypes .layui-form-pane .layui-form-item[pane] .layui-input-inline,.editGoodsParameters .layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:0;width:auto;}.addGoods .del-img,.editGoodsTypes .del-img,.editGoodsParameters .del-img{position:absolute;background-color:rgba(0,0,0,.5);color:#fff;width:13px;height:13px;line-height:12px;font-size:10px;display:inline-block;text-align:center;border-radius:50%;right:-6px;top:-6px;}.addGoods .w-e-text-container,.editGoodsTypes .w-e-text-container,.editGoodsParameters .w-e-text-container{height:600px !important;}.addGoods .layui-form-text .layui-input-block,.editGoodsTypes .layui-form-text .layui-input-block,.editGoodsParameters .layui-form-text .layui-input-block{margin-left:0;left:0;}.addGoods .imgdiv,.editGoodsTypes .imgdiv,.editGoodsParameters .imgdiv,.transactioncomponent .imgdiv{float:left;text-align:center;border:1px solid #ccc;padding:5px;padding-bottom:0;margin-right:10px;background-color:#fff;}.addGoods .layui-upload-img,.editGoodsTypes .layui-upload-img,.editGoodsParameters .layui-upload-img,.transactioncomponent .layui-upload-img{margin:0;}.addGoods .layui-upload-list,.editGoodsTypes .layui-upload-list,.editGoodsParameters .layui-upload-list,.transactioncomponent .layui-upload-list{margin:10px 0;overflow:hidden;}.addGoods .spec_image,.editGoodsTypes .spec_image,.editGoodsParameters .spec_image,.transactioncomponent .spec_image{display:inline-block;}.addGoods .spec_image_item,.editGoodsTypes .spec_image_item,.editGoodsParameters .spec_image_item,.transactioncomponent .spec_image_item{position:relative;display:inline-block;}#parametersBox .layui-form-item{background:#fff;}.text-right{text-align:right;}.text-center{text-align:center;}.text-left{text-align:left;}.core-hidden{display:none;}.core-show{display:block;}.float-left{float:left !important;}.float-right{float:right !important;}.float-none{float:none !important;}.text-red,.line-red,.lines-red{color:#e54d42;}.text-orange,.line-orange,.lines-orange{color:#f37b1d;}.text-yellow,.line-yellow,.lines-yellow{color:#fbbd08;}.text-olive,.line-olive,.lines-olive{color:#8dc63f;}.text-green,.line-green,.lines-green{color:#39b54a;}.text-cyan,.line-cyan,.lines-cyan{color:#1cbbb4;}.text-blue,.line-blue,.lines-blue{color:#0081ff;}.text-purple,.line-purple,.lines-purple{color:#6739b6;}.text-mauve,.line-mauve,.lines-mauve{color:#9c26b0;}.text-pink,.line-pink,.lines-pink{color:#e03997;}.text-brown,.line-brown,.lines-brown{color:#a5673f;}.text-grey,.line-grey,.lines-grey{color:#8799a3;}.text-gray,.line-gray,.lines-gray{color:#aaa;}.text-black,.line-black,.lines-black{color:#333;}.text-white,.line-white,.lines-white{color:#fff;}.layui-form-item .layui-inline-1{width:50px;}.layui-form-item .layui-inline-2{width:100px;}.layui-form-item .layui-inline-3{width:150px;}.layui-form-item .layui-inline-4{width:200px;}.layui-form-item .layui-inline-5{width:250px;}.layui-form-item .layui-inline-6{width:300px;}.layui-form-item .layui-inline-7{width:350px;}.layui-form-item .layui-inline-8{width:400px;}.layui-form-item .layui-inline-9{width:450px;}.layui-form-item .layui-inline-10{width:500px;}.layui-form-item .layui-inline-11{width:550px;}.layui-form-item .layui-inline-12{width:600px;}.layui-form-item .layui-inline-13{width:650px;}.layui-form-item .layui-inline-14{width:700px;}.layui-form-item .layui-inline-100{width:calc(100% - 110px - 20px - 10px);padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-1{width:20px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-2{width:80px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-3{width:130px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-4{width:180px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-5{width:230px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-6{width:280px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-7{width:330px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-8{width:380px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-9{width:430px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-10{width:480px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-11{width:530px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-12{width:580px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-13{width:630px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-14{width:680px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-100{width:calc(100% - 110px - 20px - 10px);padding:0 10px;}.coreshop-nav-tree .layui-nav-more{right:15px;padding:0;}.coreshop-nav-tree .layui-nav-item>a{height:45px;line-height:45px;}.coreshop-nav-tree .layui-nav-item a cite{letter-spacing:2px;font-size:13.5px;}.coreshop-nav-tree .layui-icon{font-size:13px;}.coreshop-nav-tree .layui-nav-item .layui-icon:first-child{position:absolute;top:50%;left:20px;margin-top:-24px;}.coreshop-admin .layui-logo{padding:0;}.coreshop-admin .layui-logo span{font-size:21px;font-weight:550;letter-spacing:5px;}.coreshop-upload-img{height:37px;max-height:37px;width:auto;margin:0 8px 0 0;}.productBox .layui-table td,.productBox .layui-table th{padding:9px 5px;text-align:center;}.productBox .layui-input,.productBox .layui-select,.productBox .layui-textarea{height:28px;}.pagebarbox .layui-table-page{text-align:right;}.pagebarbox .layui-table-pagebar{float:left;}.longLogo{height:50px;width:220px;display:block;}.layadmin-side-shrink .longLogo{height:50px;width:220px;display:none;}.layadmin-side-shrink .layui-layout-admin .layui-logo{width:60px;background-image:url(../images/common/logoMin.png);} \ No newline at end of file +::-webkit-scrollbar{width:6px;height:6px;background-color:#f5f5f5;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);border-radius:6px;background-color:#f5f5f5;}::-webkit-scrollbar-thumb{border-radius:6px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#009688;}a{cursor:pointer;}.cursor:hover{cursor:pointer;}.layui-nav *{font-size:13.5px;}.layui-breadcrumb>*{font-size:12px;}.layui-input,.layui-textarea{display:block;width:100%;padding-left:5px;}.coreshop-search-form,.layui-table-box,.layui-table-view,.coreshop-form{background-color:#fff;}.layui-side-menu .layui-nav .layui-nav-item .layui-icon{font-size:14px;}.layui-nav-tree .layui-nav-more{right:15px;padding:0;}.table-body{background-color:#fff;margin:10px;padding:0 10px;border:1px solid #e6e6e6;}.layadmin-shortcut li cite{font-size:13px;}.layui-tab-title li{font-size:13px;}.layui-elem-field legend{font-size:13px;}.coreshop-form .layui-form-item{margin-bottom:10px;font-size:12px;}.coreshop-form .order-ship-btn{margin:0 auto;margin-top:25px;display:block;}.coreshop-form .layui-btn-fluid{width:50%;}.coreshop-form .layui-tab-content{padding:10px;}.coreshop-form .add-save-btn{width:100%;}.coreshop-form .layui-form-pane .layui-form-label{padding:8px 5px;}.coreshop-form .layui-form-mid{padding:8px 10px !important;border-bottom:1px dashed #eee;min-height:21px;color:#999 !important;}.coreshop-form .layui-form-mid .layui-form-switch{margin-top:-3px;}.coreshop-form .layui-form-label{font-size:12px;}.required-color{color:#f00;}.select-address{display:inline-block !important;width:30%;margin-right:2%;padding:10px 0;border:1px solid #e6e6e6;margin-bottom:0;}.sellect_seller_brands_list li,.sellect_seller_goods_list li{background-color:#f9f9f9;padding:4px;margin:4px;}.sellect_seller_brands_list li span,.sellect_seller_goods_list li span{color:#f00;margin-right:7px;cursor:pointer;}.list-tag{float:right;margin-right:0;}.link-hot{color:#009688;cursor:pointer;}.layui-btn+.layui-btn{margin-left:5px;}.have-add .layui-form-switch,.have-add-td .layui-form-switch{margin-top:0;}.help-tip{float:right;}.icon-wenhao{color:#9e9e9e;font-size:16px !important;position:relative;top:11px;}.layui-iconpicker{margin-bottom:10px;}.layui-field-title{margin:10px 0 10px;}.noDefaultToolbar .layui-table-tool .layui-table-tool-temp{padding-right:0;}.coreshop-toolbar-search-form,.coreshop-search-form{border:1px solid #e6e6e6;padding:10px;margin:10px 10px 0 10px;}.coreshop-toolbar-search-form .layui-input-wrap,.coreshop-search-form .layui-input-wrap{line-height:30px;}.coreshop-toolbar-search-form .layui-input,.coreshop-search-form .layui-input,.coreshop-toolbar-search-form .layui-select,.coreshop-search-form .layui-select,.coreshop-toolbar-search-form .layui-textarea,.coreshop-search-form .layui-textarea{height:30px;line-height:1.3;line-height:30px\9;border-width:1px;border-style:solid;background-color:#fff;border-radius:2px;}.coreshop-toolbar-search-form .layui-form-label,.coreshop-search-form .layui-form-label{float:left;display:block;padding:5px 5px 5px 2px;width:auto;min-width:60px;max-width:120px;font-weight:400;line-height:20px;text-align:center;font-size:12px;}.coreshop-toolbar-search-form .layui-input-block,.coreshop-search-form .layui-input-block{margin-left:74px;min-height:26px;}.coreshop-toolbar-search-form .layui-form-select dl,.coreshop-search-form .layui-form-select dl{top:29px;}.coreshop-toolbar-search-form .layui-form-end-item,.coreshop-search-form .layui-form-end-item{margin-bottom:0;}.coreshop-toolbar-search-form .layui-form-item,.coreshop-search-form .layui-form-item{margin-bottom:0;}.coreshop-toolbar-search-form .layui-form-item .layui-inline,.coreshop-search-form .layui-form-item .layui-inline{margin-bottom:0;margin-right:0;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline{margin-right:5px;width:150px;font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input::-webkit-input-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input::-webkit-input-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input::-moz-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input::-moz-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input:-ms-input-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input:-ms-input-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .layui-input-inline input:-moz-placeholder,.coreshop-search-form .layui-form-item .layui-inline .layui-input-inline input:-moz-placeholder{font-size:12px;}.coreshop-toolbar-search-form .layui-form-item .layui-inline .core-time-input,.coreshop-search-form .layui-form-item .layui-inline .core-time-input{width:308px;}.coreshop-toolbar-search-form xm-select,.coreshop-search-form xm-select{min-height:28px;line-height:28px;}.coreshop-toolbar-search-form xm-select *,.coreshop-search-form xm-select *{font-size:12px;}.coreshop-toolbar-search-form .xm-body .xm-tree .xm-option-content,.coreshop-search-form .xm-body .xm-tree .xm-option-content{padding-left:6px;font-size:12px;}.coreshop-toolbar-search-form xm-select .xm-label .scroll .label-content,.coreshop-search-form xm-select .xm-label .scroll .label-content{line-height:28px;}.coreshop-toolbar-search-form xm-select>.xm-label .scroll .label-content,.coreshop-search-form xm-select>.xm-label .scroll .label-content{display:flex;padding:0 20px 0 10px;font-size:12px;}.coreshop-toolbar-search-form .layui-form-mid,.coreshop-search-form .layui-form-mid{padding:4px 0 !important;}.coreshop-toolbar-search-form .layui-input-inline.core-time-input,.coreshop-search-form .layui-input-inline.core-time-input{width:300px;}.coreshop-toolbar-search-form{border:0;padding:0;margin:0;}.order-form .layui-form-item .layui-inline{margin-bottom:5px;margin-right:0;}.order-table .layui-table-tool-temp{padding-right:0;}.order-table table th{padding:0;}.order-table .layui-table-cell{height:auto;line-height:28px;padding:0 5px;position:relative;box-sizing:border-box;}.order-table .layui-table-cell,.order-table .layui-table-tool-panel li{overflow:inherit;text-overflow:ellipsis;white-space:inherit;}.order-table .orderShip{padding:0 5px;}.order-min-table{background:#fafafa;}.order-min-table .layui-table{border-width:1px;border-style:solid;border-color:#eee;}.order-min-table .layui-table th{text-align:center;font-weight:400;}.order-min-table .layui-table tr td{text-align:center;}.order-min-table .layui-table tr td .title{padding:0 5px;}.order-tab-card .layui-tab-title{padding-left:25px;padding-top:5px;}.order-tab-card .layui-tab-title .layui-this:after{border-top:1px solid #eee;}.layui-elem-quote{border-radius:0 2px 2px 0;background-color:#f2f2f2;font-size:12px;padding:10px;}.layui-layout-admin .layui-side{overflow-x:hidden;}.layui-layout-admin .layui-side::-webkit-scrollbar{display:none;}.layui-layout-admin .layui-layer-title{height:40px;line-height:40px;border:0;background-color:#20222a;color:#fff;}.layui-layout-admin i[close]{top:5px;}.layui-layer-admin .layui-layer-title{font-size:13px;}.layui-layer-admin .layui-layer-title{height:40px;line-height:40px;border:0;background-color:#20222a;color:#fff;}.layui-layer-admin i[close]{top:8px;}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn,.layui-layer-dialog .layui-layer-btn{padding-top:10px;}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{border-top:1px dashed #eee;}.layui-layer-btn .layui-layer-btn0{border-color:#009688;background-color:#009688;color:#fff;}.layui-layer-btn a{height:32px;line-height:32px;padding:0 25px;margin:5px 0 0 10px;border-radius:100px;}.layui-upload-img{height:90px;max-height:90px;width:auto;}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:4px 5px;font-size:12px;_float:left;border-radius:2px;box-shadow:1px 1px 3px rgba(0,0,0,.2);background-color:#000;color:#fff;}.layui-badge-green{color:#52c41a;background:#f6ffed;border:1px solid #b7eb8f;}.layui-badge-blue{color:#1890ff;background:#e6f7ff;border:1px solid #91d5ff;}.layui-badge-red{color:#f5222d;background:#fff1f0;border:1px solid #ffa39e;}.layui-badge-yellow{color:#faad14;background:#fffbe6;border:1px solid #ffe58f;}.layui-badge-gray{color:#8c8c8c;background:#fafafa;border:1px solid #ccc;}xm-select>.xm-body{margin-left:-2px;}xm-select>.xm-body .xm-option{background-color:transparent !important;}xm-select>.xm-body .xm-option.hide-icon.selected{background-color:#5fb878 !important;}xm-select>.xm-body .xm-option:hover{background-color:#f2f2f2 !important;}.xm-body .xm-tree{min-width:200px;}.xm-body .xm-tree .xm-option-content{padding-left:6px;}xm-select{border-color:#e6e6e6 !important;}xm-select:hover{border-color:#d2d2d2 !important;}xm-select[style="border-color: rgb(229, 77, 66);"]{border-color:#e54d42 !important;}body .ew-xmselect-tree xm-select .xm-body .xm-option .xm-option-icon{position:absolute;left:30px;top:0;right:0;bottom:0;width:auto;height:auto;border:none !important;z-index:1;}body .ew-xmselect-tree xm-select .xm-body .xm-option .xm-option-icon:before{display:none;}body .ew-xmselect-tree xm-select .xm-body .xm-option.selected{background-color:#f2f2f2 !important;}body .ew-xmselect-tree xm-select .xm-body .xm-option.selected .xm-option-content{color:#5fb878 !important;}xm-select .xm-body .xm-option .xm-option-icon{border-color:#2d8cf0 !important;}xm-select .xm-label .xm-label-block,xm-select .xm-body .xm-option.hide-icon.selected{background-color:#2d8cf0 !important;}.layui-form-required:before{content:"*";display:inline-block;font-family:SimSun;margin-right:4px;font-size:14px;line-height:1;color:#ed4014;}.layui-form-radio *{font-size:12px;}.layui-table td,.layui-table th{position:relative;padding:9px 15px;min-height:20px;line-height:20px;font-size:12px;}.layui-table-cell{height:28px;line-height:28px;padding:0 8px;position:relative;box-sizing:border-box;}.layui-table{word-break:break-all;word-wrap:break-word;}.layui-layer-admin .layui-layer-content{padding:10px;line-height:22px;}.layui-layer-admin .layui-layer-setwin{position:absolute;right:15px;*right:0;top:8px;font-size:0;line-height:initial;}.layui-layer-admin .layui-layer-setwin a{position:relative;width:31px;height:31px;margin-left:10px;font-size:12px;_overflow:hidden;color:#fff;}.layui-layer-admin .layui-layer-setwin .layui-layer-close1{background-position:-149px -31px;cursor:pointer;}.layadmin-header{display:none;height:35px;line-height:35px;margin-bottom:0;border-radius:0;}.layui-btn{font-size:12px;}.ew-crop-img-preview{float:left;margin-bottom:10px;margin-right:15px;overflow:hidden;background:#e6e6e6;}.preview-lg{width:256px;height:144px;}.preview-md{width:128px;height:72px;}.preview-sm{width:64px;height:36px;}.preview-xs{width:32px;height:18px;margin-right:0;}.docs-data{width:100%;float:left;text-align:left;}.myCropperBox .layui-form-label{width:70px;padding:2px 5px;height:25px;line-height:20px;border-width:1px;border-style:solid;border-radius:2px 0 0 2px;text-align:center;background-color:#fbfbfb;overflow:hidden;box-sizing:border-box;}.myCropperBox .layui-form-item{margin-bottom:5px;clear:both;*zoom:1;}.myCropperBox .layui-input{height:25px;line-height:1.3;border-width:1px;border-style:solid;background-color:#fff;}.myCropperBox .layui-input-inline{margin-left:-1px;margin-right:10px;}.myCropperBox .layui-form-mid{float:left;display:block;padding:2px 0 !important;height:25px;line-height:20px;text-align:left;overflow:hidden;box-sizing:border-box;}.addGoods .layui-form-pane xm-select,.editGoodsTypes .layui-form-pane xm-select,.editGoodsParameters .layui-form-pane xm-select{margin:0 -1px -1px 0;}.addGoods .grade_price,.editGoodsTypes .grade_price,.editGoodsParameters .grade_price{width:80% !important;float:left;display:inline;}.addGoods .grade_price input,.editGoodsTypes .grade_price input,.editGoodsParameters .grade_price input{display:inline;width:100px;}.addGoods .spec-item,.editGoodsTypes .spec-item,.editGoodsParameters .spec-item{float:left;margin:5px;}.addGoods .spec-item .layui-form-checkbox,.editGoodsTypes .spec-item .layui-form-checkbox,.editGoodsParameters .spec-item .layui-form-checkbox{margin-top:0 !important;}.addGoods .spec-item .checkboxBox,.editGoodsTypes .spec-item .checkboxBox,.editGoodsParameters .spec-item .checkboxBox{float:left;display:block;line-height:20px;width:75px;}.addGoods .layui-form-pane .layui-form-item[pane] .layui-input-inline,.editGoodsTypes .layui-form-pane .layui-form-item[pane] .layui-input-inline,.editGoodsParameters .layui-form-pane .layui-form-item[pane] .layui-input-inline{margin-left:0;width:auto;}.addGoods .del-img,.editGoodsTypes .del-img,.editGoodsParameters .del-img{position:absolute;background-color:rgba(0,0,0,.5);color:#fff;width:13px;height:13px;line-height:12px;font-size:10px;display:inline-block;text-align:center;border-radius:50%;right:-6px;top:-6px;}.addGoods .w-e-text-container,.editGoodsTypes .w-e-text-container,.editGoodsParameters .w-e-text-container{height:600px !important;}.addGoods .layui-form-text .layui-input-block,.editGoodsTypes .layui-form-text .layui-input-block,.editGoodsParameters .layui-form-text .layui-input-block{margin-left:0;left:0;}.addGoods .imgdiv,.editGoodsTypes .imgdiv,.editGoodsParameters .imgdiv,.transactioncomponent .imgdiv{float:left;text-align:center;border:1px solid #ccc;padding:5px;padding-bottom:0;margin-right:10px;background-color:#fff;}.addGoods .layui-upload-img,.editGoodsTypes .layui-upload-img,.editGoodsParameters .layui-upload-img,.transactioncomponent .layui-upload-img{margin:0;}.addGoods .layui-upload-list,.editGoodsTypes .layui-upload-list,.editGoodsParameters .layui-upload-list,.transactioncomponent .layui-upload-list{margin:10px 0;overflow:hidden;}.addGoods .spec_image,.editGoodsTypes .spec_image,.editGoodsParameters .spec_image,.transactioncomponent .spec_image{display:inline-block;}.addGoods .spec_image_item,.editGoodsTypes .spec_image_item,.editGoodsParameters .spec_image_item,.transactioncomponent .spec_image_item{position:relative;display:inline-block;}#parametersBox .layui-form-item{background:#fff;}.text-right{text-align:right;}.text-center{text-align:center;}.text-left{text-align:left;}.core-hidden{display:none;}.core-show{display:block;}.float-left{float:left !important;}.float-right{float:right !important;}.float-none{float:none !important;}.text-red,.line-red,.lines-red{color:#e54d42;}.text-orange,.line-orange,.lines-orange{color:#f37b1d;}.text-yellow,.line-yellow,.lines-yellow{color:#fbbd08;}.text-olive,.line-olive,.lines-olive{color:#8dc63f;}.text-green,.line-green,.lines-green{color:#39b54a;}.text-cyan,.line-cyan,.lines-cyan{color:#1cbbb4;}.text-blue,.line-blue,.lines-blue{color:#0081ff;}.text-purple,.line-purple,.lines-purple{color:#6739b6;}.text-mauve,.line-mauve,.lines-mauve{color:#9c26b0;}.text-pink,.line-pink,.lines-pink{color:#e03997;}.text-brown,.line-brown,.lines-brown{color:#a5673f;}.text-grey,.line-grey,.lines-grey{color:#8799a3;}.text-gray,.line-gray,.lines-gray{color:#aaa;}.text-black,.line-black,.lines-black{color:#333;}.text-white,.line-white,.lines-white{color:#fff;}.layui-form-item .layui-inline-1{width:50px;}.layui-form-item .layui-inline-2{width:100px;}.layui-form-item .layui-inline-3{width:150px;}.layui-form-item .layui-inline-4{width:200px;}.layui-form-item .layui-inline-5{width:250px;}.layui-form-item .layui-inline-6{width:300px;}.layui-form-item .layui-inline-7{width:350px;}.layui-form-item .layui-inline-8{width:400px;}.layui-form-item .layui-inline-9{width:450px;}.layui-form-item .layui-inline-10{width:500px;}.layui-form-item .layui-inline-11{width:550px;}.layui-form-item .layui-inline-12{width:600px;}.layui-form-item .layui-inline-13{width:650px;}.layui-form-item .layui-inline-14{width:700px;}.layui-form-item .layui-inline-100{width:calc(100% - 110px - 20px - 10px);padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-1{width:20px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-2{width:80px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-3{width:130px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-4{width:180px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-5{width:230px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-6{width:280px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-7{width:330px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-8{width:380px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-9{width:430px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-10{width:480px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-11{width:530px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-12{width:580px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-13{width:630px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-14{width:680px;padding:0 10px;}.layui-form-item .layui-form-mid.layui-inline-100{width:calc(100% - 110px - 20px - 10px);padding:0 10px;}.coreshop-nav-tree .layui-nav-more{right:15px;padding:0;}.coreshop-nav-tree .layui-nav-item>a{height:45px;line-height:45px;}.coreshop-nav-tree .layui-nav-item a cite{letter-spacing:2px;font-size:13.5px;}.coreshop-nav-tree .layui-icon{font-size:13px;}.coreshop-nav-tree .layui-nav-item .layui-icon:first-child{position:absolute;top:50%;left:20px;margin-top:-24px;}.coreshop-admin .layui-logo{padding:0;}.coreshop-admin .layui-logo span{font-size:21px;font-weight:550;letter-spacing:5px;}.coreshop-upload-img{height:37px;max-height:37px;width:auto;margin:0 8px 0 0;}.productBox .layui-table td,.productBox .layui-table th{padding:9px 5px;text-align:center;}.productBox .layui-input,.productBox .layui-select,.productBox .layui-textarea{height:28px;}.pagebarbox .layui-table-page{text-align:right;}.pagebarbox .layui-table-pagebar{float:left;}.longLogo{height:50px;width:220px;display:block;}.layadmin-side-shrink .longLogo{height:50px;width:220px;display:none;}.layadmin-side-shrink .layui-layout-admin .layui-logo{width:60px;background-image:url(../images/common/logoMin.png);}.ew-tree-table .ew-tree-pack{cursor:pointer;line-height:16px;display:inline;vertical-align:middle;}.ew-tree-table .ew-tree-pack>span{height:16px;line-height:16px;display:inline;vertical-align:middle;} \ No newline at end of file From 453ec1c1e15c71febe27f33376266ee23671d1a4 Mon Sep 17 00:00:00 2001 From: JianWeie Date: Mon, 3 Jan 2022 23:10:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E4=B8=AA=E8=AE=A2=E5=8D=95=E7=82=B9=E5=87=BB=E3=80=90=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E3=80=91=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82#I4N4U2=20=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=98=B5=E7=A7=B0=E9=95=BF=E5=BA=A6=E3=80=82=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BA2-16=E9=95=BF=E5=BA=A6=E3=80=82=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0validate=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E3=80=82#?= =?UTF-8?q?I4N2QX=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=89=E7=BA=A7=E5=88=86=E9=94=80=E9=80=BB=E8=BE=91=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=92=8C=E5=88=9B=E5=BB=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82#I4M23L=20=E3=80=90=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0=E5=88=B8=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E8=AE=BE=E7=BD=AE=E4=B8=BA=E3=80=90=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=87=8F=E5=9B=BA=E5=AE=9A=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E3=80=91=EF=BC=8C=E8=80=8C=E4=B8=80=E5=BC=A0=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E4=BC=9A=E8=A2=AB=E5=8F=A0=E5=8A=A0=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82#I4LEQR=EF=BC=8C#I4IXMP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Good/CoreCmsGoodsRepository.cs | 26 ++++---- .../CoreCmsPromotionResultServices.cs | 62 ++++++++++++------- .../pages/member/setting/userInfo/index.vue | 41 +++++++----- .../wwwroot/views/order/orders/index.html | 4 +- CoreShop.sln => CoreShopCommunity.sln | 0 5 files changed, 79 insertions(+), 54 deletions(-) rename CoreShop.sln => CoreShopCommunity.sln (100%) diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs index a1d2c72..a69c241 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs @@ -552,20 +552,20 @@ namespace CoreCms.Net.Repository newDt.Add(pd); }); } - } - else - { - oldPostProducts.ForEach(p => + else { - var pd = new CoreCmsProductsDistribution(); - pd.createTime = DateTime.Now; - pd.productsSN = p.sn; - pd.levelOne = p.levelOne; - pd.levelTwo = p.levelTwo; - pd.levelThree = p.levelThree; - pd.productsId = p.id; - newDt.Add(pd); - }); + oldPostProducts.ForEach(p => + { + var pd = new CoreCmsProductsDistribution(); + pd.createTime = DateTime.Now; + pd.productsSN = p.sn; + pd.levelOne = p.levelOne; + pd.levelTwo = p.levelTwo; + pd.levelThree = p.levelThree; + pd.productsId = p.id; + newDt.Add(pd); + }); + } } var upOldData = await DbClient.Updateable(oldDataProducts).ExecuteCommandHasChangeAsync(); diff --git a/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs b/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs index 384accf..bdb4792 100644 --- a/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs +++ b/CoreCms.Net.Services/Promotion/CoreCmsPromotionResultServices.cs @@ -15,7 +15,6 @@ using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; using CoreCms.Net.Model.Entities; -using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Utility.Extensions; using Newtonsoft.Json; @@ -31,7 +30,7 @@ namespace CoreCms.Net.Services { private readonly ICoreCmsPromotionResultRepository _dal; - private readonly ICoreCmsPromotionConditionServices _promotionConditionServices; + private ICoreCmsPromotionConditionServices _promotionConditionServices; private readonly IUnitOfWork _unitOfWork; @@ -59,6 +58,7 @@ namespace CoreCms.Net.Services //如果是订单促销就直接去判断促销条件,如果是商品促销,就循环订单明细 if (resultModel.sValue == "goods") { + var isUsed = false; foreach (var item in cart.list) { var type = await _promotionConditionServices.goods_check(promotionInfo.id, (int)item.products.goodsId, item.nums); @@ -67,20 +67,23 @@ namespace CoreCms.Net.Services //到这里就说明此商品信息满足促销商品促销信息的条件,去计算结果 //注意,在明细上面,就不细分促销的种类了,都放到一个上面,在订单上面才细分 decimal promotionModel = 0; - switch (resultInfo.code) + if (isUsed == false) { - case "GOODS_REDUCE": - promotionModel = result_GOODS_REDUCE(parameters, item, promotionInfo); - break; - case "GOODS_DISCOUNT": - promotionModel = result_GOODS_DISCOUNT(parameters, item, promotionInfo); - break; - case "GOODS_ONE_PRICE": - promotionModel = result_GOODS_ONE_PRICE(parameters, item, promotionInfo); - break; - default: - promotionModel = 0; - break; + switch (resultInfo.code) + { + case "GOODS_REDUCE": + promotionModel = result_GOODS_REDUCE(parameters, item, promotionInfo); + break; + case "GOODS_DISCOUNT": + promotionModel = result_GOODS_DISCOUNT(parameters, item, promotionInfo); + break; + case "GOODS_ONE_PRICE": + promotionModel = result_GOODS_ONE_PRICE(parameters, item, promotionInfo); + break; + default: + promotionModel = 0; + break; + } } if (item.isSelect) @@ -94,10 +97,19 @@ namespace CoreCms.Net.Services cart.amount = Math.Round(cart.amount - promotionModel, 2); break; case (int)GlobalEnumVars.PromotionType.Coupon: - //优惠券促销金额 - cart.couponPromotionMoney = Math.Round(cart.couponPromotionMoney + promotionModel, 2); - //设置总的价格 - cart.amount = Math.Round(cart.amount - promotionModel, 2); + if (isUsed) + { + item.products.promotionList.Remove(promotionInfo.id); + } + else + { + //优惠券促销金额 + cart.couponPromotionMoney = Math.Round(cart.couponPromotionMoney + promotionModel, 2); + //设置总的价格 + cart.amount = Math.Round(cart.amount - promotionModel, 2); + //跳出下级处理 + isUsed = true; + } break; case (int)GlobalEnumVars.PromotionType.Group: //团购 @@ -246,7 +258,7 @@ namespace CoreCms.Net.Services } cartProducts.products.price = Math.Round(cartProducts.products.price - objMoney, 2); //此次商品促销一共优惠了多少钱 - promotionMoney = Math.Round(cartProducts.nums * objMoney, 2); + promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? objMoney : Math.Round(cartProducts.nums * objMoney, 2); //设置商品优惠总金额 cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + objMoney, 2); //设置商品的实际销售金额(单品) @@ -269,8 +281,9 @@ namespace CoreCms.Net.Services decimal promotionMoney = 0; decimal goodsPrice = cartProducts.products.price; cartProducts.products.price = Math.Round(Math.Round(Math.Round(cartProducts.products.price * objDiscount, 3) * 10, 2) / 100, 2); - var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); //单品优惠的金额 - promotionMoney = Math.Round(cartProducts.nums * pmoney, 2); + //单品优惠的金额 + var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); + promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? pmoney : Math.Round(cartProducts.nums * pmoney, 2); //设置商品优惠总金额 cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2); //设置商品的实际销售总金额 @@ -293,8 +306,9 @@ namespace CoreCms.Net.Services } var goodsPrice = (decimal)cartProducts.products.price; cartProducts.products.price = Math.Round(objMoney, 2); - var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); //单品优惠的金额 - promotionMoney = Math.Round(cartProducts.nums * pmoney, 2); + //单品优惠的金额 + var pmoney = Math.Round(goodsPrice - cartProducts.products.price, 2); + promotionMoney = promotionInfo.type == (int)GlobalEnumVars.PromotionType.Coupon ? pmoney : Math.Round(cartProducts.nums * pmoney, 2); //设置商品优惠总金额 cartProducts.products.promotionAmount = Math.Round(cartProducts.products.promotionAmount + promotionMoney, 2); //设置商品的实际销售总金额 diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue index 8e96278..d82459e 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/member/setting/userInfo/index.vue @@ -77,18 +77,18 @@ trigger: 'blur', }, { - min: 3, + min: 2, max: 16, - message: '昵称长度在3到16个字符', + message: '昵称长度在2到16个长度', trigger: ['change', 'blur'], }, - { - validator: (rule, value, callback) => { - return this.$u.test.chinese(value); - }, - message: '昵称必须为中文', - trigger: ['change', 'blur'], - } + //{ + // validator: (rule, value, callback) => { + // return this.$u.test.chinese(value); + // }, + // message: '昵称必须为中文', + // trigger: ['change', 'blur'], + //} ], sex: [ { @@ -187,13 +187,22 @@ this.submitStatus = false; return false; } else { - this.$u.api.editInfo({ - sex: sex, - birthday: this.model.birthday, - nickname: this.model.nickname - }).then(res => { - this.submitStatus = false; - this.$refs.uToast.show({ title: res.msg, type: 'success', back: false }) + this.$refs.uForm.validate(valid => { + if (valid) { + console.log('验证通过'); + this.$u.api.editInfo({ + sex: sex, + birthday: this.model.birthday, + nickname: this.model.nickname + }).then(res => { + this.submitStatus = false; + this.$refs.uToast.show({ title: res.msg, type: 'success', back: false }) + }); + } else { + console.log('验证失败'); + this.submitStatus = false; + this.$refs.uToast.show({ title: '验证失败,请完善信息', type: 'error' }) + } }); } } diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html index b6977e4..e73b963 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/index.html @@ -607,7 +607,9 @@ layer.confirm('确认取消订单号:' + id + ' 的订单吗?', { title: '提示', btn: ['确认', '取消'] //按钮 }, function () { - coreHelper.Post("Api/CoreCmsOrder/CancelOrder", { id: id }, function (e) { + var delidsStr = []; + delidsStr.push(id); + coreHelper.Post("Api/CoreCmsOrder/CancelOrder", { id: delidsStr }, function (e) { layer.msg(e.msg, { time: 1300 }, function () { layui.table.reloadData('LAY-app-CoreCmsOrder-tableBox'); //重载表格 doreLoadOrderCount(); diff --git a/CoreShop.sln b/CoreShopCommunity.sln similarity index 100% rename from CoreShop.sln rename to CoreShopCommunity.sln From a6bbde71e6f03dd8c5195c9bd4309ec934ad4682 Mon Sep 17 00:00:00 2001 From: JianWeie Date: Thu, 6 Jan 2022 00:45:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?2022-01-5=20##=201.2.8=20=E5=BC=80=E6=BA=90?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=89=88=EF=BC=9A=20=E3=80=90=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E4=B8=83=E7=89=9B=E4=BA=91?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E3=80=90=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=AE=8C=E6=AF=95=E5=90=8E=EF=BC=8C=E5=9C=A8=E5=A4=9A=E5=B0=91?= =?UTF-8?q?=E5=A4=A9=E5=90=8E=E8=87=AA=E5=8A=A8=E8=A2=AB=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=91=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E6=89=8B=E6=AC=A0?= =?UTF-8?q?=E9=80=A0=E6=88=90=E7=9A=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 0.0.4 会员先行版: 【修复】修复七牛云设置【文件上传完毕后,在多少天后自动被删除】的问题,手欠造成的。 【修复】SixLabors.ImageSharp生成海报时候,如果不存在【qrCode】文件夹则会报错的问题。#I4PF1G 【修复】修复因注册勾选协议的checkbox导致注册失败的问题。#I4PDA9,#I4P80I --- CoreCms.Net.Services/Com/ToolsServices.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CoreCms.Net.Services/Com/ToolsServices.cs b/CoreCms.Net.Services/Com/ToolsServices.cs index bdf2f8b..6bab58e 100644 --- a/CoreCms.Net.Services/Com/ToolsServices.cs +++ b/CoreCms.Net.Services/Com/ToolsServices.cs @@ -268,7 +268,7 @@ namespace CoreCms.Net.Services // 上传策略的过期时间(单位:秒) putPolicy.SetExpires(3600); // 文件上传完毕后,在多少天后自动被删除 - putPolicy.DeleteAfterDays = 1; + //putPolicy.DeleteAfterDays = 1; // 生成上传token string token = Qiniu.Util.Auth.CreateUploadToken(mac, putPolicy.ToJsonString()); @@ -426,7 +426,7 @@ namespace CoreCms.Net.Services // 上传策略的过期时间(单位:秒) putPolicy.SetExpires(3600); // 文件上传完毕后,在多少天后自动被删除 - putPolicy.DeleteAfterDays = 1; + //putPolicy.DeleteAfterDays = 1; // 生成上传token string token = Qiniu.Util.Auth.CreateUploadToken(mac, putPolicy.ToJsonString()); From 32adfdc4965588e6ad709a31b0771990af1e2565 Mon Sep 17 00:00:00 2001 From: JianWeie Date: Tue, 11 Jan 2022 01:36:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?2022-01-11=20##=201.2.9=20=E5=BC=80?= =?UTF-8?q?=E6=BA=90=E7=A4=BE=E5=8C=BA=E7=89=88=EF=BC=9A=20=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E5=BE=AE=E4=BF=A1=E9=85=8D=E7=BD=AE=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=E3=80=82=20?= =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=94=9F=E6=88=90sku=E6=A8=A1=E5=BC=8F=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E5=87=BA=E7=8E=B0=E8=B4=A7=E5=8F=B7=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=83=85=E5=86=B5=EF=BC=8C#I4Q4WU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 0.0.6 会员先行版: 【新增】新增微信自定义交易组件,实现微信视频号直播带货功能。 --- .../Controllers/Good/CoreCmsGoodsController.cs | 5 +++-- CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.csproj | 1 + CoreCms.Net.Web.Admin/Startup.cs | 10 ++++++++++ .../wwwroot/views/good/goods/create.html | 2 +- .../wwwroot/views/good/goods/edit.html | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs b/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs index 6a519b9..59acfbb 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs @@ -30,6 +30,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using NPOI.HSSF.UserModel; using SqlSugar; +using Yitter.IdGenerator; namespace CoreCms.Net.Web.Admin.Controllers { @@ -938,8 +939,8 @@ namespace CoreCms.Net.Web.Admin.Controllers var obj = new CoreCmsProducts(); if (count == 0) obj.isDefalut = true; - var sn = list.Find(p => p.name == "goods[sn]"); - obj.sn = sn != null ? sn.value + "_" + (count + 1) : null; + //var sn = list.Find(p => p.name == "goods[sn]"); + obj.sn = "SN" + YitIdHelper.NextId(); var price = list.Find(p => p.name == "goods[price]"); obj.price = price != null && !string.IsNullOrEmpty(price.value) ? Convert.ToDecimal(price.value) diff --git a/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.csproj b/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.csproj index 7c65b2e..5929028 100644 --- a/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.csproj +++ b/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.csproj @@ -76,6 +76,7 @@ + diff --git a/CoreCms.Net.Web.Admin/Startup.cs b/CoreCms.Net.Web.Admin/Startup.cs index e6568f9..3052590 100644 --- a/CoreCms.Net.Web.Admin/Startup.cs +++ b/CoreCms.Net.Web.Admin/Startup.cs @@ -26,6 +26,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using Yitter.IdGenerator; namespace CoreCms.Net.Web.Admin { @@ -137,6 +138,15 @@ namespace CoreCms.Net.Web.Admin p.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; }); + + + // ѩƯ㷨 + // IdGeneratorOptions ڹ캯 WorkerId + var options = new IdGeneratorOptions(1); + // IJöЧ + YitIdHelper.SetIdGenerator(options); + + } /// diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html index 1797e6d..b79933f 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/create.html @@ -1174,7 +1174,7 @@ if (e.data.products) { for (var i = 0; i < e.data.products.length; i++) { e.data.products[i].isDefalut = false; - e.data.products[i].sn = layui.coreHelper.getSN('SN'); + //e.data.products[i].sn = layui.coreHelper.getSN('SN'); tmpData.push(e.data.products[i]); } } diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html index 924e0f9..15f4fe7 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/edit.html @@ -1284,7 +1284,7 @@ if (e.data.products) { for (var i = 0; i < e.data.products.length; i++) { e.data.products[i].isDefalut = false; - e.data.products[i].sn = layui.coreHelper.getSN('SN'); + //e.data.products[i].sn = layui.coreHelper.getSN('SN'); tmpData.push(e.data.products[i]); } }