From d19f29d1a21ac5b51f64ac717ab606e55824dba3 Mon Sep 17 00:00:00 2001 From: jianweie Date: Thu, 27 Apr 2023 17:33:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=AE=BE=E8=AE=A1=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E7=A7=9F=E6=A8=A1=E5=9D=97=EF=BC=8C=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=87=8C=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreShop/common/mixins/mixinsHelper.js | 3 + .../common/setting/constVarsHelper.js | 4 +- .../Controllers/Com/ToolsController.cs | 29 +++++++- .../CoreCms.Net.Web.Admin.xml | 8 ++- .../wwwroot/lib/custom/js/main.js | 16 ++++- .../wwwroot/views/common/getGoodTypes.html | 66 +++++++++++++++++++ .../wwwroot/views/shop/pages/design.html | 3 + .../CoreCms.Net.Web.WebApi.xml | 6 ++ 8 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/common/getGoodTypes.html diff --git a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js index 97569ef2..12e6f07a 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js @@ -301,6 +301,9 @@ module.exports = { } else if (type == navLinkType.intelligentForms) { //自定义表单 this.$u.route('/pages/form/details/details', { id: val }); + } else if (type == navLinkType.shopCategory) { + //商品分类 + this.$u.route('/pages/category/list/list', { id: val }); } else { this.$u.route(val); } diff --git a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js index 5e1bab94..fbfeedaf 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js @@ -114,7 +114,7 @@ export const navLinkType = { shop: 2,// "商品" article: 3,// "文章" articleCategory: 4,// "文章分类", - intelligentForms: 5// "智能表单" + intelligentForms: 5,// "智能表单" + shopCategory: 6// "商品分类" }; - diff --git a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs index 8edf3240..7f08dd36 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs @@ -84,6 +84,7 @@ namespace CoreCms.Net.Web.Admin.Controllers private readonly ICoreCmsPagesServices _pagesServices; private readonly IToolsServices _toolsServices; private readonly ICoreCmsReportsServices _reportsServices; + private readonly ICoreCmsGoodsCategoryServices _goodsCategoryServices; @@ -110,7 +111,7 @@ namespace CoreCms.Net.Web.Admin.Controllers , ISysUserRoleServices sysUserRoleServices , ISysOrganizationServices sysOrganizationServices, ICoreCmsLogisticsServices logisticsServices, ISysLoginRecordServices sysLoginRecordServices, ISysNLogRecordsServices sysNLogRecordsServices, ICoreCmsBillPaymentsServices paymentsServices, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsUserServices userServices, ICoreCmsOrderServices orderServices, ICoreCmsBillAftersalesServices aftersalesServices, ICoreCmsSettingServices settingServices, ICoreCmsProductsServices productsServices, ICoreCmsServicesServices servicesServices, ISysRoleMenuServices sysRoleMenuServices - , IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsPagesServices pagesServices, IToolsServices toolsServices, ICoreCmsReportsServices reportsServices) + , IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsPagesServices pagesServices, IToolsServices toolsServices, ICoreCmsReportsServices reportsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices) { _user = user; _webHostEnvironment = webHostEnvironment; @@ -146,6 +147,7 @@ namespace CoreCms.Net.Web.Admin.Controllers _pagesServices = pagesServices; _toolsServices = toolsServices; _reportsServices = reportsServices; + _goodsCategoryServices = goodsCategoryServices; } #region 获取登录用户用户信息(用于面板展示)==================================================== @@ -1069,6 +1071,31 @@ namespace CoreCms.Net.Web.Admin.Controllers #endregion + #region 获取商品分类列表============================================================ + + // POST: Api/Tools/GetGoodTypes + /// + /// 获取商品分类列表 + /// + /// + [HttpPost] + [Description("获取商品分类列表")] + public async Task GetGoodTypes() + { + var jm = new AdminUiCallBack(); + + //获取数据 + var list = await _goodsCategoryServices.QueryAsync(); + //返回数据 + jm.data = list; + jm.code = 0; + jm.msg = "数据调用成功!"; + return jm; + } + + #endregion + + #region 获取公告列表============================================================ // POST: Api/Tools/GetNotices diff --git a/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.xml b/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.xml index 66400602..7f82d3a8 100644 --- a/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.xml +++ b/CoreCms.Net.Web.Admin/CoreCms.Net.Web.Admin.xml @@ -673,7 +673,7 @@ 后端常用方法 - + 构造函数 @@ -798,6 +798,12 @@ + + + 获取商品分类列表 + + + 获取公告列表 diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js index c2c84341..57df8fea 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js @@ -866,7 +866,7 @@ Vue.component('layout-config', { coreHelper.Post(getDesign, { id: id }, function (e) { if (e.code === 0) { //console.log(e); - linkType = { "1": "URL链接", "2": "商品", "3": "文章", "4": "文章分类", "5": "智能表单" }; + linkType = { "1": "URL链接", "2": "商品", "6": "商品分类", "3": "文章", "4": "文章分类", "5": "智能表单" }; that.pageCode = e.data.model.code; that.brandList = e.data.brandList; that.pageConfig = e.data.pageConfig; @@ -953,6 +953,9 @@ Vue.component('layout-config', { case 5: this.form_list() break; + case 6: + this.goodType_list() + break; default: break; } @@ -991,6 +994,17 @@ Vue.component('layout-config', { } }); }, + goodType_list: function () { + //console.log("获取商品分类列表"); + layui.admin.popup({ + title: '商品分类列表', + area: ['800px', '98%'], + id: 'LAY-app-CoreCmsCommon-GetGoodTypes', + success: function (layero, index) { + layui.view(this.id).render('common/getGoodTypes', null).done(function () { }); + } + }); + }, resetColor: function () { this.selectWg.value.backgroundColor = '#FFFFFF' diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/common/getGoodTypes.html b/CoreCms.Net.Web.Admin/wwwroot/views/common/getGoodTypes.html new file mode 100644 index 00000000..7bbccd24 --- /dev/null +++ b/CoreCms.Net.Web.Admin/wwwroot/views/common/getGoodTypes.html @@ -0,0 +1,66 @@ + +
+
+
+ + + + \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html index 97ba1d2d..063106b7 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html @@ -1236,6 +1236,9 @@
+
+ +
diff --git a/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml b/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml index 074c3fd9..1927aabb 100644 --- a/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml +++ b/CoreCms.Net.Web.WebApi/CoreCms.Net.Web.WebApi.xml @@ -261,6 +261,12 @@
+ + + 裁剪Base64上传 + + + 优惠券接口