优化调整

This commit is contained in:
2023-07-12 01:36:35 +08:00
parent 92d102c346
commit e6106c073f
15 changed files with 211 additions and 157 deletions

View File

@@ -70,7 +70,7 @@
</div>
<div style="margin-top: 2.5vh;margin-left: 20px;display: flex;flex-direction: column;flex-wrap: nowrap;">
<el-card class="box-card" style="width: 15vw">
<el-button type="info" plain @click="openLogin" v-show="this.$cookie.get('username')==null"> </el-button>
<el-button type="info" plain @click="openLogin" v-if="this.$cookie.get('username')==null"> </el-button>
<UserInfo></UserInfo>
</el-card>
@@ -79,11 +79,11 @@
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;justify-content: space-between">
<div style="display: flex;flex-direction: column;flex-wrap: nowrap">
<span style="font-size: 16px;color: #9ca3af;font-weight: bold">用户总数</span>
<span style="font-size: 30px">{{userTotal}}</span>
<span v-if="userTotal" style="font-size: 30px">{{userTotal}}</span>
</div>
<div style="display: flex;flex-direction: column;flex-wrap: nowrap">
<span style="font-size: 16px;color: #9ca3af;font-weight: bold">开源项目</span>
<span style="font-size: 30px">{{projectTotal}}</span>
<span v-if="projectTotal" style="font-size: 30px">{{projectTotal}}</span>
</div>
</div>
<!-- <el-statistic group-separator="," :precision="0" decimal-separator="." :value="userTotal" title="用户总数">-->
@@ -165,11 +165,14 @@ export default {
mounted() {
// this.account(); //获取cookie的方法
this.ProjectLists();
this.categoryList();
this.getUserTotal();
this.getProjectTotal();
},
created() {
this.categoryList();
setTimeout(()=>{
this.getProjectTotal();
},1000)
this.getUserTotal();
},
computed: {
noMore() {
@@ -290,9 +293,6 @@ export default {
method: 'post',
// 请求的地址
url: '/api/userNum',
// URL 中的查询参数
params: {
}
}).then((res)=>{
that.userTotal=res.data;
});
@@ -304,9 +304,6 @@ export default {
// 请求的地址
url: '/api/countNum',
// URL 中的查询参数
params: {
}
}).then((res)=>{
that.projectTotal=res.data;
});

View File

@@ -77,7 +77,7 @@
<el-form-item>
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: flex-end">
<el-button @click="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
<el-button @click.native.stop.once="submit('ruleForm')" type="primary" style=";margin-top:10px">提交</el-button>
</div>
</el-form-item>
</el-form>

View File

@@ -15,25 +15,25 @@
<div style="display: flex;flex-direction: column;flex-wrap: nowrap;">
<el-card style="box-shadow: none;border-radius: 10px">
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center">
<span style="font-size: 18px;color: #6b7280;font-weight: bold">
<span v-if="oneFileName" style="font-size: 18px;color: #6b7280;font-weight: bold">
{{oneFileName}} :
</span>
<span style="font-size: 16px;color: #6b7280;font-weight: bold">
<span v-if="description" style="font-size: 16px;color: #6b7280;font-weight: bold">
{{description}}
</span>
</div>
<div style="display: flex;flex-wrap: nowrap;flex-direction: row;align-items: center;justify-content: space-between">
<div style="font-size: 15px;color: #9ca3af;margin-top: 20px;">
<span>发布于: </span>
<span>{{userName}}</span>
<span v-if="userName">{{userName}}</span>
<span> · </span>
<span> 主语言 {{language}}</span>
<span v-if="language"> 主语言 {{language}}</span>
<span> · </span>
<span> {{formatNumber(lookNum)}} </span>
<span v-if="lookNum"> {{formatNumber(lookNum)}} </span>
<span> 次查看 </span>
</div>
<div style="display: flex;align-items: center;justify-content: center;margin-top: 20px;">
<el-button plain icon="el-icon-link" size="mini" @click="goTo(url)">访问</el-button>
<el-button v-if="url" v-show="url!=null" plain icon="el-icon-link" size="mini" @click="goTo(url)">访问</el-button>
<el-button plain icon="el-icon-document-copy" size="mini" @click="copyText">复制</el-button>
</div>
</div>
@@ -42,6 +42,7 @@
<el-card style="box-shadow: none;margin-top: 20px;border-radius: 10px">
<PrismEditor
class="my-editor height-300"
v-if="content"
v-model="content"
aria-disabled
:highlight="highlighter"
@@ -137,7 +138,6 @@ export default {
id:this.$route.query.id
}
}).then(function (res) {
console.log(res);
that.id=res.data.id;
that.language=res.data.language;
that.lookNum=res.data.lookNum;

View File

@@ -5,13 +5,13 @@
<br/>
<el-page-header @back="goBack" style="justify-content:left;display: flex;">
<div slot="title" style="font-size:23px;font-weight: 600;"></div>
<div slot="content" style=";display: flex;flex-direction:row;justify-content:center;font-size:23px;font-weight: 600;">
<div v-if="ArticleContent" slot="content" style=";display: flex;flex-direction:row;justify-content:center;font-size:23px;font-weight: 600;">
{{ArticleTitle}}
</div>
</el-page-header>
</div>
<div class="PageContent" style="display: flex;flex-direction: column;flex-wrap: nowrap;align-items: center">
<el-image fit="cover" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);width: 50vw; height: 35vh;margin-top: 20px" :src="articleico">
<el-image v-if="articleico" fit="cover" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);width: 50vw; height: 35vh;margin-top: 20px" :src="articleico">
<div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span>
</div>
@@ -21,7 +21,7 @@
</el-image>
<el-card style="border: none;width: 50vw;box-shadow: none;">
<el-tiptap style="margin-top: 20px;text-align: left" v-html="ArticleContent" :readonly="true" :showMenubar="false" :extensions="extensions" />
<el-tiptap v-if="ArticleContent" style="margin-top: 20px;text-align: left" v-html="ArticleContent" :readonly="true" :showMenubar="false" :extensions="extensions" />
</el-card>
</div>
</div>

