mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-22 01:06:43 +08:00
留言
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
<div class="home-page-right">
|
||||
<ul class="total-per">
|
||||
<li class="per-li">
|
||||
<span class="per-info">456</span>
|
||||
<span class="per-info">{{follow.passive}}</span>
|
||||
<span class="per-text">关注他的人</span>
|
||||
</li>
|
||||
<li class="per-li">
|
||||
<span class="per-info">456</span>
|
||||
<span class="per-info">{{follow.initiative}}</span>
|
||||
<span class="per-text">他关注的人</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -64,7 +64,11 @@
|
||||
activeName:'first',
|
||||
pageId:'',
|
||||
medalList:[],
|
||||
interestedList:[]
|
||||
interestedList:[],
|
||||
follow:{
|
||||
initiative: 0,
|
||||
passive: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -77,7 +81,7 @@
|
||||
getFollow(){
|
||||
apiFollow.counts(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
|
||||
this.follow = res.result;
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -2,39 +2,58 @@
|
||||
<!--评论组件-->
|
||||
<div class="leaving-message">
|
||||
<div>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入内容"
|
||||
v-model="textarea">
|
||||
</el-input>
|
||||
<el-button class="lea-btn" type="primary">发布</el-button>
|
||||
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="textarea"></el-input>
|
||||
<el-button class="lea-btn" type="primary" @click="add()">发布</el-button>
|
||||
</div>
|
||||
<h6 class="lea-num">12条留言</h6>
|
||||
<h6 class="lea-num">{{count}}条留言</h6>
|
||||
<div>
|
||||
<ul class="lea-ul">
|
||||
<li class="lea-li" v-for="item in 2">
|
||||
<li class="lea-li" v-for="(item, idx) in leavingList" :key="item.id">
|
||||
<div class="lev-li">
|
||||
<div class="li-img"><img src="/images/Avatarman.png"/></div>
|
||||
<div class="li-text">
|
||||
<p class="portal-title-tow">小张 <span class="portal-summary-text">个性签名:不要期待,不要假想</span></p>
|
||||
<p>在学习课程的过程中,我常常惊叹于老师的知识面之广、对技术的理解之深。这么多的知识点,老师都能讲得驾轻就熟,把复这么多的知识驾轻就熟,把复这么多的知点,老杂的知识概念解释得通俗的知识面之广、对技术的理解之深。这么多的易懂。</p>
|
||||
<div class="li-img">
|
||||
<author-img :avatar="item.authorInfo.avatar" :aid="item.authorInfo.aid" :sex="item.authorInfo.sex"></author-img>
|
||||
<!-- <img src="/images/Avatarman.png"/> -->
|
||||
</div>
|
||||
<div class="li-text">
|
||||
<p class="portal-title-tow">{{item.authorInfo.name}} <span class="portal-summary-text">个性签名:{{item.authorInfo.sign}}</span></p>
|
||||
<p>{{item.content}}</p>
|
||||
</div>
|
||||
<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>
|
||||
<div class="li-right"><interactBar :type="7" :shares="false" :views="false" :favorites="false"></interactBar></div>
|
||||
</div>
|
||||
<div class="lev-li-tow">
|
||||
<!-- 回复框 -->
|
||||
<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-button class="lea-btn" type="primary" @click="addReplys()">回复</el-button>
|
||||
</div>
|
||||
<!-- 回复框 -->
|
||||
<div class="lev-li-tow" style="display:none">
|
||||
<div class="lev-li">
|
||||
<div class="li-img"><img src="/images/Avatarman.png"/></div>
|
||||
<div class="li-text">
|
||||
<p class="portal-title-tow">小张 <span class="portal-summary-text">个性签名:不要期待,不要假想</span></p>
|
||||
<p>在学习课程的过程中,我常常惊叹于老师的知识面之广、对技术的理解之深。这么多的知识点,老师都能讲得驾轻就熟,把复这么多的知识驾轻就熟,把复这么多的知点,老杂的知识概念解释得通俗的知识面之广、对技术的理解之深。这么多的易懂。</p>
|
||||
</div>
|
||||
<div class="li-right"><interactBar :type="7" :shares="false" :views="false" :favorites="false"></interactBar></div>
|
||||
<div class="li-right"><interactBar :type="7" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<div style="text-align: center; margin-top:57px;" v-show="count > 0">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page.pageIndex"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="page.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="count">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -42,7 +61,8 @@
|
||||
import showTime from '@/components/Portal/datetimeShow.vue'
|
||||
import apiComment from '@/api/modules/comments.js'
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import authorInfo from '@/components/Portal/authorInfo.vue';
|
||||
import apiGuestbook from '@/api/phase2/guestbook.js'
|
||||
import authorImg from '@/components/Portal/authorImg.vue';
|
||||
// import author from '@/components/Portal/author.vue';
|
||||
import interactBar from "@/components/Portal/interactBar.vue";
|
||||
import { mapGetters } from 'vuex';
|
||||
@@ -50,13 +70,25 @@
|
||||
props:{
|
||||
|
||||
},
|
||||
components:{showTime,authorInfo,interactBar},
|
||||
components:{showTime,authorImg,interactBar},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
textarea:'',
|
||||
replysContent:'',
|
||||
leavingList:[],
|
||||
count:0,
|
||||
page:{
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
aid:''
|
||||
},
|
||||
replys:{
|
||||
id:'',
|
||||
reply:[],
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@@ -64,11 +96,87 @@
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.pageId = this.$route.query.id;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
methods: {
|
||||
isReplys(item,idx) {
|
||||
item.isReplys = true;
|
||||
this.replys.id = item.id;
|
||||
},
|
||||
addReplys() {
|
||||
this.replys.reply.content = this.replysContent;
|
||||
this.replys.reply.push({
|
||||
content: this.replysContent,
|
||||
aid:this.userInfo.aid
|
||||
})
|
||||
this.replys.reply = JSON.stringify(this.replys.reply);
|
||||
apiGuestbook.answer(this.replys).then(res=>{
|
||||
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.page.aid = this.pageId;
|
||||
apiGuestbook.givelist(this.page).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
// item.replysList = [];
|
||||
// item.replys = JSON.parse(item.replys);
|
||||
item.isReplys = false;
|
||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null }
|
||||
})
|
||||
this.leavingList = res.result.list;
|
||||
this.getUserData(res.result.list);
|
||||
console.log(this.leavingList,'this.leavingList ');
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
let data = {
|
||||
content:this.textarea,//留言内容
|
||||
aid:this.pageId,// 要留言的人的id
|
||||
}
|
||||
apiGuestbook.save(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.textarea = '';
|
||||
this.leavingList.push(res.result);
|
||||
this.$message.success('留言发布成功');
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserData(list) {
|
||||
let ids = list.map(item=> item.aid);
|
||||
const noReapetIds = [...new Set(ids)];
|
||||
apiUser.getByIds(noReapetIds).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach((item, index) => {
|
||||
res.result.some(author => {
|
||||
if (author.aid == item.aid) {
|
||||
item.authorInfo = author;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val;
|
||||
this.page.pageIndex = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.pageIndex = val;
|
||||
this.getList();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -124,8 +232,23 @@
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
.replys-input{
|
||||
padding-left: 50px;
|
||||
// display: flex;
|
||||
// .el-textarea{
|
||||
// width: 80%;
|
||||
// }
|
||||
}
|
||||
.li-right{
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
margin-top: 40px;
|
||||
.replys-icon{
|
||||
width: 50px;
|
||||
color: #6E7B84;
|
||||
font-size: 12px;
|
||||
margin-right: 22px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="7">
|
||||
<span slot="label"><svg-icon icon-class="home-follow" style="font-size: 30px;"></svg-icon><span class="tabs-info">关注</span></span>
|
||||
<follow-list></follow-list>
|
||||
<follow-list ref="followList"></follow-list>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="8">
|
||||
<span slot="label"><svg-icon icon-class="home-book" style="font-size: 30px;"></svg-icon><span class="tabs-info">书籍</span></span>
|
||||
@@ -125,7 +125,6 @@
|
||||
}
|
||||
this.loadMajorType();
|
||||
this.loadOrgDomain();
|
||||
console.log(this.orgDomainMap,'orgDomainMap');
|
||||
},
|
||||
methods:{
|
||||
...mapActions({
|
||||
@@ -426,7 +425,18 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClick(e) {
|
||||
handleClick() {
|
||||
if(this.activeName == '7') {
|
||||
this.$refs.followList.getPage();
|
||||
this.page.count = 0;
|
||||
return
|
||||
}
|
||||
if(this.activeName == '8') {
|
||||
this.page.count = 0;
|
||||
// console.log(this.$refs.followList,'this.$refs.followList');
|
||||
// this.$refs.followList.getPage();
|
||||
return
|
||||
}
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -125,6 +125,9 @@
|
||||
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=>{
|
||||
|
||||
})
|
||||
},
|
||||
getMedal() {
|
||||
apiStat.userMedal(this.userInfo.aid).then(res=>{
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<!--互动内容-->
|
||||
<div style="display: flex;justify-content:flex-start;align-items: center;margin-top: 0px;">
|
||||
<div style="flex:1;">
|
||||
<author :avatar="article.authorInfo.avatar" :name="article.sysCreateBy" :sex="article.authorInfo.sex" ></author>
|
||||
<author :avatar="article.authorInfo.avatar" :name="article.sysCreateBy" :sex="article.authorInfo.sex" :aid="article.authorInfo.aid"></author>
|
||||
</div>
|
||||
<div style="">
|
||||
<interactBar nodeWidth="60px" :readonly="true" :type="2" :data="article" :views="false"></interactBar>
|
||||
|
||||
Reference in New Issue
Block a user