mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
留言
This commit is contained in:
@@ -212,7 +212,7 @@ export default {
|
||||
key: "PublishNote",//后台的事件key
|
||||
title: '编辑了笔记',//事件的标题
|
||||
parameters: "",//用户自定义参数 name:value,name:value
|
||||
content: this.data.name,//this.mynoteData.content,//事件的内容
|
||||
content: "编辑了笔记",//this.mynoteData.content,//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: "6",//关联的类型
|
||||
objInfo: this.data.name +''+ this.score,
|
||||
|
||||
@@ -91,12 +91,12 @@
|
||||
this.$message.success("发布问题成功")
|
||||
let event = {
|
||||
key: "PulishQuestion",//后台的事件key 发布文章且审核通过
|
||||
title: this.askForm.title,//事件的标题
|
||||
title: '发布问题',//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: "在问答中发布一个问题",//事件的内容
|
||||
content: "提出了问题",//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: "4",//关联的类型
|
||||
objInfo: "问答",
|
||||
objInfo: this.askForm.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--评论组件-->
|
||||
<div class="leaving-message">
|
||||
<div>
|
||||
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="textarea"></el-input>
|
||||
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="textarea" maxlength="200" show-word-limit></el-input>
|
||||
<el-button class="lea-btn" type="primary" @click="add()">发布</el-button>
|
||||
</div>
|
||||
<h6 class="lea-num">{{count}}条留言</h6>
|
||||
@@ -21,22 +21,26 @@
|
||||
<div class="li-right">
|
||||
<div class="replys-icon" @click="isReplys(item, idx)"><svg-icon style="margin-right: 4px;font-size: 14px;" icon-class="comment"></svg-icon>回复</div>
|
||||
<interactBar :type="7" :data="item" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar>
|
||||
<div class="replys-icon" style="margin-right:0px;margin-left:10px" v-if="userInfo.aid == item.aid || pageId == item.aid" @click="delReply(item)"><svg-icon icon-class="notedel" style="margin-right: 4px;font-size: 14px;"></svg-icon>删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 回复框 -->
|
||||
<div class="replys-input" style="padding-left: 60px;margin:10px 0" v-if="item.isReplys">
|
||||
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent"></el-input>
|
||||
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent" maxlength="200" show-word-limit></el-input>
|
||||
<el-button class="lea-btn" type="primary" @click="addReplys()">回复</el-button>
|
||||
</div>
|
||||
<!-- 回复框 -->
|
||||
<div class="lev-li-tow" style="display:none">
|
||||
<div class="lev-li-tow" v-for="(rep,index) in item.replysList" :key="index">
|
||||
<div class="lev-li">
|
||||
<div class="li-img"><img src="/images/Avatarman.png"/></div>
|
||||
<div class="li-img"><author-img :avatar="rep.authorInfo.avatar" :aid="rep.authorInfo.aid" :sex="rep.authorInfo.sex"></author-img></div>
|
||||
<div class="li-text">
|
||||
<p class="portal-title-tow">小张 <span class="portal-summary-text">个性签名:不要期待,不要假想</span></p>
|
||||
<p>在学习课程的过程中,我常常惊叹于老师的知识面之广、对技术的理解之深。这么多的知识点,老师都能讲得驾轻就熟,把复这么多的知识驾轻就熟,把复这么多的知点,老杂的知识概念解释得通俗的知识面之广、对技术的理解之深。这么多的易懂。</p>
|
||||
<p class="portal-title-tow">{{rep.authorInfo.name}} <span class="portal-summary-text">个性签名:不要期待,不要假想</span></p>
|
||||
<p>{{rep.content}}</p>
|
||||
</div>
|
||||
<div class="li-right">
|
||||
<interactBar :type="7" :data="rep" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar>
|
||||
<div class="replys-icon" style="margin-right:0px;margin-left:10px" v-if="userInfo.aid == item.aid || pageId == item.aid" @click="delReplySon(item,index)"><svg-icon icon-class="notedel" style="margin-right: 4px;font-size: 14px;"></svg-icon>删除</div>
|
||||
</div>
|
||||
<div class="li-right"><interactBar :type="7" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +89,7 @@
|
||||
pageSize:10,
|
||||
aid:''
|
||||
},
|
||||
replys:{
|
||||
replysData:{
|
||||
id:'',
|
||||
reply:[],
|
||||
}
|
||||
@@ -100,19 +104,52 @@
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
delReplySon(item,index) { //子级的删除手动删掉,调用保存接口
|
||||
item.replysList.splice(index,1);
|
||||
let replysData = {
|
||||
id:item.id,
|
||||
reply:JSON.stringify(item.replysList)
|
||||
}
|
||||
apiGuestbook.answer(replysData).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.$message.success('删除留言成功');
|
||||
}
|
||||
})
|
||||
},
|
||||
delReply(item) {
|
||||
this.$confirm('此操作将永久删除该留言, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiGuestbook.del(item.id).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.getList();
|
||||
this.$message({type: 'success',message: '删除成功!' });
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({type: 'info', message: '已取消删除'});
|
||||
});
|
||||
},
|
||||
isReplys(item,idx) {
|
||||
item.isReplys = true;
|
||||
this.replys.id = item.id;
|
||||
this.replysData.id = item.id;
|
||||
this.replysData.reply = item.replysList;
|
||||
},
|
||||
addReplys() {
|
||||
this.replys.reply.content = this.replysContent;
|
||||
this.replys.reply.push({
|
||||
this.replysData.reply.push({
|
||||
content: this.replysContent,
|
||||
aid:this.userInfo.aid
|
||||
authorInfo:this.userInfo
|
||||
})
|
||||
this.replys.reply = JSON.stringify(this.replys.reply);
|
||||
apiGuestbook.answer(this.replys).then(res=>{
|
||||
|
||||
this.replysData.reply = JSON.stringify(this.replysData.reply);
|
||||
apiGuestbook.answer(this.replysData).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.$message.success('留言发布成功');
|
||||
this.leavingList.forEach(item=>{
|
||||
item.isReplys = false;
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
@@ -121,14 +158,15 @@
|
||||
if(res.status == 200) {
|
||||
this.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
// item.replysList = [];
|
||||
// item.replys = JSON.parse(item.replys);
|
||||
item.replysList = [];
|
||||
item.isReplys = false;
|
||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
|
||||
if(item.replys != '') {
|
||||
item.replysList = JSON.parse(item.replys);
|
||||
}
|
||||
})
|
||||
this.leavingList = res.result.list;
|
||||
this.getUserData(res.result.list);
|
||||
console.log(this.leavingList,'this.leavingList ');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
<el-table-column
|
||||
prop="num" angin="center" width="120"
|
||||
label="获得人数">
|
||||
<template slot-scope="scope">{{scope.row.num?scope.row.num:0}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -124,9 +125,21 @@
|
||||
|
||||
let data = this.medalConfig.find(it=>it.id ==item.medalId);
|
||||
this.rules = JSON.parse(data.rules);
|
||||
console.log(data,'data');
|
||||
apiStat.userMedalLevelInfo(item.id).then(res=>{
|
||||
|
||||
apiStat.userMedalLevelInfo(item.medalId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.rules.forEach((it,index)=>{
|
||||
it.num = 0;
|
||||
res.result.some(con => {
|
||||
if (con.medalLevel == it.level) {
|
||||
it.num = con.currentLeverUserCount;
|
||||
this.$set(this.rules[index],this.rules[index].num,con.currentLeverUserCount)
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMedal() {
|
||||
|
||||
@@ -230,12 +230,12 @@ export default {
|
||||
this.getAuthorInfo(this.articleDetailData)
|
||||
let event = {
|
||||
key: "ViewArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "阅读文章事件",//事件的标题
|
||||
title: "查看文章",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: this.articleDetailData.title,//事件的内容
|
||||
content: "查看了文章",//事件的内容
|
||||
objId: this.articleId,//关联的id
|
||||
objType: "2",//关联的类型
|
||||
objInfo: "文章",
|
||||
objInfo: this.articleDetailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
@@ -243,7 +243,8 @@ export default {
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
this.setTime = setTimeout(()=>{
|
||||
event.key = 'ReadArticle';
|
||||
event.title = this.articleDetailData.title;
|
||||
event.title = "阅读文章";
|
||||
event.content = "阅读了文章"
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
},1000 * 60 *2)
|
||||
//}
|
||||
|
||||
@@ -232,12 +232,12 @@ export default {
|
||||
);
|
||||
let event = {
|
||||
key: "ViewCase",//后台的事件key 发布文章且审核通过
|
||||
title: this.caseDetail.title,//事件的标题
|
||||
title: '查看案例',//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: this.caseDetail.summary,//事件的内容
|
||||
content: '查看了案例',//事件的内容
|
||||
objId: this.resolveId,//关联的id
|
||||
objType: "3",//关联的类型
|
||||
objInfo: "案例",
|
||||
objInfo:this.caseDetail.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
@@ -245,8 +245,8 @@ export default {
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
this.setTimeCase = setTimeout(()=>{
|
||||
event.key = 'ReadCase';
|
||||
event.title = this.caseDetail.title;
|
||||
event.content = this.caseDetail.summary;
|
||||
event.title = '阅读案例';
|
||||
event.content = '阅读了案例';
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
},1000 * 60 *3)
|
||||
},
|
||||
|
||||
@@ -523,10 +523,10 @@ export default {
|
||||
key: "ReadQuestion",//后台的事件key 发布文章且审核通过
|
||||
title: "阅读问题",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: this.detailData.title,//事件的内容
|
||||
content: '阅读了问题',//事件的内容
|
||||
objId: this.qid,//关联的id
|
||||
objType: "4",//关联的类型
|
||||
objInfo: "问答",
|
||||
objInfo: this.detailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
@@ -691,10 +691,10 @@ export default {
|
||||
key: "AnswerQuestion",//后台的事件key
|
||||
title: "回答问题",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: this.detailData.title,//事件的内容
|
||||
content: '回答了问题',//事件的内容
|
||||
objId: res.result.id,//关联的id
|
||||
objType: "5",//关联的类型
|
||||
objInfo: "问答",
|
||||
objInfo: this.detailData.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
|
||||
Reference in New Issue
Block a user