Browse Source

加入商品链接

master
С·æ 4 years ago
parent
commit
ce710740e6
  1. 21
      src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs
  2. 6
      src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs
  3. 4
      src/Coldairarrow.Entity/HuiYan/items.cs
  4. 4
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue

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

@ -78,7 +78,8 @@ namespace Coldairarrow.Business.HuiYan
{ {
GoodsId = b.GoodsId, GoodsId = b.GoodsId,
HasFilter = b.HasFilter, HasFilter = b.HasFilter,
Platform = b.Platform Platform = b.Platform,
GoodsUrl=b.GoodsUrl
}; };
select = select.BuildExtendSelectExpre(); select = select.BuildExtendSelectExpre();
@ -124,6 +125,21 @@ namespace Coldairarrow.Business.HuiYan
Platform = (int)model.Platform Platform = (int)model.Platform
}; };
item.GoodsUrl = string.Empty;
switch (model.Platform)
{
case ItemPlatform.Taobao:
item.GoodsUrl = $"https://item.taobao.com/item.htm?id={item.GoodsId}";
break;
case ItemPlatform.Jd:
item.GoodsUrl = $"https://item.jd.com/{item.GoodsId}.html";
break;
case ItemPlatform.ALBB:
item.GoodsUrl = $"https://detail.1688.com/offer/{item.GoodsId}.html";
break;
}
int row = Db.Insert(item); int row = Db.Insert(item);
if (row <= 0) if (row <= 0)
@ -320,7 +336,8 @@ namespace Coldairarrow.Business.HuiYan
{ {
GoodsId = b.GoodsId, GoodsId = b.GoodsId,
HasFilter = b.HasFilter, HasFilter = b.HasFilter,
Platform = b.Platform Platform = b.Platform,
GoodsUrl=b.GoodsUrl
}; };
select = select.BuildExtendSelectExpre(); select = select.BuildExtendSelectExpre();

6
src/Coldairarrow.Entity/DTO/ItemlabelInfoDto.cs

@ -23,6 +23,12 @@ namespace Coldairarrow.Entity.DTO
/// 宝贝ID /// 宝贝ID
/// </summary> /// </summary>
public string GoodsId { get; set; } public string GoodsId { get; set; }
/// <summary>
/// 商品地址
/// </summary>
public string GoodsUrl { get; set; }
} }
public class AlbbItemlabelInfoDto : albbitemlabels public class AlbbItemlabelInfoDto : albbitemlabels

4
src/Coldairarrow.Entity/HuiYan/items.cs

@ -52,5 +52,9 @@ namespace Coldairarrow.Entity.HuiYan
/// </summary> /// </summary>
public Int32 Platform { get; set; } public Int32 Platform { get; set; }
/// <summary>
/// 商品链接
/// </summary>
public string GoodsUrl { get; set; }
} }
} }

4
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue

@ -59,7 +59,7 @@
<div class="borderRight"> <div class="borderRight">
<div <div
style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;"> style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 0px auto;height: 215px;">
<a target="_black" :href="'https://item.taobao.com/item.htm?id='+item.GoodsId"> <img <a target="_black" :href="item.GoodsUrl"> <img
:src="'http:'+item.ItemImg" width="200" height="165" /></a> :src="'http:'+item.ItemImg" width="200" height="165" /></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left;">¥{{item.Price}}</a-col> <a-col :span="12" style="text-align: left;">¥{{item.Price}}</a-col>
@ -157,7 +157,7 @@
</div> </div>
<div v-else> <div v-else>
<div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 5px auto;"> <div style="padding-top: 10px;padding-bottom: 10px;width: 200px;margin: 5px auto;">
<a target="_black" :href="'https://item.taobao.com/item.htm?id='+item.RivalGoodsId"> <a target="_black" :href="item.RivalGoodsId">
<img src="/jp.png" width="200" height="165" /></a> <img src="/jp.png" width="200" height="165" /></a>
<a-row> <a-row>
<a-col :span="12" style="text-align: left;">¥{{item.RivalPrice}}</a-col> <a-col :span="12" style="text-align: left;">¥{{item.RivalPrice}}</a-col>

Loading…
Cancel
Save