Browse Source

完成战力计算

master
feng 2 years ago
parent
commit
ecc52cc689
  1. 71
      src/Coldairarrow.Entity/DTO/TeamitemDto.cs
  2. 148
      客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/competing/Index.vue

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

@ -44,10 +44,24 @@ namespace Coldairarrow.Entity.DTO
/// 扩展信息
/// </summary>
public List<TeamItemExtension> Extensions { get; set; }
private List<TeamCompetingItem> competingItems;
/// <summary>
/// 竞品信息
/// </summary>
public List<TeamCompetingItem> CompetingItems { get; set; }
public List<TeamCompetingItem> CompetingItems
{
get
{
if (competingItems != null)
{
return competingItems.OrderByDescending(c => c.CommentNumber).ThenBy(c => c.PriceNumber).ToList();
}
return competingItems;
}
set => competingItems = value;
}
}
public class TeamItemExtension
@ -107,7 +121,58 @@ namespace Coldairarrow.Entity.DTO
/// 竞品信息
/// </summary>
public class TeamCompetingItem
{
{
/// <summary>
/// 图片地址
/// </summary>
public string ImgUrl { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 价格
/// </summary>
public string Price { get; set; }
/// <summary>
/// 评价数量
/// </summary>
public string CommentCount { get; set; }
public int CommentNumber
{
get
{
string raw = CommentCount?.Replace("+", "").Replace("万", "0000").Replace("千", "000");
if (int.TryParse(raw, out int code))
return code;
else return 0;
}
}
public decimal PriceNumber
{
get
{
if (decimal.TryParse(Price, out decimal price))
{
return price;
}
return 0;
}
}
/// <summary>
/// 竞品链接
/// </summary>
public string ItemUrl { get; set; }
/// <summary>
/// 平台
/// </summary>
public int Platform { get; set; }
}
}

148
客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/competing/Index.vue

@ -68,7 +68,7 @@
竞争环境
</div>
<div style="width: 177px;" class="titleDiv">
兵力规划
建议评价量
</div>
<div style="width: 801px;" class="titleDiv">
对手信息
@ -90,27 +90,37 @@
付款人数:{{item.Sales}}
</div>
<div style="background-color: #f3f2f7;border-bottom: 0px solid #d7d7d7;background: #ffffff;justify-items: center;text-align: center;display: flex;align-items: center; vertical-align: center;height: 171px;">
<div style="background-color: #f3f2f7;border-bottom: 0px solid #d7d7d7;background: #ffffff;justify-items: center;text-align: center;display: flex;align-items: center; vertical-align: center;height: 178px;">
<div style="width: 171px;" class="contentDiv">
<img :src="item.ItemImg" style="width: 151px;height: 151px;" >
</div>
<div style="width: 177px;" class="contentDiv">
TOP1 评价量 200+
武将战力 {{getTop1Comment(item.CompetingItems)}}
</div>
<div style="width: 177px;flex-direction: column" class="contentDiv">
{{getTop1Data(item.CompetingItems)[0]}}
<div style="color:#D7D7D7;">
达到该战场定义的</div>
<div style="color:#D7D7D7;">
评价量商家个数为
3
{{getTop1Data(item.CompetingItems)[1]}}
</div>
</div>
<div style="width: 177px;" class="contentDiv">
所需兵力:500+
所需兵力:{{getCommentNeed(item.CompetingItems)}}
</div>
<div style="width: 801px;" class="contentDiv">
对手信息
<div style="width: 801px;display: block;" class="contentDiv">
<div style="display: flex;" v-for="(son,i) in item.CompetingItems" :key="i">
<div class="contentColumn">TOP{{i+1}}</div>
<div class="contentColumn">{{son.Price}}</div>
<div class="contentColumn">{{son.CommentCount}}</div>
<div class="contentColumn" style="width: 558px;">
<a :href="son.ItemUrl">
{{son.Title}}</a>
</div>
</div>
</div>
<div style="flex-direction: column;width: 177px;color: #02a7f0;" class="contentDiv" >
<div >查找竞品</div>
@ -178,6 +188,103 @@ export default {
//this.getDatas(0)
},
methods: {
getTop1Comment(items){
if(items&&items.length>0)
{
return items[0].CommentCount
}
return '未添加竞品'
},
getTop1Data(items){
if(items&&items.length>0)
{
var commentCount= items[0].CommentCount;
var text="优"
var count= items.filter(c=>c.CommentCount==commentCount).length;
if(count>=1)
{
text="良"
}
if(count>2)
{
text="中"
}
if(count>4)
{
text="差"
}
return [text,count]
}
return ['优',0]
},
getCommentNeed(items){
var result=""
if(items.filter(c=>c.CommentCount=="500+").length<2&&items.filter(c=>c.CommentNumber>=1000).length==0)
{
result="100+"
}
if(items.filter(c=>c.CommentCount=="500+").length>2&&items.filter(c=>c.CommentNumber>=1000).length==0)
{
result="500+"
}
if(this.checkIsTrue(items.filter(c=>c.CommentCount=="1000+").length,1,2)&&items.filter(c=>c.CommentNumber>=2000).length==0)
{
result="500+"
}
if(items.filter(c=>c.CommentCount=="1000+").length>2&&items.filter(c=>c.CommentNumber>=2000).length==0)
{
result="1000+"
}
if(this.checkIsTrue(items.filter(c=>c.CommentCount=="2000+").length,1,2)&&items.filter(c=>c.CommentNumber>=5000).length==0)
{
result="1000+"
}
if(items.filter(c=>c.CommentCount=="2000+").length>2&&items.filter(c=>c.CommentNumber>=5000).length==0)
{
result="2000+"
}
if(this.checkIsTrue(items.filter(c=>c.CommentCount=="5000+").length,1,2)&&items.filter(c=>c.CommentNumber>=10000).length==0)
{
result="2000+"
}
if(items.filter(c=>c.CommentCount=="5000+").length>2&&items.filter(c=>c.CommentNumber>=10000).length==0)
{
result="5000+"
}
if(items.filter(c=>c.CommentNumber>=10000).length>0)
{
result="5000+"
}
return result
},
checkIsTrue(count,value,otherValue)
{
if(count==value||count==otherValue)
{
return true;
}
return false;
},
searchPicByUrl(){
this.getImgBase64(this.getImgPath(this.searchpicurl), 2)
this.showSearchPic=false
@ -439,12 +546,25 @@ export default {
color: #333333;
text-align: center;
display: flex;
flex-direction: row;
justify-items: center;
align-items: center;
justify-content: center;
align-content: center;
height: 170px;
flex-direction: row;
justify-items: center;
align-items: center;
justify-content: center;
align-content: center;
height: 174px;
}
.contentColumn{
width: 93px;
height: 35px;
border-right: 1px solid #d7d7d7;
border-bottom: 1px solid #d7d7d7;
background-color: #ffffff;
display: flex;
flex-direction: row;
justify-items: center;
align-items: center;
justify-content: center;
align-content: center;
}
.headCol {
border: 1px solid rgba(215, 215, 215, 1);

Loading…
Cancel
Save