diff --git a/src/Coldairarrow.Api/Controllers/HuiYan/albbitemlabelsController.cs b/src/Coldairarrow.Api/Controllers/HuiYan/albbitemlabelsController.cs new file mode 100644 index 0000000..1cf1f6e --- /dev/null +++ b/src/Coldairarrow.Api/Controllers/HuiYan/albbitemlabelsController.cs @@ -0,0 +1,65 @@ +using Coldairarrow.Business.HuiYan; +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Util; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Api.Controllers.HuiYan +{ + [Route("/HuiYan/[controller]/[action]")] + public class albbitemlabelsController : BaseApiController + { + #region DI + + public albbitemlabelsController(IalbbitemlabelsBusiness albbitemlabelsBus) + { + _albbitemlabelsBus = albbitemlabelsBus; + } + + IalbbitemlabelsBusiness _albbitemlabelsBus { get; } + + #endregion + + #region 获取 + + [HttpPost] + public async Task> GetDataList(PageInput input) + { + return await _albbitemlabelsBus.GetDataListAsync(input); + } + + [HttpPost] + public async Task GetTheData(IdInputDTO input) + { + return await _albbitemlabelsBus.GetTheDataAsync(input.id); + } + + #endregion + + #region 提交 + + [HttpPost] + public async Task SaveData(albbitemlabels data) + { + if (data.Id.IsNullOrEmpty()) + { + InitEntity(data); + + await _albbitemlabelsBus.AddDataAsync(data); + } + else + { + await _albbitemlabelsBus.UpdateDataAsync(data); + } + } + + [HttpPost] + public async Task DeleteData(List ids) + { + await _albbitemlabelsBus.DeleteDataAsync(ids); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs b/src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs index c68d9c3..5a31adb 100644 --- a/src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs +++ b/src/Coldairarrow.Api/Controllers/HuiYan/itemlabelsController.cs @@ -82,10 +82,32 @@ namespace Coldairarrow.Api.Controllers.HuiYan /// /// [HttpPost] - public AjaxResult GetLabelByItemIds([FromBody] List ids, [FromQuery] ItemPlatform platform) { return _itemlabelsBus.GetLabelByItemIds(ids, platform); } + + + /// + /// 检索阿里巴巴合作标签的商品 + /// + /// + /// + [HttpPost] + public AjaxResult GetAlbbLabelByShopIds([FromBody] List ids) + { + return _itemlabelsBus.GetAlbbLabelByShopIds(ids); + } + + /// + /// 设置阿里巴巴店铺合作 + /// + /// + /// + [HttpPost] + public AjaxResult SetAlbbCooperation(string shopId) + { + return _itemlabelsBus.SetAlbbCooperation(shopId); + } } } \ No newline at end of file diff --git a/src/Coldairarrow.Api/appsettings.json b/src/Coldairarrow.Api/appsettings.json index 7432fa6..ff84a59 100644 --- a/src/Coldairarrow.Api/appsettings.json +++ b/src/Coldairarrow.Api/appsettings.json @@ -43,7 +43,7 @@ //"DatabaseType": "PostgreSql", //"ConnectionString": "Server=127.0.0.1;Port=5432;Database=Colder.Admin.AntdVue;User Id=postgres;Password=postgres;" "DatabaseType": "MySql", - "ConnectionString": "server=116.62.61.68;user id=jdhy;password=kaicn1132+-;persistsecurityinfo=True;database=jdhy;SslMode=none;AllowLoadLocalInfile=true" + "ConnectionString": "server=rm-bp1508okrh23710yfao.mysql.rds.aliyuncs.com;user id=qyroot;password=kaicn1132+-;persistsecurityinfo=True;database=jdhy;SslMode=none;AllowLoadLocalInfile=true" //"DatabaseType": "Oracle", //"ConnectionString": "Data Source=127.0.0.1/ORCL;User ID=COLDER.ADMIN.ANTDVUE;Password=123456;Connect Timeout=3" } diff --git a/src/Coldairarrow.Business/HuiYan/albbitemlabelsBusiness.cs b/src/Coldairarrow.Business/HuiYan/albbitemlabelsBusiness.cs new file mode 100644 index 0000000..296552a --- /dev/null +++ b/src/Coldairarrow.Business/HuiYan/albbitemlabelsBusiness.cs @@ -0,0 +1,65 @@ +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Util; +using EFCore.Sharding; +using LinqKit; +using Microsoft.EntityFrameworkCore; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.HuiYan +{ + public class albbitemlabelsBusiness : BaseBusiness, IalbbitemlabelsBusiness, ITransientDependency + { + public albbitemlabelsBusiness(IDbAccessor db) + : base(db) + { + } + + #region 外部接口 + + public async Task> GetDataListAsync(PageInput input) + { + var q = GetIQueryable(); + var where = LinqHelper.True(); + var search = input.Search; + + //筛选 + if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) + { + var newWhere = DynamicExpressionParser.ParseLambda( + ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); + where = where.And(newWhere); + } + + return await q.Where(where).GetPageResultAsync(input); + } + + public async Task GetTheDataAsync(string id) + { + return await GetEntityAsync(id); + } + + public async Task AddDataAsync(albbitemlabels data) + { + await InsertAsync(data); + } + + public async Task UpdateDataAsync(albbitemlabels data) + { + await UpdateAsync(data); + } + + public async Task DeleteDataAsync(List ids) + { + await DeleteAsync(ids); + } + + #endregion + + #region 私有成员 + + #endregion + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs b/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs index e4ca774..8e7af03 100644 --- a/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs @@ -70,7 +70,7 @@ namespace Coldairarrow.Business.HuiYan #region 私有成员 #endregion - + public AjaxResult GetLabelByItemIds(List ids, ItemPlatform platform) { @@ -99,6 +99,12 @@ namespace Coldairarrow.Business.HuiYan return Success(list); } + public AjaxResult GetAlbbLabelByShopIds(Listids) + { + var list= Db.GetIQueryable().Where(c => ids.Contains(c.ShopId)); + + return Success(list); + } public AjaxResult SetItemLabel(ItemLabelDto model) { @@ -114,7 +120,7 @@ namespace Coldairarrow.Business.HuiYan Deleted = false, GoodsId = model.ItemId, Id = IdHelper.GetId(), - HasFilter = model.Status == 1, + HasFilter = model.Status == ItemLabelStatus.Filter, Platform = (int)model.Platform }; @@ -125,11 +131,17 @@ namespace Coldairarrow.Business.HuiYan isAddItem = true; } - + + ////判断是否阿里巴巴合作 + //if (model.Status == ItemLabelStatus.Cooperation) + //{ + // return SetAlbbCooperation(item); + //} + var where = LinqHelper.True().And(c => c.ItemsId == item.Id); //团队筛选 - //where = where.And(c=>c.TeamId==""); + where = where.And(c=>c.TeamId==_operator.TeamId); var label = GetIQueryable().FirstOrDefault(where); @@ -154,16 +166,16 @@ namespace Coldairarrow.Business.HuiYan switch (model.Status) { - case 0: + case ItemLabelStatus.Screening: label.IsScreening = true; break; - case 1: + case ItemLabelStatus.Filter: label.IsFilter = true; break; - case 2: + case ItemLabelStatus.Added: label.IsAdded = true; break; - case 3: + case ItemLabelStatus.Competing: label.IsCompeting = true; break; } @@ -181,21 +193,21 @@ namespace Coldairarrow.Business.HuiYan { switch (model.Status) { - case 0: + case ItemLabelStatus.Screening: if (label.IsFilter) throw new Exception("该商品已被过滤!"); data.IsScreening = true; break; - case 1: + case ItemLabelStatus.Filter: if (label.IsScreening) throw new Exception("该商品已被筛选!"); data.IsFilter = true; break; - case 2: + case ItemLabelStatus.Added: //加入产品库同时也勾选筛选 data.IsAdded = true; break; - case 3: + case ItemLabelStatus.Competing: data.IsCompeting = true; break; } @@ -205,13 +217,13 @@ namespace Coldairarrow.Business.HuiYan } //设置集团过滤 - if (model.Status == 1&& !isAddItem) + if (model.Status == ItemLabelStatus.Filter&& !isAddItem) { Db.Update(c => c.Id == item.Id, (i) => { i.HasFilter = true; }); } //判断是否添加产品库 - if (model.Status==2&&!hasAdded) + if (model.Status== ItemLabelStatus.Added&&!hasAdded) { if (!iteamitemsBusiness.AddItem(new TeamitemDto() { @@ -234,5 +246,35 @@ namespace Coldairarrow.Business.HuiYan return Error(result.ex.Message); } + + /// + /// 设置阿里巴巴合作 + /// + /// + public AjaxResult SetAlbbCooperation(string shopId) + { + int count= Db.GetIQueryable().Count(c => c.ShopId == shopId); + + if (count > 0) + { + return Error("已存在相同的合作店铺!"); + } + + int row= Db.Insert(new albbitemlabels() + { + CreateTime = DateTime.Now, + CreatorId = _operator.UserId, + Deleted = false, + Id = IdHelper.GetId(), + ShopId = shopId + }); + + if (row > 0) + return Success(); + else + { + return Error(); + } + } } } \ No newline at end of file diff --git a/src/Coldairarrow.Entity/DTO/ItemLabelDto.cs b/src/Coldairarrow.Entity/DTO/ItemLabelDto.cs index 0d5df7b..e098266 100644 --- a/src/Coldairarrow.Entity/DTO/ItemLabelDto.cs +++ b/src/Coldairarrow.Entity/DTO/ItemLabelDto.cs @@ -21,7 +21,7 @@ namespace Coldairarrow.Entity.DTO /// /// 标签状态 /// - public int Status { get; set; } + public ItemLabelStatus Status { get; set; } /// /// 平台 @@ -47,4 +47,31 @@ namespace Coldairarrow.Entity.DTO /// ALBB = 2 } + + /// + /// 标签状态 + /// + public enum ItemLabelStatus + { + /// + /// 筛选 + /// + Screening=0, + /// + /// 过滤 + /// + Filter =1, + /// + /// 添加产品库 + /// + Added=2, + /// + /// 竞品 + /// + Competing=3, + /// + /// 合作 + /// + Cooperation=4 + } } diff --git a/src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs b/src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs index b848700..8e03aa2 100644 --- a/src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs +++ b/src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs @@ -24,4 +24,12 @@ namespace Coldairarrow.Entity.DTO /// public string GoodsId { get; set; } } + + public class AlbbItemlabelInfoDto : albbitemlabels + { + /// + /// 宝贝ID + /// + public string GoodsId { get; set; } + } } diff --git a/src/Coldairarrow.Entity/HuiYan/albbitemlabels.cs b/src/Coldairarrow.Entity/HuiYan/albbitemlabels.cs new file mode 100644 index 0000000..0fa09d7 --- /dev/null +++ b/src/Coldairarrow.Entity/HuiYan/albbitemlabels.cs @@ -0,0 +1,41 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Coldairarrow.Entity.HuiYan +{ + /// + /// albbitemlabels + /// + [Table("albbitemlabels")] + public class albbitemlabels + { + + /// + /// 主键 + /// + [Key, Column(Order = 1)] + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 店铺ID + /// + public String ShopId { get; set; } + + } +} \ No newline at end of file diff --git a/src/Coldairarrow.Entity/HuiYan/items.cs b/src/Coldairarrow.Entity/HuiYan/items.cs index 1328aa8..ebe844c 100644 --- a/src/Coldairarrow.Entity/HuiYan/items.cs +++ b/src/Coldairarrow.Entity/HuiYan/items.cs @@ -37,6 +37,11 @@ namespace Coldairarrow.Entity.HuiYan /// public String GoodsId { get; set; } + /// + /// 店铺ID + /// + public string ShopId { get; set; } + /// /// 是否集团过滤 /// diff --git a/src/Coldairarrow.IBusiness/HuiYan/IalbbitemlabelsBusiness.cs b/src/Coldairarrow.IBusiness/HuiYan/IalbbitemlabelsBusiness.cs new file mode 100644 index 0000000..c451271 --- /dev/null +++ b/src/Coldairarrow.IBusiness/HuiYan/IalbbitemlabelsBusiness.cs @@ -0,0 +1,16 @@ +using Coldairarrow.Entity.HuiYan; +using Coldairarrow.Util; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Coldairarrow.Business.HuiYan +{ + public interface IalbbitemlabelsBusiness + { + Task> GetDataListAsync(PageInput input); + Task GetTheDataAsync(string id); + Task AddDataAsync(albbitemlabels data); + Task UpdateDataAsync(albbitemlabels data); + Task DeleteDataAsync(List ids); + } +} \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs b/src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs index 058582b..feb812b 100644 --- a/src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs +++ b/src/Coldairarrow.IBusiness/HuiYan/IitemlabelsBusiness.cs @@ -16,5 +16,7 @@ namespace Coldairarrow.Business.HuiYan AjaxResult SetItemLabel(ItemLabelDto model); AjaxResult GetLabelByItemIds(List ids, ItemPlatform platform); + AjaxResult GetAlbbLabelByShopIds(List ids); + AjaxResult SetAlbbCooperation(string shopId); } } \ No newline at end of file diff --git a/src/Coldairarrow.Web/.env b/src/Coldairarrow.Web/.env index 6957cad..bc5c333 100644 --- a/src/Coldairarrow.Web/.env +++ b/src/Coldairarrow.Web/.env @@ -7,8 +7,8 @@ VUE_APP_DesktopPath=/Home/Introduce #发布后接口根地址 VUE_APP_PublishRootUrl=http://hyapi.qiyue666.com #本地调试接口根地址 -#VUE_APP_LocalRootUrl=http://localhost:5000 -VUE_APP_LocalRootUrl=http://hyapi.qiyue666.com +VUE_APP_LocalRootUrl=http://localhost:5000 +#VUE_APP_LocalRootUrl=http://hyapi.qiyue666.com #接口超时时间ms VUE_APP_ApiTimeout=10000 #本地开发启动端口 diff --git a/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/EditForm.vue b/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/EditForm.vue new file mode 100644 index 0000000..9e38bdc --- /dev/null +++ b/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/EditForm.vue @@ -0,0 +1,80 @@ + + + diff --git a/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/List.vue b/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/List.vue new file mode 100644 index 0000000..f066477 --- /dev/null +++ b/src/Coldairarrow.Web/src/views/HuiYan/albbitemlabels/List.vue @@ -0,0 +1,157 @@ + + + \ No newline at end of file diff --git a/客户端/齐越慧眼/齐越慧眼/ApiHelper.cs b/客户端/齐越慧眼/齐越慧眼/ApiHelper.cs index 9be2eb6..34237e5 100644 --- a/客户端/齐越慧眼/齐越慧眼/ApiHelper.cs +++ b/客户端/齐越慧眼/齐越慧眼/ApiHelper.cs @@ -10,8 +10,8 @@ namespace 齐越慧眼 { public class ApiHelper { - //public static string ApiBase { get; set; } = "http://localhost:5000"; - public static string ApiBase { get; set; } = "http://hyapi.qiyue666.com"; + public static string ApiBase { get; set; } = "http://localhost:5000"; + //public static string ApiBase { get; set; } = "http://hyapi.qiyue666.com"; public static string JwtToken { get; set; } @@ -66,7 +66,49 @@ namespace 齐越慧眼 return (isSuccess, data.Msg ?? ""); } + /// + /// 设置阿里巴巴店铺合作状态 + /// + /// + /// + public static (bool isOk, string msg) SetAlbbCooperation(string shopId) + { + var result = Http($"/HuiYan/itemlabels/SetAlbbCooperation?shopId={shopId}", ""); + var data = Newtonsoft.Json.JsonConvert.DeserializeObject(result); + + bool isSuccess = data.Success; + + return (isSuccess, data.Msg ?? ""); + } + + /// + /// 获取标签信息 + /// + /// + /// + /// + public static (bool isOk, List datas) GetAlbbLabelByShopIds(List ids) + { + try + { + var result = Http($"/HuiYan/itemlabels/GetAlbbLabelByShopIds", Newtonsoft.Json.JsonConvert.SerializeObject(ids)); + + var data = Newtonsoft.Json.JsonConvert.DeserializeObject(result); + + string json = data.Data.ToString(); + + var datas = Newtonsoft.Json.JsonConvert.DeserializeObject>(json); + + bool isSuccess = data.Success; + + return (isSuccess, datas ?? new List()); + } + catch + { + return (false, new List()); + } + } /// diff --git a/客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs b/客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs index aa317d4..ff55b05 100644 --- a/客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs +++ b/客户端/齐越慧眼/齐越慧眼/Models/ItemLabelDto.cs @@ -19,7 +19,7 @@ namespace 齐越慧眼.Models /// /// 标签状态 /// - public int Status { get; set; } + public ItemLabelStatus Status { get; set; } /// /// 平台 @@ -45,4 +45,31 @@ namespace 齐越慧眼.Models /// ALBB = 2 } + + /// + /// 标签状态 + /// + public enum ItemLabelStatus + { + /// + /// 筛选 + /// + Screening = 0, + /// + /// 过滤 + /// + Filter = 1, + /// + /// 添加产品库 + /// + Added = 2, + /// + /// 竞品 + /// + Competing = 3, + /// + /// 合作 + /// + Cooperation = 4 + } } diff --git a/客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs b/客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs index 535d115..26eaa9f 100644 --- a/客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs +++ b/客户端/齐越慧眼/齐越慧眼/Models/ItemlabelInfoDto.cs @@ -4,6 +4,38 @@ using System.Text; namespace 齐越慧眼.Models { + + public class albbitemlabels + { + + /// + /// 主键 + /// + public String Id { get; set; } + + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + /// + /// 创建人Id + /// + public String CreatorId { get; set; } + + /// + /// 否已删除 + /// + public Boolean Deleted { get; set; } + + /// + /// 商品ID + /// + public String ShopId { get; set; } + + } + + public class ItemlabelInfoDto : itemlabels { /// diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs index df6ec95..2ae0cdf 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using 齐越慧眼.cefhelper; +using 齐越慧眼.Models; namespace 齐越慧眼.UserControls { @@ -268,7 +269,6 @@ namespace 齐越慧眼.UserControls if (item.IsCompeting) { - //
if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateYellow').length").result <= 0) { DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('
')"); @@ -464,7 +464,9 @@ namespace 齐越慧眼.UserControls reports.ForEach(c => { string objid = Regex.Match(c, "object_id\\@(.*?)\\^").Groups[1].Value; + string shopId= Regex.Match(c, "object_id\\@(.*?)\\^").Groups[1].Value; DoJavaScript(@$"$(""ul#sm-offer-list"").find('div[data-aplus-report=""{c}""]').attr(""data-sku"",""{objid}"")"); + DoJavaScript(@$"$(""ul#sm-offer-list"").find('div[data-aplus-report=""{c}""]').attr(""data-shopId"",""{shopId}"")"); itemIds.Add(objid); }); } @@ -492,15 +494,14 @@ namespace 齐越慧眼.UserControls } - if (item.IsCompeting) - { - //
- if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#J_goodsList li[data-sku=""{item.GoodsId}""]')).find('.stateYellow').length").result <= 0) - { - DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.myitemState').prepend('
')"); - } - DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.stateGraydiv').addClass(""divshow"")"); - } + //if (item.IsCompeting) + //{ + // if ((int)BrowerControl.Main.DoJavaScript(@$"return $($('div#J_goodsList li[data-sku=""{item.GoodsId}""]')).find('.stateYellow').length").result <= 0) + // { + // DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.myitemState').prepend('
')"); + // } + // DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{item.GoodsId}""]')).find('.stateGraydiv').addClass(""divshow"")"); + //} if (item.IsScreening) { @@ -515,6 +516,18 @@ namespace 齐越慧眼.UserControls } } } + + var alResult = ApiHelper.GetAlbbLabelByShopIds(itemIds); + if (alResult.isOk) + { + alResult.datas.ForEach(item => { + + DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{item.ShopId}""]')).find('.myitemState').prepend('
')"); + + DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{item.ShopId}""]')).find('.stateGraydiv').addClass(""divshow"")"); + }); + } + } /// @@ -548,7 +561,7 @@ namespace 齐越慧眼.UserControls
-
竞品
+
合作
海选
淘汰
同款
@@ -802,7 +815,7 @@ namespace 齐越慧眼.UserControls Platform = Models.ItemPlatform.Taobao, Price = Convert.ToDecimal(price), Sales = sales, - Status = type, + Status = (ItemLabelStatus)type, Title = title }); @@ -868,7 +881,7 @@ namespace 齐越慧眼.UserControls Platform = Models.ItemPlatform.Jd, Price = Convert.ToDecimal(price), Sales = sales, - Status = type, + Status = (ItemLabelStatus)type, Title = title }); @@ -926,52 +939,64 @@ namespace 齐越慧眼.UserControls title = title.Trim(); string img = data.img; string itemId = data.itemid; + string shopId = data.shopId; - var result = ApiHelper.SetItemLabel(new Models.ItemLabelDto() - { - Img = img, - ItemId = itemId, - Platform = Models.ItemPlatform.ALBB, - Price = Convert.ToDecimal(price), - Sales = sales, - Status = type, - Title = title - }); - if (result.isOk) + if (type == 4) { - //判断是否团队过滤 - if (type == 1) - { - BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""falseBg"")"); - } + var result = ApiHelper.SetAlbbCooperation(shopId); - if (type == 3) + if (result.isOk) { - int row = (int)BrowerControl.Main.DoJavaScript(@$"return $($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').find('.stateYellow').length").result; + int row = (int)BrowerControl.Main.DoJavaScript(@$"return $($('ul#sm-offer-list div[data-shopId=""{shopId}""]')).find('.myitemState').find('.stateYellow').length").result; if (row < 1) { - BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').prepend('
')"); + BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-shopId=""{shopId}""]')).find('.myitemState').prepend('
')"); } } - if (type == 0) + WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示"); + return result.isOk; + } + else + { + + var result = ApiHelper.SetItemLabel(new Models.ItemLabelDto() { - BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""trueBg"")"); - } + Img = img, + ItemId = itemId, + Platform = Models.ItemPlatform.ALBB, + Price = Convert.ToDecimal(price), + Sales = sales, + Status = (ItemLabelStatus)type, + Title = title + }); - if (type == 2) + if (result.isOk) { - BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""popBg"")"); - } + //判断是否团队过滤 + if (type == 1) + { + BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""falseBg"")"); + } - BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.stateGraydiv').addClass(""divshow"")"); - } + if (type == 0) + { + BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""trueBg"")"); + } + + if (type == 2) + { + BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.myitemState').addClass(""popBg"")"); + } + BrowerControl.Main.DoJavaScript($@"$($('ul#sm-offer-list div[data-sku=""{itemId}""]')).find('.stateGraydiv').addClass(""divshow"")"); + } + WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示"); + return result.isOk; + } - WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示"); - return result.isOk; } } }