From f396d9ff6d75228a4234dfa2561df6df58bb831e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Tue, 29 Nov 2022 18:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E5=90=8C?= =?UTF-8?q?=E5=9F=8E=E9=85=8D=E9=80=81=E8=BF=90=E8=B4=B9=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B6=85=E8=BF=8720=E5=85=AC=E9=87=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=AF=8F=E5=85=AC=E9=87=8C=E9=87=91=E9=A2=9D=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=A2=E5=8D=95=E8=B6=85=E8=BF=87=E5=A4=9A?= =?UTF-8?q?=E5=B0=91=E9=87=91=E9=A2=9D=E5=85=8D=E8=BF=90=E8=B4=B9=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SystemSettingConstVars.cs | 10 ++++++ .../SystemSettingDictionary.cs | 12 ++++--- .../Shop/CoreCmsNoticeRepository.cs | 3 +- .../Cart/CoreCmsCartServices.cs | 34 +++++++++++++------ .../wwwroot/views/shop/setting/index.html | 20 +++++++++-- .../wwwroot/views/system/about.html | 13 ------- .../Controllers/NoticeController.cs | 5 +-- 7 files changed, 60 insertions(+), 37 deletions(-) diff --git a/CoreCms.Net.Configuration/SystemSettingConstVars.cs b/CoreCms.Net.Configuration/SystemSettingConstVars.cs index 5027f4fb..4d1f82bb 100644 --- a/CoreCms.Net.Configuration/SystemSettingConstVars.cs +++ b/CoreCms.Net.Configuration/SystemSettingConstVars.cs @@ -846,6 +846,16 @@ namespace CoreCms.Net.Configuration /// public static readonly string IntraCityServiceBy20KM = "intraCityServiceBy20KM"; + /// + /// 同城配送超过20公里内 + /// + public static readonly string IntraCityServiceByExceed20KM = "intraCityServiceByExceed20KM"; + + /// + /// 同城配送多少钱免运费 + /// + public static readonly string IntraCityServiceFreeCredit = "intraCityServiceFreeCredit"; + diff --git a/CoreCms.Net.Configuration/SystemSettingDictionary.cs b/CoreCms.Net.Configuration/SystemSettingDictionary.cs index f6263f60..6e70bc03 100644 --- a/CoreCms.Net.Configuration/SystemSettingDictionary.cs +++ b/CoreCms.Net.Configuration/SystemSettingDictionary.cs @@ -85,11 +85,11 @@ namespace CoreCms.Net.Configuration di.Add(SystemSettingConstVars.OrderAutoSignTime, new DictionaryKeyValues() { sKey = "订单确认收货时间", sValue = "20" }); di.Add(SystemSettingConstVars.OrderAutoEvalTime, new DictionaryKeyValues() { sKey = "订单自动评价时间", sValue = "30" }); di.Add(SystemSettingConstVars.RemindOrderTime, new DictionaryKeyValues() { sKey = "订单提醒付款时间", sValue = "1" }); - di.Add(SystemSettingConstVars.ReshipName, new DictionaryKeyValues() { sKey = "退货联系人", sValue = "" }); - di.Add(SystemSettingConstVars.ReshipMobile, new DictionaryKeyValues() { sKey = "退货联系方式", sValue = "" }); - di.Add(SystemSettingConstVars.ReshipAreaId, new DictionaryKeyValues() { sKey = "退货区域", sValue = "" }); - di.Add(SystemSettingConstVars.ReshipAddress, new DictionaryKeyValues() { sKey = "退货详细地址", sValue = "" }); - di.Add(SystemSettingConstVars.ReshipCoordinate, new DictionaryKeyValues() { sKey = "退货坐标", sValue = "" }); + di.Add(SystemSettingConstVars.ReshipName, new DictionaryKeyValues() { sKey = "商家联系人", sValue = "" }); + di.Add(SystemSettingConstVars.ReshipMobile, new DictionaryKeyValues() { sKey = "商家联系方式", sValue = "" }); + di.Add(SystemSettingConstVars.ReshipAreaId, new DictionaryKeyValues() { sKey = "商家区域", sValue = "" }); + di.Add(SystemSettingConstVars.ReshipAddress, new DictionaryKeyValues() { sKey = "商家详细地址", sValue = "" }); + di.Add(SystemSettingConstVars.ReshipCoordinate, new DictionaryKeyValues() { sKey = "商家坐标", sValue = "" }); di.Add(SystemSettingConstVars.StoreOrderAutomaticDelivery, new DictionaryKeyValues() { sKey = "门店自提自动发货", sValue = "2" }); @@ -243,6 +243,8 @@ namespace CoreCms.Net.Configuration di.Add(SystemSettingConstVars.IntraCityServiceBy10KM, new DictionaryKeyValues() { sKey = "10公里内", sValue = "0" }); di.Add(SystemSettingConstVars.IntraCityServiceBy15KM, new DictionaryKeyValues() { sKey = "15公里内", sValue = "0" }); di.Add(SystemSettingConstVars.IntraCityServiceBy20KM, new DictionaryKeyValues() { sKey = "20公里内", sValue = "0" }); + di.Add(SystemSettingConstVars.IntraCityServiceByExceed20KM, new DictionaryKeyValues() { sKey = "超过20公里", sValue = "2" }); + di.Add(SystemSettingConstVars.IntraCityServiceFreeCredit, new DictionaryKeyValues() { sKey = "免运费额度", sValue = "0" }); //签到 di.Add(SystemSettingConstVars.CheckInIsOpen, new DictionaryKeyValues() { sKey = "是否开启签到", sValue = "1" }); diff --git a/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs index c0e95f2a..e4d3b1fc 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs @@ -53,7 +53,8 @@ namespace CoreCms.Net.Repository type = p.type, sort = p.sort, isDel = p.isDel, - createTime = p.createTime + createTime = p.createTime, + contentBody = p.contentBody }).WithCache().ToPageListAsync(pageIndex, pageSize, totalCount); var list = new PageList(page, pageIndex, pageSize, totalCount); return list; diff --git a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs index 2921f469..cde29242 100644 --- a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs +++ b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs @@ -721,18 +721,30 @@ namespace CoreCms.Net.Services var intraCityServiceBy10Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy10KM).ObjectToDecimal(0); var intraCityServiceBy15Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy15KM).ObjectToDecimal(0); var intraCityServiceBy20Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceBy20KM).ObjectToDecimal(0); + var intraCityServiceByExceed20Km = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceByExceed20KM).ObjectToDecimal(0); - cartDto.costFreight = result switch + if (result is >= 0 and <= 2) + cartDto.costFreight = intraCityServiceBy2Km; + else if (result is > 2 and <= 5) + cartDto.costFreight = intraCityServiceBy5Km; + else if (result is > 5 and <= 10) + cartDto.costFreight = intraCityServiceBy10Km; + else if (result is > 10 and <= 15) + cartDto.costFreight = intraCityServiceBy15Km; + else if (result is > 15 and <= 20) + cartDto.costFreight = intraCityServiceBy20Km; + else if (result > 20) + cartDto.costFreight = Math.Round(intraCityServiceByExceed20Km * (decimal) result).ObjectToDecimal(); + else if (result < 0) + cartDto.costFreight = intraCityServiceBy2Km; + else + cartDto.costFreight = cartDto.costFreight; + + var intraCityServiceFreeCredit = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.IntraCityServiceFreeCredit).ObjectToDecimal(0); + if (intraCityServiceFreeCredit > 0 && cartDto.amount > intraCityServiceFreeCredit) { - >= 0 and <= 2 => intraCityServiceBy2Km, - > 2 and <= 5 => intraCityServiceBy5Km, - > 5 and <= 10 => intraCityServiceBy10Km, - > 10 and <= 15 => intraCityServiceBy15Km, - > 15 and <= 20 => intraCityServiceBy20Km, - > 20 => Math.Round(result * 2).ObjectToDecimal(), - < 0 => intraCityServiceBy2Km, - _ => cartDto.costFreight - }; + cartDto.costFreight = 0; + } cartDto.amount = Math.Round(cartDto.amount + cartDto.costFreight, 2); } return true; @@ -808,7 +820,7 @@ namespace CoreCms.Net.Services //最多可以抵扣的金额 var maxPointDeductedMoney = Math.Round(cartDto.amount * proportion, 4); - + //订单积分折现比例(多少积分可以折现1块钱) var pointDiscountedProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointDiscountedProportion).ObjectToDecimal(100); //积分兑换比例 var pointDeductedMoney = Math.Round(Convert.ToDecimal(point) / pointDiscountedProportion, 4); ; //积分可以抵扣的钱 diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html index 89259302..4a24e83e 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/setting/index.html @@ -440,21 +440,21 @@ -
退货区域设置
+
商家区域设置
-
退货坐标
+
商家坐标(同城配送的运费计算,将使用用户地址的坐标和本坐标进行计算多少公里数。按照公里数计算运费。)
-
退货的详细地址
+
商家的详细地址
@@ -517,6 +517,20 @@
15-20公里以内
+
+ +
+ +
+
超过20公里,每公里乘以多少。填写每公里单价。
+
+
+ +
+ +
+
订单超过多少钱,免运费,此设置超过0之后,条件满足的情况下以上的距离计算将失效。
+
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/system/about.html b/CoreCms.Net.Web.Admin/wwwroot/views/system/about.html index 72bd58d5..76066739 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/system/about.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/system/about.html @@ -8,17 +8,4 @@ GitHub下载 Gitee下载
- - -
关于版权
-
- -
- 允许个人学习研究使用,支持二次开发。
- 允许商业用途,但仅限自运营,如果商用必须保留版权信息,望自觉遵守。
- 不允许对程序代码以任何形式、任何目的的再发行或出售,否则将追究侵权者法律责任。
- 软件受国家计算机软件著作权保护(登记号:2020SR1224749)。
- 我们的团队水平有限,也是在探索中学习、改进。开源,是为了让认可我们的用户能自由的使用、学习软件的内部架构,让更多的人有机会阅读并发现Bug、对软件项目提出改进意见。 -
-

© 2021 coreshop.cn 版权所有

\ No newline at end of file diff --git a/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs b/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs index b33dbcbc..0a35d08e 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/NoticeController.cs @@ -57,8 +57,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers { var jm = new WebApiCallBack(); - var list = await _noticeServices.QueryPageAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc, - entity.page, entity.limit); + var list = await _noticeServices.QueryPageAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc, entity.page, entity.limit); jm.status = true; jm.data = list; @@ -68,8 +67,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers #endregion - - /// /// 获取单个公告内容 ///