View File

@@ -9,17 +9,17 @@
</span>
<div style="margin-top: 10px;display: flex;flex-direction: row;flex-wrap: wrap;align-items: center;font-size: 12px;color: #1f2937">
<span style="display: flex;justify-content: flex-start"> 作者: </span>
<span style="margin-left: 5px"> {{articleList.username}} </span>
<span v-if="articleList.username" style="margin-left: 5px"> {{articleList.username}} </span>
<span style="margin-left: 5px"></span>
<span style="margin-left: 5px">发布于 </span>
<span style="margin-left: 5px">{{articleList.publishtime}}</span>
<span v-if="articleList.publishtime" style="margin-left: 5px">{{articleList.publishtime}}</span>
<span style="margin-left: 5px"></span>
<span style="margin-left: 5px">阅读: </span>
<span style="margin-left: 5px">{{ formatNumber(articleList.ReadCount) }}</span>
<span v-if="articleList.ReadCount" style="margin-left: 5px">{{ formatNumber(articleList.ReadCount) }}</span>
</div>
</div>
<div style="width: 100px;height: 100px;margin-right: 10px">
<el-avatar :size="100" shape="square" :src="articleList.articleico"></el-avatar>
<el-avatar v-if="articleList.articleico" :size="100" shape="square" :src="articleList.articleico"></el-avatar>
</div>
</div>
</template>
@@ -37,7 +37,11 @@ export default {
},
computed:{
brief: function() {
if(this.articleList.ArticleContent){
return this.articleList.ArticleContent.substr(0, 100) + '...';
}else{
return false;
}
},
},
methods:{
@@ -45,12 +49,17 @@ export default {
return num >= 1e3 && num < 1e4 ? (num / 1e3).toFixed(1) + 'k' : num >= 1e4 ? (num / 1e4).toFixed(1) + 'w' : num
},
goArticleDetail(){
if(this.articleList.ArticleId){
this.$router.push({
path:'/ArticleDetail',
query: {
id: this.articleList.ArticleId,
refresh: true
}})
}else{
return false;
}
// console.log(this.$route.query.id)
},
}

View File

@@ -21,7 +21,7 @@
{{ briefTopName }}
</span>
</el-link>
<span style="text-align: left;display: flex;flex-direction:row;justify-content: flex-start;font-size: 20px;color: rgb(107 114 128);">
<span v-if="projectTitle" style="text-align: left;display: flex;flex-direction:row;justify-content: flex-start;font-size: 20px;color: rgb(107 114 128);">
{{projectTitle}}
</span>
</div>
@@ -34,7 +34,7 @@
</span>
<el-rate v-model="average" style="display: flex;justify-content: flex-start" disabled show-score text-color="#ff9900"
score-template="{value}"></el-rate>
<span style="font-size: 12px;color: #59A3A4;display: flex;justify-content: flex-start">
<span v-if="commentNum" style="font-size: 12px;color: #59A3A4;display: flex;justify-content: flex-start">
{{ commentNum }} 个评分
</span>
</div>
@@ -218,10 +218,10 @@
</div>
<div style="display: flex;flex-direction: row;justify-content: space-between;margin-left: 10px;margin-top: 5px">
<span style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<span v-if="item.commentTime" style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<div style="display: flex;align-items: center">
<span style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link @click="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
<span v-if="item.likeNum" style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link v-if="item.commentId" @click="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
</div>
</div>
@@ -252,15 +252,15 @@
</div>
<div style="margin-left: 10px;margin-top: 5px">
<el-card style="border: none;text-align:left;">
<span>{{item.content}}</span>
<span v-if="item.content">{{item.content}}</span>
</el-card>
</div>
<div style="display: flex;flex-direction: row;justify-content: space-between;margin-left: 10px;margin-top: 5px">
<span style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<span v-if="item.commentTime" style="font-size: 14px;color: #9ca3af">{{item.commentTime}}</span>
<div style="display: flex;align-items: center">
<span style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link @click.once="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
<span v-if="item.likeNum" style="margin-right: 5px;font-size: 14px; color: rgb(156, 163, 175);">{{ formatNumber(item.likeNum) }}</span>
<el-link v-if="item.commentId" @click.once="addLike(item.commentId)" icon="el-icon-star-off" :underline="false">点赞</el-link>
</div>
</div>
@@ -392,6 +392,7 @@ export default {
},
methods:{
toUserPage() {
if(this.username){
this.$router.push({
path: '/UserInfoPage',
query: {
@@ -399,8 +400,13 @@ export default {
refresh: true
}
})
}else {
return false;
}
},
toUserPage2(username) {
if(username){
this.$router.push({
path: '/UserInfoPage',
query: {
@@ -408,6 +414,10 @@ export default {
refresh: true
}
})
}else {
return false;
}
},
toComment(id){
document.querySelector(id).scrollIntoView(true)
@@ -447,9 +457,12 @@ export default {
that.username=res.data.project.username;
that.fileAddress=res.data.project.fileAddress;
// that.userUri=res.data.project.userUri;
if(res.data){
that.getDetailByGitHub();
// that.getGithub();
that.changeAvatarByLocal();
}
});
},
reload() {
@@ -698,9 +711,6 @@ export default {
// 请求的地址
url: '/github/'+this.projectName,
// URL 中的查询参数
params: {
}
}).then((res)=>{
if(res.data){
that.github.starNum=res.data.stargazers_count;

View File

@@ -1,11 +1,11 @@
<template>
<div class="ProjectList" @click="goProjectDetail">
<div class="projectIco">
<img :src="projectLists.projectIco" style="width: 5vw;height: 5vw;margin-left: 10px;border-radius: 10px">
<img v-if="projectLists.projectIco" :src="projectLists.projectIco" style="width: 5vw;height: 5vw;margin-left: 10px;border-radius: 10px">
</div>
<div style="height: 12vh;margin-left: 5px;width: auto;display: flex;flex-direction: column;justify-content: space-between">
<div class="ProjectTitle" style="font-size: 16px;font-weight: bold;display: flex;flex-direction: row;align-items: center;justify-content: space-between">
<span>{{projectLists.projectTitle}}</span>
<span v-if="projectLists.projectTitle">{{projectLists.projectTitle}}</span>
<el-tag style="font-size: 14px;height: 20px;text-align: center;display: flex;align-items: center;border-radius: 10px" v-if="projectLists.num>0" type="success">{{projectLists.num}}</el-tag>
</div>
<div class="summary">
@@ -14,18 +14,18 @@
<div class="other">
<div class="otherInfo">
<div class="projectName">
<span style="color: #59A3A4">{{ projectLists.projectName }}</span><span style="color: rgb(156 163 175);"> </span>
<span v-if=" projectLists.projectName" style="color: #59A3A4">{{ projectLists.projectName }}</span><span style="color: rgb(156 163 175);"> </span>
</div>
<div>
<div class="circle" :style="{'background-color':colorlists[Math.floor(Math.random() * colorlists.length)]}" ></div>
</div>
<el-tag size="mini" style="border-radius: 10px;margin-left: 5px" v-html="projectLists.categoryName"></el-tag><span style="color: rgb(156 163 175);margin-left: 5px"> </span>
<el-tag v-if="projectLists.categoryName" size="mini" style="border-radius: 10px;margin-left: 5px" v-html="projectLists.categoryName"></el-tag><span style="color: rgb(156 163 175);margin-left: 5px"> </span>
<div style="margin-left: 10px">
<span style="color: rgb(156 163 175); ">{{ formatTime }}</span>
<span v-if="projectLists.submitTime" style="color: rgb(156 163 175); ">{{ formatTime }}</span>
</div>
</div>
<div class="lookCount">
<i class="el-icon-view" style="color: rgb(156 163 175);"></i><span style="margin-left: 5px;color: rgb(156 163 175); ">{{ formatNumber(projectLists.lookCount) }}</span>
<i class="el-icon-view" style="color: rgb(156 163 175);"></i><span v-if="projectLists.lookCount" style="margin-left: 5px;color: rgb(156 163 175); ">{{ formatNumber(projectLists.lookCount) }}</span>
</div>
</div>
</div>
@@ -39,7 +39,7 @@ export default {
name: "ProjectList",
data(){
return{
// 作答卡片颜色设置
// 颜色设置
colorlists: [
'hsl(62,90%,49%)',
'hsl(138,63%,59%)',
@@ -63,7 +63,7 @@ export default {
computed: {
// 对时间进行格式化
formatTime: function() {
if (this.projectLists) {
if (this.projectLists.submitTime) {
const dt = new Date(this.projectLists.submitTime)
const year=dt.getFullYear()
const month = dt.getMonth()
@@ -74,7 +74,12 @@ export default {
},
// 截取文章内容的前 35 个字,并加上省略号
brief: function() {
if(this.projectLists.projectDescription){
return this.projectLists.projectDescription.substr(0, 33) + '...';
}else{
return false;
}
},
},

View File

@@ -54,12 +54,12 @@
:show-overflow-tooltip="true"
label="评论时间">
</el-table-column>
<el-table-column
prop="star"
show-overflow-tooltip
align="center"
label="项目评分">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="star"-->
<!-- show-overflow-tooltip-->
<!-- align="center"-->
<!-- label="项目评分">-->
<!-- </el-table-column>-->
<el-table-column
label="项目评分"
width="200"
@@ -334,7 +334,7 @@ export default {
},
handleDelete(index) {
var that=this;
this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
this.$confirm('此操作将永久删除该评论, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -383,7 +383,7 @@ export default {
},
handleDelete(index) {
var that=this;
this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -2,7 +2,7 @@
<div>
<div class="HeadLine">
<div class="HeadSquare"></div>
<div class="TitleFont">文章管理</div>
<div class="TitleFont">系统管理</div>
</div>
<div style="height:50px;width:100%;"></div>
@@ -288,7 +288,7 @@ export default {
// 删除按钮
handleDelete(index) {
var that=this;
this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'

View File

@@ -2,10 +2,10 @@
<el-card style="border-radius: 10px;margin-top: 10px">
<div @click="goToArticleDetail" class="UserArticle" style="display: flex;flex-direction: row;flex-wrap: nowrap;cursor: pointer">
<div style="width: 60px;height: 60px;display: flex;flex-direction: row;align-content: center">
<el-avatar :src="article.articleico" style="display: flex;align-items: center;justify-content: center" shape="square" :size="60"></el-avatar>
<el-avatar v-if="article.articleico" :src="article.articleico" style="display: flex;align-items: center;justify-content: center" shape="square" :size="60"></el-avatar>
</div>
<div style="margin-left: 10px;display: flex;flex-wrap: nowrap;flex-direction: column;">
<span style="display: flex;flex-direction: row;justify-content: flex-start;font-size: 18px;font-weight: bold;">
<span v-if="article.ArticleTitle" style="display: flex;flex-direction: row;justify-content: flex-start;font-size: 18px;font-weight: bold;">
{{article.ArticleTitle}}
</span>
<span style="font-size: 14px;color: #9ca3af;display: flex;flex-direction: row;justify-content: flex-start;flex-wrap: nowrap">
@@ -13,15 +13,15 @@
</span>
<div style="margin-top: 2.5px;display: flex;flex-direction: row;justify-content: space-between;align-content: center;align-items: center">
<div style="display: flex;flex-direction: row;align-content: center">
<span style="font-size: 13px;color: #9ca3af">
<span style="font-size: 13px;color: #9ca3af" v-if="article.username">
作者: {{article.username}}
</span>
<span style="margin-left: 10px;text-align: center;font-size: 13px;color: #9ca3af">
<span style="margin-left: 10px;text-align: center;font-size: 13px;color: #9ca3af" v-if="article.publishtime">
发布于: {{article.publishtime}}
</span>
</div>
<div style="margin-left: 5px;align-items: center;font-size: 13px;color: #9ca3af">
<i class="el-icon-view"></i> <span>{{formatNumber(article.ReadCount)}}</span>
<i class="el-icon-view"></i> <span v-if="article.ReadCount">{{formatNumber(article.ReadCount)}}</span>
</div>
</div>
@@ -44,7 +44,12 @@ export default {
},
computed:{
brief: function() {
if (this.article.ArticleContent){
return this.article.ArticleContent.substr(0, 48) + '...';
}else{
return false;
}
},
},
methods:{
@@ -52,12 +57,17 @@ export default {
return num >= 1e3 && num < 1e4 ? (num / 1e3).toFixed(1) + 'k' : num >= 1e4 ? (num / 1e4).toFixed(1) + 'w' : num
},
goToArticleDetail(){
if(this.article.ArticleId){
this.$router.push({
path:'/ArticleDetail',
query: {
id: this.article.ArticleId,
refresh: true
}})
}else{
return false;
}
// console.log(this.$route.query.id)
},
}

View File

@@ -2,7 +2,7 @@
<div style="display: flex;flex-direction: column;flex-wrap: nowrap;margin-top: 10px">
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center;justify-content: space-between">
<div>
<span style="color: #4b5563;font-size: 16px"><span style="font-size: 17px;font-weight: bold">{{index+1}}</span>. {{comments.commentTime}} 发布的评论</span>
<span v-if="comments.commentTime" style="color: #4b5563;font-size: 16px"><span style="font-size: 17px;font-weight: bold">{{index+1}}</span>. {{comments.commentTime}} 发布的评论</span>
</div>
<div>
<el-link :underline="false" style="color: red">申诉</el-link>
@@ -21,6 +21,7 @@
<span style="margin-left: 10px">评分: </span>
<el-rate
style="margin-left: 5px"
v-if="comments.star"
v-model="comments.star"
disabled
score-template="{value}">
@@ -32,7 +33,7 @@
没用过
</el-tag>
</div>
<el-card style=";border:none;display: flex;flex-direction:row;justify-content: flex-start;margin-top: 10px">
<el-card style=";border:none;display: flex;flex-direction:row;justify-content: flex-start;margin-top: 10px" v-if="comments.content">
{{comments.content}}
</el-card>
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;margin-top: 10px;align-items: center;justify-content: space-between">
@@ -46,7 +47,7 @@
<span v-if="comments.likeNum<200" style="margin-left: 8px">非热评</span>
<span style="margin-left: 8px"></span>
<span style="margin-left: 8px">点赞</span>
<span style="margin-left: 8px">{{comments.likeNum}}</span>
<span v-if="comments.likeNum" style="margin-left: 8px">{{comments.likeNum}}</span>
</div>
</div>
</div>
@@ -71,7 +72,7 @@ export default {
},
computed:{
formatTime: function() {
if (this.comments) {
if (this.comments.commentTime) {
const dt = new Date(this.comments.commentTime)
const year=dt.getFullYear()
const month = dt.getMonth()
@@ -83,11 +84,16 @@ export default {
},
methods:{
toCommentDeatil(){
if(this.comments.projectId){
this.$router.push({
path:'/ProjectDetail',
query: {
id: this.comments.projectId, refresh: true
}})
}else{
return false;
}
}
},
}

View File

@@ -10,15 +10,15 @@
</div>
</div>
<el-switch v-model="switchValue" style="">
</el-switch>
<!-- <el-switch v-model="switchValue" style="">-->
<!-- </el-switch>-->
</div>
<div style="display: flex;flex-direction: row;margin-top: 10px;justify-content: space-between;align-items: center">
<span style="font-size: 10px;color: #9ca3af">贡献值</span>
<span style="font-weight: bold;color: #59A3A4;font-size: 20px">{{ContributionValue}}/100</span>
<span v-if="ContributionValue" style="font-weight: bold;color: #59A3A4;font-size: 20px">{{ContributionValue}}/100</span>
</div>
<div style="margin-top: 10px">
<el-progress :text-inside="true" :stroke-width="15" :percentage="ContributionValue"></el-progress>
<el-progress v-if="ContributionValue" :text-inside="true" :stroke-width="15" :percentage="ContributionValue"></el-progress>
</div>
<el-divider></el-divider>
<div style="display: flex;align-items: center;justify-content: space-between;flex-direction: row;flex-wrap: nowrap;">

View File

@@ -19,7 +19,7 @@
</div>
<div style="display: flex;flex-direction: column;margin-left: 15px;">
<div style="display: flex;flex-direction: row;align-items: center;justify-content: flex-start;">
<span style="font-size: 20px;font-weight: bold;">{{username}}</span>
<span style="font-size: 20px;font-weight: bold;" v-if="username">{{username}}</span>
<span style="font-size: 15px;font-weight: bold;color: #3b82f6;margin-left: 10px">Lv.{{userLevel}}</span>
</div>
<span style="display: flex;justify-content:flex-start;margin-top: 10px;color: #6b7280;font-size: 15px">你是 HelloGitHub 社区的第<span style="font-size: 16px;color:#2b2e33;font-weight: bold "> {{userId}} </span>位用户 {{creatTime}} 加入</span>
@@ -35,7 +35,7 @@
<span v-if="contributionValue!=null" style="font-size: 16px;color:#2b2e33;font-weight: bold ">{{contributionValue}}</span>
<span v-if="contributionValue==null" style="font-size: 16px;color:#2b2e33;font-weight: bold ">0</span>
点贡献值.
<span style="font-size: 16px;color:#2b2e33;font-weight: bold ">
<span style="font-size: 16px;color:#2b2e33;font-weight: bold " v-if="article">
{{Object.keys(article).length}}
</span>
篇文章
@@ -194,6 +194,7 @@ export default {
window.history.go(-1);
},
getUserInfo(){
if(this.$route.query.name){
var that=this;
axios({
method: 'post',
@@ -212,8 +213,13 @@ export default {
// that.imageUrl=res.data.userAvatar;
that.userLevel=res.data.userLevel;
});
}else {
return false;
}
},
getUserDetail(){
if(this.$route.query.name){
var that=this;
axios({
method: 'post',
@@ -230,6 +236,10 @@ export default {
that.like=JSON.parse(res.data.like)
that.article=JSON.parse(res.data.article);
});
}else {
return false;
}
},
updateUserLevel(){
if(this.$cookie.get("username")!=null){
@@ -238,9 +248,6 @@ export default {
// 请求的地址
url: 'http://localhost:8082/helloGithub_war_exploded/levelup',
// URL 中的查询参数
params: {
}
});
}else{
return;

View File

@@ -2,24 +2,24 @@
<el-card style="border-radius: 15px;margin-top: 10px">
<div @click="toProjectDetail" class="userProjects" style="cursor: pointer;display: flex;flex-direction: row;flex-wrap: nowrap">
<div style="width: 80px;height: 80px;display: flex;align-items: center">
<el-avatar :size="80" :src="project.projectIco" shape="square"></el-avatar>
<el-avatar :size="80" v-if="project.projectIco" :src="project.projectIco" shape="square"></el-avatar>
</div>
<div style=";margin-left:10px;display: flex;flex-direction: column;flex-wrap: nowrap">
<div style="margin-left: 10px;display: flex;flex-direction: row;justify-content: flex-start">
<span style="font-size: 16px;font-weight: bold">{{project.projectName}}</span>
<span v-if="project.projectName" style="font-size: 16px;font-weight: bold">{{project.projectName}}</span>
</div>
<div style="margin-top: 10px;margin-left: 10px;">
<span style="display: flex;flex-direction: row;justify-content:flex-start;text-align: left;font-size: 16px;color: #9ca3af">{{brief}}</span>
</div>
<div style=" margin-left: 10px;;margin-top: 10px;display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center">
<div :style="{'background-color':colorlists[Math.floor(Math.random() * colorlists.length)]}" style="width: 10px;height: 10px;background-color: #42b983;border-radius: 50px"></div>
<el-tag size="mini" style="margin-left: 5px;border-radius: 10px">
<el-tag v-if="project.categoryName" size="mini" style="margin-left: 5px;border-radius: 10px">
{{project.categoryName}}
</el-tag>
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af"></span>
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{ formatNumber(project.lookCount) }}</span>
<span v-if="project.lookCount" style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{ formatNumber(project.lookCount) }}</span>
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af"></span>
<span style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{project.submitTime}}
<span v-if="project.submitTime" style="margin-left: 5px;font-size: 14px;color: #9ca3af">{{project.submitTime}}
</span><span style="margin-left: 5px;font-size: 14px;color: #9ca3af"></span>
<span v-show="project.isValid===0" style="margin-left: 5px;font-size: 14px;color: #ffca00">待审核</span>
<span v-show="project.isValid===1" style="margin-left: 5px;font-size: 14px;color: #48d04e">已通过</span>
@@ -57,7 +57,12 @@ export default {
},
computed:{
brief:function(){
if(this.project.projectDescription){
return this.project.projectDescription.substr(0, 38) + '...';
}else{
return false;
}
},
},
methods:{
@@ -65,11 +70,16 @@ export default {
return num >= 1e3 && num < 1e4 ? (num / 1e3).toFixed(1) + 'k' : num >= 1e4 ? (num / 1e4).toFixed(1) + 'w' : num
},
toProjectDetail(){
if(this.project.projectId){
this.$router.push({
path:'/ProjectDetail',
query: {
id: this.project.projectId, refresh: true
}})
}else {
return false;
}
}
}