Merge branch 'master' of http://47.108.235.38:8080/r/baifenbaishop
# Conflicts:
# CoreCms.Net.Services/Distribution/CoreCmsDistributionServices.cs
| | |
| | | /// </summary> |
| | | [Description("审核拒绝")] |
| | | VerifyRefuse = 3, |
| | | |
| | | /// <summary> |
| | | /// 审核拒绝 |
| | | /// </summary> |
| | | [Description("取消资格")] |
| | | VerifyCancel = 4, |
| | | } |
| | | /// <summary> |
| | | /// 经销商订单记录表是否结算状态 |
| | |
| | | public System.Decimal price { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商价格 |
| | | /// </summary> |
| | | public System.Decimal distributionPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商购买提成 |
| | | /// </summary> |
| | | public System.Decimal distributionCutMoney { get; set; } |
| | | /// <summary> |
| | | /// 普通商户购买提成 |
| | | /// </summary> |
| | | public System.Decimal cutMoney { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 货品市场价 |
| | | /// </summary> |
| | | |
| | |
| | | /// <param name="s"></param> |
| | | /// <returns></returns> |
| | | Task<List<SearchUserData>> SearchUserData(string s); |
| | | /// <summary> |
| | | /// 检查用户是否是经销商 |
| | | /// </summary> |
| | | /// <param name="UserId"></param> |
| | | /// <returns></returns> |
| | | |
| | | Task<bool> IsDictionary(int UserId); |
| | | } |
| | | |
| | | |
| | |
| | | * Description: 暂无 |
| | | ***********************************************************************/ |
| | | |
| | | using Chuanyin.Attribute; |
| | | using SqlSugar; |
| | | using System.ComponentModel; |
| | | using System.ComponentModel.DataAnnotations; |
| | |
| | | /// <summary> |
| | | /// 货品表 |
| | | /// </summary> |
| | | |
| | | public partial class CoreCmsProducts |
| | | { |
| | | /// <summary> |
| | |
| | | public System.Decimal costprice { get; set; } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 经销商价格 |
| | | /// </summary> |
| | | [Display(Name = "经销商价格")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | public System.Decimal distributionPrice { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 经销商提成 |
| | | /// </summary> |
| | | [Display(Name = "经销商提成")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | [SugarColumn( DefaultValue ="0",ColumnDescription = "经销商提成")] |
| | | public System.Decimal distributionCutMoney{ get; set; } |
| | | |
| | | /// <summary> |
| | | /// 普通商户提成 |
| | | /// </summary> |
| | | [Display(Name = "普通商户提成")] |
| | | [Required(ErrorMessage = "请输入{0}")] |
| | | [SugarColumn(DefaultValue = "0",ColumnDescription = "普通商户提成")] |
| | | public System.Decimal cutMoney { get; set; } |
| | | /// <summary> |
| | | /// 货品市场价 |
| | | /// </summary> |
| | |
| | | [SugarColumn(IsIgnore = true)] |
| | | public int reshipedNums { get; set; } = 0; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 货品信息 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(productId))] |
| | | public CoreCmsProducts productInfo { get; set; } |
| | | /// <summary> |
| | | /// 当前退货数量 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsIgnore = true)] |
| | | public string parentNickName { get; set; } |
| | | /// <summary> |
| | | /// 用户等级 |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToOne, nameof(grade))]//一对一 SchoolId是StudentA类里面的 |
| | | public CoreCmsUserGrade gradeInfo { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 店招图片地址 |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "店招图片地址")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "店招图片地址",Length =65535)] |
| | | public string StoreLogoUrl { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public decimal mktPrice { get; set; } |
| | | /// <summary> |
| | | /// 普通经销商分成 |
| | | /// </summary> |
| | | public decimal cutMoney { get; set; } |
| | | /// <summary> |
| | | /// 普通经销商分成 |
| | | /// </summary> |
| | | public decimal distributionCutMoney { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<string> sku_name_arr { get; set; } |
| | |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly ICoreCmsAgentOrderServices _agentOrderServices; |
| | | |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | public OrderAgentOrDistributionSubscribe(ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsDistributionOrderServices distributionOrderServices, ICoreCmsDistributionServices distributionServices, ICoreCmsSettingServices settingServices, ICoreCmsUserServices userServices, ICoreCmsAgentOrderServices agentOrderServices) |
| | | |
| | | public OrderAgentOrDistributionSubscribe(ICoreCmsBillPaymentsServices billPaymentsServices, ICoreCmsDistributionOrderServices distributionOrderServices, ICoreCmsDistributionServices distributionServices, ICoreCmsSettingServices settingServices, ICoreCmsUserServices userServices, ICoreCmsAgentOrderServices agentOrderServices ,IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | _billPaymentsServices = billPaymentsServices; |
| | | _distributionOrderServices = distributionOrderServices; |
| | |
| | | _settingServices = settingServices; |
| | | _userServices = userServices; |
| | | _agentOrderServices = agentOrderServices; |
| | | _bfbfComAPIService= bfbfComAPIService; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var jm = await _distributionOrderServices.AddData(order); //添加分享关联订单日志 |
| | | //判断是否可以成为经销商 |
| | | //先判断是否已经是经销商了。 |
| | | //百分兵法同意判决经销商 |
| | | bool check = await _distributionServices.ExistsAsync(p => p.userId == order.userId); |
| | | //bool check = await _bfbfComAPIService.IsDictionary( order.userId); |
| | | |
| | | var distributionType = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DistributionType).ObjectToInt(0); |
| | | if (distributionType == 3) //无需审核,但是要满足提交 |
| | | { |
| | |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.FromBody; |
| | |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using Newtonsoft.Json; |
| | | using NPOI.POIFS.Properties; |
| | | using SqlSugar; |
| | | |
| | | namespace CoreCms.Net.Repository |
| | |
| | | /// </summary> |
| | | public class CoreCmsGoodsRepository : BaseRepository<CoreCmsGoods>, ICoreCmsGoodsRepository |
| | | { |
| | | public CoreCmsGoodsRepository(IUnitOfWork unitOfWork) : base(unitOfWork) |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | public CoreCmsGoodsRepository(IUnitOfWork unitOfWork,IBfbfComAPIService bfbfComAPIService) : base(unitOfWork) |
| | | { |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | obj.goodsId = id; |
| | | obj.barcode = goods.bn; |
| | | obj.sn = p.sn; |
| | | |
| | | obj.price = p.price; |
| | | obj.costprice = p.costprice; |
| | | obj.mktprice = p.mktprice; |
| | |
| | | obj.isDefalut = p.isDefalut; |
| | | obj.isDel = false; |
| | | obj.images = p.images; |
| | | //百分兵法添加 |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionPrice= p.distributionPrice; |
| | | products.Add(obj); |
| | | |
| | | var pd = new CoreCmsProductsDistribution(); |
| | |
| | | pd.levelOne = p.levelOne; |
| | | pd.levelTwo = p.levelTwo; |
| | | pd.levelThree = p.levelThree; |
| | | |
| | | pds.Add(pd); |
| | | |
| | | }); |
| | |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.images = oldObj.images; |
| | | obj.distributionCutMoney = oldObj.distributionCutMoney; |
| | | obj.cutMoney = oldObj.cutMoney; |
| | | obj.distributionPrice = oldObj.distributionPrice; |
| | | |
| | | if (string.IsNullOrEmpty(obj.images)) |
| | | { |
| | |
| | | p.points = child.points; |
| | | p.stock = child.stock; |
| | | p.weight = child.weight; |
| | | p.distributionPrice = child.distributionPrice; |
| | | p.cutMoney = child.cutMoney; |
| | | p.distributionCutMoney = child.distributionCutMoney; |
| | | |
| | | } |
| | | }); |
| | |
| | | obj.points = p.points; |
| | | obj.isDefalut = p.isDefalut; |
| | | obj.images = p.images; |
| | | obj.distributionPrice = p.distributionPrice; |
| | | obj.cutMoney = p.cutMoney; |
| | | obj.distributionCutMoney = p.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(p.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.images = newObj.images; |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | obj.spesDesc = ""; |
| | | obj.isDefalut = true; |
| | | obj.isDel = false; |
| | | obj.distributionPrice = newObj.distributionPrice; |
| | | obj.cutMoney = newObj.cutMoney; |
| | | obj.distributionCutMoney = newObj.distributionCutMoney; |
| | | if (string.IsNullOrEmpty(newObj.images)) |
| | | { |
| | | obj.images = oldModel.image; |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | |
| | | labelIds = good.labelIds, |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | distributionPrice = pd.distributionPrice, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionPrice = pd.distributionPrice, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | labelIds = good.labelIds, |
| | | createTime = good.createTime, |
| | | isRecommend = good.isRecommend, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice=pd.distributionPrice, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | mktprice = pd.mktprice, |
| | |
| | | isRecommend = good.isRecommend, |
| | | isHot = good.isHot, |
| | | price = pd.price, |
| | | distributionCutMoney = pd.distributionCutMoney, |
| | | cutMoney = pd.cutMoney, |
| | | distributionPrice = pd.distributionPrice, |
| | | mktprice = pd.mktprice, |
| | | stock = pd.stock, |
| | | pointsDeduction = pd.pointsDeduction, |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | |
| | | private readonly ICoreCmsSolitaireServices _solitaireServices; |
| | | private readonly ICoreCmsUserShipServices _userShipServices; |
| | | private readonly ICoreCmsStoreServices _storeServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | private readonly IHttpContextUser _user; |
| | | |
| | | public CoreCmsCartServices( |
| | | ICoreCmsCartRepository dal |
| | |
| | | , ICoreCmsUserServices userServices |
| | | , ICoreCmsSettingServices settingServices |
| | | , ICoreCmsProductsServices productsServices |
| | | , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsSolitaireServices solitaireServices, ICoreCmsUserShipServices userShipServices, ICoreCmsStoreServices storeServices) |
| | | , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices |
| | | , IBfbfComAPIService bfbfComAPIService |
| | | ,ICoreCmsPromotionConditionServices promotionConditionServices |
| | | , ICoreCmsGoodsServices goodsServices |
| | | , ICoreCmsGoodsCategoryServices goodsCategoryServices |
| | | , ICoreCmsPromotionResultServices promotionResultServices |
| | | , ICoreCmsPinTuanRecordServices pinTuanRecordServices |
| | | , ICoreCmsSolitaireServices solitaireServices |
| | | , ICoreCmsUserShipServices userShipServices |
| | | , ICoreCmsStoreServices storeServices |
| | | ,IHttpContextUser user) |
| | | { |
| | | this._dal = dal; |
| | | base.BaseDal = dal; |
| | |
| | | _solitaireServices = solitaireServices; |
| | | _userShipServices = userShipServices; |
| | | _storeServices = storeServices; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | _user = user; |
| | | } |
| | | |
| | | #region 设置购物车商品数量==================================================== |
| | |
| | | { |
| | | case (int)GlobalEnumVars.OrderType.Common: |
| | | //标准模式不需要修改订单数据和商品数据 |
| | | { |
| | | if(await _bfbfComAPIService.IsDictionary(_user.ID)) |
| | | { |
| | | foreach (var item in cartDto.list) |
| | | { |
| | | item.products.price=item.products.distributionPrice; |
| | | |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case (int)GlobalEnumVars.OrderType.PinTuan: |
| | | //拼团模式走拼团价,去修改商品价格 |
| | |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.ViewModels.Basics; |
| | |
| | | private readonly ICoreCmsGoodsServices _goodsServices; |
| | | private readonly ICoreCmsDistributionOrderDetailsServices _distributionOrderDetailsServices; |
| | | private readonly ICoreCmsSettingServices _settingServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | public CoreCmsDistributionOrderServices(IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsDistributionOrderDetailsServices distributionOrderDetailsServices, ICoreCmsSettingServices settingServices) |
| | | public CoreCmsDistributionOrderServices(IBfbfComAPIService bfbfComAPIService, IUnitOfWork unitOfWork, ICoreCmsDistributionOrderRepository dal, ICoreCmsDistributionServices distributionServices, ICoreCmsUserBalanceServices balanceServices, ICoreCmsOrderServices orderServices, ICoreCmsUserServices userServices, ICoreCmsOrderItemServices orderItemServices, ICoreCmsProductsDistributionServices productsDistributionServices, ICoreCmsProductsServices productsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsDistributionOrderDetailsServices distributionOrderDetailsServices, ICoreCmsSettingServices settingServices) |
| | | { |
| | | this._dal = dal; |
| | | _distributionServices = distributionServices; |
| | |
| | | _settingServices = settingServices; |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | if (user is { parentId: > 0 }) |
| | | { |
| | | //获取购物明细 |
| | | var orderItems = await _orderItemServices.QueryListByClauseAsync(p => p.orderId == order.orderId); |
| | | var orderItems = await _unitOfWork.GetDbClient().Queryable<CoreCmsOrderItem>().Where(p => p.orderId == order.orderId).Includes(x => x.productInfo).ToListAsync(); |
| | | //await _orderItemServices.QueryListByClauseAsync(p => p.orderId == order.orderId); |
| | | var goodIds = orderItems.Select(p => p.goodsId).ToList(); |
| | | var productIds = orderItems.Select(p => p.productId).ToList(); |
| | | //获取货品数据 |
| | |
| | | var user = await _userServices.QueryByClauseAsync(p => p.id == userId); |
| | | if (user != null) |
| | | { |
| | | |
| | | var commission = await _distributionServices.GetGradeAndCommission(user.id); |
| | | if (commission.status && commission.data != null) //不是经销商的,不返利。 |
| | | { |
| | |
| | | //直返本级 |
| | | decimal amount = 0; |
| | | var distributionOrderDetails = new List<CoreCmsDistributionOrderDetails>(); |
| | | |
| | | //百分兵法判断订单用户是否是经销商 |
| | | bool OderUserIsDic = await _bfbfComAPIService.IsDictionary(order.userId); |
| | | foreach (var item in orderItems) |
| | | { |
| | | var orderDetails = new CoreCmsDistributionOrderDetails(); |
| | |
| | | //如果去掉优惠需要负了,就为0 |
| | | if (itemAmount < 0) itemAmount = 0; |
| | | |
| | | |
| | | |
| | | mathMoney = level switch |
| | | { |
| | | //一级分销 |
| | |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | mathMoney = level switch |
| | | //百分兵法基数按 |
| | | switch (level) |
| | | { |
| | | 1 when productsDistribution.levelOne > 0 => Math.Round( |
| | | productsDistribution.levelOne * item.nums, 2), |
| | | 2 when productsDistribution.levelTwo > 0 => Math.Round( |
| | | productsDistribution.levelTwo * item.nums, 2), |
| | | 3 when productsDistribution.levelThree > 0 => Math.Round( |
| | | productsDistribution.levelThree * item.nums, 2), |
| | | _ => mathMoney |
| | | }; |
| | | case 1 : |
| | | |
| | | if(OderUserIsDic) |
| | | //是经销商购买 |
| | | mathMoney = item.productInfo.distributionCutMoney; |
| | | else |
| | | //非经销商购买 |
| | | mathMoney= item.productInfo.cutMoney ; |
| | | |
| | | break; |
| | | case 2 when productsDistribution.levelTwo > 0: |
| | | break; |
| | | case 3 when productsDistribution.levelThree>0: |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | //原佣金计算方法 |
| | | //mathMoney = level switch |
| | | //{ |
| | | // 1 when productsDistribution.levelOne > 0 => Math.Round( |
| | | // productsDistribution.levelOne * item.nums, 2), |
| | | // 2 when productsDistribution.levelTwo > 0 => Math.Round( |
| | | // productsDistribution.levelTwo * item.nums, 2), |
| | | // 3 when productsDistribution.levelThree > 0 => Math.Round( |
| | | // productsDistribution.levelThree * item.nums, 2), |
| | | // _ => mathMoney |
| | | //}; |
| | | } |
| | | |
| | | amount += mathMoney; |
| | |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.apply; |
| | |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | private readonly ICoreCmsUserBalanceServices _userBalanceServices; |
| | | private readonly ICoreCmsUserServices _coreCmsUserServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | public CoreCmsDistributionServices(IUnitOfWork unitOfWork, ICoreCmsDistributionRepository dal, ICoreCmsDistributionOrderRepository distributionOrderRepository, ICoreCmsUserRepository userRepository, ICoreCmsGoodsRepository goodsRepository, ICoreCmsUserGradeRepository userGradeRepository, ICoreCmsSettingServices settingServices, ICoreCmsOrderRepository orderRepository, ICoreCmsDistributionGradeRepository distributionGradeRepository, ICoreCmsDistributionResultRepository distributionResultRepository, ICoreCmsDistributionConditionServices coreCmsDistributionConditionServices, ICoreCmsUserBalanceServices userBalanceServices |
| | | |
| | | |
| | | public CoreCmsDistributionServices(IBfbfComAPIService bfbfComAPIService, IUnitOfWork unitOfWork, ICoreCmsDistributionRepository dal, ICoreCmsDistributionOrderRepository distributionOrderRepository, ICoreCmsUserRepository userRepository, ICoreCmsGoodsRepository goodsRepository, ICoreCmsUserGradeRepository userGradeRepository, ICoreCmsSettingServices settingServices, ICoreCmsOrderRepository orderRepository, ICoreCmsDistributionGradeRepository distributionGradeRepository, ICoreCmsDistributionResultRepository distributionResultRepository, ICoreCmsDistributionConditionServices coreCmsDistributionConditionServices, ICoreCmsUserBalanceServices userBalanceServices |
| | | , ICoreCmsUserServices coreCmsUserServices) |
| | | { |
| | | this._dal = dal; |
| | |
| | | _userBalanceServices = userBalanceServices; |
| | | _coreCmsUserServices = coreCmsUserServices; |
| | | |
| | | |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | |
| | | |
| | | } |
| | |
| | | public async Task<WebApiCallBack> GetGradeAndCommission(int userId) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | | //百分兵法判断是否是经销商 |
| | | if(await _bfbfComAPIService.IsDictionary(userId)) |
| | | { |
| | | jm.msg = "不是经销商的,不返利"; |
| | | return jm; |
| | | } |
| | | |
| | | var info = await _dal.QueryByClauseAsync(p => p.userId == userId); |
| | | if (info == null) |
| | |
| | | var da= await _dal.GetCountAsync(x=>x.userId== Parma.UserID && x.verifyStatus== (int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes,isDataCache:true,cacheTimes:1); |
| | | if (da == 0) |
| | | return true; |
| | | var oder = new DistributionAchievementOrder |
| | | DistributionAchievementOrder oder = new DistributionAchievementOrder |
| | | { |
| | | achievementTotal = Parma.Money, |
| | | createBy = "经销商业绩写入", |
| | |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | |
| | | private readonly ICoreCmsOrderItemServices _orderItemServices; |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly ICoreCmsUserGradeServices _userGradeServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | |
| | | , ICoreCmsPromotionServices promotionServices |
| | | , ICoreCmsGoodsCollectionServices goodsCollectionServices |
| | | , ICoreCmsBrandServices brandServices |
| | | , ICoreCmsOrderItemServices orderItemServices, ICoreCmsUserServices userServices, ICoreCmsUserGradeServices userGradeServices, IServiceProvider serviceProvider) |
| | | , ICoreCmsOrderItemServices orderItemServices, ICoreCmsUserServices userServices, ICoreCmsUserGradeServices userGradeServices, IServiceProvider serviceProvider, IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | this._dal = dal; |
| | | base.BaseDal = dal; |
| | |
| | | _userServices = userServices; |
| | | _userGradeServices = userGradeServices; |
| | | _serviceProvider = serviceProvider; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //获取会员级别优惠价 |
| | | //获取会员等级优惠价格体系 |
| | | decimal gradePrice = 0; |
| | | //百分兵法增加 |
| | | bool IsDictionary = await _bfbfComAPIService.IsDictionary(userId); |
| | | if (userId > 0 && type == "goods") |
| | | { |
| | | //获取用户信息 |
| | |
| | | if (userInfo != null) |
| | | { |
| | | var goodsGrades = await _goodsGradeServices.QueryByClauseAsync(p => p.goodsId == good.id && p.gradeId == userInfo.grade); |
| | | //对接经销商会员 |
| | | |
| | | if (goodsGrades != null) |
| | | { |
| | | gradePrice = goodsGrades.gradePrice; |
| | |
| | | item.goods_id = good.id.ToString(); |
| | | item.goods_name = good.name; |
| | | item.image = o.images; |
| | | if(!IsDictionary) |
| | | item.price = o.price - gradePrice; //减去会员等级价格 |
| | | else |
| | | item.price = o.distributionPrice; |
| | | item.sku_name_arr = o.spesDesc.Split(",").Select(s => s.Split(":")[1]).ToList(); |
| | | item.stock = o.stock; |
| | | item.cutMoney = o.cutMoney; |
| | | item.distributionCutMoney = o.distributionCutMoney; |
| | | item.mktPrice = o.mktprice; |
| | | item.selPrice = o.price; |
| | | if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) |
| | |
| | | item.goods_id = good.id.ToString(); |
| | | item.goods_name = good.name; |
| | | item.image = o.images; |
| | | if (!IsDictionary) |
| | | item.price = o.price - gradePrice; //减去会员等级价格 |
| | | else |
| | | item.price = o.distributionPrice; |
| | | //item.price = o.price - gradePrice; //减去会员等级价格 |
| | | item.sku_name_arr = new List<string> { "默认" }; |
| | | item.stock = o.stock; |
| | | item.cutMoney = o.cutMoney; |
| | | item.distributionCutMoney = o.distributionCutMoney; |
| | | item.mktPrice = o.mktprice; |
| | | item.selPrice = o.price; |
| | | if (type == GlobalEnumVars.OrderType.PinTuan.ToString().ToLowerInvariant()) |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using CoreCms.Net.Auth.HttpContextUser; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IRepository; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Loging; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | |
| | | private readonly ICoreCmsPinTuanRuleServices _pinTuanRuleServices; |
| | | private readonly ICoreCmsServicesServices _servicesServices; |
| | | private readonly ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices; |
| | | |
| | | |
| | | private readonly IHttpContextUser _contextUser; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | 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, ICoreCmsArticleTypeServices articleTypeServices, ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices) |
| | | , ICoreCmsPagesItemsRepository pagesItemsRepository, |
| | | ICoreCmsPromotionServices promotionServices, |
| | | ICoreCmsNoticeServices noticeServices, |
| | | ICoreCmsGoodsCategoryServices goodsCategoryServices, |
| | | ICoreCmsSettingServices settingServices, |
| | | ICoreCmsGoodsServices goodsServices, |
| | | ICoreCmsArticleServices articleServices, |
| | | ICoreCmsPromotionConditionServices promotionConditionServices, |
| | | ICoreCmsPinTuanRuleServices pinTuanRuleServices, |
| | | ICoreCmsServicesServices servicesServices, |
| | | ICoreCmsArticleTypeServices articleTypeServices, |
| | | ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices, |
| | | IHttpContextUser httpContextUser, |
| | | IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | this._dal = dal; |
| | | _pagesItemsRepository = pagesItemsRepository; |
| | |
| | | _goodsCategoryExtendServices = goodsCategoryExtendServices; |
| | | base.BaseDal = dal; |
| | | _unitOfWork = unitOfWork; |
| | | _contextUser= httpContextUser; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | |
| | |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> GetPageConfig(string code) |
| | | { |
| | | var userID= _contextUser.ID; |
| | | |
| | | var jm = new WebApiCallBack(); |
| | | |
| | |
| | | break; |
| | | case "goodTabBar": |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters); |
| | | if (parameters != null && parameters.ContainsKey("list")) |
| | | { |
| | |
| | | limit = limit > 0 ? limit : 10; |
| | | |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, p => p.createTime, OrderByType.Desc, true, true, 60); |
| | | |
| | | if(goods!=null) |
| | | { |
| | | //百分兵法经销商修改价格 |
| | | if(isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | limit = limit > 0 ? limit : 10; |
| | | |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, limit, " sort asc,id asc ", true, true, 60); |
| | | if (goods != null) |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | //百分兵法经销商修改价格 |
| | | if (isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | count = goodids.Count; |
| | | } |
| | | var goods = await _goodsServices.QueryListByComponentsAsync(where, count, orderBy, true, true, 60); |
| | | if (goods != null) |
| | | { |
| | | bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID); |
| | | //百分兵法经销商修改价格 |
| | | if (isDic) |
| | | { |
| | | foreach (var gd in goods) |
| | | { |
| | | gd.price = gd.distributionPrice; |
| | | } |
| | | } |
| | | } |
| | | if (goods != null && goods.Any()) |
| | | { |
| | | var result = JArray.FromObject(goods); |
| | |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IRepository.UnitOfWork; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly IUnitOfWork _unitOfWork; |
| | | |
| | | public BfbfComAPIService(ICoreCmsUserServices userServices,IUnitOfWork unitOfWork) |
| | | private readonly ICoreCmsSettingServices _coreCmsSettingServices; |
| | | public BfbfComAPIService(ICoreCmsUserServices userServices,IUnitOfWork unitOfWork, ICoreCmsSettingServices coreCmsSettingServices) |
| | | { |
| | | _userServices = userServices; |
| | | _unitOfWork = unitOfWork; |
| | | _coreCmsSettingServices = coreCmsSettingServices; |
| | | } |
| | | public async Task<List<SearchUserData>> SearchUserData(string s) |
| | | { |
| | |
| | | } |
| | | return ListData.Where(x => x.name.Contains(s)).ToList(); |
| | | } |
| | | |
| | | public async Task<bool> IsDictionary(int UserId) |
| | | { |
| | | if (UserId == 0) |
| | | return false; |
| | | var user=await _unitOfWork.GetDbClient().Queryable<CoreCmsUser>().Includes(x=>x.gradeInfo).Where(x=>x.id== UserId).WithCache(10).SingleAsync(); |
| | | if (user == null) |
| | | return false; |
| | | if(user.gradeInfo==null) |
| | | return false; |
| | | var allConfigs = await _coreCmsSettingServices.GetConfigDictionaries(); |
| | | var kc = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.DictionaryUserGroupKey); |
| | | if (user.gradeInfo.valueKey == kc) |
| | | return true; |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | oldmod.Oders = entity.Oders; |
| | | |
| | | foreach (var meetin in entity.meetings) |
| | | foreach (OfflineDistributorMeeting meetin in entity.meetings) |
| | | { |
| | | if (meetin.id == 9999999) |
| | | { |
| | |
| | | <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess> |
| | | <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> |
| | | <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> |
| | | <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">E:\NUGET\</NuGetPackageRoot> |
| | | <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">E:\NUGET\</NuGetPackageFolders> |
| | | <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> |
| | | <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> |
| | | <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> |
| | | <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.0</NuGetToolVersion> |
| | | <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.2</NuGetToolVersion> |
| | | </PropertyGroup> |
| | | <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> |
| | | <SourceRoot Include="E:\NUGET\" /> |
| | | <SourceRoot Include="C:\Users\Administrator\.nuget\packages\" /> |
| | | <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" /> |
| | | </ItemGroup> |
| | | </Project> |
| | |
| | | { |
| | | where = where.And(p => p.grade == grade); |
| | | } |
| | | //用户等级 int |
| | | var isBaifenPromotion = Request.Form["isBaifenPromotion"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(isBaifenPromotion)) |
| | | { |
| | | if(isBaifenPromotion=="1") |
| | | where = where.And(p => p.IsBaifenPromotion == true); |
| | | else |
| | | where = where.And(p => p.IsBaifenPromotion == false); |
| | | } |
| | | //创建时间 datetime |
| | | var createTime = Request.Form["createTime"].FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(createTime)) |
| | |
| | | dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" |
| | | connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" |
| | | --> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=localhost\SQLEXPRESS;User ID=sa;Password=123456;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;Trusted_Connection=True; "> |
| | | <commandText> |
| | | INSERT INTO SysNLogRecords |
| | | (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod |
| | |
| | | container: 'LAY_app', // 容器ID |
| | | entry: 'index', // 默认视图文件名 |
| | | engine: '.html', // 视图文件后缀名 |
| | | pageTabs: true, // 是否开启页面选项卡功能。单页版不推荐开启 |
| | | pageTabs: false, // 是否开启页面选项卡功能。单页版不推荐开启 |
| | | refreshCurrPage: true, // 当跳转页面 url 与当前页 url 相同时,是否自动执行刷新 |
| | | |
| | | name: '百分兵法', |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="storeLogoUrl">店招</label> |
| | | <div class="layui-input-inline layui-inline-6"> |
| | | <input name="storeLogoUrl" id="storeLogoUrl" size="15" autocomplete="off" class="layui-input" lay-reqText="请输入【缩略图】" /> |
| | | <input name="storeLogoUrl1" type="hidden" id="storeLogoUrlc1" size="15" autocomplete="off" class="layui-input" lay-reqText="请输入【缩略图】" /> |
| | | <input name="storeLogoUrl2" type="hidden" id="storeLogoUrlc2" size="15" autocomplete="off" class="layui-input" lay-reqText="请输入【缩略图】" /> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalCreat">上传图像</button> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalCreat1">上传图像</button> |
| | | <div class="layui-input-inline"> |
| | | <img class="layui-upload-img" id="viewImgBox" src="{{ layui.setter.noImagePicUrl }}"> |
| | | <p id="viewTextBox"></p> |
| | | <img class="layui-upload-img" id="viewImgBox1" src="{{ layui.setter.noImagePicUrl }}"> |
| | | <p id="viewTextBox1"></p> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalCreat2">上传图像</button> |
| | | <div class="layui-input-inline"> |
| | | <img class="layui-upload-img" id="viewImgBox2" src="{{ layui.setter.noImagePicUrl }}"> |
| | | <p id="viewTextBox2"></p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | formatUserSelInPut(coreHelper, form, "CreatOfflinedisSelUserID"); |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: '#upBtnOriginalCreat' |
| | | elem: '#upBtnOriginalCreat1' |
| | | , url: layui.setter.apiUrl + 'Api/Tools/UploadFiles' |
| | | , before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $('#viewImgBox').attr('src', result); |
| | | $('#viewImgBox1').attr('src', result); |
| | | }); |
| | | } |
| | | , done: function (res) { |
| | | if (res.code > 0) { return layer.msg('上传失败'); } |
| | | layer.msg('上传成功'); |
| | | $("#storeLogoUrl").val(res.data.fileUrl); |
| | | $("#storeLogoUrlc1").val(res.data.fileUrl); |
| | | } |
| | | , error: function () { |
| | | var viewTextBox = $('#viewTextBox'); |
| | | var viewTextBox = $('#viewTextBox1'); |
| | | viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>'); |
| | | viewTextBox.find('.demo-reload').on('click', function () { |
| | | uploadInst.upload(); |
| | | }); |
| | | } |
| | | }); |
| | | upload.render({ |
| | | elem: '#upBtnOriginalCreat2' |
| | | , url: layui.setter.apiUrl + 'Api/Tools/UploadFiles' |
| | | , before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $('#viewImgBox2').attr('src', result); |
| | | }); |
| | | } |
| | | , done: function (res) { |
| | | if (res.code > 0) { return layer.msg('上传失败'); } |
| | | layer.msg('上传成功'); |
| | | $("#storeLogoUrlc2").val(res.data.fileUrl); |
| | | } |
| | | , error: function () { |
| | | var viewTextBox = $('#viewTextBox2'); |
| | | viewTextBox.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>'); |
| | | viewTextBox.find('.demo-reload').on('click', function () { |
| | | uploadInst.upload(); |
| | |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | |
| | | <div class="layui-input-inline" style="padding-left: 100px;" > |
| | | <div style="display: flex;" > |
| | | {{# layui.each(d.params.data.storeLogoUrl.split(','), function(index, item){ }} |
| | | |
| | | <img |
| | | class="layui-upload-img" |
| | | id="viewImgBoxEdit" |
| | | src="{{ d.params.data.storeLogoUrl || layui.setter.noImagePicUrl ||''}}" |
| | | style=" margin-left: 5px;" |
| | | src="{{ item || layui.setter.noImagePicUrl ||''}}" |
| | | /> |
| | | |
| | | |
| | | {{#})}} |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <label for="StoreLogoUrl" class="layui-form-label ">店招</label> |
| | | <div class="layui-input-inline" style="width: 300px;"> |
| | | <input |
| | | name="storeLogoUrl" |
| | | name="storeLogoUrl1" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入店招图片地址" |
| | | lay-reqText="请输入店招图片地址" |
| | | value="{{d.params.data.storeLogoUrl || '' }}" |
| | | value="{{d.params.data.storeLogoUrl1 || '' }}" |
| | | id="viewTextBoxEdittext" |
| | | type="hidden" |
| | | /> |
| | | <input |
| | | name="storeLogoUrl2" |
| | | lay-verType="tips" |
| | | class="layui-input" |
| | | placeholder="请输入店招图片地址" |
| | | lay-reqText="请输入店招图片地址" |
| | | value="{{d.params.data.storeLogoUrl2 || '' }}" |
| | | id="viewTextBoxEdittext2" |
| | | type="hidden" |
| | | /> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalEdit"> |
| | | 上传图像 |
| | | 修改图片 |
| | | </button> |
| | | <div class="layui-input-inline"> |
| | | <img |
| | | class="layui-upload-img" |
| | | id="viewImgBoxEdit" |
| | | src="{{ d.params.data.storeLogoUrl || layui.setter.noImagePicUrl ||''}}" |
| | | src="{{ d.params.data.storeLogoUrl1|| ''}}" |
| | | /> |
| | | <div class="layui-input-inline"> |
| | | <div id="viewTextBoxEdit"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn" id="upBtnOriginalEdit2"> |
| | | 修改图片 |
| | | </button> |
| | | <div class="layui-input-inline"> |
| | | <img |
| | | class="layui-upload-img" |
| | | id="viewImgBoxEdit2" |
| | | src="{{ d.params.data.storeLogoUrl2 ||''}}" |
| | | /> |
| | | <div class="layui-input-inline"> |
| | | <div id="viewTextBoxEdit2"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | table = layui.table, |
| | | coreHelper = layui.coreHelper; |
| | | |
| | | if( d.params.data.storeLogoUrl!=null&&d.params.data.storeLogoUrl!=undefined&&d.params.data.storeLogoUrl!="") |
| | | { |
| | | |
| | | // 拆分storeLogoUrl |
| | | var storeLogoUrl=d.params.data.storeLogoUrl.split(","); |
| | | for (let index = 0; index < storeLogoUrl.length; index++) { |
| | | |
| | | if(index>1) |
| | | break; |
| | | if(index==0) |
| | | {d.params.data.storeLogoUrl1 = storeLogoUrl[index]; |
| | | $("#viewImgBoxEdit").attr("src", d.params.data.storeLogoUrl1); |
| | | $("#viewTextBoxEdittext").val(d.params.data.storeLogoUrl1); |
| | | } |
| | | else |
| | | { d.params.data.storeLogoUrl2 = storeLogoUrl[index]; |
| | | $("#viewImgBoxEdit2").attr("src", d.params.data.storeLogoUrl2); |
| | | $("#viewTextBoxEdittext2").val(d.params.data.storeLogoUrl2); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | formatAreaInPut( |
| | | coreHelper, |
| | | "editOfflinedisRegion", |
| | |
| | | return layer.msg("上传失败"); |
| | | } |
| | | layer.msg("上传成功"); |
| | | $("#upBtnOriginalEdit").val(res.data.fileUrl); |
| | | $("#viewTextBoxEdittext").val(res.data.fileUrl); |
| | | }, |
| | | error: function () { |
| | | var viewTextBox = $("#viewTextBoxEdit"); |
| | |
| | | }); |
| | | }, |
| | | }); |
| | | //普通图片上传 |
| | | upload.render({ |
| | | elem: "#upBtnOriginalEdit2", |
| | | url: layui.setter.apiUrl + "Api/Tools/UploadFiles", |
| | | before: function (obj) { |
| | | obj.preview(function (index, file, result) { |
| | | $("#viewImgBoxEdit2").attr("src", result); |
| | | }); |
| | | }, |
| | | done: function (res) { |
| | | if (res.code > 0) { |
| | | return layer.msg("上传失败"); |
| | | } |
| | | layer.msg("上传成功"); |
| | | $("#viewTextBoxEdittext2").val(res.data.fileUrl); |
| | | }, |
| | | error: function () { |
| | | var viewTextBox = $("#viewTextBoxEdit2"); |
| | | viewTextBox.html( |
| | | '<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>' |
| | | ); |
| | | viewTextBox.find(".demo-reload").on("click", function () { |
| | | uploadInst.upload(); |
| | | }); |
| | | }, |
| | | }); |
| | | dropdown.render({ |
| | | elem: "#EditCooperationIntent", |
| | | data: [ |
| | |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | |
| | | { field: "school", title: "学校名称", sort: false, width: 105 }, |
| | | { field: "dealerName", title: "经销商名称", sort: false ,width: 105}, |
| | | { |
| | | field: 'storeLogoUrl', title: '店招', width: 120, sort: false, |
| | | templet: function (d) { |
| | | if (d.storeLogoUrl) { |
| | | |
| | | var listimg= d.storeLogoUrl.split(",") |
| | | var str=""; |
| | | listimg.forEach((value,index)=> |
| | | { |
| | | str+= '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + value + '")><image style="max-width:30px;max-height:30px; margin-left: 5px;" src="' + value + '" /></a>' |
| | | |
| | | }) |
| | | |
| | | return str; |
| | | } else { |
| | | return '<a href="javascript:void(0);" onclick=layui.coreHelper.viewImage("' + setter.noImagePicUrl + '")><image style="max-width:30px;max-height:30px; margin-left: 5px;" src="' + setter.noImagePicUrl + '" /></a>'; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: "contactPerson", |
| | | title: "联系人姓名", |
| | | sort: false, |
| | | width: 105, |
| | | }, |
| | | |
| | | { |
| | | field: "phoneNumber", |
| | | title: "联系电话", |
| | |
| | | width: 105, |
| | | templet: "#OffdismeetingCountTmp", |
| | | }, |
| | | |
| | | { |
| | | field: "money", |
| | | title: "订货记录", |
| | |
| | | "submit(LAY-app-OfflineDistributor-createForm-submit)", |
| | | function (data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.storeLogoUrl=""; |
| | | field.isdelete = field.isdelete == "on"; |
| | | if((!!field.storeLogoUrl1)&&(!!field.storeLogoUrl2)) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl1+","+field.storeLogoUrl2; |
| | | } |
| | | else |
| | | if(!!field.storeLogoUrl1) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl1; |
| | | } |
| | | else if(!!field.storeLogoUrl2) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl2; |
| | | }; |
| | | |
| | | |
| | | field.region = GetAreaCodeFormFileid( |
| | | field, |
| | | "CreatofflinedisRegion" |
| | |
| | | "submit(LAY-app-OfflineDistributor-editForm-submit)", |
| | | function (data) { |
| | | var field = data.field; //获取提交的字段 |
| | | debugger |
| | | field.storeLogoUrl=""; |
| | | if((!!field.storeLogoUrl1)&&(!!field.storeLogoUrl2)) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl1+","+field.storeLogoUrl2; |
| | | } |
| | | else |
| | | if(!!field.storeLogoUrl1) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl1; |
| | | } |
| | | else if(!!field.storeLogoUrl2) |
| | | { |
| | | field.storeLogoUrl=field.storeLogoUrl2; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | field.isdelete = field.isdelete == "on"; |
| | | field.region = GetAreaCodeFormFileid( |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-form-item"> |
| | | <label for="reMaker" class="layui-form-label" |
| | | >备注</label |
| | | > |
| | | <div class="layui-input-inline"> |
| | | <div class="layui-input-block"> |
| | | <input |
| | | name="reMaker" |
| | | lay-verType="tips" |
| | |
| | | <div class="layui-form-item"> |
| | | <label for="PromoteMoney" class="layui-form-label layui-form-required">推广费用</label> |
| | | <div class="layui-input-inline"> |
| | | <input name="PromoteMoney" disabled lay-verType="tips" lay-verify="required|number" class="layui-input" placeholder="请输入推广费用" lay-reqText="请输入推广费用" value="{{d.params.data.promoteMoney || '' }}" /> |
| | | <input name="promoteMoney" disabled lay-verType="tips" lay-verify="required|number" class="layui-input" placeholder="请输入推广费用" lay-reqText="请输入推广费用" value="{{d.params.data.promoteMoney || '' }}" /> |
| | | |
| | | </div> |
| | | <span class="layui-form-mid layui-word-aux">元</span> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-form-item"> |
| | | <label for="reMaker" class="layui-form-label " |
| | | >备注</label |
| | | > |
| | |
| | | ); |
| | | }; |
| | | |
| | | Date.prototype.Format = function (fmt) { |
| | | //author: meizz |
| | | var o = { |
| | | "M+": this.getMonth() + 1, //月份 |
| | | "d+": this.getDate(), //日 |
| | | "h+": this.getHours(), //小时 |
| | | "m+": this.getMinutes(), //分 |
| | | "s+": this.getSeconds(), //秒 |
| | | "q+": Math.floor((this.getMonth() + 3) / 3), //季度 |
| | | }; |
| | | if (/(y+)/.test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | (this.getFullYear() + "").substr(4 - RegExp.$1.length) |
| | | ); |
| | | for (var k in o) |
| | | if (new RegExp("(" + k + ")").test(fmt)) |
| | | fmt = fmt.replace( |
| | | RegExp.$1, |
| | | RegExp.$1.length == 1 |
| | | ? o[k] |
| | | : ("00" + o[k]).substr(("" + o[k]).length) |
| | | ); |
| | | return fmt; |
| | | }; |
| | | |
| | | </script> |
| | |
| | | }, |
| | | { field: "platforms", title: "入住平台", sort: false, with: 300 }, |
| | | { field: "areaCodeName", title: "区域", sort: false, with: 300 }, |
| | | { field: "promoteMoney", title: "推广费用", sort: false, with: 300 }, |
| | | { field: "createBy", title: "信息录入", sort: false, width: 100 }, |
| | | { |
| | | field: "mangerName", |
| | |
| | | <div class="layui-form" id="batchSetting" style="display:none;"> |
| | | <div class="layui-tab" lay-filter="batchSetting-hash"> |
| | | <ul class="layui-tab-title"> |
| | | <li lay-id="22">SKU选择</li> |
| | | <li class="layui-this" lay-id="11">参数设置</li> |
| | | <li lay-id="22">图片设置</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">SKU选择</label> |
| | | <div class="layui-input-block" id="skuSetImage"></div> |
| | | </div> |
| | | <div class="layui-form-item layui-center"> |
| | | |
| | | <button class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs" onclick="SellAll()">全选</button> |
| | | <button class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs" onclick="SellNoOne()">全不选</button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-tab-item layui-show"> |
| | | |
| | | <div class="layui-form-item"> |
| | |
| | | <input class="layui-input" id="oneKeySetWeight"> |
| | | </div> |
| | | <div class="layui-input-inline layui-inline-2"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" style="margin-top:5px;" onclick="oneKeySet(4)"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" style="margin-top:5px;" onclick="oneKeySetByName('product[weight]')"> |
| | | <i class="layui-icon layui-icon-set"></i>确定 |
| | | </button> |
| | | </div> |
| | |
| | | <i class="layui-icon layui-icon-set"></i>确定 |
| | | </button> |
| | | </div> |
| | | <label class="layui-form-label">经销商返现</label> |
| | | <label class="layui-form-label">普通用户购买返现</label> |
| | | <div class="layui-input-inline layui-inline-2"> |
| | | <input class="layui-input" id="oneKeySetLevelOne"> |
| | | </div> |
| | |
| | | |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">SKU选择</label> |
| | | <div class="layui-input-block" id="skuSetImage"></div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" for="avatarImage">图片:</label> |
| | | <div class="layui-input-inline" style="margin-left:20px;"> |
| | |
| | | <th>积分最大<br />可抵金额</th> --> |
| | | <th>库存</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>经销商价格</th> |
| | | <th>成本价</th> |
| | | <th>指导零售价</th> |
| | | <th>经销商返现</th> |
| | | <th>经销商用户购买返现</th> |
| | | <th>普通用户购买返现</th> |
| | | |
| | | <!-- <th>二级返现</th> |
| | | <th>三级返现</th> --> |
| | | <th>操作</th> |
| | |
| | | <input type="text" name="product[price][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[distributionPrice][]" value="{{item.distributionPrice||'0'}}" placeholder="经销商价格" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="指导零售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="经销商返现" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[distributionCutMoney][]" value="{{item.distributionCutMoney||'0'}}" placeholder="经销商购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-active="getGenerateSpecBtn"><i class="layui-icon layui-icon-export"></i>生成SKU货品列表</button> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <!-- <div class="layui-input-inline"> |
| | | <button type="button" class="aKeySetBtn layui-btn layui-btn-warm layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-set"></i>一键设置 |
| | | </button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div id="more_spec"></div> |
| | |
| | | </select> |
| | | </script> |
| | | <script src="/views/liao.js"></script> |
| | | <!--//一键设置SKU图片时自动生成选中的SKU--> |
| | | <!--一键设置SKU图片时自动生成选中的SKU--> |
| | | <script id="imageSetMoreSku_tpl" type="text/html"> |
| | | {{# layui.each(d, function(index, item){ }} |
| | | <input type="checkbox" name="skuAttrValue" value="{{item}}" title="{{item}}" lay-filter="skuAttrValue-filter"> |
| | | <input type="checkbox" name="skuAttrValue" value="{{item}}" title="{{item}}" class="class_onkeySet_checkbox_creat" lay-filter="skuAttrValue-filter"> |
| | | {{# }); }} |
| | | </script> |
| | | |
| | |
| | | view2.innerHTML = html; |
| | | }); |
| | | form.render("radio"); |
| | | |
| | | } |
| | | |
| | | //赋值数据 |
| | |
| | | //多参数产品库生成列表集合 |
| | | var products = []; |
| | | var productsCount = parseInt(field['productsCount']); |
| | | debugger |
| | | for (var i = 0; i < productsCount; i++) { |
| | | var productModel = {}; |
| | | productModel.costprice = field['product[costprice][' + i + ']']; |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //百分兵法添加 |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | | products.push(productModel); |
| | | } |
| | | //会员价格模型 |
| | |
| | | } |
| | | $('#imageIds').val(imgs); |
| | | } |
| | | function SellAll() |
| | | { |
| | | // 选取ID为ID_onkeySet_checkbox_creat的checkbox元素 |
| | | var checkBoxes = $(".class_onkeySet_checkbox_creat"); |
| | | |
| | | // 设置选中状态 |
| | | checkBoxes.prop("checked", true); |
| | | |
| | | // 如果使用了Layui Form模块,刷新表单状态 |
| | | if (typeof layui.form !== 'undefined') { |
| | | layui.form.render(); |
| | | } |
| | | } |
| | | |
| | | function SellNoOne() |
| | | { |
| | | // 选取ID为ID_onkeySet_checkbox_creat的checkbox元素 |
| | | var checkBoxes = $(".class_onkeySet_checkbox_creat"); |
| | | |
| | | // 设置选中状态 |
| | | checkBoxes.prop("checked", false); |
| | | |
| | | // 如果使用了Layui Form模块,刷新表单状态 |
| | | if (typeof layui.form !== 'undefined') { |
| | | layui.form.render(); |
| | | } |
| | | } |
| | | function setInputsValueTo(element, prefix, value) { |
| | | // 使用querySelectorAll获取所有input元素,其中name属性以prefix开头 |
| | | const inputs = element.querySelectorAll(`input[name^="${prefix}["]`); |
| | | |
| | | // 遍历所有找到的input元素 |
| | | inputs.forEach(input => { |
| | | // 检查name属性是否与prefix匹配 |
| | | if (new RegExp(`^${prefix}\\[\\d+\\]$`).test(input.name)) { |
| | | // 设置input的值为指定的value |
| | | input.value = value; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function oneKeySetByName(name) |
| | | { |
| | | debugger |
| | | |
| | | setInputsValueTo(document.getElementById('productsTbody'),name,12); |
| | | // 调用递归函数,开始遍历指定父元素及其子孙元素 |
| | | // setValuesRecursively($("#yourParentElementId")); // 替换为实际父元素的ID |
| | | // 定义要遍历的父元素(例如:一个div) |
| | | //var parentElement = $("#productsTbody tr"); // 替换为实际父元素的ID |
| | | |
| | | // 使用正则表达式匹配name属性为scol[1-4]的input元素 |
| | | //parentElement.find(`input[${name}^='scol['][${name}$=']']`).val(12); |
| | | } |
| | | function oneKeySet(tag) { |
| | | var curValue = 0; |
| | | if (tag == 4) { |
| | |
| | | <th>积分最大<br />可抵金额</th> --> |
| | | <th>库存</th> |
| | | <th><i class="required-color">*</i>销售价</th> |
| | | <th>经销商价格</th> |
| | | <th>成本价</th> |
| | | <th>指导零售价</th> |
| | | <th>一级返现</th> |
| | | |
| | | <th>经销商用户购买返现</th> |
| | | <th>普通用户购买返现</th> |
| | | <!-- <th>二级返现</th> |
| | | <th>三级返现</th> --> |
| | | <!-- <th>三级返现</th> --> --> |
| | | <th>冻结库存</th> |
| | | <th>操作</th> |
| | | </tr> |
| | |
| | | <input type="text" name="product[price][]" value="{{item.price}}" placeholder="销售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | |
| | | <input type="text" name="product[distributionPrice][]" value="{{item.distributionPrice||'0'}}" placeholder="经销商价格" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[costprice][]" value="{{item.costprice}}" placeholder="成本价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[mktprice][]" value="{{item.mktprice}}" placeholder="指导零售价" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[levelOne][]" value="{{item.levelOne}}" placeholder="经销商返现" class="layui-input layui-inline-1"> |
| | | <input type="text" name="product[distributionCutMoney][]" value="{{item.distributionCutMoney||'0'}}" placeholder="经销商购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <td> |
| | | <input type="text" name="product[cutMoney][]" value="{{item.cutMoney||'0'}}" placeholder="普通用户购买返现" class="layui-input layui-inline-1"> |
| | | </td> |
| | | <!-- <td> |
| | | <input type="text" name="product[levelTwo][]" value="{{item.levelTwo}}" placeholder="二级返现" class="layui-input layui-inline-1"> |
| | |
| | | <div class="layui-input-inline"> |
| | | <button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-active="getGenerateSpecBtn"><i class="layui-icon layui-icon-export"></i>生成SKU货品列表</button> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <!-- <div class="layui-input-inline"> |
| | | <button type="button" class="aKeySetBtn layui-btn layui-btn-warm layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-set"></i>一键设置 |
| | | </button> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <div id="more_spec"></div> |
| | |
| | | productModel.levelThree = field['product[levelThree][' + i + ']']; |
| | | productModel.pointsDeduction = field['product[pointsDeduction][' + i + ']']; |
| | | productModel.points = field['product[points][' + i + ']']; |
| | | //添加 百分兵法 |
| | | productModel.distributionPrice = field['product[distributionPrice][' + i + ']']; |
| | | productModel.distributionCutMoney = field['product[distributionCutMoney][' + i + ']']; |
| | | productModel.cutMoney = field['product[cutMoney][' + i + ']']; |
| | | products.push(productModel); |
| | | |
| | | } |
| | | //会员价格模型 |
| | | var gradePrice = []; |
| | |
| | | * @Author: 小飞侠 |
| | | * @Date: 2024-03-01 09:11:24 |
| | | * @LastEditors: Please set LastEditors |
| | | * @LastEditTime: 2024-04-01 12:39:54 |
| | | * @LastEditTime: 2024-04-10 13:37:35 |
| | | * Copyright: 2024 MinTinge CO.,LTD. All Rights Reserved. |
| | | * @Descripttion: 写入你的描述 |
| | | */ |
| | |
| | | */ |
| | | function formatAreaInPut(coreHelper, idname, areaid = "") { |
| | | let area = 0; |
| | | |
| | | if ((areaid !== "")&&(areaid!==null) &&(areaid!==0)) |
| | | area = areaid.split(",").reverse()[0]; |
| | | |
| | |
| | | $.each(data, function (i, n) { |
| | | str += `<select lay-ignore name='${idname}_` + (i + 1) + "' dep='" + (i + 1) + "' class='select-address'>"; |
| | | str += "<option value='' >请选择</option>"; |
| | | |
| | | if(n?.list?.length>0) |
| | | { |
| | | $.each(n.list, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | $.each(n.thisList, function (h, z) { |
| | | if (n.hasOwnProperty('info') && n.info?.id == z.id) { |
| | | str += "<option value='" + z.id + "' selected='selected'>" + z.name + "</option>"; |
| | | } else { |
| | | str += "<option value='" + z.id + "' >" + z.name + "</option>"; |
| | | } |
| | | }); |
| | | } |
| | | str += "</select>"; |
| | | }); |
| | | $(`input[name='${idname}']`).after(str); |
| | | //以上数据输出完,以下绑定事件 |
| | | $.each(data, function (i, n) { |
| | | if (i < (data.length)) { |
| | | $(`select[name='${idname}_` + (i + 1) + "']").change(function () { |
| | | // $(`select[name='${idname}_` + (i + 1) + "']").change(function () { |
| | | // changeareaIdArea(i + 1, data.length, idname); |
| | | // }); |
| | | $(`select[name='${idname}_` + (i + 1) + "']").click(function () { |
| | | changeareaIdArea(i + 1, data.length, idname); |
| | | }); |
| | | } |
| | |
| | | <script type="text/html" template lay-done="layui.data.sendParams(d);"> |
| | | <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUser-editForm" id="LAY-app-CoreCmsUser-editForm"> |
| | | <input type="hidden" name="id" id="id" value="{{d.params.data.model.id || '' }}" /> |
| | | |
| | | <input type="hidden" name="isBaifenPromotion" id="IsBaifenPromotion" value="{{d.params.data.model.isBaifenPromotion || 'false' }}" /> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">手机号:</label> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline layui-input-wrap layui-input-wrap-prefix"> |
| | | <div class="layui-input-inline" style="width: 200px;"> |
| | | |
| | | <select name="isBaifenPromotion" id="isBaifenPromotion"> |
| | | <option value="">请选择是否是推广人员</option> |
| | | |
| | | <option value="1">是推广人员</option> |
| | | <option value="0">不是推广人员</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline layui-input-wrap layui-input-wrap-prefix"> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsUser-search"><i class="layui-icon layui-icon-search"></i>筛选</button> |
| | | </div> |
| | | </div> |
| | |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.DTO.ComponentsDTO; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.Entities.Expression; |
| | | using CoreCms.Net.Model.FromBody; |
| | |
| | | private ICoreCmsAgentGradeServices _agentGradeServices; |
| | | private ICoreCmsGoodsCategoryExtendServices _goodsCategoryExtendServices; |
| | | private readonly ICoreCmsAreaServices _coreCmsAreaServices; |
| | | private readonly IBfbfComAPIService _bfbfComAPIService; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | ICoreCmsAgentProductsServices agentProductsServices, |
| | | ICoreCmsAgentGradeServices agentGradeServices, |
| | | ICoreCmsGoodsCategoryExtendServices goodsCategoryExtendServices, |
| | | ICoreCmsAreaServices areaServices |
| | | ICoreCmsAreaServices areaServices, |
| | | IBfbfComAPIService bfbfComAPIService |
| | | |
| | | ) |
| | | { |
| | |
| | | _agentGradeServices = agentGradeServices; |
| | | _goodsCategoryExtendServices = goodsCategoryExtendServices; |
| | | _coreCmsAreaServices = areaServices; |
| | | _bfbfComAPIService = bfbfComAPIService; |
| | | } |
| | | |
| | | //公共接口==================================================================================================== |
| | |
| | | var jm = new WebApiCallBack(); |
| | | |
| | | var where = PredicateBuilder.True<GoodListDTO>(); |
| | | //是否是经销商 |
| | | bool isDic = false; |
| | | if (_user.ID > 0) |
| | | { |
| | | isDic = await _bfbfComAPIService.IsDictionary(_user.ID); |
| | | |
| | | }; |
| | | |
| | | var className = string.Empty; |
| | | if (!string.IsNullOrWhiteSpace(entity.where)) |
| | |
| | | //获取数据 |
| | | var list = await _goodsServices.QueryPageByDTOAsync(where, entity.page, entity.limit, true); |
| | | |
| | | |
| | | //获取品牌 |
| | | var brands = await _brandServices.QueryListByClauseAsync(p => p.isShow == true, p => p.sort, OrderByType.Desc, true, true); |
| | | foreach (var item in list) |
| | |
| | | |
| | | item.area+= (await _coreCmsAreaServices.GetAreaString(code)+""); |
| | | } |
| | | //调整经销商价格 百分兵法 |
| | | if(isDic) |
| | | { |
| | | item.price = item.distributionPrice; |
| | | } |
| | | |
| | | } |
| | | //返回数据 |
| | | jm.status = true; |
| | |
| | | jm.msg = "商品获取失败"; |
| | | return jm; |
| | | } |
| | | if (await _bfbfComAPIService.IsDictionary(user.id)) |
| | | { |
| | | //百分兵法经销商 |
| | | model.product.price = model.product.distributionPrice; |
| | | } |
| | | var codelist = model.areaCode?.Split(","); |
| | | model.area = ""; |
| | | if(codelist!=null) |
| | |
| | | using AutoMapper; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.IServices; |
| | | using CoreCms.Net.IServices.baifenbingfa; |
| | | using CoreCms.Net.Model.Entities; |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Model.ViewModels.DTO; |
| | |
| | | private readonly ICoreCmsOrderServices _orderServices; |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | |
| | | , ICoreCmsSettingServices settingServices |
| | | , ICoreCmsPagesServices pagesServices |
| | | , ICoreCmsOrderServices orderServices |
| | | , ICoreCmsUserServices userServices) |
| | | , ICoreCmsUserServices userServices |
| | | ,IBfbfComAPIService bfbfComAPIService) |
| | | { |
| | | _mapper = mapper; |
| | | _settingServices = settingServices; |
| | | _pagesServices = pagesServices; |
| | | _orderServices = orderServices; |
| | | _userServices = userServices; |
| | | |
| | | } |
| | | |
| | | //公共接口==================================================================================================== |
| | |
| | | 商品相关接口处理 |
| | | </summary> |
| | | </member> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.#ctor(AutoMapper.IMapper,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsBrandServices,CoreCms.Net.IServices.ICoreCmsOrderItemServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsGoodsParamsServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsAgentServices,CoreCms.Net.IServices.ICoreCmsAgentProductsServices,CoreCms.Net.IServices.ICoreCmsAgentGradeServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryExtendServices,CoreCms.Net.IServices.ICoreCmsAreaServices)"> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.GoodController.#ctor(AutoMapper.IMapper,CoreCms.Net.Auth.HttpContextUser.IHttpContextUser,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryServices,CoreCms.Net.IServices.ICoreCmsGoodsServices,CoreCms.Net.IServices.ICoreCmsProductsServices,CoreCms.Net.IServices.ICoreCmsBrandServices,CoreCms.Net.IServices.ICoreCmsOrderItemServices,CoreCms.Net.IServices.ICoreCmsGoodsCommentServices,CoreCms.Net.IServices.ICoreCmsGoodsParamsServices,CoreCms.Net.IServices.ICoreCmsGoodsCollectionServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ICoreCmsAgentServices,CoreCms.Net.IServices.ICoreCmsAgentProductsServices,CoreCms.Net.IServices.ICoreCmsAgentGradeServices,CoreCms.Net.IServices.ICoreCmsGoodsCategoryExtendServices,CoreCms.Net.IServices.ICoreCmsAreaServices,CoreCms.Net.IServices.baifenbingfa.IBfbfComAPIService)"> |
| | | <summary> |
| | | 构造函数 |
| | | </summary> |
| | |
| | | 页面接口 |
| | | </summary> |
| | | </member> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.#ctor(AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsUserServices)"> |
| | | <member name="M:CoreCms.Net.Web.WebApi.Controllers.PageController.#ctor(AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsSettingServices,CoreCms.Net.IServices.ICoreCmsPagesServices,CoreCms.Net.IServices.ICoreCmsOrderServices,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.baifenbingfa.IBfbfComAPIService)"> |
| | | <summary> |
| | | 构造函数 |
| | | </summary> |
| | |
| | | dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" |
| | | connectionString="Server=127.0.0.1;Database=BaseMIS;User ID=sa;Password=123456" |
| | | --> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=localhost\SQLEXPRESS;User ID=sa;Password=123456;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;"> |
| | | <target name="log_database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient" connectionString="Server=MS-FSEUTNLCXFDB\SQLEXPRESS;Database=CoreShopProfessional;MultipleActiveResultSets=true;pooling=true;min pool size=5;max pool size=32767;connect timeout=20;Encrypt=True;TrustServerCertificate=True;Trusted_Connection=True; "> |
| | | <commandText> |
| | | INSERT INTO SysNLogRecords |
| | | (LogDate,LogLevel,LogType,LogTitle,Logger,Message,MachineName,MachineIp,NetRequestMethod |
| | |
| | | <p>6、如果第三方请求接口服务获取不到数据,Debug提示【Access-Control-Allow-Origin】的错误,表示为跨域问题,请打开【appsettings.json】文件在【Cors】节点设置请求白名单。</p> |
| | | </div> |
| | | <div class="copyright"> |
| | | <p>©2020 <a href="http://www.coreshop.com.cn/" target="_blank"></a>. All Rights Reserved</p> |
| | | <p>©2024 <a href="" target="_blank"></a>. All Rights Reserved</p> |
| | | </div> |
| | | </body> |
| | | </html> |