Browse Source

增加产品库返回宝贝链接

master
С·æ 4 years ago
parent
commit
d07e4c78fd
  1. 3
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  2. 17
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  3. 1
      src/Coldairarrow.Entity/DTO/ItemLabelDto.cs
  4. 5
      src/Coldairarrow.Entity/DTO/TeamitemDto.cs
  5. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js
  6. 2
      客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map

3
src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs

@ -274,7 +274,8 @@ namespace Coldairarrow.Business.HuiYan
Price = model.Price,
Platform = item.Platform,
Sales = model.Sales,
Title = model.Title
Title = model.Title,
GoodsUrl=item.GoodsUrl
}).Success)
{
throw new Exception("添加产品库失败!");

17
src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs

@ -76,6 +76,7 @@ namespace Coldairarrow.Business.HuiYan
GoodsId = b.GoodsId,
HasFilter = b.HasFilter,
Platform = b.Platform,
GoodsUrl = b.GoodsUrl,
Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TeamItemExtension>>(a.ExtensionJson)
};
@ -115,7 +116,7 @@ namespace Coldairarrow.Business.HuiYan
item = new items()
{
GoodsId = model.GoodsId,
GoodsUrl = model.GoodsUrl,
CreateTime = DateTime.Now,
CreatorId = _operator.UserId,
Deleted = false,
@ -124,6 +125,20 @@ namespace Coldairarrow.Business.HuiYan
Platform = 0
};
item.GoodsUrl = string.Empty;
switch (model.Platform)
{
case (int)ItemPlatform.Taobao:
item.GoodsUrl = $"https://item.taobao.com/item.htm?id={item.GoodsId}";
break;
case (int)ItemPlatform.Jd:
item.GoodsUrl = $"https://item.jd.com/{item.GoodsId}.html";
break;
case (int)ItemPlatform.ALBB:
item.GoodsUrl = $"https://detail.1688.com/offer/{item.GoodsId}.html";
break;
}
if (Db.Insert<items>(item) <= 0)
{
return Error("商品添加失败!");

1
src/Coldairarrow.Entity/DTO/ItemLabelDto.cs

@ -18,6 +18,7 @@ namespace Coldairarrow.Entity.DTO
public string Img { get; set; }
/// <summary>
/// 标签状态
/// </summary>

5
src/Coldairarrow.Entity/DTO/TeamitemDto.cs

@ -24,6 +24,11 @@ namespace Coldairarrow.Entity.DTO
/// </summary>
public string GoodsId { get; set; }
/// <summary>
/// 宝贝链接
/// </summary>
public string GoodsUrl { get; set; }
/// <summary>
/// 扩展信息
/// </summary>

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js

File diff suppressed because one or more lines are too long

2
客户端/齐越慧眼/齐越慧眼/vuepage/dist/js/app.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save