Commit ed8d526b by yanju

修改项目卡片

parent 9314cbaa
......@@ -137,6 +137,33 @@
this.cardUser = info.author;
this.cardType = 1;
}
if(this.info.contentId){
this.cardName = info.title;
this.cardIntro = info.subTitle;
this.cardId = info.contentId;
this.src = info.cover;
this.cardTime = dateConvert(info.createTime);
this.cardUser = info.author;
this.cardType = 3;
}
if(this.info.itemId&&this.info.itemType==="BLOG"){
this.cardName = info.title;
this.cardIntro = info.description;
this.cardId = info.itemId;
this.src = info.cover;
this.cardTime = dateConvert(info.createTime);
this.cardUser = info.author;
this.cardType = 2;
}
if(this.info.itemId&&this.info.itemType==="PROJECT"){
this.cardName = info.title;
this.cardIntro = info.description;
this.cardId = info.itemId;
this.src = info.cover;
this.cardTime = dateConvert(info.createTime);
this.cardUser = info.author;
this.cardType = 2;
}
},
showAlert(id){
......
......@@ -189,13 +189,16 @@
let indexArr = [];
let html=``;
let reg = /(#([^#]+?)#)/;
for (let i = 0; i <content.length ; i++) {
let index = content.indexOf("#",i);
if(index!==-1&&index===i){
indexArr.push(index)
}
}
if(indexArr.length>=1){
if(indexArr.length>1){
for (let i = 0; i < indexArr.length-1; i+=2) {
let firstP = i>0?indexArr[i-1]+1:0;
html = html +`${content.substring(firstP,indexArr[i])}<a href="/topic/detail/${content.substring(indexArr[i]+1,indexArr[i+1])}">${content.substring(indexArr[i],indexArr[i+1]+1)}</a>`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment