jenkins init
This commit is contained in:
parent
156ee49215
commit
7148fe0846
@ -1,13 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="user-coin-card mb-4">
|
<div class="user-coin-card mb-4">
|
||||||
<div class="row" style="width: 100%;">
|
<div class="row" style="width: 100%">
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="content-wrap" style="float: none;">
|
<div class="content-wrap" style="float: none">
|
||||||
<div class="content-layout">
|
<div class="content-layout">
|
||||||
<div class="fixed-wrap bbs-home-tab">
|
<div class="fixed-wrap bbs-home-tab">
|
||||||
|
|
||||||
<div class="fixed-wrap-content">
|
<div class="fixed-wrap-content">
|
||||||
<div class="tab-content bbs-main-tab-content">
|
<div class="tab-content bbs-main-tab-content">
|
||||||
<!-- 文章列表 -->
|
<!-- 文章列表 -->
|
||||||
@ -16,30 +15,77 @@
|
|||||||
<div class="user-info flex ac mb10">
|
<div class="user-info flex ac mb10">
|
||||||
<!-- <a href="/"> -->
|
<!-- <a href="/"> -->
|
||||||
<div @click="showConfirm">
|
<div @click="showConfirm">
|
||||||
<span class="avatar-img"><img src="https://onlinephoto.oss-cn-chengdu.aliyuncs.com/hangtian/touxiang.jpg" data-src="//www.cmstui.com/wp-content/themes/zibll/img/avatar-default.png" class="lazyload avatar avatar-id-1">
|
<span class="avatar-img"
|
||||||
|
><img
|
||||||
|
src="https://onlinephoto.oss-cn-chengdu.aliyuncs.com/hangtian/touxiang.jpg"
|
||||||
|
data-src="//www.cmstui.com/wp-content/themes/zibll/img/avatar-default.png"
|
||||||
|
class="lazyload avatar avatar-id-1"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- </a> -->
|
<!-- </a> -->
|
||||||
<div class="user-right flex flex1 ac jsb ml10">
|
<div class="user-right flex flex1 ac jsb ml10">
|
||||||
<div class="flex1">
|
<div class="flex1">
|
||||||
<div class="flex ac flex1"><a class="display-name text-ellipsis " href="/">{{ getUserName(forums.userId) }}</a></div>
|
<div class="flex ac flex1">
|
||||||
|
<a
|
||||||
|
class="display-name text-ellipsis"
|
||||||
|
href="/"
|
||||||
|
>{{ getUserName(forums.userId) }}</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="content mt6"><a target="_blank" href="#" class="excerpt" v-html="forums.articleContent"></a></div>
|
<div class="content mt6">
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
href="#"
|
||||||
|
class="excerpt"
|
||||||
|
v-html="forums.articleContent"
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex ac jsb mt10">
|
<div class="flex ac jsb mt10">
|
||||||
<div class="action-meta flex0 flex jsb">
|
<div class="action-meta flex0 flex jsb">
|
||||||
<div class="score-btns"><a href="javascript:;" ajax-action="score_extra" class="btn-score extra"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-extra-points"></use></svg></a><text>评分</text>
|
<div class="score-btns">
|
||||||
<a href="javascript:;" ajax-action="score_deduct" class="btn-score deduct"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-deduct-points"></use></svg></a>
|
<a
|
||||||
</div><a href="#" class="item"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-comment"></use></svg><text>回复</text></a>
|
href="javascript:;"
|
||||||
<a mobile-bottom="true" data-height="243" class="btn-share item" href="javascript:;" data-toggle="RefreshModal"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-share"></use></svg><text>分享</text></a>
|
ajax-action="score_extra"
|
||||||
|
class="btn-score extra"
|
||||||
|
><svg class="icon" aria-hidden="true">
|
||||||
|
<use
|
||||||
|
xlink:href="#icon-extra-points"
|
||||||
|
></use></svg></a
|
||||||
|
><text>评分</text>
|
||||||
|
<a
|
||||||
|
href="javascript:;"
|
||||||
|
ajax-action="score_deduct"
|
||||||
|
class="btn-score deduct"
|
||||||
|
><svg class="icon" aria-hidden="true">
|
||||||
|
<use
|
||||||
|
xlink:href="#icon-deduct-points"
|
||||||
|
></use></svg
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
|
<a href="#" class="item"
|
||||||
|
><svg class="icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-comment"></use></svg
|
||||||
|
><text>回复</text></a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
mobile-bottom="true"
|
||||||
|
data-height="243"
|
||||||
|
class="btn-share item"
|
||||||
|
href="javascript:;"
|
||||||
|
data-toggle="RefreshModal"
|
||||||
|
><svg class="icon" aria-hidden="true">
|
||||||
|
<use xlink:href="#icon-share"></use></svg
|
||||||
|
><text>分享</text></a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -48,17 +94,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<section id="comments" class="box-show wow fadeInDown">
|
<section id="comments" class="box-show wow fadeInDown">
|
||||||
<div id="comt-respond" class="commentpost">
|
<div id="comt-respond" class="commentpost">
|
||||||
<h4>发表评论<span><a rel="nofollow" id="cancel-reply" href="#comment" class="page_speeder_1817808094"></a></span></h4>
|
<h4>
|
||||||
|
发表评论<span
|
||||||
|
><a
|
||||||
|
rel="nofollow"
|
||||||
|
id="cancel-reply"
|
||||||
|
href="#comment"
|
||||||
|
class="page_speeder_1817808094"
|
||||||
|
></a
|
||||||
|
></span>
|
||||||
|
</h4>
|
||||||
<form id="frmSumbit">
|
<form id="frmSumbit">
|
||||||
<input type=hidden id="inpId" value="413" >
|
<input type="hidden" id="inpId" value="413" />
|
||||||
<input type=hidden id="inpRevID" value="0" >
|
<input type="hidden" id="inpRevID" value="0" />
|
||||||
|
|
||||||
<div id="comment-tools">
|
<div id="comment-tools">
|
||||||
<div class="tools_text">
|
<div class="tools_text">
|
||||||
<textarea placeholder="请输入您的评论" name="txaArticle" id="txaArticle" class="text input-block-level comt-area" cols="50" rows="4" tabindex="5" v-model="text"></textarea>
|
<textarea
|
||||||
|
placeholder="请输入您的评论"
|
||||||
|
name="txaArticle"
|
||||||
|
id="txaArticle"
|
||||||
|
class="text input-block-level comt-area"
|
||||||
|
cols="50"
|
||||||
|
rows="4"
|
||||||
|
tabindex="5"
|
||||||
|
v-model="text"
|
||||||
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<div class="psumbit">
|
<div class="psumbit">
|
||||||
<a-button type="primary" @click="PublishComments">
|
<a-button type="primary" @click="PublishComments">
|
||||||
@ -73,27 +136,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2 class="comment-text-center" v-if="!this.msg"><i class="icon font-meiyou"></i> 还没有评论,来说两句吧...</h2><label id="AjaxCommentBegin"></label>
|
<h2 class="comment-text-center" v-if="!this.msg">
|
||||||
|
<i class="icon font-meiyou"></i> 还没有评论,来说两句吧...
|
||||||
|
</h2>
|
||||||
|
<label id="AjaxCommentBegin"></label>
|
||||||
<div v-for="(item, index) in comments" :key="index">
|
<div v-for="(item, index) in comments" :key="index">
|
||||||
<div class="shadow-box msg noimg wow fadeInRight" data-wow-delay="0.25s" id="cmt225">
|
<div
|
||||||
<div style="display:flex;flex-direction: row;align-items:end;justify-content:flex-end;" @click="DeleteComments(item)">删除</div>
|
class="shadow-box msg noimg wow fadeInRight"
|
||||||
|
data-wow-delay="0.25s"
|
||||||
|
id="cmt225"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: end;
|
||||||
|
justify-content: flex-end;
|
||||||
|
"
|
||||||
|
@click="DeleteComments(item)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</div>
|
||||||
<div class="msgimg">
|
<div class="msgimg">
|
||||||
<img class="avatar" src="https://q2.qlogo.cn/headimg_dl?dst_uin=36926842&spec=100" alt="网友昵称:访客" title="网友昵称:访客">
|
<img
|
||||||
|
class="avatar"
|
||||||
|
src="https://q2.qlogo.cn/headimg_dl?dst_uin=36926842&spec=100"
|
||||||
|
alt="网友昵称:访客"
|
||||||
|
title="网友昵称:访客"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="msgtxt">
|
<div class="msgtxt">
|
||||||
<div class="msgname">
|
<div class="msgname">
|
||||||
<span class="autlv aut-6 vs">V</span><span class="autlv autlvname aut-6">游客</span>
|
<span class="autlv aut-6 vs">V</span
|
||||||
<span class='dot shafa'>沙发</span>
|
><span class="autlv autlvname aut-6">游客</span>
|
||||||
|
<span class="dot shafa">沙发</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="interact-bar">
|
<div class="interact-bar">
|
||||||
<span class="interact-time" title="评论时间">{{ item.publishTime | formatTime }}</span>
|
<span class="interact-time" title="评论时间">{{
|
||||||
|
item.publishTime | formatTime
|
||||||
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="msgarticle">
|
<div class="msgarticle">
|
||||||
{{item.commentContent}}<label id="AjaxComment225"></label></div>
|
{{ item.commentContent }}<label id="AjaxComment225"></label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -104,11 +191,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
import {ArticleById,CommentsById,PublishComments,DeleteComments,AllUser} from "@/api"
|
ArticleById,
|
||||||
|
CommentsById,
|
||||||
|
PublishComments,
|
||||||
|
DeleteComments,
|
||||||
|
AllUser,
|
||||||
|
} from "@/api";
|
||||||
import ColumnSetting from "@/components/common/ColumnSetting.vue";
|
import ColumnSetting from "@/components/common/ColumnSetting.vue";
|
||||||
export default {
|
export default {
|
||||||
name: 'UserCenter',
|
name: "UserCenter",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
@ -120,7 +212,7 @@ import ColumnSetting from "@/components/common/ColumnSetting.vue";
|
|||||||
text: "",
|
text: "",
|
||||||
msg: "",
|
msg: "",
|
||||||
comments: [],
|
comments: [],
|
||||||
users:[]
|
users: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -134,29 +226,30 @@ filters: {
|
|||||||
const date = new Date(time);
|
const date = new Date(time);
|
||||||
// 获取年月日时分秒
|
// 获取年月日时分秒
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
const day = String(date.getDate()).padStart(2, "0");
|
||||||
const hours = String(date.getHours()).padStart(2, '0');
|
const hours = String(date.getHours()).padStart(2, "0");
|
||||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||||
// 返回格式化后的时间字符串
|
// 返回格式化后的时间字符串
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showConfirm() {
|
showConfirm() {
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
title: '添加好友?',
|
title: "添加好友?",
|
||||||
content: '是否现在与该用户进行聊天',
|
content: "是否现在与该用户进行聊天",
|
||||||
onOk: () => { // 使用箭头函数定义回调函数
|
onOk: () => {
|
||||||
|
// 使用箭头函数定义回调函数
|
||||||
let data = {
|
let data = {
|
||||||
friendId: this.forums.userId,
|
friendId: this.forums.userId,
|
||||||
friendName: this.getUserName(this.forums.userId),
|
friendName: this.getUserName(this.forums.userId),
|
||||||
}
|
};
|
||||||
console.log(data)
|
console.log(data);
|
||||||
this.$api.addFriend(data).then(res => {
|
this.$api.addFriend(data).then((res) => {
|
||||||
console.log(res)
|
console.log(res);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
onCancel() {},
|
onCancel() {},
|
||||||
});
|
});
|
||||||
@ -164,77 +257,91 @@ methods: {
|
|||||||
|
|
||||||
PublishComments() {
|
PublishComments() {
|
||||||
// 发布评论
|
// 发布评论
|
||||||
let formdata = { articleId: this.ArticleId, commentContent: this.text, userId: this.userId };
|
let formdata = {
|
||||||
|
articleId: this.ArticleId,
|
||||||
|
commentContent: this.text,
|
||||||
|
userId: this.userId,
|
||||||
|
};
|
||||||
// console.log(formdata);
|
// console.log(formdata);
|
||||||
PublishComments(formdata).then(res => {
|
PublishComments(formdata)
|
||||||
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message.success('发布成功');
|
this.$message.success("发布成功");
|
||||||
|
|
||||||
// 发布成功后重新获取评论
|
// 发布成功后重新获取评论
|
||||||
this.fetchData();
|
this.fetchData();
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
})
|
||||||
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
this.$message.error(error.msg || '发布失败');
|
this.$message.error(error.msg || "发布失败");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchData() {
|
fetchData() {
|
||||||
// 获取文章
|
// 获取文章
|
||||||
let datas = { id: this.ArticleId };
|
let datas = { id: this.ArticleId };
|
||||||
ArticleById(datas).then(res => {
|
ArticleById(datas)
|
||||||
|
.then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.forums = res.data;
|
this.forums = res.data;
|
||||||
// 获取文章成功后再获取评论
|
// 获取文章成功后再获取评论
|
||||||
this.getuser()
|
this.getuser();
|
||||||
this.fetchComments();
|
this.fetchComments();
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
})
|
||||||
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 删除评论
|
// 删除评论
|
||||||
DeleteComments(item) {
|
DeleteComments(item) {
|
||||||
DeleteComments(item.commentId).then(res=>{
|
DeleteComments(item.commentId)
|
||||||
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message.success('删除成功');
|
this.$message.success("删除成功");
|
||||||
// 获取文章成功后再获取评论
|
// 获取文章成功后再获取评论
|
||||||
this.fetchComments();
|
this.fetchComments();
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
})
|
||||||
this.$message.error(error || '删除失败');
|
.catch((error) => {
|
||||||
|
this.$message.error(error || "删除失败");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fetchComments() {
|
fetchComments() {
|
||||||
// 获取评论
|
// 获取评论
|
||||||
let data = { id: this.ArticleId };
|
let data = { id: this.ArticleId };
|
||||||
CommentsById(data).then(res => {
|
CommentsById(data)
|
||||||
|
.then((res) => {
|
||||||
this.msg = res.data.length || 0;
|
this.msg = res.data.length || 0;
|
||||||
this.comments = res.data;
|
this.comments = res.data;
|
||||||
// console.log(this.comments);
|
// console.log(this.comments);
|
||||||
// console.log(this.comments);
|
console.log(this.comments);
|
||||||
}).catch(error => {
|
})
|
||||||
|
.catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},getuser() {
|
},
|
||||||
AllUser().then(response => {
|
getuser() {
|
||||||
|
AllUser()
|
||||||
|
.then((response) => {
|
||||||
this.users = response.data;
|
this.users = response.data;
|
||||||
}).catch(error => {
|
})
|
||||||
|
.catch((error) => {
|
||||||
console.error("Failed to load users:", error);
|
console.error("Failed to load users:", error);
|
||||||
});
|
});
|
||||||
},getUserName(userId) {
|
|
||||||
const user = this.users.find(u => u.userId === userId);
|
|
||||||
return user ? user.userName : '未知用户';
|
|
||||||
},
|
},
|
||||||
}
|
getUserName(userId) {
|
||||||
}
|
const user = this.users.find((u) => u.userId === userId);
|
||||||
|
return user ? user.userName : "未知用户";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style src="@/assets/pages.css"></style>
|
<style src="@/assets/pages.css"></style>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
button {
|
button {
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
background-color: #3690cf;
|
background-color: #3690cf;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 88px;
|
width: 88px;
|
||||||
@ -248,6 +355,6 @@ button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.router-link-exact-active {
|
.router-link-exact-active {
|
||||||
color: none
|
color: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
x
Reference in New Issue
Block a user