diff --git a/CoreCms.Net.CodeGenerator/CrudTemplete/Repositories/Repository.tpl b/CoreCms.Net.CodeGenerator/CrudTemplete/Repositories/Repository.tpl index 7c67548a..1b2b795e 100644 --- a/CoreCms.Net.CodeGenerator/CrudTemplete/Repositories/Repository.tpl +++ b/CoreCms.Net.CodeGenerator/CrudTemplete/Repositories/Repository.tpl @@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -71,7 +71,7 @@ namespace CoreCms.Net.Repository {% for field in ModelFields %}oldModel.{{field.DbColumnName}} = entity.{{field.DbColumnName}}; {% endfor %} //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -87,7 +87,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable<{{ModelClassName}}>(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable<{{ModelClassName}}>(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; @@ -119,7 +119,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable<{{ModelClassName}}>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable<{{ModelClassName}}>().In(ids).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 70e13a7e..b27df945 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -417,19 +417,19 @@ namespace CoreCms.Net.Configuration public enum OrderStatus { /// - /// 订单正常 + /// 进行中 /// - [Description("订单正常")] + [Description("进行中")] Normal = 1, /// - /// 订单完成 + /// 已完结 /// - [Description("订单完成")] + [Description("已完结")] Complete = 2, /// - /// 订单取消 + /// 已取消 /// - [Description("订单取消")] + [Description("已取消")] Cancel = 3 } @@ -439,19 +439,19 @@ namespace CoreCms.Net.Configuration public enum OrderStatusDescription { /// - /// 订单正常 + /// 进行中 /// - [Description("正常(-)")] + [Description("进行中(-)")] Normal = 1, /// - /// 订单完成 + /// 已完结 /// - [Description("完成(√)")] + [Description("已完结(√)")] Complete = 2, /// - /// 订单取消 + /// 已取消 /// - [Description("取消(×)")] + [Description("已取消(×)")] Cancel = 3 } @@ -1696,15 +1696,15 @@ namespace CoreCms.Net.Configuration /// public enum WeiChatPayTradeType { - [Description("JSAPI")] + [Description("JSAPI(小程序支付)")] JSAPI = 1, - [Description("JSAPI_OFFICIAL")] + [Description("JSAPI_OFFICIAL(公众号支付)")] JSAPI_OFFICIAL = 2, - [Description("NATIVE")] + [Description("NATIVE(扫码支付)")] NATIVE = 3, - [Description("APP")] + [Description("APP(APP支付)")] APP = 4, - [Description("MWEB")] + [Description("MWEB(H5支付)")] MWEB = 5 } @@ -1944,6 +1944,11 @@ namespace CoreCms.Net.Configuration /// [Description("12接龙")] Solitaire = 12, + /// + /// 13服务商品 + /// + [Description("13服务商品")] + ServiceGoods = 13, } /// diff --git a/CoreCms.Net.Core/Config/SqlSugarSetup.cs b/CoreCms.Net.Core/Config/SqlSugarSetup.cs index 6cf727c0..0ee70a9c 100644 --- a/CoreCms.Net.Core/Config/SqlSugarSetup.cs +++ b/CoreCms.Net.Core/Config/SqlSugarSetup.cs @@ -39,7 +39,7 @@ namespace CoreCms.Net.Core.Config //判断数据库类型 DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, //是否开启自动关闭数据库连接 - IsAutoCloseConnection = true, + IsAutoCloseConnection = true }); //设置参数 @@ -51,6 +51,11 @@ namespace CoreCms.Net.Core.Config //判断是否开启redis设置二级缓存方式 DataInfoCacheService = AppSettingsConstVars.RedisUseCache ? (ICacheService)new SqlSugarRedisCache() : new SqlSugarMemoryCache() }; + db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings() + { + //所有 增、删 、改 会自动调用.RemoveDataCache()清理二级缓存 + IsAutoRemoveDataCache = true + }; //执行SQL 错误事件,可监控sql(暂时屏蔽,需要可开启) //db.Aop.OnLogExecuting = (sql, p) => diff --git a/CoreCms.Net.DTO/CoreCms.Net.DTO.csproj b/CoreCms.Net.DTO/CoreCms.Net.DTO.csproj new file mode 100644 index 00000000..132c02c5 --- /dev/null +++ b/CoreCms.Net.DTO/CoreCms.Net.DTO.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/CoreCms.Net.DTO/GroupPurchaseSeckillDTO.cs b/CoreCms.Net.DTO/GroupPurchaseSeckillDTO.cs new file mode 100644 index 00000000..38691e7d --- /dev/null +++ b/CoreCms.Net.DTO/GroupPurchaseSeckillDTO.cs @@ -0,0 +1,112 @@ +using System.ComponentModel.DataAnnotations; + +namespace CoreCms.Net.DTO +{ + /// + /// 秒杀列表返回dto数据层 + /// + public class GroupPurchaseSeckillDTO + { + + /// + /// 序列 + /// + public System.Int32 id { get; set; } + /// + /// 促销名称 + /// + public System.String name { get; set; } + /// + /// 类型 + /// + public System.Int32 type { get; set; } + /// + /// 排序 + /// + public System.Int32 sort { get; set; } + /// + /// 每人限购数量 + /// + public System.Int32 maxNums { get; set; } + /// + /// 每个商品活动数量 + /// + public System.Int32 maxGoodsNums { get; set; } + /// + /// 最大领取数量 + /// + public System.Int32 maxRecevieNums { get; set; } + /// + /// 开始时间 + /// + public System.DateTime startTime { get; set; } + /// + /// 结束时间 + /// + public System.DateTime endTime { get; set; } + /// + /// 是否排他 + /// + public System.Boolean isExclusive { get; set; } + /// + /// 是否自动领取 + /// + public System.Boolean isAutoReceive { get; set; } + /// + /// 是否开启 + /// + public System.Boolean isEnable { get; set; } + /// + /// 有效天数 + /// + public System.Int32 effectiveDays { get; set; } + /// + /// 有效小时 + /// + public System.Int32 effectiveHours { get; set; } + /// + /// 倒计时 + /// + public System.Int32 timestamp { get; set; } + /// + /// 状态 + /// + public System.Int32 startStatus { get; set; } + /// + /// 商品描述 + /// + public string goodBrief { get; set; } + /// + /// 商品名称 + /// + public string goodName { get; set; } + /// + /// 商品缩略图 + /// + public string goodThumbnail { get; set; } + /// + /// 商品图集 + /// + public string goodImages { get; set; } + /// + /// 商品库存 + /// + public int goodStock { get; set; } + /// + /// 商品浏览量 + /// + public int goodViewCount { get; set; } + /// + /// 商品单位 + /// + public string goodUnit { get; set; } + /// + /// 商品市场价 + /// + public decimal mktPrice { get; set; } + /// + /// 商品价格 + /// + public decimal price { get; set; } + } +} \ No newline at end of file diff --git a/CoreCms.Net.DTO/PinTuanListDTO.cs b/CoreCms.Net.DTO/PinTuanListDTO.cs new file mode 100644 index 00000000..832969a7 --- /dev/null +++ b/CoreCms.Net.DTO/PinTuanListDTO.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace CoreCms.Net.DTO +{ + /// + /// 拼团列表返回 + /// + public class PinTuanListDTO + { + /// + /// 拼团序列 + /// + public System.Int32 id { get; set; } + + /// + /// 商品序列 + /// + public System.Int32 goodsId { get; set; } + + /// + /// 拼团排序 + /// + public System.Int32 sortId { get; set; } + + /// + /// 拼团名称 + /// + public string name { get; set; } + + /// + /// 拼团单数 + /// + public System.Int32 pinTuanRecordNums { get; set; } + + /// + /// 拼团销量 + /// + public System.Int32 buyPinTuanCount { get; set; } + + /// + /// 多少人团 + /// + public System.Int32 peopleNumber { get; set; } + + /// + /// 倒计时 + /// + public System.Int32 timestamp { get; set; } + + /// + /// 开始时间 + /// + public System.DateTime startTime { get; set; } + + /// + /// 结束时间 + /// + public System.DateTime endTime { get; set; } + + /// + /// 优惠金额 + /// + public System.Decimal discountAmount { get; set; } + /// + /// 每人限购数量 + /// + public System.Int32 maxNums { get; set; } + /// + /// 每个商品活动数量 + /// + public System.Int32 maxGoodsNums { get; set; } + + /// + /// 状态 + /// + public System.Int32 startStatus { get; set; } + /// + /// 商品描述 + /// + public string goodBrief { get; set; } + /// + /// 商品名称 + /// + public string goodName { get; set; } + /// + /// 商品缩略图 + /// + public string goodThumbnail { get; set; } + /// + /// 商品图集 + /// + public string goodImages { get; set; } + /// + /// 商品库存 + /// + public int goodStock { get; set; } + /// + /// 商品浏览量 + /// + public int goodViewCount { get; set; } + /// + /// 商品单位 + /// + public string goodUnit { get; set; } + /// + /// 商品市场价 + /// + public decimal mktPrice { get; set; } + /// + /// 拼团价格 + /// + public decimal pinTuanPrice { get; set; } + } +} diff --git a/CoreCms.Net.IRepository/Article/ICoreCmsArticleTypeRepository.cs b/CoreCms.Net.IRepository/Article/ICoreCmsArticleTypeRepository.cs index 26a9bd9c..67302658 100644 --- a/CoreCms.Net.IRepository/Article/ICoreCmsArticleTypeRepository.cs +++ b/CoreCms.Net.IRepository/Article/ICoreCmsArticleTypeRepository.cs @@ -4,19 +4,49 @@ * Web: https://www.corecms.net * Author: 大灰灰 * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * CreateTime: 2022/10/24 3:54:14 * Description: 暂无 ***********************************************************************/ - +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + namespace CoreCms.Net.IRepository { /// - /// 文章分类表 工厂接口 + /// 文章分类表 工厂接口 /// public interface ICoreCmsArticleTypeRepository : IBaseRepository { + + /// + /// 重写异步插入方法 + /// + /// + /// + Task InsertAsync(CoreCmsArticleType entity); + + + /// + /// 重写异步更新方法 + /// + /// + /// + Task UpdateAsync(CoreCmsArticleType entity); + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + Task DeleteByIdAsync(object id); + } -} \ No newline at end of file +} diff --git a/CoreCms.Net.IRepository/CoreCms.Net.IRepository.csproj b/CoreCms.Net.IRepository/CoreCms.Net.IRepository.csproj index 656d6675..fe8ae3d8 100644 --- a/CoreCms.Net.IRepository/CoreCms.Net.IRepository.csproj +++ b/CoreCms.Net.IRepository/CoreCms.Net.IRepository.csproj @@ -5,6 +5,7 @@ + diff --git a/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs b/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs index f5982ed3..1ebf7237 100644 --- a/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs +++ b/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs @@ -170,5 +170,18 @@ namespace CoreCms.Net.IRepository /// /// Task> QueryEnumEntityAsync(); + + + /// + /// 获取商品及默认货品信息 + /// + /// + /// + /// + /// 是否使用WITH(NOLOCK) + /// + Task> QueryGoodWithDefaultProductAsync(Expression> predicate, + Expression> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false); + } } \ No newline at end of file diff --git a/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs b/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs index 525f5050..07e656e0 100644 --- a/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs +++ b/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; +using CoreCms.Net.DTO; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.DTO; @@ -53,5 +54,20 @@ namespace CoreCms.Net.IRepository /// 规则序列 /// Task GetPinTuanInfo(int ruleId); + + + /// + /// 根据规则ID数组获取拼团相关信息 + /// + /// 规则序列 + /// + /// + /// + /// + /// + Task> GetPinTuanInfos(int[] ruleIds, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20); + } } \ No newline at end of file diff --git a/CoreCms.Net.IRepository/Shop/ICoreCmsNoticeRepository.cs b/CoreCms.Net.IRepository/Shop/ICoreCmsNoticeRepository.cs index 320e77ff..1572ee58 100644 --- a/CoreCms.Net.IRepository/Shop/ICoreCmsNoticeRepository.cs +++ b/CoreCms.Net.IRepository/Shop/ICoreCmsNoticeRepository.cs @@ -38,16 +38,10 @@ namespace CoreCms.Net.IRepository /// - /// 获取列表首页用 + /// 获取首页组件数据 /// /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// /// - Task> QueryListAsync(Expression> predicate, - Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, - int pageSize = 20); + Task> QueryComponentAsync(Expression> predicate); } } \ No newline at end of file diff --git a/CoreCms.Net.IServices/Article/ICoreCmsArticleTypeServices.cs b/CoreCms.Net.IServices/Article/ICoreCmsArticleTypeServices.cs index 63484665..d5c7e316 100644 --- a/CoreCms.Net.IServices/Article/ICoreCmsArticleTypeServices.cs +++ b/CoreCms.Net.IServices/Article/ICoreCmsArticleTypeServices.cs @@ -4,18 +4,47 @@ * Web: https://www.corecms.net * Author: 大灰灰 * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * CreateTime: 2022/10/24 3:54:14 * Description: 暂无 ***********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; namespace CoreCms.Net.IServices { /// - /// 文章分类表 服务工厂接口 + /// 文章分类表 服务工厂接口 /// public interface ICoreCmsArticleTypeServices : IBaseServices { + + /// + /// 重写异步插入方法 + /// + /// + /// + Task InsertAsync(CoreCmsArticleType entity); + + /// + /// 重写异步更新方法 + /// + /// + /// + Task UpdateAsync(CoreCmsArticleType entity); + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + Task DeleteByIdAsync(object id); + } -} \ No newline at end of file +} diff --git a/CoreCms.Net.IServices/CoreCms.Net.IServices.csproj b/CoreCms.Net.IServices/CoreCms.Net.IServices.csproj index 63b74790..44769607 100644 --- a/CoreCms.Net.IServices/CoreCms.Net.IServices.csproj +++ b/CoreCms.Net.IServices/CoreCms.Net.IServices.csproj @@ -10,6 +10,7 @@ + diff --git a/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs b/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs index 8fb5452b..91cd455e 100644 --- a/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs +++ b/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs @@ -114,8 +114,7 @@ namespace CoreCms.Net.IServices /// /// /// - Task GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", - int groupId = 0, bool needSku = false); + Task GetGoodsDetail(int id, int userId = 0, bool isPromotion = false, string type = "goods", int groupId = 0, bool needSku = false); /// /// 通过商品序列获取sku列表 @@ -263,5 +262,18 @@ namespace CoreCms.Net.IServices Task DeleteByIdsAsync(int[] ids); #endregion + + + /// + /// 获取商品及默认货品信息 + /// + /// + /// + /// + /// 是否使用WITH(NOLOCK) + /// + Task> QueryGoodWithDefaultProductAsync(Expression> predicate, + Expression> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false); + } } \ No newline at end of file diff --git a/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs b/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs index 833cc47f..1195bb9c 100644 --- a/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs +++ b/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs @@ -12,6 +12,7 @@ using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; +using CoreCms.Net.DTO; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.DTO; @@ -37,7 +38,7 @@ namespace CoreCms.Net.IServices /// 接口上获取拼团所有商品 /// /// - Task GetPinTuanList(int userId = 0); + Task GetPinTuanList(int userId = 0, int pageIndex = 1, int pageSize = 20); /// @@ -60,5 +61,20 @@ namespace CoreCms.Net.IServices /// 规则序列 /// Task GetPinTuanInfo(int ruleId); + + + + /// + /// 根据规则ID数组获取拼团相关信息 + /// + /// 规则序列 + /// + /// + /// + /// + /// + Task> GetPinTuanInfos(int[] ruleIds, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20); } } \ No newline at end of file diff --git a/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs b/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs index 82cf3874..98c7bf67 100644 --- a/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs +++ b/CoreCms.Net.IServices/Promotion/ICoreCmsPromotionServices.cs @@ -51,13 +51,13 @@ namespace CoreCms.Net.IServices /// 获取团购列表数据 /// /// - Task GetGroupList(int type, int userId, int status, int pageIndex, int pageSize); + Task GetGroupList(int type, int status, int pageIndex, int pageSize); /// /// 获取团购/秒杀商品详情 /// /// - Task GetGroupDetail(int goodId = 0, int userId = 0, int type = (int)GlobalEnumVars.PromotionType.Group, int groupId = 0, bool needSku = false); + Task GetGroupDetail(int goodId, int userId, int type, bool needSku); /// /// 获取可领取的优惠券 diff --git a/CoreCms.Net.IServices/Shop/ICoreCmsNoticeServices.cs b/CoreCms.Net.IServices/Shop/ICoreCmsNoticeServices.cs index 3389cab3..2fa88129 100644 --- a/CoreCms.Net.IServices/Shop/ICoreCmsNoticeServices.cs +++ b/CoreCms.Net.IServices/Shop/ICoreCmsNoticeServices.cs @@ -38,16 +38,10 @@ namespace CoreCms.Net.IServices /// - /// 获取列表首页用 + /// 获取首页组件数据 /// /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// /// - Task> QueryListAsync(Expression> predicate, - Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, - int pageSize = 20); + Task> QueryComponentAsync(Expression> predicate); } } \ No newline at end of file diff --git a/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionCondition.cs b/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionCondition.cs index 8b0f85ef..59958b4c 100644 --- a/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionCondition.cs +++ b/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionCondition.cs @@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities /// [Display(Name = "促销ID")] [SugarColumn(ColumnDescription = "促销ID", IsNullable = true)] - public System.Int32? promotionId { get; set; } + public System.Int32 promotionId { get; set; } /// /// 促销条件编码 /// diff --git a/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionResult.cs b/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionResult.cs index 07ef6c88..e49bb1b9 100644 --- a/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionResult.cs +++ b/CoreCms.Net.Model/Entities/Promotion/CoreCmsPromotionResult.cs @@ -37,7 +37,7 @@ namespace CoreCms.Net.Model.Entities /// [Display(Name = "促销ID")] [SugarColumn(ColumnDescription = "促销ID", IsNullable = true)] - public System.Int32? promotionId { get; set; } + public System.Int32 promotionId { get; set; } /// /// 促销条件编码 /// diff --git a/CoreCms.Net.Model/Entities/Service/CoreCmsServicesPartial.cs b/CoreCms.Net.Model/Entities/Service/CoreCmsServicesPartial.cs index db0469d8..fb8fb9c7 100644 --- a/CoreCms.Net.Model/Entities/Service/CoreCmsServicesPartial.cs +++ b/CoreCms.Net.Model/Entities/Service/CoreCmsServicesPartial.cs @@ -26,6 +26,13 @@ namespace CoreCms.Net.Model.Entities [SugarColumn(IsIgnore = true)] public int timestamp { get; set; } = 0; + /// + /// 开启状态 + /// + [Display(Name = "开启状态")] + [SugarColumn(IsIgnore = true)] + public int openStatus { get; set; } = 0; + /// /// 允许购买用户等级 /// diff --git a/CoreCms.Net.Model/FromBody/FMGroup.cs b/CoreCms.Net.Model/FromBody/FMGroup.cs index 7ddb55fc..baf81090 100644 --- a/CoreCms.Net.Model/FromBody/FMGroup.cs +++ b/CoreCms.Net.Model/FromBody/FMGroup.cs @@ -38,17 +38,16 @@ namespace CoreCms.Net.Model.FromBody public int status { get; set; } = 0; } + /// + /// 获取团购秒杀商品详情 + /// public class FMGetGoodsDetial { public int id { get; set; } - public int groupId { get; set; } public int type { get; set; } public bool needSku { get; set; } = false; - - - } } \ No newline at end of file diff --git a/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs b/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs index 68fc9ed3..09b38065 100644 --- a/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs +++ b/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs @@ -54,7 +54,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO public int areaId { get; set; } /// - /// 购物车货品数据 + /// 购物车序列 /// public string cartIds { get; set; } @@ -109,7 +109,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO public int storeId { get; set; } = 0; /// - /// 订单类型,1是普通订单,2是拼团订单 + /// 订单类型[对应CoreCmsOrder表orderType字段]/也对应购物车cart订单类型 /// public int orderType { get; set; } = 1; diff --git a/CoreCms.Net.Model/ViewModels/DTO/UserDto.cs b/CoreCms.Net.Model/ViewModels/DTO/UserDto.cs index 62a59b2a..0612bdcd 100644 --- a/CoreCms.Net.Model/ViewModels/DTO/UserDto.cs +++ b/CoreCms.Net.Model/ViewModels/DTO/UserDto.cs @@ -38,7 +38,7 @@ namespace CoreCms.Net.Model.ViewModels.DTO public decimal orderMoney { get; set; } /// - /// 购物车货品序列号 + /// 购物车序列号 /// public string ids { get; set; } diff --git a/CoreCms.Net.Repository/Agent/CoreCmsAgentGradeRepository.cs b/CoreCms.Net.Repository/Agent/CoreCmsAgentGradeRepository.cs index 8cf783a4..cda8e82e 100644 --- a/CoreCms.Net.Repository/Agent/CoreCmsAgentGradeRepository.cs +++ b/CoreCms.Net.Repository/Agent/CoreCmsAgentGradeRepository.cs @@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository return jm; } - var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync(); + var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync(); var bl = id > 0; jm.code = bl ? 0 : 1; @@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository { if (entity.isDefault) { - await DbClient.Updateable().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Updateable().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).ExecuteCommandAsync(); } } return jm; @@ -106,7 +106,7 @@ namespace CoreCms.Net.Repository oldModel.description = entity.description; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; if (bl) @@ -114,7 +114,7 @@ namespace CoreCms.Net.Repository //其他处理 if (entity.isDefault) { - await DbClient.Updateable().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Updateable().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).ExecuteCommandAsync(); } } @@ -141,7 +141,7 @@ namespace CoreCms.Net.Repository jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; if (bl) { - await DbClient.Deleteable().Where(p => p.agentGradeId == id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + await DbClient.Deleteable().Where(p => p.agentGradeId == id).ExecuteCommandHasChangeAsync(); } return jm; } diff --git a/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs b/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs index b51aff62..3ad064c8 100644 --- a/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs +++ b/CoreCms.Net.Repository/Api/CoreCmsPrinterRepository.cs @@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); entity.createTime = DateTime.Now; - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -88,7 +88,7 @@ namespace CoreCms.Net.Repository oldModel.storeId = entity.storeId; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -104,7 +104,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Article/CoreCmsArticleTypeRepository.cs b/CoreCms.Net.Repository/Article/CoreCmsArticleTypeRepository.cs index 8aa4865d..464cb0ad 100644 --- a/CoreCms.Net.Repository/Article/CoreCmsArticleTypeRepository.cs +++ b/CoreCms.Net.Repository/Article/CoreCmsArticleTypeRepository.cs @@ -4,23 +4,96 @@ * Web: https://www.corecms.net * Author: 大灰灰 * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * CreateTime: 2022/10/24 3:54:14 * Description: 暂无 ***********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Caching.Manual; +using CoreCms.Net.Configuration; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; -using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; namespace CoreCms.Net.Repository { /// - /// 文章分类表 接口实现 + /// 文章分类表 接口实现 /// public class CoreCmsArticleTypeRepository : BaseRepository, ICoreCmsArticleTypeRepository { + private readonly IUnitOfWork _unitOfWork; public CoreCmsArticleTypeRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { + _unitOfWork = unitOfWork; } + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public async Task InsertAsync(CoreCmsArticleType entity) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; + + return jm; + } + + /// + /// 重写异步更新方法 + /// + /// + /// + public async Task UpdateAsync(CoreCmsArticleType entity) + { + var jm = new AdminUiCallBack(); + + var oldModel = await DbClient.Queryable().In(entity.id).SingleAsync(); + if (oldModel == null) + { + jm.msg = "不存在此信息"; + return jm; + } + //事物处理过程开始 + //oldModel.id = entity.id; + oldModel.name = entity.name; + oldModel.parentId = entity.parentId; + oldModel.sort = entity.sort; + + //事物处理过程结束 + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + + return jm; + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public async Task DeleteByIdAsync(object id) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + + return jm; + } + } -} \ No newline at end of file +} diff --git a/CoreCms.Net.Repository/CheckIn/CoreCmsContinuousCheckInRulesRepository.cs b/CoreCms.Net.Repository/CheckIn/CoreCmsContinuousCheckInRulesRepository.cs index aa724d09..adf5468d 100644 --- a/CoreCms.Net.Repository/CheckIn/CoreCmsContinuousCheckInRulesRepository.cs +++ b/CoreCms.Net.Repository/CheckIn/CoreCmsContinuousCheckInRulesRepository.cs @@ -66,8 +66,8 @@ namespace CoreCms.Net.Repository _unitOfWork.BeginTran(); //先清理掉数据,因为是配置数据,可直接删除添加新的 - await DbClient.Deleteable().Where(p => p.id > 0).RemoveDataCache().ExecuteCommandAsync(); - await DbClient.Deleteable().Where(p => p.id > 0).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Deleteable().Where(p => p.id > 0).ExecuteCommandAsync(); + await DbClient.Deleteable().Where(p => p.id > 0).ExecuteCommandAsync(); //遍历数据存值 foreach (var item in entity) @@ -77,13 +77,13 @@ namespace CoreCms.Net.Repository days = item.days }; - var id = await DbClient.Insertable(continuous).RemoveDataCache().ExecuteReturnIdentityAsync(); + var id = await DbClient.Insertable(continuous).ExecuteReturnIdentityAsync(); if (id <= 0) continue; foreach (var detail in item.details) { detail.ruleId = id; } - await DbClient.Insertable(item.details).RemoveDataCache().ExecuteReturnIdentityAsync(); + await DbClient.Insertable(item.details).ExecuteReturnIdentityAsync(); } _unitOfWork.CommitTran(); diff --git a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionGradeRepository.cs b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionGradeRepository.cs index 3b45eb7e..d2b568af 100644 --- a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionGradeRepository.cs +++ b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionGradeRepository.cs @@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository return jm; } - var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync(); + var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync(); var bl = id > 0; jm.code = bl ? 0 : 1; @@ -58,7 +58,7 @@ namespace CoreCms.Net.Repository { if (entity.isDefault == true) { - await DbClient.Updateable().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Updateable().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).ExecuteCommandAsync(); } } return jm; @@ -103,7 +103,7 @@ namespace CoreCms.Net.Repository oldModel.description = entity.description; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; if (bl) @@ -111,7 +111,7 @@ namespace CoreCms.Net.Repository //其他处理 if (entity.isDefault) { - await DbClient.Updateable().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Updateable().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).ExecuteCommandAsync(); } } @@ -133,13 +133,13 @@ namespace CoreCms.Net.Repository jm.msg = "存在关联的分销用户数据,禁止删除"; return jm; } - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; if (bl) { - await DbClient.Deleteable().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync(); - await DbClient.Deleteable().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync(); + await DbClient.Deleteable().Where(p => p.gradeId == id).ExecuteCommandAsync(); + await DbClient.Deleteable().Where(p => p.gradeId == id).ExecuteCommandAsync(); } return jm; diff --git a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionResultRepository.cs b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionResultRepository.cs index d5069806..ac8b24db 100644 --- a/CoreCms.Net.Repository/Distribution/CoreCmsDistributionResultRepository.cs +++ b/CoreCms.Net.Repository/Distribution/CoreCmsDistributionResultRepository.cs @@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository return jm; } - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -84,7 +84,7 @@ namespace CoreCms.Net.Repository oldModel.parameters = entity.parameters; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; return jm; @@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; @@ -131,7 +131,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsCategoryRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsCategoryRepository.cs index 053874c7..d79b2e9d 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsCategoryRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsCategoryRepository.cs @@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository public async Task InsertAsync(CoreCmsGoodsCategory entity) { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -56,7 +56,7 @@ namespace CoreCms.Net.Repository var jm = new AdminUiCallBack(); //事物处理过程结束 - var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -72,7 +72,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs index b9bee871..ef597743 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs @@ -36,6 +36,7 @@ namespace CoreCms.Net.Repository } + #region 重写异步插入方法 /// /// 重写异步插入方法 /// @@ -285,6 +286,9 @@ namespace CoreCms.Net.Repository return jm; } + #endregion + + #region 重写异步更新方法方法 /// /// 重写异步更新方法方法 /// @@ -734,7 +738,7 @@ namespace CoreCms.Net.Repository return jm; } - + #endregion #region 重写删除指定ID集合的数据(批量删除) /// @@ -1923,5 +1927,132 @@ namespace CoreCms.Net.Repository } #endregion + #region 获取商品及默认货品信息 + + /// + /// 获取商品及默认货品信息 + /// + /// + /// + /// + /// 是否使用WITH(NOLOCK) + /// + public async Task> QueryGoodWithDefaultProductAsync(Expression> predicate, Expression> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false) + { + List listData; + if (blUseNoLock) + { + listData = await DbClient.Queryable((good, pd) => new JoinQueryInfos(JoinType.Left, good.id == pd.goodsId)) + .Where((good, pd) => pd.isDefalut == true && pd.isDel == false) + .Select((good, pd) => new CoreCmsGoods + { + id = good.id, + bn = good.bn, + name = good.name, + brief = good.brief, + image = good.image, + images = good.images, + video = good.video, + productsDistributionType = good.productsDistributionType, + goodsCategoryId = good.goodsCategoryId, + goodsTypeId = good.goodsTypeId, + brandId = good.brandId, + isNomalVirtual = good.isNomalVirtual, + isMarketable = good.isMarketable, + unit = good.unit, + //intro = good.intro, + spesDesc = good.spesDesc, + parameters = good.parameters, + commentsCount = good.commentsCount, + viewCount = good.viewCount, + buyCount = good.buyCount, + uptime = good.uptime, + downtime = good.downtime, + sort = good.sort, + labelIds = good.labelIds, + newSpec = good.newSpec, + openSpec = good.openSpec, + createTime = good.createTime, + updateTime = good.updateTime, + isRecommend = good.isRecommend, + isHot = good.isHot, + isDel = good.isDel, + sn = pd.sn, + price = pd.price, + costprice = pd.costprice, + mktprice = pd.mktprice, + stock = pd.stock, + freezeStock = pd.freezeStock, + pointsDeduction = pd.pointsDeduction, + points = pd.points, + weight = pd.weight, + initialSales = good.initialSales, + }) + .With(SqlWith.NoLock) + .MergeTable() + .WhereIF(predicate != null, predicate) + .OrderByIF(orderByPredicate != null, orderByPredicate, orderByType) + .ToListAsync(); + } + else + { + listData = await DbClient.Queryable((good, pd) => new JoinQueryInfos( + JoinType.Left, good.id == pd.goodsId)) + .Where((good, pd) => pd.isDefalut == true && pd.isDel == false) + .Select((good, pd) => new CoreCmsGoods + { + id = good.id, + bn = good.bn, + name = good.name, + brief = good.brief, + image = good.image, + images = good.images, + video = good.video, + productsDistributionType = good.productsDistributionType, + goodsCategoryId = good.goodsCategoryId, + goodsTypeId = good.goodsTypeId, + brandId = good.brandId, + isNomalVirtual = good.isNomalVirtual, + isMarketable = good.isMarketable, + unit = good.unit, + //intro = good.intro, + spesDesc = good.spesDesc, + parameters = good.parameters, + commentsCount = good.commentsCount, + viewCount = good.viewCount, + buyCount = good.buyCount, + uptime = good.uptime, + downtime = good.downtime, + sort = good.sort, + labelIds = good.labelIds, + newSpec = good.newSpec, + openSpec = good.openSpec, + createTime = good.createTime, + updateTime = good.updateTime, + isRecommend = good.isRecommend, + isHot = good.isHot, + isDel = good.isDel, + sn = pd.sn, + price = pd.price, + costprice = pd.costprice, + mktprice = pd.mktprice, + stock = pd.stock, + freezeStock = pd.freezeStock, + pointsDeduction = pd.pointsDeduction, + points = pd.points, + weight = pd.weight, + initialSales = good.initialSales, + }) + .MergeTable() + .WhereIF(predicate != null, predicate) + .OrderByIF(orderByPredicate != null, orderByPredicate, orderByType) + .ToListAsync(); + } + return listData; + } + + + #endregion + } } diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsTypeSpecRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsTypeSpecRepository.cs index 46963763..db66fe6c 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsTypeSpecRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsTypeSpecRepository.cs @@ -64,10 +64,10 @@ namespace CoreCms.Net.Repository var goodsTypeSpec = new CoreCmsGoodsTypeSpec(); goodsTypeSpec.name = entity.name; goodsTypeSpec.sort = entity.sort; - var specId = await DbClient.Insertable(goodsTypeSpec).RemoveDataCache().ExecuteReturnIdentityAsync(); + var specId = await DbClient.Insertable(goodsTypeSpec).ExecuteReturnIdentityAsync(); if (specId <= 0 || entity.value is not { Count: > 0 }) return jm; var list = entity.value.Select((item, index) => new CoreCmsGoodsTypeSpecValue() { specId = specId, value = item, sort = index + 1 }).ToList(); - var bl = await DbClient.Insertable(list).RemoveDataCache().ExecuteCommandAsync() > 0; + var bl = await DbClient.Insertable(list).ExecuteCommandAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -107,7 +107,7 @@ namespace CoreCms.Net.Repository } oldModel.name = entity.name; oldModel.sort = entity.sort; - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); if (bl) { var oldValues = await DbClient.Queryable().OrderBy(p => p.sort).Where(p => p.specId == oldModel.id).ToListAsync(); @@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository //获取需要删除的数据库数据 var deleteValues = oldValues.Where(p => !entity.value.Contains(p.value)).ToList(); //删除旧数据 - if (deleteValues.Any()) bl = await DbClient.Deleteable(deleteValues).RemoveDataCache().ExecuteCommandHasChangeAsync(); + if (deleteValues.Any()) bl = await DbClient.Deleteable(deleteValues).ExecuteCommandHasChangeAsync(); //新数据 var values = oldValues.Select(p => p.value).ToList(); @@ -125,7 +125,7 @@ namespace CoreCms.Net.Repository if (newValues.Any()) { var newList = newValues.Select((t, index) => new CoreCmsGoodsTypeSpecValue() { specId = oldModel.id, value = t, sort = oldValues.Count + index }).ToList(); - bl = await DbClient.Insertable(newList).RemoveDataCache().ExecuteCommandAsync() > 0; + bl = await DbClient.Insertable(newList).ExecuteCommandAsync() > 0; } } jm.code = bl ? 0 : 1; @@ -144,12 +144,12 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; if (bl) { - await DbClient.Deleteable(p => p.specId == (int)id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + await DbClient.Deleteable(p => p.specId == (int)id).ExecuteCommandHasChangeAsync(); } return jm; diff --git a/CoreCms.Net.Repository/Order/CoreCmsOrderRepository.cs b/CoreCms.Net.Repository/Order/CoreCmsOrderRepository.cs index ac3eba9a..6937776a 100644 --- a/CoreCms.Net.Repository/Order/CoreCmsOrderRepository.cs +++ b/CoreCms.Net.Repository/Order/CoreCmsOrderRepository.cs @@ -150,7 +150,6 @@ namespace CoreCms.Net.Repository #endregion - #region 根据用户id和商品id获取下了多少订单 /// /// 根据用户id和商品id获取下了多少订单 diff --git a/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs b/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs index 6853d1ed..f4445ddf 100644 --- a/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs +++ b/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs @@ -14,6 +14,7 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using CoreCms.Net.Configuration; +using CoreCms.Net.DTO; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.Model.Entities; @@ -176,5 +177,71 @@ namespace CoreCms.Net.Repository #endregion + #region 根据规则ID数组获取拼团相关信息 + + /// + /// 根据规则ID数组获取拼团相关信息 + /// + /// 规则序列 + /// + /// + /// + /// + /// + public async Task> GetPinTuanInfos(int[] ruleIds, Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, int pageSize = 20) + { + var dt = DateTime.Now; + RefAsync totalCount = 0; + var reuslt = await DbClient.Queryable( + (prModel, pgModel, goodModel, productsModel) => new object[] + { + JoinType.Inner, prModel.id ==pgModel.ruleId , + JoinType.Inner, pgModel.goodsId == goodModel.id, + JoinType.Left, goodModel.id == productsModel.goodsId + }) + .Where((prModel, pgModel, goodModel, productsModel) => prModel.isStatusOpen == true && ruleIds.Contains(prModel.id) && prModel.endTime > dt && productsModel.isDefalut == true && productsModel.isDel == false) + .Select((prModel, pgModel, goodModel, productsModel) => new PinTuanListDTO + { + id = prModel.id, + goodsId = pgModel.goodsId, + sortId = prModel.sort, + name = prModel.name, + pinTuanRecordNums = SqlFunc.Subqueryable().Where(s => s.objectId == prModel.id).Count(), + + buyPinTuanCount = SqlFunc.Subqueryable() + .LeftJoin((sOrderItem, sOrder) => sOrder.orderId == sOrderItem.orderId) + .Where((sOrderItem, sOrder) => sOrderItem.goodsId == pgModel.goodsId + && sOrder.orderType == (int)GlobalEnumVars.OrderType.PinTuan + && sOrder.objectId == prModel.id) + .Sum(p => p.nums), + + peopleNumber = prModel.peopleNumber, + timestamp = 0, + startStatus = 0, + goodBrief = goodModel.brief, + goodName = goodModel.name, + goodThumbnail = goodModel.image, + goodImages = goodModel.images, + goodStock = productsModel.stock, + goodViewCount = goodModel.viewCount, + goodUnit = goodModel.unit, + mktPrice = productsModel.mktprice, + pinTuanPrice = productsModel.price, + startTime = prModel.startTime, + endTime = prModel.endTime, + discountAmount = prModel.discountAmount, + maxGoodsNums = prModel.maxGoodsNums, + maxNums = prModel.maxNums, + + }).MergeTable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .With(SqlWith.Null).ToPageListAsync(pageIndex, pageSize, totalCount); + + var list = new PageList(reuslt, pageIndex, pageSize, totalCount); + return list; + } + + #endregion + } } diff --git a/CoreCms.Net.Repository/Shop/CoreCmsAreaRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsAreaRepository.cs index edc16397..fb947b5e 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsAreaRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsAreaRepository.cs @@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -69,7 +69,7 @@ namespace CoreCms.Net.Repository oldModel.sort = entity.sort; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -85,7 +85,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs index f6595b71..c0e95f2a 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsNoticeRepository.cs @@ -54,35 +54,31 @@ namespace CoreCms.Net.Repository sort = p.sort, isDel = p.isDel, createTime = p.createTime - }).ToPageListAsync(pageIndex, pageSize, totalCount); + }).WithCache().ToPageListAsync(pageIndex, pageSize, totalCount); var list = new PageList(page, pageIndex, pageSize, totalCount); return list; } /// - /// 获取列表首页用 + /// 获取首页组件数据 /// /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// /// - public async Task> QueryListAsync(Expression> predicate, - Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, - int pageSize = 20) + public async Task> QueryComponentAsync(Expression> predicate) { - var list = await DbClient.Queryable().OrderByIF(orderByExpression != null, orderByExpression, orderByType) - .WhereIF(predicate != null, predicate).Select(p => new CoreCmsNotice + var list = await DbClient.Queryable() + .WhereIF(predicate != null, predicate) + .OrderBy(p => p.sort) + .Select(p => (dynamic)new { - id = p.id, - title = p.title, - type = p.type, - sort = p.sort, - isDel = p.isDel, - createTime = p.createTime - }).ToPageListAsync(pageIndex, pageSize); + p.id, + p.title, + p.type, + p.sort, + p.createTime + }) + .WithCache().ToListAsync(); return list; } diff --git a/CoreCms.Net.Repository/Shop/CoreCmsOrderDistributionModelRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsOrderDistributionModelRepository.cs index f10043ea..3dea07f2 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsOrderDistributionModelRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsOrderDistributionModelRepository.cs @@ -45,7 +45,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository oldModel.isOpenSelfDelivery = entity.isOpenSelfDelivery; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Shop/CoreCmsServiceDescriptionRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsServiceDescriptionRepository.cs index 423268af..01830546 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsServiceDescriptionRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsServiceDescriptionRepository.cs @@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -73,7 +73,7 @@ namespace CoreCms.Net.Repository oldModel.sortId = entity.sortId; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -89,7 +89,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs index cb93d312..5e53a2aa 100644 --- a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs +++ b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs @@ -43,7 +43,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -76,7 +76,7 @@ namespace CoreCms.Net.Repository oldModel.isDelete = entity.isDelete; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -92,7 +92,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable(id).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; @@ -108,7 +108,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Deleteable().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Repository/System/SysMenuRepository.cs b/CoreCms.Net.Repository/System/SysMenuRepository.cs index 1be99f71..28570261 100644 --- a/CoreCms.Net.Repository/System/SysMenuRepository.cs +++ b/CoreCms.Net.Repository/System/SysMenuRepository.cs @@ -42,7 +42,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0; + var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0; jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; @@ -83,7 +83,7 @@ namespace CoreCms.Net.Repository oldModel.identificationCode = entity.identificationCode; //事物处理过程结束 - var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -99,7 +99,7 @@ namespace CoreCms.Net.Repository { var jm = new AdminUiCallBack(); - var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; @@ -126,7 +126,7 @@ namespace CoreCms.Net.Repository var ids = new List() { id }; GetIds(all, id, ids); - var bl = await DbClient.Deleteable().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; diff --git a/CoreCms.Net.Services/Article/CoreCmsArticleTypeServices.cs b/CoreCms.Net.Services/Article/CoreCmsArticleTypeServices.cs index eceb1118..468a99d7 100644 --- a/CoreCms.Net.Services/Article/CoreCmsArticleTypeServices.cs +++ b/CoreCms.Net.Services/Article/CoreCmsArticleTypeServices.cs @@ -4,19 +4,28 @@ * Web: https://www.corecms.net * Author: 大灰灰 * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * CreateTime: 2022/10/24 3:54:14 * Description: 暂无 ***********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Configuration; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + namespace CoreCms.Net.Services { /// - /// 文章分类表 接口实现 + /// 文章分类表 接口实现 /// public class CoreCmsArticleTypeServices : BaseServices, ICoreCmsArticleTypeServices { @@ -25,9 +34,40 @@ namespace CoreCms.Net.Services public CoreCmsArticleTypeServices(IUnitOfWork unitOfWork, ICoreCmsArticleTypeRepository dal) { - _dal = dal; - BaseDal = dal; + this._dal = dal; + base.BaseDal = dal; _unitOfWork = unitOfWork; } + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public async Task InsertAsync(CoreCmsArticleType entity) + { + return await _dal.InsertAsync(entity); + } + + /// + /// 重写异步更新方法方法 + /// + /// + /// + public async Task UpdateAsync(CoreCmsArticleType entity) + { + return await _dal.UpdateAsync(entity); + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public async Task DeleteByIdAsync(object id) + { + return await _dal.DeleteByIdAsync(id); + } + } -} \ No newline at end of file +} diff --git a/CoreCms.Net.Services/CoreCms.Net.Services.csproj b/CoreCms.Net.Services/CoreCms.Net.Services.csproj index c1f555bc..2469aed7 100644 --- a/CoreCms.Net.Services/CoreCms.Net.Services.csproj +++ b/CoreCms.Net.Services/CoreCms.Net.Services.csproj @@ -13,6 +13,7 @@ + diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs index 186b1953..6075c8c3 100644 --- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs +++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs @@ -998,7 +998,6 @@ namespace CoreCms.Net.Services } #endregion - /// /// 根据条件查询代理池商品分页数据 /// @@ -1045,5 +1044,19 @@ namespace CoreCms.Net.Services #endregion + /// + /// 获取商品及默认货品信息 + /// + /// + /// + /// + /// 是否使用WITH(NOLOCK) + /// + public async Task> QueryGoodWithDefaultProductAsync(Expression> predicate, + Expression> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false) + { + return await _dal.QueryGoodWithDefaultProductAsync(predicate, orderByPredicate, orderByType, blUseNoLock); + } + } } diff --git a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs index d271f39e..32d5569d 100644 --- a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs +++ b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs @@ -185,6 +185,7 @@ namespace CoreCms.Net.Services #endregion + #region 获取税号 /// /// 获取税号 diff --git a/CoreCms.Net.Services/Pay/AliPayServices.cs b/CoreCms.Net.Services/Pay/AliPayServices.cs index e8ad23e4..9f6b2aca 100644 --- a/CoreCms.Net.Services/Pay/AliPayServices.cs +++ b/CoreCms.Net.Services/Pay/AliPayServices.cs @@ -17,6 +17,7 @@ using Newtonsoft.Json; using System.Threading.Tasks; using NLog; using System; +using System.Globalization; using Essensoft.Paylink.Alipay; using Essensoft.Paylink.Alipay.Domain; using Essensoft.Paylink.Alipay.Request; @@ -67,7 +68,7 @@ namespace CoreCms.Net.Services OutTradeNo = entity.paymentId, Subject = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle, ProductCode = entity.paymentCode, - TotalAmount = entity.money.ToString(), + TotalAmount = entity.money.ToString(CultureInfo.InvariantCulture), Body = entity.payTitle.Length > 40 ? entity.payTitle[..40] : entity.payTitle }; var req = new AlipayTradeAppPayRequest(); diff --git a/CoreCms.Net.Services/Pay/WeChatPayServices.cs b/CoreCms.Net.Services/Pay/WeChatPayServices.cs index 9dcddc6b..5c3e03a8 100644 --- a/CoreCms.Net.Services/Pay/WeChatPayServices.cs +++ b/CoreCms.Net.Services/Pay/WeChatPayServices.cs @@ -19,6 +19,7 @@ using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Utility.Extensions; using CoreCms.Net.WeChat.Service.HttpClients; +using Essensoft.Paylink.Alipay.Domain; using Essensoft.Paylink.WeChatPay; using Essensoft.Paylink.WeChatPay.V2; using Essensoft.Paylink.WeChatPay.V2.Request; @@ -26,6 +27,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using QRCoder; using SKIT.FlurlHttpClient.Wechat.Api; using SKIT.FlurlHttpClient.Wechat.Api.Models; @@ -178,36 +180,69 @@ namespace CoreCms.Net.Services var response = await _client.ExecuteAsync(orderRequest, _optionsAccessor.Value); if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success) { - var req = new WeChatPayJsApiSdkRequest - { - Package = "prepay_id=" + response.PrepayId - }; - WeChatPayDictionary parameter; + //App微信支付 if (tradeType == GlobalEnumVars.WeiChatPayTradeType.APP.ToString()) { var reqApp = new WeChatPayAppSdkRequest() { PrepayId = response.PrepayId }; - parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value); + var parameter = await _client.ExecuteAsync(reqApp, _optionsAccessor.Value); + parameter.Add("paymentId", entity.paymentId); + jm.status = true; + jm.msg = "创建微信APP支付环境成功"; + jm.data = parameter; + jm.otherData = response; } - else + //JsApi通用微信支付 + else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString()) { - parameter = await _client.ExecuteAsync(req, _optionsAccessor.Value); + // 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6) + var req = new WeChatPayJsApiSdkRequest + { + Package = "prepay_id=" + response.PrepayId + }; + var parameter = await _client.ExecuteAsync(req, _optionsAccessor.Value); + parameter.Add("paymentId", entity.paymentId); + jm.status = true; + jm.msg = "创建JSAPI支付环境成功"; + jm.data = parameter; + //jm.otherData = response; + } + //扫码支付 + else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.NATIVE.ToString()) + { + jm.status = true; + jm.msg = "创建微信扫码支付环境成功"; + jm.data = new + { + response, + entity.paymentId + }; + //确定是否存在扫码的图片,然后转成base64到前端进行扫码支付 + if (!string.IsNullOrEmpty(response.CodeUrl) && response.CodeUrl.Contains("weixin://wxpay/bizpayurl?pr=")) + { + using var qrGenerator = new QRCodeGenerator(); + using var qrCodeData = qrGenerator.CreateQrCode(response.CodeUrl, QRCodeGenerator.ECCLevel.L); + using var pngByteQrCode = new PngByteQRCode(qrCodeData); + var pngBytes = pngByteQrCode.GetGraphic(20, false); + var stringBase64Str = Convert.ToBase64String(pngBytes); + jm.otherData = stringBase64Str; + } + } + //H5支付 + else if (tradeType == GlobalEnumVars.WeiChatPayTradeType.MWEB.ToString()) + { + jm.status = true; + jm.msg = "创建H5支付环境成功"; + jm.data = response; } - // 将参数(parameter)给 公众号前端 让他在微信内H5调起支付(https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_7&index=6) - parameter.Add("paymentId", entity.paymentId); - - jm.status = true; - //jm.msg = "创建支付环境成功"; - jm.data = parameter; - jm.otherData = response; } else { jm.status = false; jm.msg = "微信建立支付请求失败"; - jm.otherData = response; + //jm.otherData = response; } return jm; } diff --git a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanGoodsServices.cs b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanGoodsServices.cs index 4e356693..4ad8bdb2 100644 --- a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanGoodsServices.cs +++ b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanGoodsServices.cs @@ -63,9 +63,7 @@ namespace CoreCms.Net.Services using var container = _serviceProvider.CreateScope(); var goodsServices = container.ServiceProvider.GetService(); - var pinTuanRuleServices = container.ServiceProvider.GetService(); var pinTuanRecordServices = container.ServiceProvider.GetService(); - var pinTuanGoodsServices = container.ServiceProvider.GetService(); var orderServices = container.ServiceProvider.GetService(); var goodsInfo = await goodsServices.GetGoodsDetail(goodsId, userId, false, "goods", 0, needGoodSku); @@ -83,14 +81,14 @@ namespace CoreCms.Net.Services { goodsInfo.pinTuanRule.pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun; - TimeSpan ts = goodsInfo.pinTuanRule.startTime.Subtract(dt); + var ts = goodsInfo.pinTuanRule.startTime.Subtract(dt); goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds; } else if (goodsInfo.pinTuanRule.startTime <= dt && goodsInfo.pinTuanRule.endTime > dt) { goodsInfo.pinTuanRule.pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin; - TimeSpan ts = goodsInfo.pinTuanRule.endTime.Subtract(dt); + var ts = goodsInfo.pinTuanRule.endTime.Subtract(dt); goodsInfo.pinTuanRule.lastTime = (int)ts.TotalSeconds; } else diff --git a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs index 743f971d..a51ed146 100644 --- a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs +++ b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs @@ -14,6 +14,7 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using CoreCms.Net.Configuration; +using CoreCms.Net.DTO; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; @@ -23,6 +24,7 @@ using CoreCms.Net.Model.Entities.Expression; using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Model.ViewModels.UI; +using Essensoft.Paylink.Alipay.Domain; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using SqlSugar; @@ -65,15 +67,18 @@ namespace CoreCms.Net.Services /// 接口上获取拼团所有商品 /// /// - public async Task GetPinTuanList(int userId = 0) + public async Task GetPinTuanList(int userId = 0, int pageIndex = 1, int pageSize = 20) { var jm = new WebApiCallBack(); using var container = _serviceProvider.CreateScope(); var pinTuanGoodsServices = container.ServiceProvider.GetService(); var pinTuanRuleServices = container.ServiceProvider.GetService(); + var goodsServices = container.ServiceProvider.GetService(); - var pinTuanRules = await pinTuanRuleServices.QueryListByClauseAsync(p => p.isStatusOpen == true, p => p.sort, OrderByType.Asc, true, true, 24 * 60); + //从缓存中获取有效的数据 + var dt = DateTime.Now; + var pinTuanRules = await pinTuanRuleServices.QueryListByClauseAsync(p => p.isStatusOpen == true && p.startTime < dt && p.endTime > dt, p => p.sort, OrderByType.Asc, true, true, 24 * 60); if (pinTuanRules == null && !pinTuanRules.Any()) { jm.status = true; @@ -81,30 +86,35 @@ namespace CoreCms.Net.Services return jm; } //获取开启的规则集序列 - var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToList(); - //获取下级商品数据 - var pinTuanGoods = await pinTuanGoodsServices.QueryListByClauseAsync(p => pinTuanRuleIds.Contains(p.ruleId), p => p.ruleId, OrderByType.Asc, true, true); - //从缓存中获取有效的数据 - var dt = DateTime.Now; - var list = pinTuanRules.Where(p => p.startTime < dt && p.endTime > dt).OrderBy(p => p.sort).ToList(); + var pinTuanRuleIds = pinTuanRules.Select(p => p.id).ToArray(); - if (list.Any()) + + var dtoData = await _dal.GetPinTuanInfos(pinTuanRuleIds, p => p.sortId, OrderByType.Asc, pageIndex, pageSize); + foreach (var item in dtoData) { - var goods = new List(); - foreach (var item in list) + //判断拼团状态 + var dtNow = DateTime.Now; + if (item.startTime > dt) { - var pinTuanGood = pinTuanGoods.Find(p => p.ruleId == item.id); - if (pinTuanGood != null) - { - var g = await pinTuanGoodsServices.GetGoodsInfo(item, pinTuanGood.goodsId, userId, false, - false, false); - if (g == null) continue; - goods.Add(g); - } + item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun; + var ts = item.startTime.Subtract(dt); + item.timestamp = (int)ts.TotalSeconds; } - jm.data = goods; + else if (item.startTime <= dt && item.endTime > dt) + { + item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin; + var ts = item.endTime.Subtract(dt); + item.timestamp = (int)ts.TotalSeconds; + } + else + { + item.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired; + } + + item.pinTuanPrice -= item.discountAmount; } + jm.data = dtoData; jm.status = true; return jm; } @@ -136,5 +146,25 @@ namespace CoreCms.Net.Services { return await _dal.GetPinTuanInfo(ruleId); } + + + /// + /// 根据规则ID数组获取拼团相关信息 + /// + /// 规则序列 + /// + /// + /// + /// + /// + public async Task> GetPinTuanInfos(int[] ruleIds, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20) + { + + return await _dal.GetPinTuanInfos(ruleIds, orderByExpression, orderByType, pageIndex, pageSize); + + } + } } diff --git a/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs b/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs index e0f52059..d94d0023 100644 --- a/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs +++ b/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using CoreCms.Net.Configuration; +using CoreCms.Net.DTO; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; @@ -175,17 +176,17 @@ namespace CoreCms.Net.Services #endregion - - - - #region 获取团购列表数据 /// /// 获取团购列表数据 /// /// - public async Task GetGroupList(int type, int userId, int status, int pageIndex, int pageSize) + public async Task GetGroupList(int type, int status, int pageIndex, int pageSize) { + using var container = _serviceProvider.CreateScope(); + + var goodsServices = container.ServiceProvider.GetService(); + var orderServices = container.ServiceProvider.GetService(); var jm = new WebApiCallBack { status = true }; @@ -207,51 +208,75 @@ namespace CoreCms.Net.Services { where = where.And(p => p.endTime < dt); } - var goods = new List(); - var list = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize); - if (list != null && list.Any()) + var promotions = await _dal.QueryPageAsync(where, p => p.endTime, OrderByType.Desc, pageIndex, pageSize, true, true, 60); + var dtoData = new List(); + if (promotions != null && promotions.Any()) { - foreach (var item in list) + //获取团购序列 + var pIds = promotions.Select(p => p.id).ToList(); + //获取规则参数 + var conditions = await _promotionConditionServices.QueryListByClauseAsync(p => pIds.Contains(p.promotionId), p => p.id, OrderByType.Asc, true, true); + //获取规则结果集 + var results = await _promotionResultServices.QueryListByClauseAsync(p => pIds.Contains(p.promotionId), p => p.id, OrderByType.Asc, true, true); + + var goodIds = (from condition in conditions where condition != null && condition.parameters.Contains("goodsId") select (JObject)JsonConvert.DeserializeObject(condition.parameters) into parameters select parameters["goodsId"].ObjectToInt(0)).ToList(); + + var goodData = await goodsServices.QueryGoodWithDefaultProductAsync(p => goodIds.Contains(p.id), p => p.id, OrderByType.Asc, true); + + foreach (var item in promotions) { - var promotionId = item.id; - var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId); + var dtNow = DateTime.Now; + + var dto = new GroupPurchaseSeckillDTO(); + + //事物处理过程开始 + dto.id = item.id; + dto.name = item.name; + dto.type = item.type; + dto.sort = item.sort; + dto.maxNums = item.maxNums; + dto.maxGoodsNums = item.maxGoodsNums; + dto.maxRecevieNums = item.maxRecevieNums; + dto.startTime = item.startTime; + dto.endTime = item.endTime; + dto.isEnable = item.isEnable; + dto.isExclusive = item.isExclusive; + dto.isAutoReceive = item.isAutoReceive; + dto.effectiveDays = item.effectiveDays; + dto.effectiveHours = item.effectiveHours; + dto.startStatus = status; + + var condition = conditions.Find(p => p.promotionId == item.id); if (condition != null && condition.parameters.Contains("goodsId")) { - JObject parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters); - - - var res = await GetGroupDetail(parameters["goodsId"].ObjectToInt(0), userId, type, item.id); - if (res.status) + var parameters = (JObject)JsonConvert.DeserializeObject(condition.parameters); + var goodId = parameters["goodsId"].ObjectToInt(0); + var good = goodData.Find(p => p.id == goodId); + if (good != null) { - var good = res.data as CoreCmsGoods; + dto.goodBrief = good.brief; + dto.goodName = good.name; + dto.goodThumbnail = good.image; + dto.goodImages = good.images; + dto.goodStock = good.stock; + dto.goodViewCount = good.viewCount; + dto.goodUnit = good.unit; + dto.mktPrice = good.mktprice; + dto.price = good.price; - good.groupId = item.id; - good.groupType = item.type; - good.groupStatus = item.isEnable; - good.groupTime = DateTime.Now; - good.groupStartTime = item.startTime; - good.groupEndTime = item.endTime; - - TimeSpan ts = item.endTime.Subtract(dt); - good.groupTimestamp = (int)ts.TotalSeconds; - - goods.Add(good); - } - else - { - item.expression1 = res.msg; + TimeSpan ts = item.endTime.Subtract(dtNow); + dto.timestamp = (int)ts.TotalSeconds; } } + dtoData.Add(dto); } } - jm.data = new { - goods, - list.TotalCount, - list.TotalPages, - list, + promotions.TotalCount, + promotions.TotalPages, + list = dtoData, pageIndex, pageSize }; @@ -266,7 +291,7 @@ namespace CoreCms.Net.Services /// /// - public async Task GetGroupDetail(int goodId = 0, int userId = 0, int type = (int)GlobalEnumVars.PromotionType.Group, int groupId = 0, bool needSku = false) + public async Task GetGroupDetail(int groupId, int userId, int type, bool needSku) { using var container = _serviceProvider.CreateScope(); @@ -275,31 +300,40 @@ namespace CoreCms.Net.Services var jm = new WebApiCallBack() { msg = "关键参数丢失" }; - if (goodId == 0) + if (groupId == 0) { return jm; } - //判断商品是否参加团购 - var isInGroup = _dal.IsInGroup(goodId, out var promotionId, type); - if (!isInGroup) - { - jm.msg = "商品未参加团购"; - return jm; - } - - var promotion = await _dal.QueryByClauseAsync(p => p.isDel == false && p.isEnable == true && p.id == promotionId); + var promotion = await _dal.QueryByClauseAsync(p => p.isDel == false && p.isEnable == true && p.id == groupId, true, true); if (promotion == null) { jm.msg = "无此活动"; - jm.otherData = promotionId; + jm.otherData = groupId; + return jm; + } + + var goodId = 0; + var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == groupId, true, true); + if (condition != null) + { + var obj = (JObject)JsonConvert.DeserializeObject(condition.parameters); + if (obj.ContainsKey("goodsId") && obj["goodsId"].ObjectToInt(0) > 0) + { + goodId = obj["goodsId"].ObjectToInt(0); + } + } + + if (goodId == 0) + { + jm.msg = "未提交商品信息"; + jm.otherData = groupId; return jm; } - var goods = new CoreCmsGoods(); string typeStr = type == (int)GlobalEnumVars.PromotionType.Group ? GlobalEnumVars.PromotionType.Group.ToString().ToLowerInvariant() : GlobalEnumVars.PromotionType.Seckill.ToString().ToLowerInvariant(); - goods = await goodsServices.GetGoodsDetail(goodId, userId, true, typeStr, groupId, needSku); + var goods = await goodsServices.GetGoodsDetail(goodId, userId, true, typeStr, groupId, needSku); if (goods == null) { jm.msg = "商品不存在"; @@ -315,8 +349,6 @@ namespace CoreCms.Net.Services //调整前台显示数量 var checkOrder = orderServices.FindLimitOrder(goods.product.id, userId, promotion.startTime, promotion.endTime, promotion.type); - var productStock = goods.product.stock; - //如果最大为设置值 if (promotion.maxGoodsNums > 0) { @@ -335,10 +367,8 @@ namespace CoreCms.Net.Services goods.product.stock = checkOrder.TotalOrders - promotion.maxNums >= 0 ? 0 : promotion.maxNums - checkOrder.TotalOrders; } - goods.buyPromotionCount = checkOrder.TotalOrders; - var dt = DateTime.Now; goods.groupId = promotion.id; @@ -351,7 +381,6 @@ namespace CoreCms.Net.Services TimeSpan ts = promotion.endTime.Subtract(dt); goods.groupTimestamp = (int)ts.TotalSeconds; - //进行促销后要更换原销售价替换原市场价 var originPrice = Math.Round(goods.product.price + goods.product.promotionAmount, 2); goods.product.mktprice = originPrice; diff --git a/CoreCms.Net.Services/Share/CoreCmsShareServices.cs b/CoreCms.Net.Services/Share/CoreCmsShareServices.cs index 0f88587d..98c95f18 100644 --- a/CoreCms.Net.Services/Share/CoreCmsShareServices.cs +++ b/CoreCms.Net.Services/Share/CoreCmsShareServices.cs @@ -532,9 +532,9 @@ namespace CoreCms.Net.Services } break; case (int)GlobalEnumVars.UrlSharePageType.PinTuan: - if (parameter.ContainsKey("goodsId") && parameter.ContainsKey("teamId") && parameter.ContainsKey("groupId")) + if (parameter.ContainsKey("teamId") && parameter.ContainsKey("groupId")) { - str = parameter["goodsId"] + "_" + parameter["groupId"] + "_" + parameter["teamId"]; + str = parameter["groupId"] + "_" + parameter["teamId"]; } else { @@ -565,9 +565,9 @@ namespace CoreCms.Net.Services } break; case (int)GlobalEnumVars.UrlSharePageType.AddPinTuan: - if (parameter.ContainsKey("goodsId") && parameter.ContainsKey("groupId") && parameter.ContainsKey("teamId")) + if (parameter.ContainsKey("groupId") && parameter.ContainsKey("teamId")) { - str = parameter["goodsId"] + "_" + parameter["groupId"] + "_" + parameter["teamId"]; + str = parameter["groupId"] + "_" + parameter["teamId"]; } else { @@ -598,24 +598,24 @@ namespace CoreCms.Net.Services } break; case (int)GlobalEnumVars.UrlSharePageType.Group: - if (parameter.ContainsKey("goodsId") || parameter.ContainsKey("groupId")) + if (parameter.ContainsKey("groupId")) { - str = parameter["goodsId"] + "_" + parameter["groupId"]; + str = parameter["groupId"].ToString(); } else { - jm.msg = "参数必须传goodsId,groupId"; + jm.msg = "参数必须传groupId"; return jm; } break; case (int)GlobalEnumVars.UrlSharePageType.Seckill: - if (parameter.ContainsKey("goodsId") || parameter.ContainsKey("groupId")) + if (parameter.ContainsKey("groupId")) { - str = parameter["goodsId"] + "_" + parameter["groupId"]; + str = parameter["groupId"].ToString(); } else { - jm.msg = "参数必须传goodsId,groupId"; + jm.msg = "参数必须传groupId"; return jm; } break; @@ -641,6 +641,17 @@ namespace CoreCms.Net.Services return jm; } break; + case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods: + if (parameter.ContainsKey("serviceGoodsId")) + { + str = parameter["serviceGoodsId"]?.ToString(); + } + else + { + jm.msg = "参数必须传id"; + return jm; + } + break; default: jm.msg = GlobalErrorCodeVars.Code10000; return jm; @@ -682,9 +693,8 @@ namespace CoreCms.Net.Services { jm.data = new { - goodsId = arr[0], - groupId = arr[1], - teamId = arr[2] + groupId = arr[0], + teamId = arr[1] }; jm.status = true; } @@ -712,9 +722,8 @@ namespace CoreCms.Net.Services { jm.data = new { - goodsId = arr[0], - groupId = arr[1], - teamId = arr[2] + groupId = arr[0], + teamId = arr[1] }; jm.status = true; } @@ -734,23 +743,21 @@ namespace CoreCms.Net.Services } break; case (int)GlobalEnumVars.UrlSharePageType.Group: - if (arr.Length == 2) + if (arr.Length == 1) { jm.data = new { - goodsId = arr[0], - groupId = arr[1], + groupId = arr[0], }; jm.status = true; } break; case (int)GlobalEnumVars.UrlSharePageType.Seckill: - if (arr.Length == 2) + if (arr.Length == 1) { jm.data = new { - goodsId = arr[0], - groupId = arr[1], + groupId = arr[0], }; jm.status = true; } @@ -769,6 +776,13 @@ namespace CoreCms.Net.Services jm.status = true; } break; + case (int)GlobalEnumVars.UrlSharePageType.ServiceGoods: + if (arr.Length == 1) + { + jm.data = new { serviceGoodsId = arr[0] }; + jm.status = true; + } + break; default: jm.msg = GlobalErrorCodeVars.Code10000; return jm; diff --git a/CoreCms.Net.Services/Shop/CoreCmsNoticeServices.cs b/CoreCms.Net.Services/Shop/CoreCmsNoticeServices.cs index 5a97bd3e..88436482 100644 --- a/CoreCms.Net.Services/Shop/CoreCmsNoticeServices.cs +++ b/CoreCms.Net.Services/Shop/CoreCmsNoticeServices.cs @@ -57,19 +57,13 @@ namespace CoreCms.Net.Services /// - /// 获取列表首页用 + /// 获取首页组件数据 /// /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// /// - public async Task> QueryListAsync(Expression> predicate, - Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, - int pageSize = 20) + public async Task> QueryComponentAsync(Expression> predicate) { - return await _dal.QueryListAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize); + return await _dal.QueryComponentAsync(predicate); } } } diff --git a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs index 2736f2f4..5ad1376b 100644 --- a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs +++ b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs @@ -23,6 +23,7 @@ using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.DTO; using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Utility.Extensions; +using Essensoft.Paylink.Alipay.Domain; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SqlSugar; @@ -43,6 +44,7 @@ namespace CoreCms.Net.Services private readonly ICoreCmsSettingServices _settingServices; private readonly ICoreCmsGoodsServices _goodsServices; private readonly ICoreCmsArticleServices _articleServices; + private readonly ICoreCmsArticleTypeServices _articleTypeServices; private readonly ICoreCmsPromotionConditionServices _promotionConditionServices; private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices; private readonly ICoreCmsServicesServices _servicesServices; @@ -51,7 +53,7 @@ namespace CoreCms.Net.Services private readonly IUnitOfWork _unitOfWork; public CoreCmsPagesServices(IUnitOfWork unitOfWork , ICoreCmsPagesRepository dal - , ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices) + , ICoreCmsPagesItemsRepository pagesItemsRepository, ICoreCmsPromotionServices promotionServices, ICoreCmsNoticeServices noticeServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsSettingServices settingServices, ICoreCmsGoodsServices goodsServices, ICoreCmsArticleServices articleServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsPinTuanRuleServices pinTuanRuleServices, ICoreCmsServicesServices servicesServices, ICoreCmsArticleTypeServices articleTypeServices) { this._dal = dal; _pagesItemsRepository = pagesItemsRepository; @@ -64,6 +66,7 @@ namespace CoreCms.Net.Services _promotionConditionServices = promotionConditionServices; _pinTuanRuleServices = pinTuanRuleServices; _servicesServices = servicesServices; + _articleTypeServices = articleTypeServices; base.BaseDal = dal; _unitOfWork = unitOfWork; } @@ -136,13 +139,13 @@ namespace CoreCms.Net.Services wherePage = code == "mobile_home" ? wherePage.And(p => p.type == 1) : wherePage.And(p => p.code == code); - var model = await _dal.QueryByClauseAsync(wherePage); + var model = await _dal.QueryByClauseAsync(wherePage, true, true); if (model == null) { return jm; } jm.status = true; - var items = await _pagesItemsRepository.QueryListByClauseAsync(p => p.pageCode == model.code, p => p.sort, OrderByType.Asc); + var items = await _pagesItemsRepository.QueryListByClauseAsync(p => p.pageCode == model.code, p => p.sort, OrderByType.Asc, true, true); var itemsDto = new List(); foreach (var item in items) @@ -156,143 +159,220 @@ namespace CoreCms.Net.Services item.parameters = item.parameters.Replace("/images/empty-banner.png", "/static/images/common/empty-banner.png"); - if (item.widgetCode == "search") //搜索 + switch (item.widgetCode) { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "tabBar") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "notice") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto") - { - var list = await _noticeServices.QueryListAsync(p => p.isDel == false, p => p.createTime, OrderByType.Desc, 1, 20); - if (list != null && list.Any()) + //搜索 + case "search": + case "tabBar": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "notice": { - JArray result = JArray.FromObject(list); - parameters.Remove("list"); - parameters.Add("list", result); - } - } - else if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "choose") - { - - var where = PredicateBuilder.True(); - - var orderBy = string.Empty; - var noticeIdsStr = string.Empty; - if (parameters != null && parameters.ContainsKey("list")) - { - JArray result = JArray.Parse(parameters["list"].ToString()); - var noticeIds = new List(); - foreach (var ss in result) //查找某个字段与值 + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto") { - var noticeId = ((JObject)ss)["id"].ObjectToInt(0); - if (noticeId > 0) + var list = await _noticeServices.QueryComponentAsync(p => p.isDel == false); + if (list != null && list.Any()) { - noticeIds.Add(noticeId); + var result = JArray.FromObject(list); + parameters.Remove("list"); + parameters.Add("list", result); } } - where = where.And(p => noticeIds.Contains(p.id)); - if (noticeIds.Any()) + else if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "choose") { - noticeIdsStr = string.Join(",", noticeIdsStr); - //按照固定的序列id进行排序 - if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString()) + + var where = PredicateBuilder.True(); + + var orderBy = string.Empty; + var noticeIdsStr = string.Empty; + if (parameters != null && parameters.ContainsKey("list")) { - orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + noticeIdsStr + "') "; + var result = JArray.Parse(parameters["list"].ToString()); + var noticeIds = result.Select(ss => ((JObject)ss)["id"].ObjectToInt(0)).Where(noticeId => noticeId > 0).ToList(); + where = where.And(p => noticeIds.Contains(p.id)); + if (noticeIds.Any()) + { + noticeIdsStr = string.Join(",", noticeIdsStr); + //按照固定的序列id进行排序 + if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString()) + { + orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + noticeIdsStr + "') "; + } + else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString()) + { + orderBy = " find_in_set(id,'" + noticeIdsStr + "') "; + } + } } - else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString()) + var notices = await _noticeServices.QueryListByClauseAsync(where, orderBy); + if (notices != null && notices.Any()) { - orderBy = " find_in_set(id,'" + noticeIdsStr + "') "; + var result = JArray.FromObject(notices); + parameters.Remove("list"); + parameters.Add("list", result); + } + else + { + parameters.Remove("list"); + parameters.Add("list", new JArray()); } } - } - var notices = await _noticeServices.QueryListByClauseAsync(where, orderBy); - if (notices != null && notices.Any()) - { - JArray result = JArray.FromObject(notices); - parameters.Remove("list"); - parameters.Add("list", result); - } - else - { - parameters.Remove("list"); - parameters.Add("list", new JArray()); - } - } - dto.parameters = parameters; - } - else if (item.widgetCode == "imgSlide") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "coupon") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) != 0) - { - var list = await _promotionServices.ReceiveCouponList(parameters["limit"].ObjectToInt(0)); - if (list != null && list.Any()) - { - JArray result = JArray.FromObject(list); - parameters.Remove("list"); - parameters.Add("list", result); + dto.parameters = parameters; + break; } - } - - dto.parameters = parameters; - } - else if (item.widgetCode == "blank") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "textarea") - { - JObject parameters = new JObject(); - parameters["value"] = item.parameters; - dto.parameters = parameters; - } - else if (item.widgetCode == "video") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "imgWindow") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "imgSingle") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "goodTabBar") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("list")) - { - var list = JArray.Parse(parameters["list"].ToString()); - var newList = new JArray(); - var count = 0; - foreach (var jToken in list) + case "imgSlide": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "coupon": { - var child = (JObject)jToken; + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) != 0) + { + var list = await _promotionServices.ReceiveCouponList(parameters["limit"].ObjectToInt(0)); + if (list != null && list.Any()) + { + var result = JArray.FromObject(list); + parameters.Remove("list"); + parameters.Add("list", result); + } + } + + dto.parameters = parameters; + break; + } + case "blank": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "textarea": + { + var parameters = new JObject(); + parameters["value"] = item.parameters; + dto.parameters = parameters; + break; + } + case "video": + case "imgWindow": + case "imgSingle": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "goodTabBar": + { + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("list")) + { + var list = JArray.Parse(parameters["list"].ToString()); + var newList = new JArray(); + foreach (var jToken in list) + { + var child = (JObject)jToken; + var where = PredicateBuilder.True(); + where = where.And(p => p.isDel == false); + where = where.And(p => p.isMarketable == true); + + if (child != null && child.ContainsKey("type") && child["type"].ToString() == "auto") + { + //商品分类,同时取所有子分类 + if (child.ContainsKey("classifyId") && child["classifyId"].ObjectToInt(0) > 0) + { + var classifyId = child["classifyId"].ObjectToInt(0); + var gc = await _goodsCategoryServices.GetCaChe(); + var childCats = gc.Where(p => p.parentId == classifyId).ToList(); + var catIds = childCats != null && childCats.Any() + ? childCats.Select(p => p.id).ToList() + : new List(); + catIds.Add(classifyId); + + where = where.And(p => catIds.Contains(p.goodsCategoryId)); + //扩展分类 CoreCmsGoodsCategory + } + //品牌筛选 + if (child.ContainsKey("brandId") && child["brandId"].ObjectToInt(0) > 0) + { + var brandId = child["brandId"].ObjectToInt(0); + where = where.And(p => p.brandId == brandId); + } + + var limit = 0; + if (child.ContainsKey("limit") && child["limit"].ObjectToInt(0) > 0) + { + limit = child["limit"].ObjectToInt(0); + } + limit = limit > 0 ? limit : 10; + + var goods = await _goodsServices.QueryListByClauseAsync(where, limit, p => p.createTime, OrderByType.Desc, true); + if (goods != null && goods.Any()) + { + var result = JArray.FromObject(goods); + child.Remove("list"); + child.Add("list", result); + } + else + { + child.Remove("list"); + child.Add("list", new JArray()); + } + } + else + { + var orderBy = string.Empty; + string goodidsStr; + if (child != null && child.ContainsKey("list")) + { + var result = JArray.Parse(child["list"].ToString()); + var goodids = result.Select(ss => ((JObject)ss)["id"].ObjectToInt(0)).Where(goodid => goodid > 0).ToList(); + where = where.And(p => goodids.Contains(p.id)); + if (goodids.Any()) + { + goodidsStr = string.Join(",", goodids); + //按照id序列打乱后的顺序排序 + if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString()) + { + orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + goodidsStr + "') "; + } + else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString()) + { + orderBy = " find_in_set(id,'" + goodidsStr + "') "; + } + } + } + var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy, true); + if (goods != null && goods.Any()) + { + var result = JArray.FromObject(goods); + child.Remove("list"); + child.Add("list", result); + } + else + { + child.Remove("list"); + child.Add("list", new JArray()); + } + } + newList.Add(child); + } + if (newList != null && newList.Any()) + { + parameters.Remove("list"); + parameters.Add("list", newList); + } + } + dto.parameters = parameters; + break; + } + case "goods": + { + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); var where = PredicateBuilder.True(); where = where.And(p => p.isDel == false); where = where.And(p => p.isMarketable == true); - - if (child != null && child.ContainsKey("type") && child["type"].ToString() == "auto") + if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto") { //商品分类,同时取所有子分类 - if (child.ContainsKey("classifyId") && child["classifyId"].ObjectToInt(0) > 0) + if (parameters.ContainsKey("classifyId") && parameters["classifyId"].ObjectToInt(0) > 0) { - var classifyId = child["classifyId"].ObjectToInt(0); + var classifyId = parameters["classifyId"].ObjectToInt(0); var gc = await _goodsCategoryServices.GetCaChe(); var childCats = gc.Where(p => p.parentId == classifyId).ToList(); var catIds = childCats != null && childCats.Any() @@ -304,39 +384,39 @@ namespace CoreCms.Net.Services //扩展分类 CoreCmsGoodsCategory } //品牌筛选 - if (child.ContainsKey("brandId") && child["brandId"].ObjectToInt(0) > 0) + if (parameters.ContainsKey("brandId") && parameters["brandId"].ObjectToInt(0) > 0) { - var brandId = child["brandId"].ObjectToInt(0); + var brandId = parameters["brandId"].ObjectToInt(0); where = where.And(p => p.brandId == brandId); } - + //数量 var limit = 0; - if (child.ContainsKey("limit") && child["limit"].ObjectToInt(0) > 0) + if (parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) > 0) { - limit = child["limit"].ObjectToInt(0); + limit = parameters["limit"].ObjectToInt(0); } limit = limit > 0 ? limit : 10; - var goods = await _goodsServices.QueryListByClauseAsync(where, limit, p => p.createTime, OrderByType.Desc, true); + var goods = await _goodsServices.QueryPageAsync(where, " sort desc,id desc ", 1, limit, true); if (goods != null && goods.Any()) { - JArray result = JArray.FromObject(goods); - child.Remove("list"); - child.Add("list", result); + var result = JArray.FromObject(goods); + parameters.Remove("list"); + parameters.Add("list", result); } else { - child.Remove("list"); - child.Add("list", new JArray()); + parameters.Remove("list"); + parameters.Add("list", new JArray()); } } else { var orderBy = string.Empty; string goodidsStr; - if (child != null && child.ContainsKey("list")) + if (parameters != null && parameters.ContainsKey("list")) { - JArray result = JArray.Parse(child["list"].ToString()); + JArray result = JArray.Parse(parameters["list"].ToString()); var goodids = new List(); foreach (var ss in result) //查找某个字段与值 { @@ -361,390 +441,294 @@ namespace CoreCms.Net.Services } } } - var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy); + var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy, true); if (goods != null && goods.Any()) { JArray result = JArray.FromObject(goods); - child.Remove("list"); - child.Add("list", result); + parameters.Remove("list"); + parameters.Add("list", result); } else { - child.Remove("list"); - child.Add("list", new JArray()); + parameters.Remove("list"); + parameters.Add("list", new JArray()); } } - count++; - newList.Add(child); - } - if (newList != null && newList.Any()) - { - parameters.Remove("list"); - parameters.Add("list", newList); + dto.parameters = parameters; + break; } - } - dto.parameters = parameters; - } - else if (item.widgetCode == "goods") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - var where = PredicateBuilder.True(); - where = where.And(p => p.isDel == false); - where = where.And(p => p.isMarketable == true); - if (parameters != null && parameters.ContainsKey("type") && parameters["type"].ToString() == "auto") - { - //商品分类,同时取所有子分类 - if (parameters.ContainsKey("classifyId") && parameters["classifyId"].ObjectToInt(0) > 0) + case "article": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "articleClassify": { - var classifyId = parameters["classifyId"].ObjectToInt(0); - var gc = await _goodsCategoryServices.GetCaChe(); - var childCats = gc.Where(p => p.parentId == classifyId).ToList(); - var catIds = childCats != null && childCats.Any() - ? childCats.Select(p => p.id).ToList() - : new List(); - catIds.Add(classifyId); - - where = where.And(p => catIds.Contains(p.goodsCategoryId)); - //扩展分类 CoreCmsGoodsCategory - } - //品牌筛选 - if (parameters.ContainsKey("brandId") && parameters["brandId"].ObjectToInt(0) > 0) - { - var brandId = parameters["brandId"].ObjectToInt(0); - where = where.And(p => p.brandId == brandId); - } - - var limit = 0; - if (parameters.ContainsKey("limit") && parameters["limit"].ObjectToInt(0) > 0) - { - limit = parameters["limit"].ObjectToInt(0); - } - limit = limit > 0 ? limit : 10; - - var goods = await _goodsServices.QueryPageAsync(where, " sort desc,id desc ", 1, limit, true); - if (goods != null && goods.Any()) - { - JArray result = JArray.FromObject(goods); - parameters.Remove("list"); - parameters.Add("list", result); - } - else - { - parameters.Remove("list"); - parameters.Add("list", new JArray()); - } - } - else - { - var orderBy = string.Empty; - string goodidsStr; - if (parameters != null && parameters.ContainsKey("list")) - { - JArray result = JArray.Parse(parameters["list"].ToString()); - var goodids = new List(); - foreach (var ss in result) //查找某个字段与值 + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null) { - var goodid = ((JObject)ss)["id"].ObjectToInt(0); - if (goodid > 0) + if (parameters.ContainsKey("articleClassifyId") && parameters["articleClassifyId"].ObjectToInt(0) > 0) { - goodids.Add(goodid); - } - } - where = where.And(p => goodids.Contains(p.id)); - if (goodids.Any()) - { - goodidsStr = string.Join(",", goodids); - //按照id序列打乱后的顺序排序 - if (AppSettingsConstVars.DbDbType == DbType.SqlServer.ToString()) - { - orderBy = " CHARINDEX(RTRIM(CAST(id as NCHAR)),'" + goodidsStr + "') "; - } - else if (AppSettingsConstVars.DbDbType == DbType.MySql.ToString()) - { - orderBy = " find_in_set(id,'" + goodidsStr + "') "; - } - } - } - var goods = await _goodsServices.QueryListByClauseAsync(where, orderBy); - if (goods != null && goods.Any()) - { - JArray result = JArray.FromObject(goods); - parameters.Remove("list"); - parameters.Add("list", result); - } - else - { - parameters.Remove("list"); - parameters.Add("list", new JArray()); - } - } + var articleClassifyId = parameters["articleClassifyId"].ObjectToInt(0); + var limit = parameters["limit"].ObjectToInt(0); + limit = limit > 0 ? limit : 20; + var articleClassifyObj = await _articleTypeServices.QueryByClauseAsync(p => p.id == articleClassifyId, true, true); + var articleClassifyObjJson = JsonConvert.SerializeObject(articleClassifyObj); - dto.parameters = parameters; + parameters.Add("articleClassifyObj", JToken.Parse(articleClassifyObjJson)); - } - else if (item.widgetCode == "article") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "articleClassify") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null) - { - if (parameters.ContainsKey("articleClassifyId") && parameters["articleClassifyId"].ObjectToInt(0) > 0) - { - var articleClassifyId = parameters["articleClassifyId"].ObjectToInt(0); - var limit = parameters["limit"].ObjectToInt(0); - limit = limit > 0 ? limit : 20; - var list = await _articleServices.QueryPageAsync(p => p.typeId == articleClassifyId && p.isPub == true, - p => p.createTime, OrderByType.Desc, 1, limit); - if (list != null && list.Any()) - { - JArray result = JArray.FromObject(list); - parameters.Remove("list"); - parameters.Add("list", result); - } - } - } - - dto.parameters = parameters; - } - else if (item.widgetCode == "navBar") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "groupPurchase") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("list")) - { - JArray result = JArray.Parse(parameters["list"].ToString()); - var newReslut = new JArray(); - foreach (var jToken in result) - { - var ss = (JObject)jToken; - if (ss.ContainsKey("id")) - { - //判断拼团状态 - var dt = DateTime.Now; - - var promotionId = ((JObject)ss)["id"].ObjectToInt(0); - if (promotionId > 0) - { - var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true); - if (promotionModel != null) + var list = await _articleServices.QueryPageAsync(p => p.typeId == articleClassifyId && p.isPub == true, p => p.createTime, OrderByType.Desc, 1, limit, true, true); + if (list != null && list.Any()) { - var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true); - if (condition != null) - { - var obj = (JObject)JsonConvert.DeserializeObject(condition.parameters); - if (obj.ContainsKey("goodsId") && obj["goodsId"].ObjectToInt(0) > 0) - { - var goodsId = obj["goodsId"].ObjectToInt(0); - var goods = await _promotionServices.GetGroupDetail(goodsId, 0, (int)GlobalEnumVars.PromotionType.Group, promotionId); - if (goods.status) - { - var goodJson = JsonConvert.SerializeObject(goods.data); - ((JObject)ss).Add("goods", JToken.Parse(goodJson)); - } - } - } - - var startStatus = 1; - int lastTime = 0; - bool isOverdue = false; - - if (promotionModel.startTime > dt) - { - startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming; - - TimeSpan ts = promotionModel.startTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; - isOverdue = lastTime > 0; - } - else if (promotionModel.startTime <= dt && promotionModel.endTime > dt) - { - startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress; - - TimeSpan ts = promotionModel.endTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; - isOverdue = lastTime > 0; - } - else - { - startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished; - } - - ((JObject)ss).Add("startStatus", startStatus); - ((JObject)ss).Add("lastTime", lastTime); - ((JObject)ss).Add("isOverdue", isOverdue); - - newReslut.Add(ss); + var result = JArray.FromObject(list); + parameters.Remove("list"); + parameters.Add("list", result); } } } + + dto.parameters = parameters; + break; } - parameters.Remove("list"); - parameters.Add("list", newReslut); - } - - dto.parameters = parameters; - } - else if (item.widgetCode == "record") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "pinTuan") - { - JObject parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("list")) - { - JArray result = JArray.Parse(parameters["list"].ToString()); - var newReslut = new JArray(); - foreach (JObject ss in result) + case "navBar": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "groupPurchase": { - if (ss.ContainsKey("goodsId")) + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("list")) { - var ruleId = ((JObject)ss)["id"].ObjectToInt(0); - if (ruleId > 0) + var result = JArray.Parse(parameters["list"].ToString()); + var newReslut = new JArray(); + foreach (var jToken in result) { - var goodsInfo = await _pinTuanRuleServices.GetPinTuanInfo(ruleId); - if (goodsInfo != null) + var ss = (JObject)jToken; + if (ss.ContainsKey("id")) + { + //判断拼团状态 + var dt = DateTime.Now; + var promotionId = ss["id"].ObjectToInt(0); + if (promotionId > 0) + { + var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true); + if (promotionModel != null) + { + var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true); + if (condition != null) + { + var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Group, false); + if (goods.status) + { + var goodJson = JsonConvert.SerializeObject(goods.data); + ss.Add("goods", JToken.Parse(goodJson)); + } + } + int startStatus; + var lastTime = 0; + if (promotionModel.startTime > dt) + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming; + var ts = promotionModel.startTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else if (promotionModel.startTime <= dt && promotionModel.endTime > dt) + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress; + var ts = promotionModel.endTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished; + } + + ss.Add("startStatus", startStatus); + ss.Add("lastTime", lastTime); + newReslut.Add(ss); + } + } + } + } + parameters.Remove("list"); + parameters.Add("list", newReslut); + } + + dto.parameters = parameters; + break; + } + case "seckill": + { + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("list")) + { + var result = JArray.Parse(parameters["list"].ToString()); + var newReslut = new JArray(); + foreach (var jToken in result) + { + var ss = (JObject)jToken; + if (ss.ContainsKey("id")) + { + //判断拼团状态 + var dt = DateTime.Now; + var promotionId = ss["id"].ObjectToInt(0); + if (promotionId > 0) + { + var promotionModel = await _promotionServices.QueryByClauseAsync(p => p.id == promotionId && p.isEnable == true && p.startTime <= dt && p.endTime > dt, true, true); + if (promotionModel != null) + { + var condition = await _promotionConditionServices.QueryByClauseAsync(p => p.promotionId == promotionId, true, true); + if (condition != null) + { + var goods = await _promotionServices.GetGroupDetail(promotionId, 0, (int)GlobalEnumVars.PromotionType.Seckill, false); + if (goods.status) + { + var goodJson = JsonConvert.SerializeObject(goods.data); + ss.Add("goods", JToken.Parse(goodJson)); + } + } + + int startStatus; + int lastTime = 0; + + if (promotionModel.startTime > dt) + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Upcoming; + + var ts = promotionModel.startTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else if (promotionModel.startTime <= dt && promotionModel.endTime > dt) + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.InProgress; + + var ts = promotionModel.endTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else + { + startStatus = (int)GlobalEnumVars.GroupSeckillStatus.Finished; + } + + ss.Add("startStatus", startStatus); + ss.Add("lastTime", lastTime); + newReslut.Add(ss); + } + } + } + } + parameters.Remove("list"); + parameters.Add("list", newReslut); + } + + dto.parameters = parameters; + break; + } + case "record": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + case "pinTuan": + { + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + if (parameters != null && parameters.ContainsKey("list")) + { + var result = JArray.Parse(parameters["list"].ToString()); + var newReslut = new JArray(); + + var ruleIdIds = (from JObject ss in result where ss.ContainsKey("goodsId") select ss["id"].ObjectToInt(0)).ToArray(); + + if (ruleIdIds.Any()) + { + var dtoData = await _pinTuanRuleServices.GetPinTuanInfos(ruleIdIds, p => p.sortId, OrderByType.Asc, 1, result.Count); + foreach (var itemDto in dtoData) { - var pinTuanStartStatus = 1; - int lastTime = 0; - bool isOverdue = false; //判断拼团状态 var dt = DateTime.Now; - if (goodsInfo.startTime > dt) + if (itemDto.startTime > dt) { - pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun; - - TimeSpan ts = goodsInfo.startTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; - isOverdue = lastTime > 0; + itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.notBegun; + itemDto.timestamp = (int)itemDto.startTime.Subtract(dt).TotalSeconds; } - else if (goodsInfo.startTime <= dt && goodsInfo.endTime > dt) + else if (itemDto.startTime <= dt && itemDto.endTime > dt) { - pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin; - - TimeSpan ts = goodsInfo.endTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; - isOverdue = lastTime > 0; + itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.begin; + itemDto.timestamp = (int)itemDto.endTime.Subtract(dt).TotalSeconds; } else { - pinTuanStartStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired; + itemDto.startStatus = (int)GlobalEnumVars.PinTuanRuleStatus.haveExpired; } - decimal pinTuanPrice = goodsInfo.goodsPrice - goodsInfo.discountAmount; - if (pinTuanPrice < 0) pinTuanPrice = 0; + itemDto.pinTuanPrice -= itemDto.discountAmount; + if (itemDto.pinTuanPrice < 0) itemDto.pinTuanPrice = 0; - var obj = new JObject(); - ((JObject)obj).Add("pinTuanStartStatus", pinTuanStartStatus); - ((JObject)obj).Add("lastTime", lastTime); - ((JObject)obj).Add("isOverdue", isOverdue); - ((JObject)obj).Add("pinTuanPrice", pinTuanPrice); - - ((JObject)obj).Add("createTime", goodsInfo.createTime); - ((JObject)obj).Add("discountAmount", goodsInfo.discountAmount); - ((JObject)obj).Add("endTime", goodsInfo.endTime); - ((JObject)obj).Add("goodsId", goodsInfo.goodsId); - ((JObject)obj).Add("goodsImage", goodsInfo.goodsImage); - ((JObject)obj).Add("goodsName", goodsInfo.goodsName); - ((JObject)obj).Add("goodsPrice", goodsInfo.goodsPrice); - ((JObject)obj).Add("id", goodsInfo.id); - ((JObject)obj).Add("isStatusOpen", goodsInfo.isStatusOpen); - ((JObject)obj).Add("maxGoodsNums", goodsInfo.maxGoodsNums); - ((JObject)obj).Add("maxNums", goodsInfo.maxNums); - ((JObject)obj).Add("name", goodsInfo.name); - ((JObject)obj).Add("peopleNumber", goodsInfo.peopleNumber); - ((JObject)obj).Add("significantInterval", goodsInfo.significantInterval); - ((JObject)obj).Add("sort", goodsInfo.sort); - ((JObject)obj).Add("startTime", goodsInfo.startTime); - ((JObject)obj).Add("updateTime", goodsInfo.updateTime); - - //((JObject)ss).Add("goodsInfo", JToken.FromObject(goodsInfo)); - newReslut.Add(obj); + newReslut.Add(JObject.FromObject(itemDto)); } + parameters.Remove("list"); + parameters.Add("list", newReslut); } } + dto.parameters = parameters; + break; } - parameters.Remove("list"); - parameters.Add("list", newReslut); - } - - dto.parameters = parameters; - - } - else if (item.widgetCode == "service") - { - var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - - if (parameters != null && parameters.ContainsKey("list")) - { - var result = JArray.Parse(parameters["list"].ToString()); - var ids = (from JObject ss in result where ss.ContainsKey("id") select ((JObject)ss)["id"].ObjectToInt(0) into id where id > 0 select id).ToList(); - - if (ids.Any()) + case "service": { - var serviceObj = await _servicesServices.QueryListByClauseAsync(p => ids.Contains(p.id)); - foreach (var jToken in result) + var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + + if (parameters != null && parameters.ContainsKey("list")) { - var ss = (JObject) jToken; - var id = ((JObject)ss)["id"].ObjectToInt(0); - var serviceInfo = serviceObj.Find(p => p.id == id); - if (serviceInfo != null) + var result = JArray.Parse(parameters["list"].ToString()); + var ids = (from JObject ss in result where ss.ContainsKey("id") select ((JObject)ss)["id"].ObjectToInt(0) into id where id > 0 select id).ToList(); + + if (ids.Any()) { - var openStatus = 1; - int lastTime = 0; - var dt = DateTime.Now; - if (serviceInfo.startTime > dt) + var serviceObj = await _servicesServices.QueryListByClauseAsync(p => ids.Contains(p.id), p => p.id, OrderByType.Asc, true, true); + foreach (var jToken in result) { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun; - TimeSpan ts = serviceInfo.startTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; - } - else if (serviceInfo.startTime <= dt && serviceInfo.endTime > dt) - { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin; + var ss = (JObject)jToken; + var id = ss["id"].ObjectToInt(0); + var serviceInfo = serviceObj.Find(p => p.id == id); + if (serviceInfo != null) + { + int openStatus; + int lastTime = 0; + var dt = DateTime.Now; + if (serviceInfo.startTime > dt) + { + openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun; + var ts = serviceInfo.startTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else if (serviceInfo.startTime <= dt && serviceInfo.endTime > dt) + { + openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin; - TimeSpan ts = serviceInfo.endTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; + var ts = serviceInfo.endTime.Subtract(dt); + lastTime = (int)ts.TotalSeconds; + } + else + { + openStatus = (int)GlobalEnumVars.ServicesOpenStatus.haveExpired; + } + ss.Add("openStatus", openStatus); + ss.Add("lastTime", lastTime); + } } - else - { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.haveExpired; - } - ss.Add("openStatus", openStatus); - ss.Add("lastTime", lastTime); } + + parameters.Remove("list"); + parameters.Add("list", result); } + + dto.parameters = parameters; + break; } - - parameters.Remove("list"); - parameters.Add("list", result); - } - - dto.parameters = parameters; - } - else if (item.widgetCode == "adpop") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else if (item.widgetCode == "topImgSlide") - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); - } - else - { - dto.parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); + case "adpop": + case "topImgSlide": + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; + default: + dto.parameters = JsonConvert.DeserializeObject(item.parameters); + break; } itemsDto.Add(dto); } diff --git a/CoreCms.Net.Uni-App/CoreShop/App.vue b/CoreCms.Net.Uni-App/CoreShop/App.vue index ec6d6dc6..7c3b8ab9 100644 --- a/CoreCms.Net.Uni-App/CoreShop/App.vue +++ b/CoreCms.Net.Uni-App/CoreShop/App.vue @@ -10,6 +10,14 @@ showLoginTip: false, }, onLaunch() { + + // 此版本发布于2022-10-23 + const version = '0.6.4' + // 开发环境才提示,生产环境不会提示 + if (process.env.NODE_ENV === 'development') { + console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;'); + } + // #ifdef MP-WEIXIN this.autoUpdate(); // #endif @@ -21,14 +29,6 @@ // 获取店铺配置信息 全局只请求一次 this.$u.api.shopConfigV2().then(res => { this.$store.commit('config', res.data) - // #ifdef H5 - //百度统计 - if (res.data.statistics) { - var script = document.createElement("script"); - script.innerHTML = res.data.statistics; - document.getElementsByTagName("body")[0].appendChild(script); - } - // #endif }) //获取三级联动城市信息 this.$u.api.getAreaList().then(res => { @@ -36,12 +36,11 @@ this.$db.set('areaList', res.data) } }); - }, onShow: function (obj) { // #ifdef MP-WEIXIN this.$store.commit('scene', obj.scene) - console.log(obj); + //console.log(obj); // #endif //console.log('App Show') }, @@ -170,7 +169,7 @@ // vue App的样式 /* #ifdef APP-PLUS */ - @import "@/static/style/style.vue.scss"; + @import "@/static/style/style.app.scss"; /* #endif */ // 小程序特有的样式 diff --git a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js index afa00815..97569ef2 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/mixins/mixinsHelper.js @@ -160,21 +160,25 @@ module.exports = { this.$u.route(url) }, // 秒杀详情 - goSeckillDetail(id, groupId) { - this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id, groupId: groupId, }); + goSeckillDetail(id) { + this.$u.route('/pages/activity/seckill/seckillDetails/seckillDetails', { id: id }); }, // 团购详情 - goGroupBuyingDetail(id, groupId) { - this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id, groupId: groupId, }); + goGroupBuyingDetail(id) { + this.$u.route('/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', { id: id }); }, //拼团详情页 - goPinTuanDetail(id, pinTuanId, teamId) { + goPinTuanDetail(id, teamId) { if (teamId) { - this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, pinTuanId: pinTuanId, teamId: teamId, }); + this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, teamId: teamId, }); } else { - this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id, pinTuanId: pinTuanId }); + this.$u.route('/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', { id: id }); } }, + // 查看团购列表 + goGroupPurchase() { + this.$u.route('/pages/activity/groupBuying/list/list') + }, // 查看秒杀列表 goSeckillList() { this.$u.route('/pages/activity/seckill/list/list') @@ -189,7 +193,10 @@ module.exports = { * 文章接口 */ - // 查看文章总列表 + // 查看文章分类 + goArticleClassify(id) { + this.$u.route('/pages/article/list/list', { id: id }); + }, goArticleList() { this.$u.route('/pages/article/list/list') }, @@ -231,7 +238,7 @@ module.exports = { * 接龙接口信息 */ - // 查看服务详情 + // 查看接龙详情 goSolitaireDetail(id) { this.$u.route('/pages/activity/solitaire/solitaireDetails/solitaireDetails', { id: id }); }, @@ -241,7 +248,6 @@ module.exports = { }, //服务接口信息 - // 查看服务详情 goServicesDetail(serviceId) { this.$u.route('/pages/serviceGoods/details/details', { id: serviceId }); }, @@ -266,14 +272,11 @@ module.exports = { } if (type == navLinkType.urlLink) { if (val.indexOf('http') != -1) { - // #ifdef H5 - window.location.href = val - // #endif - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP + // #ifdef APP-PLUS || APP-PLUS-NVUE || MP this.$u.route('/pages/webview/webview', { src: val }); // #endif } else { - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE || MP + // #ifdef APP-PLUS || APP-PLUS-NVUE || MP if (val == '/pages/index/default/default' || val == '/pages/category/index/index' || val == '/pages/index/cart/cart' || val == '/pages/index/member/member') { this.$u.route({ type: 'switchTab', url: val }); return; diff --git a/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js b/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js index 25658444..26c03d1e 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/request/http.api.js @@ -5,7 +5,6 @@ const install = (Vue, vm) => { // 获取店铺配置 - //let shopConfig = (params, config = {}) => http.post('/Api/Common/GetConfig', params, { custom: { methodName: 'common.shopConfig', needToken: false } }); let shopConfigV2 = (params, config = {}) => http.post('/Api/Common/GetConfigV2', params, { custom: { methodName: 'common.shopConfigV2', needToken: false } }); //获取商城关键词说明 let getServiceDescription = (params, config = {}) => http.post('/Api/Common/GetServiceDescription', params, { custom: { methodName: 'common.getServiceDescription', needToken: false } }); @@ -399,24 +398,11 @@ const install = (Vue, vm) => { let serviceVerificationTicket = (params, config = {}) => http.post('/Api/Service/VerificationTicket', params, { custom: { methodName: 'service.verificationTicket', needToken: true } }); - //获取接龙列表 let getSolitairePageList = (params, config = {}) => http.post('/Api/Solitaire/GetList', params, { custom: { methodName: 'solitaire.getList', needToken: false } }); let getSolitaireDetail = (params, config = {}) => http.post('/Api/Solitaire/GetDetail', params, { custom: { methodName: 'solitaire.getDetail', needToken: false } }); - - // 用户注册(废弃,改为自动获取app数据及使用短信验证码登录)建议直接使用smsLogin接口 - //let reg = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.reg', needToken: true } }); - // 用户登录(废弃,改为短信验证码登录) - //let login = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.login', needToken: true } }); - // 获取用户信息(废弃) - // let trustLogin = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.trustcallback', needToken: true } }); - // 订单售后状态(废弃方法,建议直接用order.details接口) - // let afterSalesStatus = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'order.aftersalesstatus', needToken: true } }); - // 我的积分(弃用) - //let myPoint = (params, config = {}) => http.post('/Api/Common/InterFaceTest', params, { custom: { methodName: 'user.mypoint', needToken: true } }); - // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = { shopConfigV2, @@ -485,8 +471,7 @@ const install = (Vue, vm) => { paymentInfo, pay, orderEvaluate, - //isSign, - //sign, + userCheckIn, getUserCheckByMonth, getUserCheckCount, diff --git a/CoreCms.Net.Uni-App/CoreShop/common/request/request.js b/CoreCms.Net.Uni-App/CoreShop/common/request/request.js index dd08fca9..63f5879f 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/request/request.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/request/request.js @@ -17,16 +17,12 @@ module.exports = (vm) => { // #endif // 注:如果局部custom与全局custom有同名属性,则后面的属性会覆盖前面的属性,相当于Object.assign(全局,局部) //defaultConfig.custom = {}; // 全局自定义参数默认值 - // #ifdef H5 || APP-PLUS || MP-ALIPAY || MP-WEIXIN + // #ifdef APP-PLUS || MP-ALIPAY || MP-WEIXIN defaultConfig.timeout = 60000; // #endif // #ifdef APP-PLUS defaultConfig.sslVerify = true; // #endif - // #ifdef H5 - // 跨域请求时是否携带凭证(cookies)仅H5支持(HBuilderX 2.6.15+) - defaultConfig.withCredentials = false; - // #endif // #ifdef APP-PLUS defaultConfig.firstIpv4 = false; // DNS解析时优先使用ipv4 仅 App-Android 支持 (HBuilderX 2.8.0+) // #endif @@ -84,7 +80,7 @@ module.exports = (vm) => { //console.log(page.route); // 登录信息过期或者未登录 if (data.data === 14007 || data.data === 14006) { - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE + // #ifdef APP-PLUS || APP-PLUS-NVUE if (page.route.indexOf('pages/login/loginBySMS/loginBySMS') < 0) { db.del("userToken"); uni.showToast({ diff --git a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js index 6fa977b1..5e1bab94 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/setting/constVarsHelper.js @@ -1,20 +1,14 @@ /** * 全局配置文件 - * @version 0.6.2 + * @version 1.0.0 */ //接口请求地址,如果需要不部署接口端的情况下测试uni-app,可以直接替换为官方测试接口:https://api.demo.coreshop.cn -//export const apiBaseUrl = 'https://api.pro.coreshop.cn'; -export const apiBaseUrl = 'http://localhost:2015'; +export const apiBaseUrl = process.env.NODE_ENV === 'development' ? 'https://api.nsts.mvccms.cn' : 'https://api.nsts.mvccms.cn'; + //项目静态资源请求地址,如果使用官方的静态文件地址可以直接替换为:https://files.cdn.coreshop.cn export const apiFilesUrl = 'https://files.cdn.coreshop.cn'; -export const h5Url = apiBaseUrl + "/wap/"; //H5端网站地址, - -// #ifdef H5 -export const baseUrl = process.env.NODE_ENV === 'development' ? window.location.origin + '/' : apiBaseUrl -// #endif - //支付单类型 export const paymentType = { //普通订单 @@ -25,7 +19,6 @@ export const paymentType = { group: 3, //秒杀订单 seckill: 4, - //砍价 bargain: 6, //赠品 @@ -34,10 +27,8 @@ export const paymentType = { solitaire: 8, //交易组件 transactionComponent: 10, - //充值 recharge: 201, - //服务订单 serviceOrder: 501, //表单付款码 @@ -46,7 +37,6 @@ export const paymentType = { formOrder: 302, }; - //分享链接及海报类型 export const shareType = { // 首页 @@ -55,7 +45,7 @@ export const shareType = { goods: 2, // 3拼团详情页 pinTuan: 3, - // 4店铺邀请 + // 4分销店铺 inv: 4, // 5文章页面 article: 5, @@ -69,15 +59,54 @@ export const shareType = { group: 9, // 10秒杀 seckill: 10, - // 11代理 + // 11代理店铺 agent: 11, // 12接龙 solitaire: 12, + // 13 服务商品 + serviceGoods: 13 +}; + +//分享终端 +export const shareClient = { + // 普通h5 + h5: 1, + // 微信小程序 + wxMiNiProgram: 2, + // 微信公众号(h5) + wxOfficial: 3, + // 头条系小程序 + ttMiNiProgram: 4, + // 电脑pc端 + pc: 5, + // 阿里小程序 + aLiMiNiProgram: 6, +}; + + +//分享终端 +export const shareModel = { + // 链接分享 + url: 1, + // 二维码 + qrCode: 2, + // 海报 + poster: 3, }; export const shareUrl = 'pages/share/jump/jump'; //分享初始化地址 +//列表加载状态 +export const loadStatus = { + // 加载前的状态 + loadMore: 'loadmore', + // 加载中的状态 + loading: 'loading', + // 没有更多的状态 + noMore: 'nomore', +}; + //nav页面导航类型 export const navLinkType = { @@ -87,3 +116,5 @@ export const navLinkType = { articleCategory: 4,// "文章分类", intelligentForms: 5// "智能表单" }; + + diff --git a/CoreCms.Net.Uni-App/CoreShop/common/setting/coreThemeHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/setting/coreThemeHelper.js deleted file mode 100644 index 900f00c7..00000000 --- a/CoreCms.Net.Uni-App/CoreShop/common/setting/coreThemeHelper.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 很多无法css实现的换肤效果,通过此模块实现 - * 使用方法,在代码中直接使用 this.$coreTheme.mainNabBar.background - * @version 1.0.0 - */ - -//通用头部背景样式 -export const mainNabBar = { - background: { - //颜色 - backgroundColor: '#e54d42', - // 导航栏背景图 - // background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat', - // 还可以设置背景图size属性 - // backgroundSize: 'cover', - - // 渐变色 - //backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))' - }, - //通用头部文字颜色 - titleColor: "#fff", - //通用头部文字颜色 - backIconColor: "#fff", -}; - diff --git a/CoreCms.Net.Uni-App/CoreShop/common/utils/commonHelper.js b/CoreCms.Net.Uni-App/CoreShop/common/utils/commonHelper.js index c2518ec8..cc42459d 100644 --- a/CoreCms.Net.Uni-App/CoreShop/common/utils/commonHelper.js +++ b/CoreCms.Net.Uni-App/CoreShop/common/utils/commonHelper.js @@ -29,26 +29,8 @@ function modelShow( }; -//时间差转倒计时数据 -function timeToDateObj(micro_second) { - var time = {} - // 总秒数 - var second = Math.floor(micro_second) - // 天数 - time.day = Math.floor(second / 3600 / 24) - // 小时 - time.hour = Math.floor((second / 3600) % 24) - // 分钟 - time.minute = Math.floor((second / 60) % 60) - // 秒 - time.second = Math.floor(second % 60) - return time -}; - //货币格式化 function formatMoney(number, places, symbol, thousand, decimal) { - // console.log(number) - // console.log(places) number = number || 0 places = !isNaN((places = Math.abs(places))) ? places : 2 symbol = symbol !== undefined ? symbol : '¥' @@ -71,41 +53,6 @@ function formatMoney(number, places, symbol, thousand, decimal) { ) } -/** - * 获取url参数 - * - * @param {*} name - * @param {*} [url=window.location.serach] - * @returns - */ -function getQueryString(name, url) { - var url = url || window.location.href - var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i') - var r = url.substr(1).match(reg) - if (r != null) { - return r[2] - } - return null -} - -/** - * - * 判断是否在微信浏览器 true是 - */ -function isWeiXinBrowser() { - // #ifdef H5 - // window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型 - let ua = window.navigator.userAgent.toLowerCase() - // 通过正则表达式匹配ua中是否含有MicroMessenger字符串 - if (ua.match(/MicroMessenger/i) == 'micromessenger') { - return true - } else { - return false - } - // #endif - return false -} - /** * 金额相加 * @param {Object} value1 @@ -125,29 +72,9 @@ function moneySub(value1, value2) { } -//设置手机通知栏字体颜色 -function setBarColor(black = false) { - if (black) { - uni.setNavigationBarColor({ - frontColor: '#000000', - backgroundColor: '#FAFAFA' - }); - } else { - uni.setNavigationBarColor({ - frontColor: '#ffffff', - backgroundColor: '#FAFAFA' - }); - } -} - - export { formatMoney, modelShow, - isWeiXinBrowser, - getQueryString, - timeToDateObj, moneySum, moneySub, - setBarColor } diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue index 729c025f..0f4356b1 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-login-modal/coreshop-login-modal.vue @@ -98,7 +98,7 @@ * @property {Boolean} value=showLoginTip - 由v-model控制显示隐藏。 * @property {Boolean} forceOauth - 小程序端特制的全屏登录提示。 */ - import { mapMutations, mapActions, mapState } from 'vuex'; + import { mapState } from 'vuex'; export default { name: 'coreshopLoginModal', components: {}, diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-article.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-article.vue index ac7b79e8..68c59a28 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-article.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-article.vue @@ -1,33 +1,57 @@ - - - - - {{ item.title }} + + + + + {{title}} + + + + + + + + + + {{ brief }} + - - {{ item.brief }} + + - - - + \ No newline at end of file diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-content.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-content.vue index 4d31b9a2..f121485b 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-content.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-content.vue @@ -12,15 +12,6 @@ content: { required: true, } - }, - created() { }, - methods: { - preview(src, e) { - // do something - }, - navigate(href, e) { - // do something - } } } diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue index 9803076a..40757c7c 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-coupon.vue @@ -1,94 +1,71 @@ - - - + - - 领券专区 - + + 领券专区 + - - - - - - - - - - - - ¥ - - {{ item.name }} + + + + + + + + + + + + + ¥ + {{ item.name }} + + + 【{{itemCondition}}】 + + + 有效期:{{$u.timeFormat(item.startTime, 'yyyy-mm-dd')}} 至 {{$u.timeFormat(item.endTime, 'yyyy-mm-dd')}} + - - 【{{itemCondition}}】 - - - 有效期:{{$u.timeFormat(item.startTime, 'yyyy-mm-dd')}} 至 {{$u.timeFormat(item.endTime, 'yyyy-mm-dd')}} - - - - 立即领取 - - {{itemResult}} + + 立即领取 + + {{itemResult}} + - - + + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue index 7fe5767e..8a4bb129 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-goods.vue @@ -1,16 +1,19 @@ - - + - - - + + + {{coreshopData.parameters.title}} + - - + + + + + - - + + {{item.name}} @@ -18,18 +21,21 @@ ¥ {{item.price}} - {{item.mktprice}}元 + {{item.mktprice}}元 {{item.buyCount+'人付款'}} - + + + + {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ $common.formatMoney(item.price - item.pointsDeduction, 2, '')}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}}元 @@ -54,18 +60,21 @@ ¥ {{item.price}} - {{item.mktprice}}元 + {{item.mktprice}}元 {{item.buyCount+'人付款'}} - + + + + {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ $common.formatMoney(item.price - item.pointsDeduction, 2, '')}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}}元 @@ -81,54 +90,55 @@ - - - - - - - + + + {{coreshopData.parameters.title}} + - - - - - - - {{item.name}} - - - {{item.price}}元 {{item.mktprice}}元 - - - 推荐 - - - 热门 - - - - {{ pointShowName}}兑换价: - - - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元 - - - - - 购买赠送: - - - {{item.points}}{{ pointShowName}} - - + + + + + + + + + + {{ item.name }} + {{ item.brief }} + + 已售{{item.buyCount}}{{item.unit}} + {{item.viewCount}}人访问 - - + + + ¥{{ item.price }} + ¥{{ item.mktprice }} + + 马上抢 + + + + + {{ pointShowName}}兑换价: + + + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 + + + + + 购买赠送: + + + {{item.points}}{{ pointShowName}} + + + @@ -136,18 +146,21 @@ - - - + + + {{coreshopData.parameters.title}} + - - + + + + + - - + + - + {{item.name}} @@ -166,7 +179,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -186,12 +199,15 @@ - + - + + + + @@ -204,20 +220,9 @@ count: false }; }, - filters: { - substr(val) { - if (val.length == 0 || val == undefined) { - return false; - } else if (val.length > 13) { - return val.substring(0, 13) + "..."; - } else { - return val; - } - } - }, - name: "coreshopgoods", + name: "coreshopGoods", props: { - coreshopdata: { + coreshopData: { // type: Array, required: true, } @@ -243,9 +248,9 @@ }, }, created() { - this.count = this.coreshopdata.parameters.list.length > 0; - var page = Number(this.coreshopdata.parameters.list.length / this.coreshopdata.parameters.column).toFixed(0); - if (this.coreshopdata.parameters.column * page < this.coreshopdata.parameters.list.length) { + this.count = this.coreshopData.parameters.list.length > 0; + var page = Number(this.coreshopData.parameters.list.length / this.coreshopData.parameters.column).toFixed(0); + if (this.coreshopData.parameters.column * page < this.coreshopData.parameters.list.length) { page = Number(page) + 1; } for (var i = 0; i < page; i++) { @@ -256,20 +261,17 @@ + .mainWindow { width: 100%; height: 200px; + .left { width: 50%; height: 200px; } + .right { width: 50%; height: 200px; } + .minBox { width: 50%; } + } + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-navBar.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-navBar.vue index 6c47f3a2..3d4eabed 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-navBar.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-navBar.vue @@ -1,9 +1,9 @@ - + - + @@ -11,12 +11,11 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-record.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-record.vue index 4070fc19..13e2b583 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-record.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-record.vue @@ -1,5 +1,5 @@ - + @@ -16,9 +16,9 @@ + + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-serviceGood.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-serviceGood.vue new file mode 100644 index 00000000..a50f6d57 --- /dev/null +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-serviceGood.vue @@ -0,0 +1,125 @@ + + + + {{coreshopData.parameters.title}} + + + + + + + + + + + + {{ item.title }} + {{ item.description }} + + 限购{{item.maxBuyNumber}} + 不限购 + {{item.ticketNumber}}张券 + + + + + + 仅剩: + + {{ item.timeData.days }} + + 天 + + {{ item.timeData.hours >= 10 ? item.timeData.hours :'0' +item.timeData.hours}} + + : + + {{ item.timeData.minutes }} + + : + + {{ item.timeData.seconds }} + + + + + + + + 即将开始: + + {{ item.timeData.days }} + + 天 + + {{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}} + + : + + {{ item.timeData.minutes }} + + : + + {{ item.timeData.seconds }} + + + + + + + + ¥{{ item.money }} + + 马上抢 + 已结束 + + + + + + + ● + + + + + + + + + + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-tabbar.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-tabbar.vue index 7075f4b1..7047349b 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-tabbar.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-tabbar.vue @@ -28,22 +28,13 @@ }; }, created() { - //#ifdef H5 - this.$nextTick(() => { - this.searchTop = this.$refs.tabBar.$el.offsetTop - 52; - }) - // #endif this.searchStyle() }, mounted() { - // #ifdef H5 - window.addEventListener('scroll', this.handleScroll) - // #endif }, methods: { searchStyle() { this.$store.commit('searchStyle', this.coreshopdata.parameters.style) - // console.log(this.data.parameters.style) }, handleScroll() { this.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-textarea.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-textarea.vue index 479e646c..da330fc7 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-textarea.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-textarea.vue @@ -1,6 +1,6 @@ - - + + @@ -10,20 +10,12 @@ components: { coreshopContent }, - name: "coreshoptextarea", + name: "coreshopTextArea", props: { - coreshopdata: { + coreshopData: { // type: Object, required: true, } - }, - created() { - }, - onLoad() { - - }, - methods: { - } } diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-video.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-video.vue index b3ba070b..8dbf7139 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-video.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-page/coreshop-video.vue @@ -1,14 +1,14 @@ - + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-share-wx/coreshop-share-wx.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-share-wx/coreshop-share-wx.vue index 81d8c567..5297ea64 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-share-wx/coreshop-share-wx.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-share-wx/coreshop-share-wx.vue @@ -96,8 +96,8 @@ params: { goodsId: this.goodsId }, - type: 3,//海报 - client: 2 //终端 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { @@ -112,31 +112,43 @@ goodsId: this.goodsId, teamId: this.teamId }, - type: 3,//海报 - client: 2 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { data.token = userToken } - console.log(data); } - else if (this.shareType == this.$globalConstVars.shareType.group || this.shareType == this.$globalConstVars.shareType.seckill) { + else if (this.shareType == this.$globalConstVars.shareType.group) { data = { page: this.shareType, url: this.$globalConstVars.shareUrl, params: { - goodsId: this.goodsId, groupId: this.groupId }, - type: 3,//海报 - client: 2 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram + } + let userToken = this.$db.get('userToken') + if (userToken) { + data.token = userToken + } + } + else if (this.shareType == this.$globalConstVars.shareType.seckill) { + data = { + page: this.shareType, + url: this.$globalConstVars.shareUrl, + params: { + groupId: this.groupId + }, + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { data.token = userToken } - console.log(data); } else if (this.shareType == this.$globalConstVars.shareType.goods) { data = { @@ -145,14 +157,13 @@ params: { goodsId: this.goodsId, }, - type: 3,//海报 - client: 2 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { data.token = userToken } - console.log(data); } else if (this.shareType == this.$globalConstVars.shareType.addPinTuan) { data = { @@ -163,14 +174,13 @@ groupId: this.groupId, teamId: this.teamId }, - type: 3,//海报 - client: 2 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { data.token = userToken } - console.log(data); } else if (this.shareType == this.$globalConstVars.shareType.solitaire) { data = { page: this.shareType, @@ -178,8 +188,22 @@ params: { id: this.objectId }, - type: 3,//海报 - client: 2 + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram + } + let userToken = this.$db.get('userToken') + if (userToken) { + data.token = userToken + } + } else if (this.shareType == this.$globalConstVars.shareType.serviceGoods) { + data = { + page: this.shareType, + url: this.$globalConstVars.shareUrl, + params: { + serviceGoodsId: this.objectId + }, + type: this.$globalConstVars.shareModel.poster, + client: this.$globalConstVars.shareClient.wxMiNiProgram } let userToken = this.$db.get('userToken') if (userToken) { @@ -191,7 +215,10 @@ uni.hideLoading(); if ( this.shareType == this.$globalConstVars.shareType.goods || - this.shareType == this.$globalConstVars.shareType.pinTuan + this.shareType == this.$globalConstVars.shareType.pinTuan || + this.shareType == this.$globalConstVars.shareType.seckill || + this.shareType == this.$globalConstVars.shareType.group || + this.shareType == this.$globalConstVars.shareType.serviceGoods ) { //data.posterUrl = encodeURIComponent(res.data); data.params.posterUrl = res.data; diff --git a/CoreCms.Net.Uni-App/CoreShop/components/fy-dropdown/fy-dropdown.vue b/CoreCms.Net.Uni-App/CoreShop/components/fy-dropdown/fy-dropdown.vue index 7eea62a2..dc3a506d 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/fy-dropdown/fy-dropdown.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/fy-dropdown/fy-dropdown.vue @@ -205,16 +205,7 @@ }); // #endif - // #ifdef H5 - uni.createSelectorQuery().in(this).select('#fy_dropdown__menu').boundingClientRect().exec(rect => { - const data = rect[0]; - const top = data.top + this.titleHeight + this.H5NavBarHeight + 'px'; - this.maskClass.top = top; - this.transClass.top = top; - }); - // #endif - - // #ifndef APP-NVUE || H5 + // #ifndef APP-NVUE uni.createSelectorQuery().in(this).select('.fy_dropdown__menu').boundingClientRect(rect => { const top = rect.top + this.titleHeight + 'px'; this.maskClass.top = top; diff --git a/CoreCms.Net.Uni-App/CoreShop/main.js b/CoreCms.Net.Uni-App/CoreShop/main.js index 9e7aa684..0d58b4b1 100644 --- a/CoreCms.Net.Uni-App/CoreShop/main.js +++ b/CoreCms.Net.Uni-App/CoreShop/main.js @@ -9,9 +9,6 @@ import * as Db from '@/common/utils/dbHelper.js' //全局常量配置 import * as GlobalConstVars from '@/common/setting/constVarsHelper.js' -//全局常量配置 -import * as CoreTheme from '@/common/setting/coreThemeHelper.js' - import store from '@/common/store' //引入全局uView @@ -44,7 +41,6 @@ Vue.prototype.$upload = Upload; Vue.prototype.$common = Common; Vue.prototype.$db = Db; Vue.prototype.$globalConstVars = GlobalConstVars; -Vue.prototype.$coreTheme = CoreTheme; Vue.prototype.$store = store; diff --git a/CoreCms.Net.Uni-App/CoreShop/manifest.json b/CoreCms.Net.Uni-App/CoreShop/manifest.json index b0ee0991..4b0686c0 100644 --- a/CoreCms.Net.Uni-App/CoreShop/manifest.json +++ b/CoreCms.Net.Uni-App/CoreShop/manifest.json @@ -1,182 +1,179 @@ { - "name": "南山田舍", - "appid": "__UNI__EAACF14", - "description": "核心商城系统(CoreShop)是基于uni-app框架开发的商城应用程序", - "versionName": "1.0", - "versionCode": 1, - "transformPx": false, - "app-plus": { - /* 5+App特有相关 */ - "modules": { - "Payment": {}, - "VideoPlayer": {}, - "Maps": {} - }, - /* 模块配置 */ - "distribute": { - /* 应用发布信息 */ - "android": { - /* android打包配置 */ - "permissions": [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ], - "abiFilters": [ "armeabi-v7a", "arm64-v8a", "x86" ] - }, - "ios": {}, - /* ios打包配置 */ - "sdkConfigs": { - "payment": { - "weixin": { - "appid": "wx11d95cdaee6058f6" - } + "name" : "核心商城系统", + "appid" : "__UNI__EAACF14", + "description" : "核心商城系统(CoreShop)是基于uni-app框架开发的商城应用程序", + "versionName" : "1.0", + "versionCode" : 1, + "transformPx" : false, + "app-plus" : { + /* 5+App特有相关 */ + "modules" : { + "Payment" : {}, + "VideoPlayer" : {}, + "Maps" : {} }, - "ad": {}, - "maps": { - "amap": { - "appkey_ios": "91b94ecb48605c4e048aa1971459eca7", - "appkey_android": "91b94ecb48605c4e048aa1971459eca7" - } + /* 模块配置 */ + "distribute" : { + /* 应用发布信息 */ + "android" : { + /* android打包配置 */ + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ], + "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ] + }, + "ios" : {}, + /* ios打包配置 */ + "sdkConfigs" : { + "payment" : { + "weixin" : { + "appid" : "wx11d95cdaee6058f6" + } + }, + "ad" : {}, + "maps" : { + "amap" : { + "appkey_ios" : "91b94ecb48605c4e048aa1971459eca7", + "appkey_android" : "91b94ecb48605c4e048aa1971459eca7" + } + }, + "oauth" : { + "univerify" : {} + }, + "share" : {} + }, + "icons" : { + "android" : { + "hdpi" : "", + "xhdpi" : "", + "xxhdpi" : "", + "xxxhdpi" : "" + }, + "ios" : { + "appstore" : "", + "ipad" : { + "app" : "", + "app@2x" : "", + "notification" : "", + "notification@2x" : "", + "proapp@2x" : "", + "settings" : "", + "settings@2x" : "", + "spotlight" : "", + "spotlight@2x" : "" + }, + "iphone" : { + "app@2x" : "", + "app@3x" : "", + "notification@2x" : "", + "notification@3x" : "", + "settings@2x" : "", + "settings@3x" : "", + "spotlight@2x" : "", + "spotlight@3x" : "" + } + } + } }, - "oauth": { - "univerify": {} - }, - "share": {} - }, - "icons": { - "android": { - "hdpi": "unpackage/res/icons/72x72.png", - "xhdpi": "unpackage/res/icons/96x96.png", - "xxhdpi": "unpackage/res/icons/144x144.png", - "xxxhdpi": "unpackage/res/icons/192x192.png" - }, - "ios": { - "appstore": "unpackage/res/icons/1024x1024.png", - "ipad": { - "app": "unpackage/res/icons/76x76.png", - "app@2x": "unpackage/res/icons/152x152.png", - "notification": "unpackage/res/icons/20x20.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "proapp@2x": "unpackage/res/icons/167x167.png", - "settings": "unpackage/res/icons/29x29.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "spotlight": "unpackage/res/icons/40x40.png", - "spotlight@2x": "unpackage/res/icons/80x80.png" - }, - "iphone": { - "app@2x": "unpackage/res/icons/120x120.png", - "app@3x": "unpackage/res/icons/180x180.png", - "notification@2x": "unpackage/res/icons/40x40.png", - "notification@3x": "unpackage/res/icons/60x60.png", - "settings@2x": "unpackage/res/icons/58x58.png", - "settings@3x": "unpackage/res/icons/87x87.png", - "spotlight@2x": "unpackage/res/icons/80x80.png", - "spotlight@3x": "unpackage/res/icons/120x120.png" - } + "splashscreen" : { + "waiting" : true } - } }, - "splashscreen": { - "waiting": true - } - }, - /* SDK配置 */ - "quickapp": {}, - /* 快应用特有相关 */ - "mp-weixin": { - "appid": "wx6fc139d4de0b470f", - "setting": { - "urlCheck": true, - "postcss": true, - "minified": true, - "es6": true, - "checkSiteMap": false + /* SDK配置 */ + "quickapp" : {}, + /* 快应用特有相关 */ + "mp-weixin" : { + "appid" : "wx6fc139d4de0b470f", + "setting" : { + "urlCheck" : true, + "postcss" : true, + "minified" : true, + "es6" : true, + "checkSiteMap" : false + }, + "plugins" : { + "chooseLocation" : { + "version" : "1.0.9", + "provider" : "wx76a9a06e5b4e693e" + } + }, + "permission" : { + "scope.userLocation" : { + "desc" : "你的位置信息将用于小程序定位" + } + }, + "optimization" : { + "subPackages" : true + }, + "requiredPrivateInfos" : [ "getLocation", "chooseAddress" ] }, - "plugins": { - "chooseLocation": { - "version": "1.0.9", - "provider": "wx76a9a06e5b4e693e" - } - }, - "permission": { - "scope.userLocation": { - "desc": "你的位置信息将用于小程序定位" - } - }, - "optimization": { - "subPackages": true - }, - "requiredPrivateInfos": [ - "getLocation", - "chooseAddress" - ] - }, - "h5": { - "title": "南山田舍", - "domain": "https://h5.coreshop.coreshop.net", - "router": { - "base": "./", - "mode": "hash" - }, - "template": "index.html", - "devServer": { - "port": 80, - "disableHostCheck": true, - "https": true - }, - "sdkConfigs": { - "maps": { - "qqmap": { - "key": "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33" + "h5" : { + "title" : "南山田舍", + "domain" : "https://h5.coreshop.coreshop.net", + "router" : { + "base" : "./", + "mode" : "hash" + }, + "template" : "index.html", + "devServer" : { + "port" : 80, + "disableHostCheck" : true, + "https" : true + }, + "sdkConfigs" : { + "maps" : { + "qqmap" : { + "key" : "AEIBZ-H5TRI-A6VGA-5KRNA-QKKK6-JGB33" + } + } + }, + "optimization" : { + "treeShaking" : { + "enable" : false + } } - } }, - "optimization": { - "treeShaking": { - "enable": false - } - } - }, - "mp-toutiao": { - "setting": { - "es6": true, - "postcss": true, - "minified": true + "mp-toutiao" : { + "setting" : { + "es6" : true, + "postcss" : true, + "minified" : true + }, + "appid" : "" }, - "appid": "" - }, - "mp-qq": { - "setting": { - "es6": true, - "postcss": true, - "minified": true + "mp-qq" : { + "setting" : { + "es6" : true, + "postcss" : true, + "minified" : true + }, + "optimization" : { + "subPackages" : true + } }, - "optimization": { - "subPackages": true - } - }, - "mp-alipay": {}, - "mp-baidu": {} + "mp-alipay" : {}, + "mp-baidu" : {} } diff --git a/CoreCms.Net.Uni-App/CoreShop/pages.json b/CoreCms.Net.Uni-App/CoreShop/pages.json index bddfacd6..78eb5461 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages.json +++ b/CoreCms.Net.Uni-App/CoreShop/pages.json @@ -195,13 +195,6 @@ "navigationBarTitleText": "支付" } }, - { - "path": "waiting/waiting", - "style": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "等待支付" - } - }, { "path": "result/result", "style": { diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/checkIn/checkIn/checkIn.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/checkIn/checkIn/checkIn.vue index 8965ce90..0ca47b1e 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/checkIn/checkIn/checkIn.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/checkIn/checkIn/checkIn.vue @@ -82,7 +82,7 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/list/list.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/list/list.vue index 3b6e4db7..daadd6e0 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/list/list.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/list/list.vue @@ -17,36 +17,36 @@ 爆款推荐 省钱省心限时拼 - - + + TOP{{ index + 1 }} - + - - {{ item.pinTuanRule.name }} - {{ item.name }} + + {{ item.name }} + {{ item.goodName }} - - - + 已拼{{item.buyPinTuanCount}}单 + 已售{{item.pinTuanRecordNums}}{{item.goodUnit}} + {{item.peopleNumber}}人团 ¥{{ item.pinTuanPrice }} - ¥{{ item.price }} + ¥{{ item.mktPrice }} - 马上拼 + 马上拼 - - - - - + + + + + @@ -62,7 +62,9 @@ export default { data() { return { - goodsList: [], + page: 1, + limit: 10, + list: [], status: 'loadmore', iconType: 'flower', loadText: { @@ -72,12 +74,41 @@ } }; }, - //加载执行 - onShow: function () { - _this = this - _this.getGoods(); + onLoad() { + this.getPinTuanlist() + }, + onShow() { + }, + onReachBottom() { + if (this.status === 'loadmore') { + this.getPinTuanlist() + } }, methods: { + getPinTuanlist() { + let _this = this; + let data = { + page: this.page, + limit: this.limit + } + this.status = 'loading' + this.$u.api.pinTuanList(data).then(res => { + if (res.status) { + if (res.data) { + let _list = res.data + this.list = [...this.list, ..._list] + } + if (res.code >= _this.list.length) { + _this.page++ + _this.status = 'loadmore' + } else { + _this.status = 'nomore' + } + } else { + _this.$u.toast(res.msg) + } + }) + }, //取得列表数据 getGoods: function () { uni.showLoading({ @@ -93,7 +124,7 @@ if (item.pinTuanPrice <= 0) { item.pinTuanPrice = '0.00'; } else { - item.pinTuanPrice = _this.$common.moneySub(item.price, item.pinTuanRule.discountAmount); + item.pinTuanPrice = parseFloat(item.price - item.pinTuanRule.discountAmount).toFixed(2); } }); } diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/details.scss b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/details.scss index bdff3fd9..c8636c30 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/details.scss +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/details.scss @@ -1,7 +1,7 @@ .groupHeight { height: 61px !important; } .group-swiper-c { height: 121px; } - .group-swiper-c .swiper-item .coreshop-cell-item { height: 50%; } + .group-swiper-c .swiper-item .coreshop-cell-item { height: 50%; padding: 10px 0px; } .group-swiper-c .swiper-item .coreshop-cell-item .user-head-img { width: 40px; height: 40px; border-radius: 50%; } .group-swiper-c .swiper-item .coreshop-cell-item .coreshop-cell-hd-title { max-width: 100px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; } .group-swiper-c .swiper-item .coreshop-cell-item .coreshop-cell-item-bd { min-width: 75px; text-align: center; display: block; } @@ -33,3 +33,8 @@ .coreshop-lower-shelf .coreshop-cell-item-bd { opacity: 0.4; } .coreshop-lower-shelf .coreshop-cell-item-ft { opacity: 0.4; } .coreshop-lower-shelf .coreshop-lower-box { position: absolute; height: calc(100% - 20px); width: calc(100% - 10px); background-color: rgba(0, 0, 0, 0.6); text-align: center; font-size: 14px; color: #dedede; -webkit-transition: left .15s; transition: left .15s; z-index: 999; -webkit-transition: all .15s; transition: all .15s; line-height: 40px; } + + +.u-count-down { + .u-count-down__text { font-size: 12px; } +} diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails.vue index 8177e1c4..ef6299c7 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails.vue @@ -5,9 +5,7 @@ - - - + @@ -24,7 +22,7 @@ ¥ {{ price || '0.00' }} - + @@ -34,7 +32,7 @@ 天 - {{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} + {{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}} : @@ -56,7 +54,7 @@ 天 - {{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} + {{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}} : @@ -70,12 +68,7 @@ - - - - - {{ goodsInfo.name || '' }} @@ -94,12 +87,11 @@ {{ goodsInfo.buyPinTuanCount || '0' }} - 累计销售: - {{ goodsInfo.buyCount || '0' }} + - 库存: - {{product.stock}} + + @@ -140,76 +132,70 @@ 开团信息 - - - - - {{ teamCount || '0' }}人在拼单,可直接参与 - - - - - - - - 已结束 - - - {{ item[0].nickName || '' }} - - - - - 还差 - {{ item[0].teamNums || '' }}人 - 拼成 - - - - 剩余: - - - - - 去拼单 - 已结束 - - - - 已结束 - - - {{ item[1].nickName || '' }} - - - - - 还差 - {{ item[1].teamNums || '' }}人 - 拼成 - - - - - 剩余: - - - - - - 去拼单 - 已结束 - - - - - + + + + {{ teamCount || '0' }}人在拼单,可直接参与 - - - 暂无开团信息 - + + + + + + + + + 还差 + {{ item[0].teamNums || '' }}人 + 拼成 + + + + 剩余: + + + + 已结束 + + + + + 去拼单 + 已结束 + + + + + + + 还差 + {{ item[1].teamNums || '' }}人 + 拼成 + + + + 剩余: + + + + 已结束 + + + + + 去拼单 + 已结束 + + + + + + + + + + 暂无开团信息 @@ -306,7 +292,7 @@ 还差 - {{ teamInfo.teamNums || '' }} + {{ teamInfo.teamNums || '' }} 人,赶快拼单吧 参与拼团 @@ -317,9 +303,6 @@ - - - @@ -378,7 +361,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -415,7 +398,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -440,7 +423,7 @@ - + @@ -533,7 +516,7 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/seckill/seckillDetails/seckillDetails.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/seckill/seckillDetails/seckillDetails.vue index a29647ba..abcbb465 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/seckill/seckillDetails/seckillDetails.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/seckill/seckillDetails/seckillDetails.vue @@ -6,8 +6,6 @@ - - @@ -24,7 +22,7 @@ ¥ {{ product.price || '0.00' }} - + @@ -34,7 +32,7 @@ 天 - {{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} + {{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}} : @@ -48,10 +46,6 @@ - - - - {{ goodsInfo.name || '' }} @@ -66,17 +60,16 @@ - - 运费: - 包邮 - 销量: - {{ goodsInfo.buyCount || '0' }} + {{ goodsInfo.buyCount || '0' }} - 库存: - {{product.stock}} + + + + + @@ -201,14 +194,11 @@ - - - - + - + @@ -261,7 +251,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -298,7 +288,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price - item.pointsDeduction).toFixed(2)}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -357,7 +347,7 @@ - + @@ -378,11 +368,6 @@ - 立即秒杀 @@ -407,7 +392,7 @@ - diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue b/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue index 03b4acd8..66286a61 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/payment/components/coreshop-paymentsByWx.vue @@ -13,7 +13,7 @@ 当前余额:{{userInfo.balance}}元 - + {{item.memo}} @@ -39,7 +39,7 @@ - - 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 f63e527c..b09afc11 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/index/index.vue @@ -119,7 +119,7 @@ ({{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.products.pointsDeduction }}{{ pointShowName}}+{{ item.products.price - item.products.pointsDeduction}}元 + {{pointDiscountedProportion * item.products.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.products.price - item.products.pointsDeduction).toFixed(2)}}元 ) @@ -133,7 +133,7 @@ {{ pointShowName}}兑换价合计: - {{pointDiscountedProportion * item.products.pointsDeduction * item.nums }}{{ pointShowName}}+{{(item.products.price - item.products.pointsDeduction)*item.nums }}元 + {{pointDiscountedProportion * item.products.pointsDeduction * item.nums }}{{ pointShowName}}+{{parseFloat((item.products.price - item.products.pointsDeduction)*item.nums).toFixed(2) }}元 @@ -354,18 +354,16 @@ onLoad(options) { var _this = this; //下单前置检查,自定义交易组件检测场景是否需要推送订单到微信服务。 - // #ifdef H5|APP-PLUS|APP-PLUS-NVUE + // #ifdef APP-PLUS|APP-PLUS-NVUE _this.getOrderDistributionModel() // #endif // #ifdef MP wx.checkBeforeAddOrder({ success(res) { - console.log('下单前置检查', res); if (res.errMsg == 'checkBeforeAddOrder:ok') { _this.requireOrder = res.data.requireOrder; _this.requiredFundType = res.data.requiredFundType; _this.traceId = res.data.traceId; - // 获取不同类型营销下单支持的配送方式 _this.getOrderDistributionModel() } @@ -429,7 +427,7 @@ this.$db.del('userStore', true); } // #endif - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE + // #ifdef APP-PLUS || APP-PLUS-NVUE let userShip = this.$store.state.userShip; if (userShip) { this.userShip = userShip; @@ -781,9 +779,6 @@ data['taxType'] = this.invoice.type data['taxName'] = this.invoice.name data['taxCode'] = this.invoice.code - // #ifdef H5 - data['source'] = 2; - // #endif // #ifdef MP-WEIXIN data['source'] = 3; // #endif @@ -818,7 +813,6 @@ }, //发起订阅 subscription() { - let _this = this; this.$u.api.getSubscriptionTmplIds(null).then(res => { if (res.status) { console.log(res.data); @@ -857,7 +851,6 @@ // 获取默认店铺 getDefaultStore() { if (this.storeSwitch == 1) { - console.log("获取默认店铺"); this.$u.api.defaultStore().then(res => { if (res.status) { if (res.data && res.data.id) { diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/invoice/invoice.vue b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/invoice/invoice.vue index 331dafd2..878f32d6 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/invoice/invoice.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/invoice/invoice.vue @@ -113,7 +113,7 @@ let pre = pages[pages.length - 2] console.log(pre); if (pre != undefined) { - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE + // #ifdef APP-PLUS || APP-PLUS-NVUE invoice = pre.invoice // #endif // #ifdef MP-WEIXIN @@ -193,7 +193,7 @@ // #ifdef MP-WEIXIN beforePage.$vm.invoice = data; // #endif - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE + // #ifdef APP-PLUS || APP-PLUS-NVUE // beforePage.invoice = data; this.$store.commit('invoice', data) // #endif diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/storeList/storeList.vue b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/storeList/storeList.vue index b4daf07e..a37a7242 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/storeList/storeList.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/placeOrder/storeList/storeList.vue @@ -90,6 +90,10 @@ _this.latitude = res.latitude; }, complete: function (res) { + if (!_this.longitude || !_this.latitude) { + _this.longitude = '0'; + _this.latitude = '0'; + } let data = { 'key': _this.key, 'longitude': _this.longitude, @@ -126,7 +130,7 @@ pre.$vm.store = store // #endif - // #ifdef H5 || APP-PLUS || APP-PLUS-NVUE + // #ifdef APP-PLUS || APP-PLUS-NVUE pre.store = store // #endif diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/details/details.vue b/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/details/details.vue index 25ec37d2..1f1cffa4 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/details/details.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/details/details.vue @@ -7,13 +7,15 @@ + + - + @@ -23,8 +25,8 @@ {{ info.money || '0.00' }} - - + + 仅剩: @@ -32,7 +34,7 @@ 天 - {{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} + {{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}} : @@ -45,16 +47,16 @@ - - + + - 仅剩: + 即将开始: {{ timeData.days }} 天 - {{ timeData.hours>10?timeData.hours:'0'+timeData.hours}} + {{ timeData.hours>=10?timeData.hours:'0'+timeData.hours}} : @@ -67,7 +69,7 @@ - 已结束 + 已结束 @@ -174,7 +176,6 @@ - {{item.name}} @@ -192,7 +193,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -211,7 +212,6 @@ - {{item.name}} @@ -229,7 +229,7 @@ {{ pointShowName}}兑换价: - {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ item.price - item.pointsDeduction}}元 + {{pointDiscountedProportion * item.pointsDeduction }}{{ pointShowName}}+{{ parseFloat(item.price,item.pointsDeduction).toFixed(2)}} 元 @@ -247,6 +247,18 @@ + + + + + + + + + + + + @@ -255,7 +267,7 @@ - + @@ -271,7 +283,7 @@ - 立刻购买 + 立刻购买 @@ -282,17 +294,23 @@ diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.scss b/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.scss deleted file mode 100644 index 8491aa16..00000000 --- a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.scss +++ /dev/null @@ -1,7 +0,0 @@ -.cell { margin-top: 0; min-height: 30px; line-height: 30px; } -.order .top .left .store { margin: 0 5px; font-size: 14px; font-weight: normal; } -.order .bottom { margin-top: 0px; } - -.order .bottom2 { display: flex; margin-top: 10px; padding: 0 5px; justify-content: space-between; align-items: center; } - .order .bottom2 .coreshop-btn { line-height: 26px; width: 80px; border-radius: 13px; border: 1px solid $u-border-color; font-size: 13px; text-align: center; color: $u-type-info-dark; } - .order .bottom2 .evaluate { color: $u-type-warning-dark; border-color: $u-type-warning-dark; } diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.vue index 36afb773..e7fa9b27 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/serviceGoods/index/index.vue @@ -11,33 +11,19 @@ - - - - - - - - - - - - 仅剩{{item.amount}} - - + + - + {{item.title}} - {{item.description}} + {{item.description}} {{ item.money }} 最大购买限制:{{item.maxBuyNumber== 0 ? '不限' : item.maxBuyNumber}} - 兑换级别: @@ -52,12 +38,61 @@ {{item}} - - - 购买截止:{{ item.endTime }} + + + + + 仅剩时间: + + {{ item.timeData.days }} + + 天 + + {{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}} + + : + + {{ item.timeData.minutes }} + + : + + {{ item.timeData.seconds }} + + + - - 立刻抢购 + + + + 距离开始: + + {{ item.timeData.days }} + + 天 + + {{ item.timeData.hours>=10?item.timeData.hours:'0'+item.timeData.hours}} + + : + + {{ item.timeData.minutes }} + + : + + {{ item.timeData.seconds }} + + + + + + + 活动已结束 + + + + 活动已结束 + + + 立刻抢购 @@ -126,10 +161,15 @@ } }) }, + onChange(e, key) { + this.$set(this.list[key], 'timeData', e) + }, } }; diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/share/jump/jump.vue b/CoreCms.Net.Uni-App/CoreShop/pages/share/jump/jump.vue index 7fdc103e..17775e2a 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/share/jump/jump.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/share/jump/jump.vue @@ -36,7 +36,7 @@ break; //拼团 case _this.$globalConstVars.shareType.pinTuan: - _this.gotoPinTuan(res.data.params.groupId, res.data.params.goodsId, res.data.params.teamId) + _this.gotoPinTuan(res.data.params.groupId, res.data.params.teamId) break; //店铺邀请 case _this.$globalConstVars.shareType.inv: @@ -48,7 +48,7 @@ break; //参团页面 case _this.$globalConstVars.shareType.addPinTuan: - _this.gotoInvitationGroup(res.data.params.groupId, res.data.params.goodsId, res.data.params.teamId) + _this.gotoInvitationGroup(res.data.params.groupId, res.data.params.teamId) break; //自定义页面 case _this.$globalConstVars.shareType.page: @@ -60,11 +60,11 @@ break; //团购 case _this.$globalConstVars.shareType.group: - _this.gotoGroup(res.data.params.goodsId, res.data.params.groupId); + _this.gotoGroup(res.data.params.groupId); break; //秒杀 case _this.$globalConstVars.shareType.seckill: - _this.gotoSeckill(res.data.params.goodsId, res.data.params.groupId); + _this.gotoSeckill(res.data.params.groupId); break; //代理商 case _this.$globalConstVars.shareType.agent: @@ -74,6 +74,10 @@ case _this.$globalConstVars.shareType.solitaire: _this.gotoSolitaire(res.data.params.id); break; + //接龙 + case _this.$globalConstVars.shareType.serviceGoods: + _this.gotoServiceGoods(res.data.params.serviceGoodsId); + break; default: _this.gotoIndex(); break; @@ -130,15 +134,14 @@ } }, //跳转到拼团 - gotoPinTuan(groupId, goodsId, teamId) { - if (groupId && goodsId && teamId) { + gotoPinTuan(groupId, teamId) { + if (groupId && teamId) { uni.$u.route({ url: '/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', type: 'redirectTo', params: { - id: goodsId, + id: groupId, teamId: teamId, - pinTuanId: groupId, } }) } else { @@ -146,15 +149,14 @@ } }, //跳转到参团 - gotoInvitationGroup(groupId, goodsId, teamId) { - if (groupId && goodsId && teamId) { + gotoInvitationGroup(groupId, teamId) { + if (groupId && teamId) { uni.$u.route({ url: '/pages/activity/pinTuan/pinTuanDetails/pinTuanDetails', type: 'redirectTo', params: { - id: goodsId, + id: groupId, teamId: teamId, - pinTuanId: groupId, } }) } else { @@ -162,14 +164,13 @@ } }, //跳转到团购 - gotoGroup(id, groupId) { - if (id && groupId) { + gotoGroup(id) { + if (id) { uni.$u.route({ url: '/pages/activity/groupBuying/groupBuyingDetails/groupBuyingDetails', type: 'redirectTo', params: { id: id, - groupId: groupId } }) } else { @@ -177,14 +178,13 @@ } }, //跳转到秒杀 - gotoSeckill(id, groupId) { - if (id && groupId) { + gotoSeckill(id) { + if (id) { uni.$u.route({ url: '/pages/activity/seckill/seckillDetails/seckillDetails', type: 'redirectTo', params: { id: id, - groupId: groupId } }) } else { @@ -260,6 +260,20 @@ } else { _this.gotoIndex(); } + }, + //跳转服务商品 + gotoServiceGoods(id) { + if (id) { + uni.$u.route({ + url: '/pages/serviceGoods/details/details', + type: 'redirectTo', + params: { + id: id + } + }) + } else { + _this.gotoIndex(); + } } } }; diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/share/shareNewPoster/shareNewPoster.vue b/CoreCms.Net.Uni-App/CoreShop/pages/share/shareNewPoster/shareNewPoster.vue index 87dd0038..3676e6b1 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/share/shareNewPoster/shareNewPoster.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/share/shareNewPoster/shareNewPoster.vue @@ -26,13 +26,17 @@ - + + + + + @@ -49,10 +53,7 @@ - - - - + @@ -86,8 +87,13 @@ endTime: '', peopleNumber: 0, }, + groupPurchaseSeckill: { + endTime: '', + }, + }, - showPinTuanArguments: false + showPinTuanArguments: false, + showGroupPurchaseSeckillArguments: false }; }, onLoad(options) { @@ -161,12 +167,117 @@ }) } }) + } else if (options.shareType == _this.$globalConstVars.shareType.serviceGoods) { + let data = { + id: parseInt(options.serviceGoodsId), + data: false, + } + _this.$u.api.getServiceDetail(data).then(res => { + if (res.status == true) { + console.log(res.data); + _this.showModel.describe = "为您推荐了一个服务商品"; + _this.showModel.image = res.data.thumbnail; + _this.showModel.brief = res.data.description; + _this.showModel.name = res.data.title; + _this.showModel.price = res.data.money; + _this.showModel.mktprice = res.data.mktprice; + + setTimeout(function () { + _this.canvasToTempFilePath(); + uni.hideLoading(); + }, 1000); + + } else { + _this.$refs.uToast.show({ + message: res.msg, type: 'error', complete: function () { + uni.navigateBack({ + delta: 1 + }); + } + }) + } + }) + + } else if (options.shareType == _this.$globalConstVars.shareType.seckill) { + let data = { + id: parseInt(options.groupId), + type: _this.$globalConstVars.shareType.seckill, + needSku: true + } + let userToken = this.$db.get('userToken'); + if (userToken) { + data.token = userToken + } + _this.$u.api.groupInfo(data).then(res => { + if (res.status == true) { + console.log(res.data); + _this.showModel.describe = "为您推荐了一个秒杀"; + _this.showModel.image = res.data.image; + _this.showModel.brief = res.data.brief; + _this.showModel.name = res.data.name; + _this.showModel.price = res.data.price; + _this.showModel.mktprice = res.data.mktprice; + + _this.showGroupPurchaseSeckillArguments = true; + _this.showModel.groupPurchaseSeckill.endTime = res.data.groupEndTime; + + setTimeout(function () { + _this.canvasToTempFilePath(); + uni.hideLoading(); + }, 1000); + + } else { + _this.$refs.uToast.show({ + message: res.msg, type: 'error', complete: function () { + uni.navigateBack({ + delta: 1 + }); + } + }) + } + }) + } else if (options.shareType == _this.$globalConstVars.shareType.group) { + let data = { + id: parseInt(options.groupId), + type: _this.$globalConstVars.shareType.seckill, + needSku: true + } + let userToken = this.$db.get('userToken'); + if (userToken) { + data.token = userToken + } + _this.$u.api.groupInfo(data).then(res => { + if (res.status == true) { + console.log(res.data); + _this.showModel.describe = "为您推荐了一个团购"; + _this.showModel.image = res.data.image; + _this.showModel.brief = res.data.brief; + _this.showModel.name = res.data.name; + _this.showModel.price = res.data.price; + _this.showModel.mktprice = res.data.mktprice; + + _this.showGroupPurchaseSeckillArguments = true; + _this.showModel.groupPurchaseSeckill.endTime = res.data.groupEndTime; + + setTimeout(function () { + _this.canvasToTempFilePath(); + uni.hideLoading(); + }, 1000); + + } else { + _this.$refs.uToast.show({ + message: res.msg, type: 'error', complete: function () { + uni.navigateBack({ + delta: 1 + }); + } + }) + } + }) + } }, computed: { - weiXinBrowser() { - return this.$common.isWeiXinBrowser() - } }, methods: { canvasToTempFilePath() { @@ -190,10 +301,6 @@ // 保存海报到本地 savePoster() { let _this = this; - // #ifdef H5 - _this.downloadIamge(_this.path, 'image'); - // #endif - // #ifdef MP || MP-ALIPAY || APP-PLUS || APP-PLUS-NVUE _this.downloadImageOfMp(_this.path) // #endif diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/share/sharePoster/sharePoster.vue b/CoreCms.Net.Uni-App/CoreShop/pages/share/sharePoster/sharePoster.vue index 6217fcb3..d9f5d16a 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/share/sharePoster/sharePoster.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/share/sharePoster/sharePoster.vue @@ -15,10 +15,7 @@ - - - - + @@ -41,9 +38,6 @@ this.poster = decodeURIComponent(options.poster); }, computed: { - weiXinBrowser() { - return this.$common.isWeiXinBrowser() - } }, methods: { goBack() { @@ -54,10 +48,6 @@ // 保存海报到本地 savePoster() { let _this = this; - // #ifdef H5 - _this.downloadIamge(_this.poster, 'image'); - // #endif - // #ifdef MP || MP-ALIPAY || APP-PLUS || APP-PLUS-NVUE _this.downloadImageOfMp(_this.poster) // #endif diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/storeMap/storeMap.scss b/CoreCms.Net.Uni-App/CoreShop/pages/storeMap/storeMap.scss index 0460e3ce..6efcc4cb 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/storeMap/storeMap.scss +++ b/CoreCms.Net.Uni-App/CoreShop/pages/storeMap/storeMap.scss @@ -1,4 +1,4 @@ -.content { width: 100%; /* #ifdef H5 */ height: calc(100vh - 44px); /* #endif */ } +.content { width: 100%; } .map-body { width: 100%; height: 350px; position: relative; } .store-list { background-color: #fff; height: calc(100vh - 44px - 350px); .coreshop-list-item { height: 80px; diff --git a/CoreCms.Net.Uni-App/CoreShop/static/style/coreCommon.scss b/CoreCms.Net.Uni-App/CoreShop/static/style/coreCommon.scss index 34a16481..fd3a0f0e 100644 --- a/CoreCms.Net.Uni-App/CoreShop/static/style/coreCommon.scss +++ b/CoreCms.Net.Uni-App/CoreShop/static/style/coreCommon.scss @@ -1,5 +1,5 @@ /*page { background: #f6f7f9; }*/ -page, .bg-page, .bg-main { background: #f7f7f7; } +page, .bg-page, .coreshop-bg-main { background: #f7f7f7; } // nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器 @@ -198,8 +198,6 @@ view, text { box-sizing: border-box; } //width:max-content 使用子元素中最大的开你的。无论是inline还是block .coreshop-width-max-content { width: max-content; } - - /*字体高度*/ .coreshop-line-height-initial { line-height: initial } @@ -235,6 +233,7 @@ view, text { box-sizing: border-box; } .coreshop-btn-all { width: 100%; } + .coreshop-border-radius-tr-8 { border-radius: 8rpx 8rpx 0rpx 0rpx; } .coreshop-border-radius-tr-16 { border-radius: 16rpx 16rpx 0rpx 0rpx; } .coreshop-border-radius-tr-18 { border-radius: 18rpx 18rpx 0rpx 0rpx; } @@ -244,6 +243,10 @@ view, text { box-sizing: border-box; } .coreshop-border-radius-bl-24 { border-radius: 0rpx 0rpx 24rpx 24rpx; } .coreshop-border-radius-bl-32 { border-radius: 0rpx 0rpx 32rpx 32rpx; } .coreshop-border-radius-tlb-18-l-4 { border-radius: 18rpx 18rpx 18rpx 4rpx; } + +.coreshop-border-radius-trbl-18 { border-radius: 18rpx 18rpx 18rpx 18rpx; } + + .coreshop-border-none { border: 0; } /*图标大小*/ diff --git a/CoreCms.Net.Uni-App/CoreShop/static/style/style.vue.scss b/CoreCms.Net.Uni-App/CoreShop/static/style/style.app.scss similarity index 91% rename from CoreCms.Net.Uni-App/CoreShop/static/style/style.vue.scss rename to CoreCms.Net.Uni-App/CoreShop/static/style/style.app.scss index 1191b463..3593093e 100644 --- a/CoreCms.Net.Uni-App/CoreShop/static/style/style.vue.scss +++ b/CoreCms.Net.Uni-App/CoreShop/static/style/style.app.scss @@ -712,3 +712,30 @@ u-icon { line-height: 0; } .index-goods .goods { -webkit-column-break-inside: avoid; border-radius: 18rpx; break-inside: avoid; margin-bottom: 24rpx; width: 326rpx; } .coreshop-title-294 { width: 294rpx; } .coreshop-image-price-tags { height: 32rpx; margin-bottom: 4rpx; margin-right: 12rpx; vertical-align: middle; width: 98rpx; } + + + +/*分割线*/ +.coreshop-divider { display: flex; flex-direction: row; flex-direction: row; align-items: center; + .complete { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; margin: 10px 0; } + .groupPurchase, .seckill, .serviceGood { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; margin: 10px 0; } + .left { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; } + .dot { font-size: 12px; margin: 0 12px; color: #c0c4cc; } + .right { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; } +} + + +.coreshop-buy-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #fe832a, #ff6600); box-shadow: 0px 3.5px 3px 0px rgba(221, 185, 184, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-groupPurchase-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #00c78a, #04c668); box-shadow: 0px 3.5px 3px 0px rgba(134, 194, 135, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-seckill-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #ffbd1d, #ff4a09); box-shadow: 0px 3.5px 3px 0px rgba(255, 104, 4, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-solitaire-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #04c668, #13804b); box-shadow: 0px 3.5px 3px 0px rgba(255, 104, 4, 0.22); border-radius: 15px; font-size: 12px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-buy-btn-disabled { width: 70px; height: 24px; background: linear-gradient(180deg,#f8f8f8,#f5f5f5); box-shadow: 0px 3.5px 3px 0px rgba(255, 224, 226, 0.3); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #8799a3; padding: 0; text-align: center; line-height: 24px; border-color: #ebedf0; border-width: 1px; border-style: solid; } + + +.good-tag-hot { display: flex; margin-top: 5px; position: absolute; top: 15rpx; left: 15rpx; background-color: $u-type-error; color: #FFFFFF; display: flex; align-items: center; padding: 4rpx 14rpx; border-radius: 50rpx; font-size: 20rpx; line-height: 1; } +.good-tag-recommend { display: flex; margin-top: 5px; position: absolute; top: 15rpx; right: 15rpx; background-color: $u-type-primary; color: #FFFFFF; margin-left: 10px; border-radius: 50rpx; line-height: 1; padding: 4rpx 14rpx; display: flex; align-items: center; border-radius: 50rpx; font-size: 20rpx; } +.good-tag-recommend2 { display: flex; margin-top: 5px; position: absolute; bottom: 15rpx; left: 15rpx; background-color: $u-type-primary; color: #FFFFFF; border-radius: 50rpx; line-height: 1; padding: 4rpx 14rpx; display: flex; align-items: center; border-radius: 50rpx; font-size: 20rpx; } diff --git a/CoreCms.Net.Uni-App/CoreShop/static/style/style.mp.scss b/CoreCms.Net.Uni-App/CoreShop/static/style/style.mp.scss index e0b25b2a..76a362d9 100644 --- a/CoreCms.Net.Uni-App/CoreShop/static/style/style.mp.scss +++ b/CoreCms.Net.Uni-App/CoreShop/static/style/style.mp.scss @@ -716,8 +716,26 @@ u-icon { line-height: 0; } /*分割线*/ -.coreshop-divider { display: flex; flex-direction: row; flex-direction: row; align-items: center; margin: 5px 0 15px 0; +.coreshop-divider { display: flex; flex-direction: row; flex-direction: row; align-items: center; + .complete { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; margin: 10px 0; } + .groupPurchase, .seckill, .serviceGood { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; margin: 10px 0; } .left { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; } .dot { font-size: 12px; margin: 0 12px; color: #c0c4cc; } .right { margin: 0; border-bottom-width: 1px; border-bottom-style: solid; width: 100%; transform: scaleY(0.5); border-color: #dcdfe6; flex: 1; vertical-align: middle; } -} \ No newline at end of file +} + + +.coreshop-buy-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #fe832a, #ff6600); box-shadow: 0px 3.5px 3px 0px rgba(221, 185, 184, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-groupPurchase-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #00c78a, #04c668); box-shadow: 0px 3.5px 3px 0px rgba(134, 194, 135, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-seckill-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #ffbd1d, #ff4a09); box-shadow: 0px 3.5px 3px 0px rgba(255, 104, 4, 0.22); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-solitaire-btn { width: 70px; height: 24px; background: linear-gradient(90deg, #04c668, #13804b); box-shadow: 0px 3.5px 3px 0px rgba(255, 104, 4, 0.22); border-radius: 15px; font-size: 12px; font-family: PingFang SC; font-weight: 500; color: #fff; padding: 0; text-align: center; line-height: 24px; } + +.coreshop-buy-btn-disabled { width: 70px; height: 24px; background: linear-gradient(180deg,#f8f8f8,#f5f5f5); box-shadow: 0px 3.5px 3px 0px rgba(255, 224, 226, 0.3); border-radius: 15px; font-size: 13px; font-family: PingFang SC; font-weight: 500; color: #8799a3; padding: 0; text-align: center; line-height: 24px; border-color: #ebedf0; border-width: 1px; border-style: solid; } + + +.good-tag-hot { display: flex; margin-top: 5px; position: absolute; top: 15rpx; left: 15rpx; background-color: $u-type-error; color: #FFFFFF; display: flex; align-items: center; padding: 4rpx 14rpx; border-radius: 50rpx; font-size: 20rpx; line-height: 1; } +.good-tag-recommend { display: flex; margin-top: 5px; position: absolute; top: 15rpx; right: 15rpx; background-color: $u-type-primary; color: #FFFFFF; margin-left: 10px; border-radius: 50rpx; line-height: 1; padding: 4rpx 14rpx; display: flex; align-items: center; border-radius: 50rpx; font-size: 20rpx; } +.good-tag-recommend2 { display: flex; margin-top: 5px; position: absolute; bottom: 15rpx; left: 15rpx; background-color: $u-type-primary; color: #FFFFFF; border-radius: 50rpx; line-height: 1; padding: 4rpx 14rpx; display: flex; align-items: center; border-radius: 50rpx; font-size: 20rpx; } \ No newline at end of file diff --git a/CoreCms.Net.Uni-App/CoreShop/static/style/tags.scss b/CoreCms.Net.Uni-App/CoreShop/static/style/tags.scss index 8624c264..62d93af4 100644 --- a/CoreCms.Net.Uni-App/CoreShop/static/style/tags.scss +++ b/CoreCms.Net.Uni-App/CoreShop/static/style/tags.scss @@ -1,6 +1,6 @@ .tag-bangfu { background: #04c668; border-radius: 0rpx 18rpx 0 18rpx; height: 40rpx; line-height: 40rpx; position: absolute; right: 0; text-align: center; top: 0; width: 88rpx; } - +/*对口帮扶底图*/ .tag-duikoubangfu { background: url(data:image/png;base64,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) no-repeat; background-size: 100%; } .tag-duikoubangfu, .tag-hyzx { bottom: 0; height: 46rpx; left: 0; line-height: 46rpx; position: absolute; width: 168rpx; } diff --git a/CoreCms.Net.Web.Admin/Controllers/Article/CoreCmsArticleTypeController.cs b/CoreCms.Net.Web.Admin/Controllers/Article/CoreCmsArticleTypeController.cs index 1922bd3f..e7ba2e9a 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Article/CoreCmsArticleTypeController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Article/CoreCmsArticleTypeController.cs @@ -21,6 +21,7 @@ using CoreCms.Net.Loging; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.UI; +using CoreCms.Net.Services; using CoreCms.Net.Utility.Helper; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; @@ -74,7 +75,7 @@ namespace CoreCms.Net.Web.Admin.Controllers //获取数据 var list = await _coreCmsArticleTypeServices.QueryListByClauseAsync(p => p.id > 0, p => p.sort, - OrderByType.Desc); + OrderByType.Desc, true, true); //返回数据 jm.data = list; jm.code = 0; @@ -132,12 +133,7 @@ namespace CoreCms.Net.Web.Admin.Controllers [Description("创建提交")] public async Task DoCreate([FromBody] CoreCmsArticleType entity) { - var jm = new AdminUiCallBack(); - - var bl = await _coreCmsArticleTypeServices.InsertAsync(entity) > 0; - jm.code = bl ? 0 : 1; - jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure); - + var jm = await _coreCmsArticleTypeServices.InsertAsync(entity); return jm; } #endregion @@ -194,15 +190,13 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } //事物处理过程开始 - oldModel.id = entity.id; + //oldModel.id = entity.id; oldModel.name = entity.name; oldModel.parentId = entity.parentId; oldModel.sort = entity.sort; //事物处理过程结束 - var bl = await _coreCmsArticleTypeServices.UpdateAsync(oldModel); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + jm = await _coreCmsArticleTypeServices.UpdateAsync(oldModel); return jm; } @@ -240,9 +234,7 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } - var bl = await _coreCmsArticleTypeServices.DeleteByIdAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + jm = await _coreCmsArticleTypeServices.DeleteByIdAsync(entity.id); return jm; } diff --git a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs index 6f590bd1..66067f9f 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs @@ -1142,10 +1142,12 @@ namespace CoreCms.Net.Web.Admin.Controllers var jm = new AdminUiCallBack(); var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30); + var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); + var where = PredicateBuilder.True(); var dt = DateTime.Now; - where = where.And(p => p.isEnable == true && p.isDel == false && p.startTime < dt && p.endTime > dt && p.type == (int)GlobalEnumVars.PromotionType.Seckill); + where = where.And(p => p.isEnable == true && p.isDel == false && p.startTime < dt && p.endTime > dt && p.type == id); //促销名称 nvarchar var name = Request.Form["name"].FirstOrDefault(); diff --git a/CoreCms.Net.Web.Admin/appsettings.json b/CoreCms.Net.Web.Admin/appsettings.json index 031def2a..9b35aed5 100644 --- a/CoreCms.Net.Web.Admin/appsettings.json +++ b/CoreCms.Net.Web.Admin/appsettings.json @@ -16,7 +16,7 @@ "AppConfig": { "AppUrl": "https://admin.test.pro.coreshop.cn/", //后端管理地址 "AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址 - "AppVersion": "CoreShopProfessional v0.6.2" + "AppVersion": "CoreShopProfessional v0.6.4" }, //redis为必须启动项,请保持redis为正常可用 "RedisConfig": { diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.css b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.css index 6910b905..d73b816b 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.css +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.css @@ -1045,7 +1045,8 @@ template { #selectGoods li .icon-delete:hover { color: #000; } -#selectGroupPurchaseGoods li { +#selectGroupPurchaseGoods li, +#selectSeckillGoods li { float: left; margin: 10px; height: 100px; @@ -1055,23 +1056,27 @@ template { border-radius: 3px; cursor: move; } -#selectGroupPurchaseGoods li .left { +#selectGroupPurchaseGoods li .left, +#selectSeckillGoods li .left { float: left; width: 170px; height: 90px; } -#selectGroupPurchaseGoods li .left img { +#selectGroupPurchaseGoods li .left img, +#selectSeckillGoods li .left img { width: 170px; height: 90px; object-fit: cover; } -#selectGroupPurchaseGoods li .right { +#selectGroupPurchaseGoods li .right, +#selectSeckillGoods li .right { float: left; width: calc(100% - 180px); height: 90px; margin-left: 10px; } -#selectGroupPurchaseGoods li .icon-delete { +#selectGroupPurchaseGoods li .icon-delete, +#selectSeckillGoods li .icon-delete { position: absolute; top: -6px; right: -6px; @@ -1082,7 +1087,8 @@ template { transition: background-color 0.3s ease-out, border-color 0.3s ease-out; -webkit-transition: background-color 0.3s ease-out, border-color 0.3s ease-out; } -#selectGroupPurchaseGoods li .icon-delete:hover { +#selectGroupPurchaseGoods li .icon-delete:hover, +#selectSeckillGoods li .icon-delete:hover { color: #000; } .divider { diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.less b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.less index 66651d8b..14cdf584 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.less +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.less @@ -289,7 +289,7 @@ template { display: none; } } } } -#selectGroupPurchaseGoods { +#selectGroupPurchaseGoods, #selectSeckillGoods { li { float: left; margin: 10px; height: 100px; width: calc(100% - 20px); background: #f7fafc; position: relative; border-radius: 3px; cursor: move; .left { float: left; width: 170px; height: 90px; img { width: 170px; height: 90px; object-fit: cover; } diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.min.css b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.min.css index 9a760260..5f6b764f 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.min.css +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/css/style.min.css @@ -1 +1 @@ -html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;}body{margin:0;padding:20px;}article,aside,footer,header,nav,section{display:block;}h1{font-size:2em;margin:.67em 0;}figcaption,figure,main{display:block;}figure{margin:1em 40px;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace,monospace;font-size:1em;}a{background-color:transparent;-webkit-text-decoration-skip:objects;}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:inherit;font-weight:bolder;}code,kbd,samp{font-family:monospace,monospace;font-size:1em;}dfn{font-style:italic;}mark{background-color:#ff0;color:#000;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sub{bottom:-.25em;}sup{top:-.5em;}audio,video{display:inline-block;}audio:not([controls]){display:none;height:0;}img{border-style:none;}svg:not(:root){overflow:hidden;}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible;}button,select{text-transform:none;}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button;}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0;}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText;}fieldset{padding:.35em .75em .625em;}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{display:inline-block;vertical-align:baseline;}textarea{overflow:auto;}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto;}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details,menu{display:block;}summary{display:list-item;}canvas{display:inline-block;}template{display:none;}[hidden]{display:none;}.clearfix:after{content:".";display:block;clear:both;visibility:hidden;height:0;font-size:0;}::-moz-selection{background:#009688;color:#fff;}::selection{background:#159b76;color:#fff;}::-webkit-scrollbar{width:6px;height:6px;}::-webkit-scrollbar-thumb{border-radius:10px;background-color:#bdbdbd;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);}.twolist-hidden{display:-webkit-box;word-break:break-all;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;}.form-edit-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;min-width:1200px;background:#fff;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;}.edit-body{height:auto;width:calc(100% - 700px - 300px);}.center-container{width:375px;height:806px;border:1px solid #e9e9e9;box-shadow:0 3px 10px #dcdcdc;position:relative;}.center-container .model-title{height:88px;width:100%;position:relative;}.center-container .model-title img{width:100%;height:100%;}.nav-aside{width:300px;height:auto;position:relative;}.nav-aside .components-wrap{border:1px solid #e9e9e9;padding:10px;text-align:left;color:#666;}.nav-aside .components-wrap .components-title{padding:5px;border-bottom:1px solid #f0f0f0;margin-bottom:35px;}.nav-aside .components-wrap .components-title .text{padding:0 10px;border-left:4px solid #ff7159;}.nav-aside .components-wrap .components-list{display:-webkit-box;display:-ms-flexbox;display:flex;}.nav-aside .components-wrap .components-list .component-item{padding:10px;}.nav-aside .components-wrap .components-list .component-item ul{position:relative;overflow:hidden;padding:0;margin:0;}.nav-aside .components-wrap .components-list .component-item-title{font-size:12px;color:#999;margin:10px 0;}.nav-aside .components-wrap .components-list .component-item-li{width:74px;float:left;padding:3px 0;margin:5px;height:50px;text-align:center;display:block;background-color:#f5f5f5;border:1px solid #ddd;font-size:12px;color:#333;cursor:pointer;-webkit-transition:all .5s;transition:all .5s;height:auto;}.nav-aside .components-wrap .components-list .component-item-li .iconfont{font-size:20px !important;margin-bottom:5px;margin-right:0 !important;}.nav-aside .components-wrap .components-list .component-item-li .text{padding:0;margin-top:5px;}.urlBox{width:800px;border:1px solid #e9e9e9;box-shadow:0 3px 10px #dcdcdc;position:relative;padding:10px;}.urlBox p{font-size:13px;word-break:break-all;line-height:30px;}.recycle{position:absolute;top:43px;right:26px;}.recycle ul{position:relative;}.recycle ul li.component-item-li{display:none;}.recycle ul .layout-main{position:absolute;width:100%;height:30px;top:10px;left:0;}.recycle ul .ghost{background:#fff;border:1px dashed #409eff;position:absolute;left:0;line-height:30px;height:30px;overflow:hidden;list-style:none;font-size:0;}.recycle ul .ghost::after{content:'删除组件';display:block;background:#fff;position:absolute;text-align:center;top:0;left:0;right:0;font-size:12px;color:#000;z-index:2000;}.recycle-content{width:55px;padding:3px 0;margin:5px;height:45px;text-align:center;background-color:#fff;border:1px solid #ddd;font-size:12px;color:#333;-webkit-transition:all .5s;transition:all .5s;height:auto;}.recycle-content .iconfont{font-size:16px !important;margin-right:0 !important;margin-bottom:3px;}.recycle-content .text{margin-top:5px;}.layout-list{height:710px;overflow-y:scroll;}.layout-list .layout-main{position:relative;}.layout-list .layout-main.npr{position:static !important;}.layout-list .layout-main .drag{position:relative;}.layout-list .layout-main .lay-item{display:-webkit-box;display:-ms-flexbox;display:flex;}.layout-list .layout-main .lay-notice{line-height:32px;padding:2px 10px;background:#fff;overflow:hidden;}.layout-list .layout-main .lay-notice .notice-right{height:32px;overflow:hidden;}.layout-list .layout-main .lay-notice .notice-right .notice-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.layout-list .layout-main .lay-notice .iconfont{color:#ff7159;margin-right:2px;}.layout-list .layout-main .lay-guide .line{width:100%;height:0;border-top:1px solid #000;}.layout-list .layout-main .lay-textarea textarea{display:block;width:100%;border:none;}.layout-list .layout-main .lay-navBar.row3 .item{width:33.3333%;}.layout-list .layout-main .lay-navBar.row4 .item{width:25%;}.layout-list .layout-main .lay-navBar.row5 .item{width:20%;}.layout-list .layout-main .lay-navBar .item{float:left;text-align:center;padding:10px 0;}.layout-list .layout-main .lay-navBar .item-image{margin-bottom:4px;text-align:center;}.layout-list .layout-main .lay-navBar .item-image img{height:44px;width:44px;object-fit:cover;}.layout-list .layout-main .lay-navBar .item-text{height:20px;line-height:20px;width:70px;margin:0 auto;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.layout-list .layout-main .lay-imgSingle .img-wrap{display:block;margin:0;height:auto;flex:1;position:relative;}.layout-list .layout-main .lay-imgSingle .img-wrap img{display:block;width:100%;}.layout-list .layout-main .lay-imgSingle .img-wrap .img-btn{display:block;position:absolute;bottom:25px;left:40px;width:80px;height:30px;line-height:30px;text-align:center;}.layout-list .layout-main .lay-imgSlide .el-carousel{overflow:hidden !important;width:100%;height:175px !important;}.layout-list .layout-main .el-carousel__container{height:175px !important;}.layout-list .layout-main .el-carousel__item{height:175px !important;}.layout-list .layout-main .lay-search{width:100%;height:50px;padding:7px 13px;}.layout-list .layout-main .lay-search .iconfont{position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:15px;color:#999;font-size:18px !important;}.layout-list .layout-main .lay-search-c{width:100%;height:100%;position:relative;}.layout-list .layout-main .lay-search-input{width:100%;height:100%;border-radius:50px;background-color:#e9e9e9;border:none;padding:0 15px;color:#999;cursor:move;}.layout-list .layout-main .lay-search-input.square{border-radius:0;}.layout-list .layout-main .lay-search-input.radius{border-radius:5px;}.layout-list .layout-main .lay-search-input.round{border-radius:18px;}.layout-list .layout-main .btn-clone{position:absolute;height:18px;line-height:18px;right:50px;bottom:2px;z-index:90;width:36px;text-align:center;font-size:10px;color:#fff;background:#409eff;cursor:pointer;z-index:1300;}.layout-list .layout-main .btn-delete{position:absolute;height:18px;line-height:18px;right:2px;bottom:2px;z-index:90;width:36px;text-align:center;font-size:10px;color:#fff;background:rgba(0,0,0,.4);cursor:pointer;z-index:1300;}.layout-list .ghost{background:#fff;border:1px dashed #409eff;}.layout-list .ghost::after{background:#fff;}.layout-list li.ghost{position:relative;line-height:30px;list-style:none;font-size:0;}.layout-list li.ghost::after{content:'放到这里';display:block;background:#fff;position:absolute;left:50%;margin-left:-32px;top:0;font-size:16px;color:#999;z-index:10;}.layout-list .layout-main.active .drag:before,.layout-main:hover .drag:before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;border:2px dashed #ff7159;cursor:move;z-index:1001;}.lay-navBar{min-height:88px;}.lay-article{background:#f7f7f7;}.lay-article .article-wrap{width:100%;height:100px;padding:15px;background:#fff;}.lay-article .article-wrap:not(last-child){margin-bottom:10px;}.lay-article .article-wrap .article-left{float:left;height:100%;width:200px;}.lay-article .article-wrap .article-img{float:right;width:120px;height:70px;}.lay-article .article-wrap .article-img img{display:block;width:120px;height:100%;object-fit:cover;}.savePageBtn{padding:10px 13px;border-top:1px dotted #ddd;display:flex;justify-content:space-between;}.lay-special{height:30px;align-items:center;}.lay-special .special-left{width:70px;padding:5px 10px;}.lay-special .special-left img{width:100%;}.lay-goods{background:#f6f6f6;}.lay-goods .goods-head{height:40px;display:flex;justify-content:space-between;align-items:center;background:#fff;padding:0 10px;}.lay-goods .goods-tab-head{min-height:40px;display:inline-block;justify-content:flex-start;align-items:center;background:#fff;padding:0 10px;}.lay-goods .goods-tab-head div{padding:3px 10px;background:#e9e9e9;border-radius:10px;margin:5px 5px;float:left;}.lay-goods.list{height:auto;}.lay-goods.list .goods-item{float:left;}.lay-goods.slide{overflow-x:hidden;white-space:nowrap;width:auto;}.lay-goods.slide .goods-item{float:none;display:inline-block;}.lay-goods .goods-item.column2{width:50%;padding:3px;float:left;}.lay-goods .goods-item.column1{width:100%;padding:8px;height:140px;display:flex;background:#fff;margin-bottom:8px;}.lay-goods .goods-item.column1 .goods-price{margin-top:50px;}.lay-goods .goods-item.column1 .goods-image{width:120px;height:120px;padding:0;}.lay-goods .goods-item.column1 .goods-image img{width:120px;height:120px;padding:0;}.lay-goods .goods-item.column1 .goods-detail{flex:1;}.lay-goods .goods-item.column3{width:33%;padding:3px;}.lay-goods .goods-item .goods-image{position:relative;width:100%;height:0;padding-bottom:100%;overflow:hidden;background:#fff;}.lay-goods .goods-item .goods-image:after{content:'';display:block;margin-top:100%;}.lay-goods .goods-item .goods-image img{position:absolute;width:100%;height:100%;top:0;left:0;-o-object-fit:cover;object-fit:cover;}.lay-goods .goods-item .goods-detail{padding:4px;background:#fff;font-size:13px;}.lay-goods .goods-item .goods-detail .goods-name{height:40px;overflow:hidden;margin-bottom:5px;}.lay-goods .goods-item .goods-detail .goods-price{font-size:15px;color:#f00;}.lay-goods.group{background:#fff;padding:10px;}.lay-goods .group-item{width:300px;padding:10px;position:relative;background:#f6f6f6;height:120px;display:inline-block;margin-right:15px;}.lay-goods .group-item .group-image{width:98px;height:98px;position:absolute;left:10px;top:10px;}.lay-goods .group-item .group-image img{width:100%;height:100%;object-fit:cover;}.lay-goods .group-item .group-detail{position:absolute;top:10px;left:120px;bottom:10px;right:0;}.lay-goods .group-item .group-detail .group-price{position:absolute;top:50px;left:0;font-size:18px;color:#ff7159;}.lay-goods .group-item .group-detail .group-time{position:absolute;bottom:0;left:0;font-size:12px;}.lay-goods .group-item .group-detail .group-time span{color:#ff7159;padding:3px;text-align:center;}.lay-goods .group-item .group-detail .group-time span.time{background:#fff;}.lay-goods .group-item .group-detail .buy-icon{position:absolute;bottom:0;right:10px;display:block;width:20px;height:20px;}.lay-goods .group-item .group-detail .buy-icon img{width:100%;}.lay-service{width:50px;height:50px;padding:4px;position:absolute;bottom:30px;right:10px;}.lay-record{width:210px;background:rgba(0,0,0,.25);position:absolute !important;top:30%;z-index:9999;cursor:pointer;}.lay-record.left{left:0;}.lay-record.right{right:0;}.lay-record:before{cursor:pointer !important;}.record-item{height:30px;line-height:30px;padding-left:10px;}.record-item .text{color:#ff7159;}.lay-coupon{padding:4px 12px;}.lay-coupon .coupon-item{width:100%;box-sizing:border-box;background:linear-gradient(to right,#ff6565,#ff8a8a);margin:.1rem 0;border-radius:5px;overflow:hidden;position:relative;}.lay-coupon .coupon-item .coupon-left{width:28%;height:50px;color:#fff7f7;font-size:12px;padding:0 14px;float:left;margin:12px 0;text-align:center;box-sizing:border-box;border-right:1px dotted #fff;display:inline-block;}.lay-coupon .coupon-item .coupon-left p{position:relative;top:50%;transform:translateY(-50%);}.lay-coupon .coupon-item .coupon-right{width:50%;height:100%;float:left;text-align:left;color:#fff;box-sizing:border-box;padding:10px;display:inline-block;font-size:12px;}.lay-coupon .coupon-item .coupon-right .conpon-f{font-size:14px;}.lay-coupon .coupon-item .coupon-btn{padding:0 8px;background-color:#ffe7e7;color:#ff5454;font-size:12px;position:absolute;top:50%;transform:translateY(-50%);right:10px;border-radius:2px;}.lay-imgWindow{min-height:100px;}.lay-imgWindow.row0 .display{height:0;width:100%;margin:0;padding-bottom:50%;position:relative;}.lay-imgWindow.row2 .img-wrap{width:50%;height:150px;}.lay-imgWindow.row3 .img-wrap{width:33%;height:150px;}.lay-imgWindow.row4 .img-wrap{width:25%;height:150px;}.lay-imgWindow .img-wrap{float:left;box-sizing:border-box;}.lay-imgWindow .img-wrap img{width:100%;height:100%;object-fit:cover;}.display img{width:100%;height:100%;}.display .display-left{width:50%;height:100%;position:absolute;top:0;left:0;}.display .display-right{width:50%;height:100%;position:absolute;top:0;left:50%;}.display .display-right .display-right1{width:100%;height:50%;position:absolute;top:0;left:0;}.display .display-right .display-right2{width:100%;height:50%;position:absolute;top:50%;left:0;}.display .display-right .display-right2 .left{width:50%;height:100%;position:absolute;top:0;left:0;}.display .display-right .display-right2 .right{width:50%;height:100%;position:absolute;top:0;left:50%;}.lay-video .video-wrap{width:100%;z-index:1200;}.lay-video .video-wrap video{display:block;width:100%;}.pl25{padding-left:25px;}.custom-tip{margin-top:40px;}.custom-tip p{margin-bottom:5px;}#selectGoods li{float:left;margin:10px;height:70px;width:70px;background:#f7fafc;position:relative;border-radius:3px;cursor:move;}#selectGoods li img{width:100%;height:100%;object-fit:cover;}#selectGoods li .icon-delete{position:absolute;top:-6px;right:-6px;border-radius:50%;text-align:center;cursor:pointer;font-size:18px;transition:background-color .3s ease-out,border-color .3s ease-out;-webkit-transition:background-color .3s ease-out,border-color .3s ease-out;}#selectGoods li .icon-delete:hover{color:#000;}#selectGroupPurchaseGoods li{float:left;margin:10px;height:100px;width:calc(100% - 20px);background:#f7fafc;position:relative;border-radius:3px;cursor:move;}#selectGroupPurchaseGoods li .left{float:left;width:170px;height:90px;}#selectGroupPurchaseGoods li .left img{width:170px;height:90px;object-fit:cover;}#selectGroupPurchaseGoods li .right{float:left;width:calc(100% - 180px);height:90px;margin-left:10px;}#selectGroupPurchaseGoods li .icon-delete{position:absolute;top:-6px;right:-6px;border-radius:50%;text-align:center;cursor:pointer;font-size:18px;transition:background-color .3s ease-out,border-color .3s ease-out;-webkit-transition:background-color .3s ease-out,border-color .3s ease-out;}#selectGroupPurchaseGoods li .icon-delete:hover{color:#000;}.divider{height:0;margin:20px auto;overflow:hidden;clear:both;border-top:1px dashed #ccc;}.el-color-picker{height:24px !important;vertical-align:middle;}.el-color-picker__trigger{height:24px !important;}.reset-color{display:inline-block;padding:0 10px;border:1px solid #bdbdbd;text-align:center;height:20px;line-height:20px;vertical-align:middle;margin-left:5px;}.main-body{padding:10px;border:1px solid #e9e9e9;}.main-body .el-form-item{padding:0;margin-bottom:0 !important;font-size:12px !important;}.main-body .el-form-item__label{font-size:12px !important;line-height:40px !important;}.main-body .el-slider__runway{margin:12px 0 !important;}.custom-item-t{padding:5px;border-bottom:1px solid #f0f0f0;margin-bottom:15px;}.custom-item-t-c{padding:0 10px;border-left:4px solid #ff7159;text-align:left;}.custom-item .layui-form-label{box-sizing:content-box;}.custom-item .content{padding:10px;}.custom-item .drag-block{height:30px;background:#f2f2f2;cursor:move;position:relative;}.custom-item .drag-block .handle-icon{position:absolute;right:0;top:0;width:30px;height:30px;line-height:30px;text-align:center;cursor:pointer;}.custom-item .drag-block .handle-icon .iconfont{font-size:16px !important;color:#999;margin:0 auto;}.custom-item .drag-block .handle-icon .iconfont:hover{color:#ff7159;}.custom-item .content-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px;}.custom-item .content-item .item-label{width:90px;}.custom-item .content-item .el-input{-webkit-box-flex:1;-ms-flex:1;flex:1;}.custom-item li{border:1px dashed #e9e9e9;}.custom-item li.ghost{border-color:#ff7159;}.custom-item .addImg{width:100%;height:32px;line-height:32px;text-align:left;border:1px dashed #e9e9e9;margin-top:15px;cursor:pointer;padding-left:5px;}.custom-item .addImg .iconfont{font-size:12px !important;margin-right:5px !important;}.custom-item .addImg:hover{color:#ff7159;}.content-item .el-form-item{flex:1;}.content-item .el-radio-group .el-radio{margin-bottom:10px;}.el-select-dropdown__item.second span{padding-left:15px !important;}.number-input{width:100%;padding:5px;margin-bottom:4px;border:0;border-bottom:1px solid #c2cad8;transition:all ease-in-out .15s;}.number-input:focus{border-color:#ff7159;}.tpl-block{flex:1;padding-left:20px;}.tpl-item{width:75px;height:75px;display:inline-block;border:1px solid #e5e5e5;margin:0 10px 15px 0;padding-top:5px;background-color:#fff;text-align:center;cursor:pointer;}.tpl-item.active{border:1px solid #ff7159;}.tpl-item .tpl-item-image{height:40px;}.tpl-item .tpl-item-image img{height:auto;width:60px;margin:0 auto;vertical-align:middle;}.tpl-item .tpl-item-text{margin-top:10px;font-size:12px;}.selectLinkVal{width:100%;padding:0 10px;color:#555;height:30px;line-height:30px;margin-top:5px;border:1px solid #bdbdbd;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;}.layout-select{width:100%;padding:5px 6px;color:#555;line-height:1.5;margin-bottom:4px;}.el-select{width:100% !important;}.el-input__inner,.el-textarea__inner{border-radius:0 !important;border:1px solid #bdbdbd !important;height:30px !important;line-height:30px !important;padding:0 10px !important;font-size:12px !important;}.ml20{margin-left:20px;}.layout-tip{color:#838fa1;font-size:12px;}*,*:before,*:after{box-sizing:inherit;}.layui-nav .layui-nav-item{box-sizing:content-box;}.tabBarItem{border:1px solid #e9e9e9;margin-bottom:10px;padding:10px;} \ No newline at end of file +html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;box-sizing:border-box;}body{margin:0;padding:20px;}article,aside,footer,header,nav,section{display:block;}h1{font-size:2em;margin:.67em 0;}figcaption,figure,main{display:block;}figure{margin:1em 40px;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace,monospace;font-size:1em;}a{background-color:transparent;-webkit-text-decoration-skip:objects;}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:inherit;font-weight:bolder;}code,kbd,samp{font-family:monospace,monospace;font-size:1em;}dfn{font-style:italic;}mark{background-color:#ff0;color:#000;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sub{bottom:-.25em;}sup{top:-.5em;}audio,video{display:inline-block;}audio:not([controls]){display:none;height:0;}img{border-style:none;}svg:not(:root){overflow:hidden;}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible;}button,select{text-transform:none;}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button;}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0;}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText;}fieldset{padding:.35em .75em .625em;}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{display:inline-block;vertical-align:baseline;}textarea{overflow:auto;}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto;}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details,menu{display:block;}summary{display:list-item;}canvas{display:inline-block;}template{display:none;}[hidden]{display:none;}.clearfix:after{content:".";display:block;clear:both;visibility:hidden;height:0;font-size:0;}::-moz-selection{background:#009688;color:#fff;}::selection{background:#159b76;color:#fff;}::-webkit-scrollbar{width:6px;height:6px;}::-webkit-scrollbar-thumb{border-radius:10px;background-color:#bdbdbd;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);}.twolist-hidden{display:-webkit-box;word-break:break-all;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;}.form-edit-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;min-width:1200px;background:#fff;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;}.edit-body{height:auto;width:calc(100% - 700px - 300px);}.center-container{width:375px;height:806px;border:1px solid #e9e9e9;box-shadow:0 3px 10px #dcdcdc;position:relative;}.center-container .model-title{height:88px;width:100%;position:relative;}.center-container .model-title img{width:100%;height:100%;}.nav-aside{width:300px;height:auto;position:relative;}.nav-aside .components-wrap{border:1px solid #e9e9e9;padding:10px;text-align:left;color:#666;}.nav-aside .components-wrap .components-title{padding:5px;border-bottom:1px solid #f0f0f0;margin-bottom:35px;}.nav-aside .components-wrap .components-title .text{padding:0 10px;border-left:4px solid #ff7159;}.nav-aside .components-wrap .components-list{display:-webkit-box;display:-ms-flexbox;display:flex;}.nav-aside .components-wrap .components-list .component-item{padding:10px;}.nav-aside .components-wrap .components-list .component-item ul{position:relative;overflow:hidden;padding:0;margin:0;}.nav-aside .components-wrap .components-list .component-item-title{font-size:12px;color:#999;margin:10px 0;}.nav-aside .components-wrap .components-list .component-item-li{width:74px;float:left;padding:3px 0;margin:5px;height:50px;text-align:center;display:block;background-color:#f5f5f5;border:1px solid #ddd;font-size:12px;color:#333;cursor:pointer;-webkit-transition:all .5s;transition:all .5s;height:auto;}.nav-aside .components-wrap .components-list .component-item-li .iconfont{font-size:20px !important;margin-bottom:5px;margin-right:0 !important;}.nav-aside .components-wrap .components-list .component-item-li .text{padding:0;margin-top:5px;}.urlBox{width:800px;border:1px solid #e9e9e9;box-shadow:0 3px 10px #dcdcdc;position:relative;padding:10px;}.urlBox p{font-size:13px;word-break:break-all;line-height:30px;}.recycle{position:absolute;top:43px;right:26px;}.recycle ul{position:relative;}.recycle ul li.component-item-li{display:none;}.recycle ul .layout-main{position:absolute;width:100%;height:30px;top:10px;left:0;}.recycle ul .ghost{background:#fff;border:1px dashed #409eff;position:absolute;left:0;line-height:30px;height:30px;overflow:hidden;list-style:none;font-size:0;}.recycle ul .ghost::after{content:'删除组件';display:block;background:#fff;position:absolute;text-align:center;top:0;left:0;right:0;font-size:12px;color:#000;z-index:2000;}.recycle-content{width:55px;padding:3px 0;margin:5px;height:45px;text-align:center;background-color:#fff;border:1px solid #ddd;font-size:12px;color:#333;-webkit-transition:all .5s;transition:all .5s;height:auto;}.recycle-content .iconfont{font-size:16px !important;margin-right:0 !important;margin-bottom:3px;}.recycle-content .text{margin-top:5px;}.layout-list{height:710px;overflow-y:scroll;}.layout-list .layout-main{position:relative;}.layout-list .layout-main.npr{position:static !important;}.layout-list .layout-main .drag{position:relative;}.layout-list .layout-main .lay-item{display:-webkit-box;display:-ms-flexbox;display:flex;}.layout-list .layout-main .lay-notice{line-height:32px;padding:2px 10px;background:#fff;overflow:hidden;}.layout-list .layout-main .lay-notice .notice-right{height:32px;overflow:hidden;}.layout-list .layout-main .lay-notice .notice-right .notice-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.layout-list .layout-main .lay-notice .iconfont{color:#ff7159;margin-right:2px;}.layout-list .layout-main .lay-guide .line{width:100%;height:0;border-top:1px solid #000;}.layout-list .layout-main .lay-textarea textarea{display:block;width:100%;border:none;}.layout-list .layout-main .lay-navBar.row3 .item{width:33.3333%;}.layout-list .layout-main .lay-navBar.row4 .item{width:25%;}.layout-list .layout-main .lay-navBar.row5 .item{width:20%;}.layout-list .layout-main .lay-navBar .item{float:left;text-align:center;padding:10px 0;}.layout-list .layout-main .lay-navBar .item-image{margin-bottom:4px;text-align:center;}.layout-list .layout-main .lay-navBar .item-image img{height:44px;width:44px;object-fit:cover;}.layout-list .layout-main .lay-navBar .item-text{height:20px;line-height:20px;width:70px;margin:0 auto;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.layout-list .layout-main .lay-imgSingle .img-wrap{display:block;margin:0;height:auto;flex:1;position:relative;}.layout-list .layout-main .lay-imgSingle .img-wrap img{display:block;width:100%;}.layout-list .layout-main .lay-imgSingle .img-wrap .img-btn{display:block;position:absolute;bottom:25px;left:40px;width:80px;height:30px;line-height:30px;text-align:center;}.layout-list .layout-main .lay-imgSlide .el-carousel{overflow:hidden !important;width:100%;height:175px !important;}.layout-list .layout-main .el-carousel__container{height:175px !important;}.layout-list .layout-main .el-carousel__item{height:175px !important;}.layout-list .layout-main .lay-search{width:100%;height:50px;padding:7px 13px;}.layout-list .layout-main .lay-search .iconfont{position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:15px;color:#999;font-size:18px !important;}.layout-list .layout-main .lay-search-c{width:100%;height:100%;position:relative;}.layout-list .layout-main .lay-search-input{width:100%;height:100%;border-radius:50px;background-color:#e9e9e9;border:none;padding:0 15px;color:#999;cursor:move;}.layout-list .layout-main .lay-search-input.square{border-radius:0;}.layout-list .layout-main .lay-search-input.radius{border-radius:5px;}.layout-list .layout-main .lay-search-input.round{border-radius:18px;}.layout-list .layout-main .btn-clone{position:absolute;height:18px;line-height:18px;right:50px;bottom:2px;z-index:90;width:36px;text-align:center;font-size:10px;color:#fff;background:#409eff;cursor:pointer;z-index:1300;}.layout-list .layout-main .btn-delete{position:absolute;height:18px;line-height:18px;right:2px;bottom:2px;z-index:90;width:36px;text-align:center;font-size:10px;color:#fff;background:rgba(0,0,0,.4);cursor:pointer;z-index:1300;}.layout-list .ghost{background:#fff;border:1px dashed #409eff;}.layout-list .ghost::after{background:#fff;}.layout-list li.ghost{position:relative;line-height:30px;list-style:none;font-size:0;}.layout-list li.ghost::after{content:'放到这里';display:block;background:#fff;position:absolute;left:50%;margin-left:-32px;top:0;font-size:16px;color:#999;z-index:10;}.layout-list .layout-main.active .drag:before,.layout-main:hover .drag:before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;border:2px dashed #ff7159;cursor:move;z-index:1001;}.lay-navBar{min-height:88px;}.lay-article{background:#f7f7f7;}.lay-article .article-wrap{width:100%;height:100px;padding:15px;background:#fff;}.lay-article .article-wrap:not(last-child){margin-bottom:10px;}.lay-article .article-wrap .article-left{float:left;height:100%;width:200px;}.lay-article .article-wrap .article-img{float:right;width:120px;height:70px;}.lay-article .article-wrap .article-img img{display:block;width:120px;height:100%;object-fit:cover;}.savePageBtn{padding:10px 13px;border-top:1px dotted #ddd;display:flex;justify-content:space-between;}.lay-special{height:30px;align-items:center;}.lay-special .special-left{width:70px;padding:5px 10px;}.lay-special .special-left img{width:100%;}.lay-goods{background:#f6f6f6;}.lay-goods .goods-head{height:40px;display:flex;justify-content:space-between;align-items:center;background:#fff;padding:0 10px;}.lay-goods .goods-tab-head{min-height:40px;display:inline-block;justify-content:flex-start;align-items:center;background:#fff;padding:0 10px;}.lay-goods .goods-tab-head div{padding:3px 10px;background:#e9e9e9;border-radius:10px;margin:5px 5px;float:left;}.lay-goods.list{height:auto;}.lay-goods.list .goods-item{float:left;}.lay-goods.slide{overflow-x:hidden;white-space:nowrap;width:auto;}.lay-goods.slide .goods-item{float:none;display:inline-block;}.lay-goods .goods-item.column2{width:50%;padding:3px;float:left;}.lay-goods .goods-item.column1{width:100%;padding:8px;height:140px;display:flex;background:#fff;margin-bottom:8px;}.lay-goods .goods-item.column1 .goods-price{margin-top:50px;}.lay-goods .goods-item.column1 .goods-image{width:120px;height:120px;padding:0;}.lay-goods .goods-item.column1 .goods-image img{width:120px;height:120px;padding:0;}.lay-goods .goods-item.column1 .goods-detail{flex:1;}.lay-goods .goods-item.column3{width:33%;padding:3px;}.lay-goods .goods-item .goods-image{position:relative;width:100%;height:0;padding-bottom:100%;overflow:hidden;background:#fff;}.lay-goods .goods-item .goods-image:after{content:'';display:block;margin-top:100%;}.lay-goods .goods-item .goods-image img{position:absolute;width:100%;height:100%;top:0;left:0;-o-object-fit:cover;object-fit:cover;}.lay-goods .goods-item .goods-detail{padding:4px;background:#fff;font-size:13px;}.lay-goods .goods-item .goods-detail .goods-name{height:40px;overflow:hidden;margin-bottom:5px;}.lay-goods .goods-item .goods-detail .goods-price{font-size:15px;color:#f00;}.lay-goods.group{background:#fff;padding:10px;}.lay-goods .group-item{width:300px;padding:10px;position:relative;background:#f6f6f6;height:120px;display:inline-block;margin-right:15px;}.lay-goods .group-item .group-image{width:98px;height:98px;position:absolute;left:10px;top:10px;}.lay-goods .group-item .group-image img{width:100%;height:100%;object-fit:cover;}.lay-goods .group-item .group-detail{position:absolute;top:10px;left:120px;bottom:10px;right:0;}.lay-goods .group-item .group-detail .group-price{position:absolute;top:50px;left:0;font-size:18px;color:#ff7159;}.lay-goods .group-item .group-detail .group-time{position:absolute;bottom:0;left:0;font-size:12px;}.lay-goods .group-item .group-detail .group-time span{color:#ff7159;padding:3px;text-align:center;}.lay-goods .group-item .group-detail .group-time span.time{background:#fff;}.lay-goods .group-item .group-detail .buy-icon{position:absolute;bottom:0;right:10px;display:block;width:20px;height:20px;}.lay-goods .group-item .group-detail .buy-icon img{width:100%;}.lay-service{width:50px;height:50px;padding:4px;position:absolute;bottom:30px;right:10px;}.lay-record{width:210px;background:rgba(0,0,0,.25);position:absolute !important;top:30%;z-index:9999;cursor:pointer;}.lay-record.left{left:0;}.lay-record.right{right:0;}.lay-record:before{cursor:pointer !important;}.record-item{height:30px;line-height:30px;padding-left:10px;}.record-item .text{color:#ff7159;}.lay-coupon{padding:4px 12px;}.lay-coupon .coupon-item{width:100%;box-sizing:border-box;background:linear-gradient(to right,#ff6565,#ff8a8a);margin:.1rem 0;border-radius:5px;overflow:hidden;position:relative;}.lay-coupon .coupon-item .coupon-left{width:28%;height:50px;color:#fff7f7;font-size:12px;padding:0 14px;float:left;margin:12px 0;text-align:center;box-sizing:border-box;border-right:1px dotted #fff;display:inline-block;}.lay-coupon .coupon-item .coupon-left p{position:relative;top:50%;transform:translateY(-50%);}.lay-coupon .coupon-item .coupon-right{width:50%;height:100%;float:left;text-align:left;color:#fff;box-sizing:border-box;padding:10px;display:inline-block;font-size:12px;}.lay-coupon .coupon-item .coupon-right .conpon-f{font-size:14px;}.lay-coupon .coupon-item .coupon-btn{padding:0 8px;background-color:#ffe7e7;color:#ff5454;font-size:12px;position:absolute;top:50%;transform:translateY(-50%);right:10px;border-radius:2px;}.lay-imgWindow{min-height:100px;}.lay-imgWindow.row0 .display{height:0;width:100%;margin:0;padding-bottom:50%;position:relative;}.lay-imgWindow.row2 .img-wrap{width:50%;height:150px;}.lay-imgWindow.row3 .img-wrap{width:33%;height:150px;}.lay-imgWindow.row4 .img-wrap{width:25%;height:150px;}.lay-imgWindow .img-wrap{float:left;box-sizing:border-box;}.lay-imgWindow .img-wrap img{width:100%;height:100%;object-fit:cover;}.display img{width:100%;height:100%;}.display .display-left{width:50%;height:100%;position:absolute;top:0;left:0;}.display .display-right{width:50%;height:100%;position:absolute;top:0;left:50%;}.display .display-right .display-right1{width:100%;height:50%;position:absolute;top:0;left:0;}.display .display-right .display-right2{width:100%;height:50%;position:absolute;top:50%;left:0;}.display .display-right .display-right2 .left{width:50%;height:100%;position:absolute;top:0;left:0;}.display .display-right .display-right2 .right{width:50%;height:100%;position:absolute;top:0;left:50%;}.lay-video .video-wrap{width:100%;z-index:1200;}.lay-video .video-wrap video{display:block;width:100%;}.pl25{padding-left:25px;}.custom-tip{margin-top:40px;}.custom-tip p{margin-bottom:5px;}#selectGoods li{float:left;margin:10px;height:70px;width:70px;background:#f7fafc;position:relative;border-radius:3px;cursor:move;}#selectGoods li img{width:100%;height:100%;object-fit:cover;}#selectGoods li .icon-delete{position:absolute;top:-6px;right:-6px;border-radius:50%;text-align:center;cursor:pointer;font-size:18px;transition:background-color .3s ease-out,border-color .3s ease-out;-webkit-transition:background-color .3s ease-out,border-color .3s ease-out;}#selectGoods li .icon-delete:hover{color:#000;}#selectGroupPurchaseGoods li,#selectSeckillGoods li{float:left;margin:10px;height:100px;width:calc(100% - 20px);background:#f7fafc;position:relative;border-radius:3px;cursor:move;}#selectGroupPurchaseGoods li .left,#selectSeckillGoods li .left{float:left;width:170px;height:90px;}#selectGroupPurchaseGoods li .left img,#selectSeckillGoods li .left img{width:170px;height:90px;object-fit:cover;}#selectGroupPurchaseGoods li .right,#selectSeckillGoods li .right{float:left;width:calc(100% - 180px);height:90px;margin-left:10px;}#selectGroupPurchaseGoods li .icon-delete,#selectSeckillGoods li .icon-delete{position:absolute;top:-6px;right:-6px;border-radius:50%;text-align:center;cursor:pointer;font-size:18px;transition:background-color .3s ease-out,border-color .3s ease-out;-webkit-transition:background-color .3s ease-out,border-color .3s ease-out;}#selectGroupPurchaseGoods li .icon-delete:hover,#selectSeckillGoods li .icon-delete:hover{color:#000;}.divider{height:0;margin:20px auto;overflow:hidden;clear:both;border-top:1px dashed #ccc;}.el-color-picker{height:24px !important;vertical-align:middle;}.el-color-picker__trigger{height:24px !important;}.reset-color{display:inline-block;padding:0 10px;border:1px solid #bdbdbd;text-align:center;height:20px;line-height:20px;vertical-align:middle;margin-left:5px;}.main-body{padding:10px;border:1px solid #e9e9e9;}.main-body .el-form-item{padding:0;margin-bottom:0 !important;font-size:12px !important;}.main-body .el-form-item__label{font-size:12px !important;line-height:40px !important;}.main-body .el-slider__runway{margin:12px 0 !important;}.custom-item-t{padding:5px;border-bottom:1px solid #f0f0f0;margin-bottom:15px;}.custom-item-t-c{padding:0 10px;border-left:4px solid #ff7159;text-align:left;}.custom-item .layui-form-label{box-sizing:content-box;}.custom-item .content{padding:10px;}.custom-item .drag-block{height:30px;background:#f2f2f2;cursor:move;position:relative;}.custom-item .drag-block .handle-icon{position:absolute;right:0;top:0;width:30px;height:30px;line-height:30px;text-align:center;cursor:pointer;}.custom-item .drag-block .handle-icon .iconfont{font-size:16px !important;color:#999;margin:0 auto;}.custom-item .drag-block .handle-icon .iconfont:hover{color:#ff7159;}.custom-item .content-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px;}.custom-item .content-item .item-label{width:90px;}.custom-item .content-item .el-input{-webkit-box-flex:1;-ms-flex:1;flex:1;}.custom-item li{border:1px dashed #e9e9e9;}.custom-item li.ghost{border-color:#ff7159;}.custom-item .addImg{width:100%;height:32px;line-height:32px;text-align:left;border:1px dashed #e9e9e9;margin-top:15px;cursor:pointer;padding-left:5px;}.custom-item .addImg .iconfont{font-size:12px !important;margin-right:5px !important;}.custom-item .addImg:hover{color:#ff7159;}.content-item .el-form-item{flex:1;}.content-item .el-radio-group .el-radio{margin-bottom:10px;}.el-select-dropdown__item.second span{padding-left:15px !important;}.number-input{width:100%;padding:5px;margin-bottom:4px;border:0;border-bottom:1px solid #c2cad8;transition:all ease-in-out .15s;}.number-input:focus{border-color:#ff7159;}.tpl-block{flex:1;padding-left:20px;}.tpl-item{width:75px;height:75px;display:inline-block;border:1px solid #e5e5e5;margin:0 10px 15px 0;padding-top:5px;background-color:#fff;text-align:center;cursor:pointer;}.tpl-item.active{border:1px solid #ff7159;}.tpl-item .tpl-item-image{height:40px;}.tpl-item .tpl-item-image img{height:auto;width:60px;margin:0 auto;vertical-align:middle;}.tpl-item .tpl-item-text{margin-top:10px;font-size:12px;}.selectLinkVal{width:100%;padding:0 10px;color:#555;height:30px;line-height:30px;margin-top:5px;border:1px solid #bdbdbd;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;}.layout-select{width:100%;padding:5px 6px;color:#555;line-height:1.5;margin-bottom:4px;}.el-select{width:100% !important;}.el-input__inner,.el-textarea__inner{border-radius:0 !important;border:1px solid #bdbdbd !important;height:30px !important;line-height:30px !important;padding:0 10px !important;font-size:12px !important;}.ml20{margin-left:20px;}.layout-tip{color:#838fa1;font-size:12px;}*,*:before,*:after{box-sizing:inherit;}.layui-nav .layui-nav-item{box-sizing:content-box;}.tabBarItem{border:1px solid #e9e9e9;margin-bottom:10px;padding:10px;} \ No newline at end of file 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 8fac3dbc..c2c84341 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/custom/js/main.js @@ -296,9 +296,30 @@ var allWidget = { }, { "type": "groupPurchase", - "name": "团购秒杀", + "name": "团购", "value": { - "title": '活动名称', + "title": '团购活动名称', + "limit": '10', + "list": [ + { + "image": "/static/images/common/empty-banner.png", + "name": '', + "price": '' + }, + { + "image": "/static/images/common/empty-banner.png", + "name": '', + "price": '' + }, + ] + }, + "icon": "icon-tuangou" + }, + { + "type": "seckill", + "name": "秒杀", + "value": { + "title": '秒杀活动名称', "limit": '10', "list": [ { @@ -780,7 +801,10 @@ Vue.component('layout-config', { return '商品选项卡' break; case 'groupPurchase': - return '团购秒杀' + return '团购' + break; + case 'seckill': + return '秒杀' break; case 'pinTuan': return '拼团' @@ -1202,7 +1226,7 @@ Vue.component('layout-config', { var that = this; layui.use(['form', 'table'], function () { layui.admin.popup({ - title: '团购秒杀列表', + title: '团购列表', area: ['1200px', '90%'], id: 'LAY-app-CoreCmsCommon-getGroupIds', success: function (layero, index) { @@ -1218,9 +1242,36 @@ Vue.component('layout-config', { for (let i in ids) { arr.push(ids[i]); } - console.log(arr); - + that.$set(that.selectWg.value, 'list', arr) + layer.close(index); + }); + }); + } + }); + }); + }, + selectSeckillGoods: function () { + var that = this; + layui.use(['form', 'table'], function () { + layui.admin.popup({ + title: '秒杀列表', + area: ['1200px', '90%'], + id: 'LAY-app-CoreCmsCommon-getSeckillIds', + success: function (layero, index) { + layui.view(this.id).render('common/getSeckillIds', null).done(function () { + layui.form.on('submit(LAY-app-CoreCmsCommon-GetSeckillIds-submit)', + function (data) { + //判断个数是否满足 + if (Object.getOwnPropertyNames(ids).length > that.maxSelectGoods) { + layer.msg("最多只能选择" + that.maxSelectGoods + "个"); + return false; + } + var arr = [] + for (let i in ids) { + arr.push(ids[i]); + } + console.log(arr); that.$set(that.selectWg.value, 'list', arr) layer.close(index); }); diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/config.js b/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/config.js index f9c7ac17..48306ba0 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/config.js +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/config.js @@ -12,7 +12,7 @@ layui.define(['laytpl', 'layer', 'element', 'util'], function (exports) { , pageTabs: false //是否开启页面选项卡功能。单页版不推荐开启 , name: '核心商城系统' - , version: 'CoreShopProfessional v0.6.2' + , version: '0.6.4' , tableName: 'CoreCms' //本地存储表名 , MOD_NAME: 'admin' //模块事件名 diff --git a/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.js b/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.js index c416d13a..75bd94df 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.js +++ b/CoreCms.Net.Web.Admin/wwwroot/lib/layuiAdmin/index.js @@ -1,2 +1,2 @@ /** layuiAdmin.pro-v1.7.0 LPPL License */ -; layui.extend({ setter: "config", admin: "lib/admin", view: "lib/view", breadcrumb: 'controller/breadcrumb' }).define(["setter", "admin", "breadcrumb"],function(e){var a=layui.setter,n=layui.element,i=layui.admin,t=i.tabsPage,l=layui.view,r=function(){var e=layui.router(),o=e.path,y=i.correctRouter(e.path.join("/"));o.length||(o=[""]),""===o[o.length-1]&&(o[o.length-1]=a.entry);var h=function(e){r.haveInit&&d(".layui-layer").each(function(){var e=d(this),a=e.attr("times");e.hasClass("layui-layim")||layer.close(a)}),r.haveInit=!0,d(s).scrollTop(0),delete t.type};return"tab"===t.type&&("/"!==y||"/"===y&&i.tabsBody().html())?(i.tabsBodyChange(t.index),h(t.type)):(l().render(o.join("/")).then(function(l){var r,o=d("#LAY_app_tabsheader>li");o.each(function(e){var a=d(this),n=a.attr("lay-id");n===y&&(r=!0,t.index=e)}),a.pageTabs&&"/"!==y&&(r||(d(s).append(''),t.index=o.length,n.tabAdd(u,{title:""+(l.title||"新标签页")+"",id:y,attr:e.href}))),this.container=i.tabsBody(t.index),a.pageTabs||this.container.scrollTop(0),n.tabChange(u,y),i.tabsBodyChange(t.index)}).done(function(){layui.use("common",layui.cache.callback.common),c.on("resize",layui.data.resize),n.render("breadcrumb","breadcrumb"),i.tabsBody(t.index).on("scroll",function(){var e=d(this),a=d(".layui-laydate"),n=d(".layui-layer")[0];a[0]&&(a.each(function(){var e=d(this);e.hasClass("layui-laydate-static")||e.remove()}),e.find("input").blur()),n&&layer.closeAll("tips")})}),void h())},o=function(e){var n,t=layui.router(),o=l(a.container),s=i.correctRouter(t.path.join("/"));if(layui.each(a.indPage,function(e,a){if(s===a)return n=!0}),layui.config({base:a.base+"controller/"}),n||"/user/login"===s)o.render(t.path.join("/")).done(function(){i.pageType="alone"});else{if(a.interceptor){var u=layui.data(a.tableName);if(!u[a.request.tokenName])return location.hash="/user/login/redirect="+encodeURIComponent(s)}"console"===i.pageType?r():o.render("layout").done(function(){r(),layui.element.render(),i.screen()<2&&i.sideFlexible(),i.pageType="console"})}},s="#LAY_app_body",u="layadmin-layout-tabs",d=layui.$,c=d(window);layui.link(a.base+"style/admin.css?v="+(i.v+"-1"),function(){o()},"layuiAdmin"),window.onhashchange=function(){o(),layui.event.call(this,a.MOD_NAME,"hash({*})",layui.router())},layui.each(a.extend,function(e,n){var i={},t=a.extend.constructor===Array;i[t?n:e]="{/}"+a.base+"lib/extend/"+n,layui.extend(i)}),e("index",{render:r})}); \ No newline at end of file +; layui.extend({ setter: "config", admin: "lib/admin", view: "lib/view", breadcrumb: 'controller/breadcrumb' }).define(["setter", "admin", "breadcrumb"],function(e){console.log(`\n %c \u6838\u5fc3\u5546\u57ce\u7cfb\u7edf\u0020\u0043\u006f\u0072\u0065\u0053\u0068\u006f\u0070 V${layui.setter.version} %c \u0068\u0074\u0074\u0070\u0073\u003a\u002f\u002f\u0077\u0077\u0077\u002e\u0063\u006f\u0072\u0065\u0073\u0068\u006f\u0070\u002e\u0063\u006e\u002f \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #f1f1f1; padding:5px 0;');var a=layui.setter,n=layui.element,i=layui.admin,t=i.tabsPage,l=layui.view,r=function(){var e=layui.router(),o=e.path,y=i.correctRouter(e.path.join("/"));o.length||(o=[""]),""===o[o.length-1]&&(o[o.length-1]=a.entry);var h=function(e){r.haveInit&&d(".layui-layer").each(function(){var e=d(this),a=e.attr("times");e.hasClass("layui-layim")||layer.close(a)}),r.haveInit=!0,d(s).scrollTop(0),delete t.type};return"tab"===t.type&&("/"!==y||"/"===y&&i.tabsBody().html())?(i.tabsBodyChange(t.index),h(t.type)):(l().render(o.join("/")).then(function(l){var r,o=d("#LAY_app_tabsheader>li");o.each(function(e){var a=d(this),n=a.attr("lay-id");n===y&&(r=!0,t.index=e)}),a.pageTabs&&"/"!==y&&(r||(d(s).append(''),t.index=o.length,n.tabAdd(u,{title:""+(l.title||"新标签页")+"",id:y,attr:e.href}))),this.container=i.tabsBody(t.index),a.pageTabs||this.container.scrollTop(0),n.tabChange(u,y),i.tabsBodyChange(t.index)}).done(function(){layui.use("common",layui.cache.callback.common),c.on("resize",layui.data.resize),n.render("breadcrumb","breadcrumb"),i.tabsBody(t.index).on("scroll",function(){var e=d(this),a=d(".layui-laydate"),n=d(".layui-layer")[0];a[0]&&(a.each(function(){var e=d(this);e.hasClass("layui-laydate-static")||e.remove()}),e.find("input").blur()),n&&layer.closeAll("tips")})}),void h())},o=function(e){var n,t=layui.router(),o=l(a.container),s=i.correctRouter(t.path.join("/"));if(layui.each(a.indPage,function(e,a){if(s===a)return n=!0}),layui.config({base:a.base+"controller/"}),n||"/user/login"===s)o.render(t.path.join("/")).done(function(){i.pageType="alone"});else{if(a.interceptor){var u=layui.data(a.tableName);if(!u[a.request.tokenName])return location.hash="/user/login/redirect="+encodeURIComponent(s)}"console"===i.pageType?r():o.render("layout").done(function(){r(),layui.element.render(),i.screen()<2&&i.sideFlexible(),i.pageType="console"})}},s="#LAY_app_body",u="layadmin-layout-tabs",d=layui.$,c=d(window);layui.link(a.base+"style/admin.css?v="+(i.v+"-1"),function(){o()},"layuiAdmin"),window.onhashchange=function(){o(),layui.event.call(this,a.MOD_NAME,"hash({*})",layui.router())},layui.each(a.extend,function(e,n){var i={},t=a.extend.constructor===Array;i[t?n:e]="{/}"+a.base+"lib/extend/"+n,layui.extend(i)}),e("index",{render:r})}); \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/common/getGroupIds.html b/CoreCms.Net.Web.Admin/wwwroot/views/common/getGroupIds.html index c9478c68..a90815a3 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/common/getGroupIds.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/common/getGroupIds.html @@ -61,7 +61,7 @@ method: 'POST', toolbar: '#LAY-app-getGroupIds-toolbar', defaultToolbar: null, - where: { types: 3 }, + where: { id: 3 }, height: 'full-260',//无面包屑127,搜索框189,1行62 page: true, limit: 30, @@ -70,8 +70,8 @@ cols: [ [ { type: "checkbox", fixed: "left" }, - { field: 'id', title: '', width: 60, sort: false }, - { field: 'name', title: '团购(秒杀)名称', sort: false }, + { field: 'id', title: '序列', width: 60, sort: false }, + { field: 'name', title: '团购名称', sort: false }, { field: 'sort', title: '权重', sort: false, width: 105 }, ] ], diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/common/getSeckillIds.html b/CoreCms.Net.Web.Admin/wwwroot/views/common/getSeckillIds.html new file mode 100644 index 00000000..a3dce5dc --- /dev/null +++ b/CoreCms.Net.Web.Admin/wwwroot/views/common/getSeckillIds.html @@ -0,0 +1,132 @@ + + + + + + + \ 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 bd760661..97ba1d2d 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/pages/design.html @@ -225,7 +225,7 @@ - + {{item.value.title}} @@ -248,6 +248,29 @@ + + + + {{item.value.title}} + + + + + + + + {{goods.name||'此处显示商品名称'}} + + {{goods.price||'¥99.00'}} + + 剩余:21:30:45 + + + + + + + @@ -684,7 +707,7 @@ - + @@ -718,7 +741,46 @@ - 团购秒杀数据请到 促销管理 - 团购秒杀列表中管理 + 团购数据请到 促销管理 - 团购秒杀列表中管理 + + + + + + + + + + + + + + + + + + + {{goods.name}} + + + + + + + 选择商品 + + + + + + + + + + + + + 秒杀数据请到 促销管理 - 团购秒杀列表中管理 diff --git a/CoreCms.Net.Web.WebApi/Controllers/GroupController.cs b/CoreCms.Net.Web.WebApi/Controllers/GroupController.cs index 657fa8ae..bdafa4be 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/GroupController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/GroupController.cs @@ -34,17 +34,15 @@ namespace CoreCms.Net.Web.WebApi.Controllers private readonly IHttpContextUser _user; private readonly ICoreCmsPromotionServices _coreCmsPromotionServices; - private ICoreCmsGoodsServices _goodsServices; /// /// 构造函数 /// - public GroupController(IHttpContextUser user, ICoreCmsPromotionServices coreCmsPromotionServices, ICoreCmsGoodsServices goodsServices) + public GroupController(IHttpContextUser user, ICoreCmsPromotionServices coreCmsPromotionServices) { _user = user; _coreCmsPromotionServices = coreCmsPromotionServices; - _goodsServices = goodsServices; } @@ -58,7 +56,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers [HttpPost] public async Task GetList([FromBody] FMGroupGetListPost entity) { - var jm = await _coreCmsPromotionServices.GetGroupList(entity.type, _user.ID, entity.status, entity.page, entity.limit); + var jm = await _coreCmsPromotionServices.GetGroupList(entity.type, entity.status, entity.page, entity.limit); return jm; } @@ -72,7 +70,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers [HttpPost] public async Task GetGoodsDetial([FromBody] FMGetGoodsDetial entity) { - var jm = await _coreCmsPromotionServices.GetGroupDetail(entity.id, 0, entity.type, entity.groupId, entity.needSku); + var jm = await _coreCmsPromotionServices.GetGroupDetail(entity.id, 0, entity.type, entity.needSku); return jm; } #endregion diff --git a/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs b/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs index d93d824b..e727e40c 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/OrderController.cs @@ -16,6 +16,7 @@ using CoreCms.Net.Auth.HttpContextUser; using CoreCms.Net.Caching.AutoMate.RedisCache; using CoreCms.Net.Configuration; using CoreCms.Net.IServices; +using CoreCms.Net.Loging; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities.Expression; using CoreCms.Net.Model.FromBody; @@ -25,6 +26,7 @@ using CoreCms.Net.Utility.Extensions; using CoreCms.Net.Utility.Helper; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; using SqlSugar; namespace CoreCms.Net.Web.WebApi.Controllers @@ -48,6 +50,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers private readonly ICoreCmsGoodsServices _goodsServices; private readonly ICoreCmsStoreServices _storeServices; private readonly ICoreCmsOrderDistributionModelServices _orderDistributionModelServices; + private readonly ICoreCmsBillPaymentsServices _billPaymentsServices; private readonly IRedisOperationRepository _redisOperationRepository; @@ -61,7 +64,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers , ICoreCmsSettingServices settingServices , ICoreCmsAreaServices areaServices , ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices - , ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository) + , ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillPaymentsServices billPaymentsServices) { _user = user; _orderServices = orderServices; @@ -76,6 +79,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers _storeServices = storeServices; _orderDistributionModelServices = orderDistributionModelServices; _redisOperationRepository = redisOperationRepository; + _billPaymentsServices = billPaymentsServices; } @@ -269,6 +273,52 @@ namespace CoreCms.Net.Web.WebApi.Controllers } #endregion + #region 订单是否支付状态查询================================================== + /// + /// 订单预览 + /// + /// + [HttpPost] + [Authorize] + public async Task CheckOrderIsPaid([FromBody] FMStringId entity) + { + var jm = new WebApiCallBack(); + + var lockKey = "LOCK_CheckOrderIsPaid:user_" + _user.ID; + var lockHolder = Guid.NewGuid().ToString("N"); //锁持有者 + var redisUserLock = await _redisOperationRepository.LockTakeAsync(lockKey, lockHolder, TimeSpan.FromSeconds(5)); + if (redisUserLock) + { + try + { + if (string.IsNullOrEmpty(entity.id)) + { + jm.msg = "支付单编号不能为空"; + return jm; + } + var bl = await _orderServices.ExistsAsync(p => p.orderId == entity.id && (p.payStatus == (int)GlobalEnumVars.OrderPayStatus.Yes || p.payStatus == (int)GlobalEnumVars.OrderPayStatus.PartialYes), true); + jm.status = true; + jm.data = bl; + } + catch (Exception e) + { + jm.msg = "数据处理异常"; + jm.otherData = e; + NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.ApiRequest, "用户支付支付", JsonConvert.SerializeObject(jm)); + } + finally + { + await _redisOperationRepository.LockReleaseAsync(lockKey, lockHolder); + } + } + else + { + jm.msg = "当前请求太频繁_请稍后再试"; + } + return jm; + } + #endregion + #region 获取订单不同状态的数量================================================== /// /// 获取订单不同状态的数量 @@ -610,5 +660,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers #endregion + + } } \ No newline at end of file diff --git a/CoreCms.Net.Web.WebApi/Controllers/PageController.cs b/CoreCms.Net.Web.WebApi/Controllers/PageController.cs index 5eec51c2..939d5f0c 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/PageController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/PageController.cs @@ -84,45 +84,24 @@ namespace CoreCms.Net.Web.WebApi.Controllers /// [HttpPost] [Description("获取用户购买记录")] - public async Task GetRecod([FromBody] FMGetRecodPost entity) + public async Task GetRecord([FromBody] FMGetRecodPost entity) { var jm = new WebApiCallBack() { status = true, msg = "获取成功", otherData = entity }; - /*** - * 随机数 - * 其它随机数据,需要自己补充 - */ - //logo作为头像 - Random rand = new Random(); - + //随机数 + var rand = new Random(); + //获取配置项 var allConfigs = await _settingServices.GetConfigDictionaries(); - + //logo作为头像 var avatar = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.ShopLogo); - var names = new string[] { "无人像你", "啭裑①羣豞", "朕射妳无罪", "骑着蜗牛狂奔", "残孤星", "上网可以,别开QVOD", "请把QQ留下!", "蹭网可以,一小时两块钱", "I~在。哭泣", "不倾国倾城只倾他一人", "你再发光我就拔你插头", "家,世间最温暖的地方", "挥着鸡翅膀的女孩", "难不难过都是一个人过", "原谅我盛装出席只为错过你", "残孤星", "只适合被遗忘", "爱情,算个屁丶", "执子辶掱", "朕今晚翻你牌子", "①苆兜媞命", "中华一样的高傲", "始于心动止于枯骨", "我们幸福呢", "表白失败,勿扰", "髮型吥能亂", "陽咣丅啲憂喐", "你棺材是翻盖的还是滑盖的", "孤枕", "泪颜葬相思", "喵星人", "超拽霸气的微博名字", "晚安晚安晚晚难安", "却输给了秒", "为什么我吃德芙没有黑丝飘", "请输入我大" }; - var listUsers = new List(); - - foreach (var itemName in names) - { - var min = rand.Next(100, 1000); - var createTime = DateTime.Now.AddMinutes(-min); - listUsers.Add(new RandUser() - { - avatar = avatar, - createTime = CommonHelper.TimeAgo(createTime), - nickname = itemName, - desc = "下单成功", - dt = createTime - }); - } if (entity.type == "home") { //数据库里面随机取出来几条数据 - var orders = await _orderServices.QueryListByClauseAsync(p => p.isdel == false, 20, p => p.createTime, - OrderByType.Desc); + var orders = await _orderServices.QueryListByClauseAsync(p => p.isdel == false, 20, p => p.createTime, OrderByType.Desc, true, true, 60); if (orders != null && orders.Any()) { - Random rd = new Random(); + var rd = new Random(); var index = rd.Next(orders.Count); var orderItem = orders[index]; if (orderItem != null) @@ -143,7 +122,24 @@ namespace CoreCms.Net.Web.WebApi.Controllers } else { - Random rd = new Random(); + var names = new[] { "无人像你", "啭裑①羣豞", "朕射妳无罪", "骑着蜗牛狂奔", "残孤星", "上网可以,别开QVOD", "请把QQ留下!", "蹭网可以,一小时两块钱", "I~在。哭泣", "不倾国倾城只倾他一人", "你再发光我就拔你插头", "家,世间最温暖的地方", "挥着鸡翅膀的女孩", "难不难过都是一个人过", "原谅我盛装出席只为错过你", "残孤星", "只适合被遗忘", "爱情,算个屁丶", "执子辶掱", "朕今晚翻你牌子", "①苆兜媞命", "中华一样的高傲", "始于心动止于枯骨", "我们幸福呢", "表白失败,勿扰", "髮型吥能亂", "陽咣丅啲憂喐", "你棺材是翻盖的还是滑盖的", "孤枕", "泪颜葬相思", "喵星人", "超拽霸气的微博名字", "晚安晚安晚晚难安", "却输给了秒", "为什么我吃德芙没有黑丝飘", "请输入我大" }; + var listUsers = new List(); + + foreach (var itemName in names) + { + var min = rand.Next(100, 1000); + var createTime = DateTime.Now.AddMinutes(-min); + listUsers.Add(new RandUser() + { + avatar = avatar, + createTime = CommonHelper.TimeAgo(createTime), + nickname = itemName, + desc = "下单成功", + dt = createTime + }); + } + + var rd = new Random(); var listI = rd.Next(listUsers.Count); jm.data = listUsers[listI]; } diff --git a/CoreCms.Net.Web.WebApi/Controllers/PinTuanController.cs b/CoreCms.Net.Web.WebApi/Controllers/PinTuanController.cs index 5c5ea33f..2ded376d 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/PinTuanController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/PinTuanController.cs @@ -66,7 +66,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers /// /// [HttpPost] - public async Task GetList() + public async Task GetList([FromBody] FMPageByIntId entity) { WebApiCallBack jm; @@ -75,7 +75,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers { userId = _user.ID; } - jm = await _pinTuanRuleServices.GetPinTuanList(userId); + jm = await _pinTuanRuleServices.GetPinTuanList(userId, entity.page, entity.limit); return jm; } diff --git a/CoreCms.Net.Web.WebApi/Controllers/ServiceController.cs b/CoreCms.Net.Web.WebApi/Controllers/ServiceController.cs index fd0d7da1..ab3cf385 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/ServiceController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/ServiceController.cs @@ -92,7 +92,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers where = where.And(p => p.status == (int)GlobalEnumVars.ServicesStatus.Shelve); where = where.And(p => p.amount > 0); - where = where.And(p => p.startTime < dt && p.endTime > dt); + //where = where.And(p => p.startTime < dt && p.endTime > dt); var list = await _servicesServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit); @@ -101,30 +101,45 @@ namespace CoreCms.Net.Web.WebApi.Controllers var storesAll = await _storeServices.QueryAsync(); var userGradesAll = await _userGradeServices.QueryAsync(); - foreach (var data in list) + foreach (var item in list) { - TimeSpan ts = data.endTime.Subtract(dt); - data.timestamp = (int)ts.TotalSeconds; - if (!string.IsNullOrEmpty(data.consumableStore)) + if (item.startTime > dt) { - var consumableStoreStr = CommonHelper.GetCaptureInterceptedText(data.consumableStore, ","); + item.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun; + TimeSpan ts = item.startTime.Subtract(dt); + item.timestamp = (int)ts.TotalSeconds; + } + else if (item.startTime <= dt && item.endTime > dt) + { + item.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin; + TimeSpan ts = item.endTime.Subtract(dt); + item.timestamp = (int)ts.TotalSeconds; + } + else + { + item.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.haveExpired; + } + + if (!string.IsNullOrEmpty(item.consumableStore)) + { + var consumableStoreStr = CommonHelper.GetCaptureInterceptedText(item.consumableStore, ","); var consumableStoreIds = CommonHelper.StringToIntArray(consumableStoreStr); if (consumableStoreIds.Any()) { var stores = storesAll.Where(p => consumableStoreIds.Contains(p.id)).ToList(); - data.consumableStores = stores.Select(p => p.storeName).ToList(); + item.consumableStores = stores.Select(p => p.storeName).ToList(); } } - if (!string.IsNullOrEmpty(data.allowedMembership)) + if (!string.IsNullOrEmpty(item.allowedMembership)) { - var allowedMembershipStr = CommonHelper.GetCaptureInterceptedText(data.allowedMembership, ","); + var allowedMembershipStr = CommonHelper.GetCaptureInterceptedText(item.allowedMembership, ","); var allowedMembershipIds = CommonHelper.StringToIntArray(allowedMembershipStr); if (allowedMembershipIds.Any()) { var userGrades = userGradesAll.Where(p => allowedMembershipIds.Contains(p.id)).ToList(); - data.allowedMemberships = userGrades.Select(p => p.title).ToList(); + item.allowedMemberships = userGrades.Select(p => p.title).ToList(); } } } @@ -184,35 +199,25 @@ namespace CoreCms.Net.Web.WebApi.Controllers } } - int openStatus; - var lastTime = 0; if (serviceInfo.startTime > dt) { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun; + serviceInfo.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.notBegun; var ts = serviceInfo.startTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; + serviceInfo.timestamp = (int)ts.TotalSeconds; } else if (serviceInfo.startTime <= dt && serviceInfo.endTime > dt) { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin; + serviceInfo.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.begin; var ts = serviceInfo.endTime.Subtract(dt); - lastTime = (int)ts.TotalSeconds; + serviceInfo.timestamp = (int)ts.TotalSeconds; } else { - openStatus = (int)GlobalEnumVars.ServicesOpenStatus.haveExpired; + serviceInfo.openStatus = (int)GlobalEnumVars.ServicesOpenStatus.haveExpired; } - + jm.status = true; - jm.data = new - { - serviceInfo, - timer=new - { - openStatus, - lastTime, - } - }; + jm.data = serviceInfo; return jm; } diff --git a/CoreCms.Net.Web.WebApi/Controllers/StoreController.cs b/CoreCms.Net.Web.WebApi/Controllers/StoreController.cs index 9cc6ca43..af29dffe 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/StoreController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/StoreController.cs @@ -74,7 +74,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers { var jm = new WebApiCallBack(); - var ship = await _storeServices.QueryByClauseAsync(p => p.isDefault == true); + var ship = await _storeServices.QueryByClauseAsync(p => p.isDefault == true, true, true); jm.status = true; jm.data = ship; @@ -119,7 +119,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers } else { - item.distanceStr = "未知"; + item.distanceStr = ""; } } jm.data = data; @@ -243,7 +243,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers var store = await _storeServices.GetStoreByUserId(_user.ID); if (store != null) { - jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status,entity.receiptType, entity.storeId, entity.page, entity.limit); + jm = await _orderServices.GetOrderPageByMerchant(entity.dateType, entity.date, entity.status, entity.receiptType, entity.storeId, entity.page, entity.limit); } else { diff --git a/CoreCms.Net.Web.WebApi/appsettings.json b/CoreCms.Net.Web.WebApi/appsettings.json index 031def2a..9b35aed5 100644 --- a/CoreCms.Net.Web.WebApi/appsettings.json +++ b/CoreCms.Net.Web.WebApi/appsettings.json @@ -16,7 +16,7 @@ "AppConfig": { "AppUrl": "https://admin.test.pro.coreshop.cn/", //后端管理地址 "AppInterFaceUrl": "https://api.test.pro.coreshop.cn/", //接口请求地址 - "AppVersion": "CoreShopProfessional v0.6.2" + "AppVersion": "CoreShopProfessional v0.6.4" }, //redis为必须启动项,请保持redis为正常可用 "RedisConfig": { diff --git a/CoreShopProfessional.sln b/CoreShopProfessional.sln index 7a71697a..a5c15912 100644 --- a/CoreShopProfessional.sln +++ b/CoreShopProfessional.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29020.237 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "9.App", "9.App", "{9C52D39C-A85B-4D5E-B29C-724D6566AB04}" EndProject @@ -59,6 +59,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "5.WeChat", "5.WeChat", "{FD EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreCms.Net.WeChat.Service", "CoreCms.Net.WeChat.Service\CoreCms.Net.WeChat.Service.csproj", "{7CB698AD-DECF-43B9-A01A-E5E1E5738BAA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreCms.Net.DTO", "CoreCms.Net.DTO\CoreCms.Net.DTO.csproj", "{834DBA03-2302-4618-A65F-46C45F42BBD1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -153,6 +155,10 @@ Global {7CB698AD-DECF-43B9-A01A-E5E1E5738BAA}.Debug|Any CPU.Build.0 = Debug|Any CPU {7CB698AD-DECF-43B9-A01A-E5E1E5738BAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7CB698AD-DECF-43B9-A01A-E5E1E5738BAA}.Release|Any CPU.Build.0 = Release|Any CPU + {834DBA03-2302-4618-A65F-46C45F42BBD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {834DBA03-2302-4618-A65F-46C45F42BBD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {834DBA03-2302-4618-A65F-46C45F42BBD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {834DBA03-2302-4618-A65F-46C45F42BBD1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -180,6 +186,7 @@ Global {C9E6388D-A70F-48BF-8935-8E571BD3DF6B} = {9C52D39C-A85B-4D5E-B29C-724D6566AB04} {927E68B4-92D1-4F66-B137-87804055DE93} = {B3F41F4C-3681-48F3-9BE3-809763AC1937} {7CB698AD-DECF-43B9-A01A-E5E1E5738BAA} = {FD17E974-7FED-49C6-B9C9-90C8AE4849B7} + {834DBA03-2302-4618-A65F-46C45F42BBD1} = {CA1C3EDD-146A-4968-9E25-8FB393DA1D2E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A325D634-06E7-4F4E-BA15-AB3E14622FF1}
+ {{goods.name||'此处显示商品名称'}} +
{{goods.price||'¥99.00'}}
+ 剩余:21:30:45 +
- 团购秒杀数据请到 促销管理 - 团购秒杀列表中管理 + 团购数据请到 促销管理 - 团购秒杀列表中管理 +
{{goods.name}}
+ 秒杀数据请到 促销管理 - 团购秒杀列表中管理