Commit 320b7559 by yanju

修改细节,添加message页面

parent 223d3f3d
...@@ -239,10 +239,8 @@ export default { ...@@ -239,10 +239,8 @@ export default {
}, },
Message:{ Message:{
delete:'/api/message/',//删除消息 +{messageId} delete:'/api/message/',//删除消息 +{messageId}
deleteAll:'/api/messages',//删除所有消息
}, },
Messages:{
delete:'/api/messages',//删除所有消息
}
}, },
put:{ put:{
Blog:{ Blog:{
...@@ -291,7 +289,8 @@ export default { ...@@ -291,7 +289,8 @@ export default {
listenCommentReget3:'listenCommentReget3', listenCommentReget3:'listenCommentReget3',
listenDetailInfo:'listenDetailInfo', listenDetailInfo:'listenDetailInfo',
listenYunInputIcon:'listenYunInputIcon', listenYunInputIcon:'listenYunInputIcon',
listenSearchWord:'listenSearchWord' listenSearchWord:'listenSearchWord',
listioncommentConNumber:'listioncommentConNumber'
}, },
......
...@@ -65,10 +65,12 @@ ...@@ -65,10 +65,12 @@
watch:{ watch:{
currentPage(){ currentPage(){
this.dataGetComment() this.dataGetComment()
} },
}, },
methods:{ methods:{
dataPostComment(){ dataPostComment(){
if(!this.$store.state.auth.token){ if(!this.$store.state.auth.token){
this.$message({ this.$message({
...@@ -116,6 +118,8 @@ ...@@ -116,6 +118,8 @@
type:'success', type:'success',
message:'发表成功!' message:'发表成功!'
}) })
this.$emit(config.event.listioncommentConNumber,1)
}else{ }else{
this.$message({ this.$message({
type:'warning', type:'warning',
...@@ -162,6 +166,7 @@ ...@@ -162,6 +166,7 @@
} }
this.pages = response.data.totalPage; this.pages = response.data.totalPage;
this.totalRecords = response.data.totalRecords; this.totalRecords = response.data.totalRecords;
} }
} }
}) })
......
<template>
<transition name="fade-transform" mode="out-in">
<div class="notice-card__wrap" v-if="showCard">
<div class="notice-card">
<div class="notice-card__top">
<div class="card-top_l">
<yun-avatar size="42px" name="系"></yun-avatar>
<div class="info-box">
<yun-icon class="close" name="close1" @click.native="showAlert"></yun-icon>
<div class="info1">
<p class="name">消息提示:</p>
<!-- <p class="thing">{{thing}}</p>-->
<p class="date">{{dataConvert(createTime)}}</p>
</div>
<div class="info2" v-html="mscContent"></div>
</div>
</div>
<div class="card-top_r">
<p v-if="status===0" class="unread" @click="dataPutRead">标记已读</p>
<p v-if="status===1" class="read">标记已读</p>
</div>
</div>
</div>
</div>
</transition>
</template>
<script>
import {dateConvert} from '../../action/utils/dataConvert'
import config from "../../action/config";
export default {
name:'noticeCard',
data(){
return{
src:'https://s2.ax1x.com/2020/01/15/lO2kIf.png',
createTime:'2020-1-1',
mscContent:'manmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanmanman',
userId:'',
status:0,
messageId:'',
showCard:true,
}
},
props:{
info:{
type:Object,
default:()=>({})
}
},
created() {
this.dataGet2Info()
},
methods:{
dataConvert(date){
return dateConvert(date)
},
dataGet2Info(){
let info = this.info;
this.createTime = info.createTime;
this.mscContent = info.mscContent;
this.userId = info.userId;
// this.status = info.status;
this.messageId = info.messageId;
},
dataPutRead() {
this.$axios.$put(config.api.put.Message.read+this.messageId+'/read').then((response) => {
if (response.code=== 0) {
this.$message({
type: 'success',
message: '已标记已读'
});
this.status = 1
} else {
this.$message({
type: 'warning',
message: '操作失败'
});
}
})
},
showAlert(){
this.$alert('确认删除?', '', {
confirmButtonText: '确定',
callback: action => {
this.dataDeleteMessage()
}
});
},
dataDeleteMessage() {
this.$axios.$delete(config.api.delete.Message.delete+this.messageId).then((response) => {
if(response.code===0){
this.$message({
type: 'success',
message: '已删除消息!'
});
this.showCard = false;
}else{
this.$message({
type: 'warning',
message: '删除消息失败!'
});
}
})
},
}
}
</script>
<style lang="scss" >
.notice-card__wrap{
.notice-card{
background-color: #fff;
width:890*$length;
padding:18*$length 24*$length 20*$length;
border-bottom:1px solid #EFEFEF;
.notice-card__top{
@extend %flex-row-spb;
align-items: flex-end;
.card-top_l{
@extend %flex-row-spb;
align-items: flex-start;
justify-content: flex-start;
.info-box{
margin-left: 14*$length;
width:646*$length;
position: relative;
.close{
position: absolute;
right:-180*$length;
top:0;
font-size: 10px;
color:#999;
&:hover{
color:#00AAE6;
}
}
.info1{
@extend %flex-row-spb;
justify-content: flex-start;
.name{
@include fontStyle(12,16,500,#000,left);
}
.thing{
margin-left:14*$length;
@include fontStyle(12,16,500,#333,left);
span{
color:#00AAE6;
}
}
.date{
margin-left:14*$length;
@include fontStyle(12,16,500,#999,left);
}
}
.info2{
margin-top: 18*$length;
@include fontStyle(12,20,500,#333,left);
height:auto;
word-break: break-word;
a{
color:#00AAE6;
}
}
}
}
.card-top_r{
height:100%;
@extend %flex-column-spb;
/*justify-content: flex-end;*/
.unread{
@extend %cursorPointer;
@extend %animate-transition;
@include fontStyle(12,36,500,#fff,center);
background-color: #00AAE6;
border-radius: 4*$length;
width:90*$length;
&:hover{
filter:brightness(130%);
}
}
.read{
@extend %cursorPointer;
@extend %animate-transition;
@include fontStyle(12,36,500,#fff,center);
background-color: coral;
border-radius: 4*$length;
width:90*$length;
&:hover{
filter:brightness(130%);
}
}
h6{
@extend %animate-transition;
@extend %cursorPointer;
@include fontStyle(12,36,500,#aaa,center);
background-color: #fff;
border-radius: 4*$length;
width:100*$length;
border:1px solid #F0F0F0;
&:hover{
filter:brightness(110%);
}
}
}
}
.notice-card__bottom{
@extend %flex-row-spb;
justify-content: flex-end;
.comment-card{
width:834*$length;
box-sizing: border-box;
padding:14*$length 16*$length;
background-color: #F4F8FA;
border-radius: 4*$length;
margin-top:20*$length;
.info1{
text-align: left;
.name{
@include fontStyle(14,22,500,#666,left)
}
.comment{
@include fontStyle(14,22,500,#333,left)
}
}
.info2{
margin-top: 10*$length;
@include fontStyle(12,16,500,#999,left)
}
}
}
}
}
</style>
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
<!-- </li>--> <!-- </li>-->
<li> <li>
<nuxt-link tag="span" to="/personal-center/person">我的关注</nuxt-link> <nuxt-link tag="span" to="/personal-center/person/following">我的关注</nuxt-link>
</li> </li>
<li> <li>
<nuxt-link tag="span" to="/personal-center/account">账号资料</nuxt-link> <nuxt-link tag="span" to="/personal-center/account/info">账号资料</nuxt-link>
</li> </li>
<li @click="handleLogout">安全退出</li> <li @click="handleLogout">安全退出</li>
</ul> </ul>
......
...@@ -232,8 +232,6 @@ ...@@ -232,8 +232,6 @@
}) })
}else if(this.cardType===2){ }else if(this.cardType===2){
this.$axios.$delete(config.api.delete.Blog.delete+id).then((response)=>{ this.$axios.$delete(config.api.delete.Blog.delete+id).then((response)=>{
console.log(response);
console.log(typeof response.code)
if(response.code===0){ if(response.code===0){
this.cardId=''; this.cardId='';
this.$message({ this.$message({
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<transition name="fade"> <transition name="fade">
<div class="func-item__abs" v-if="showTopicCard" ref="topicCard"> <div class="func-item__abs" v-if="showTopicCard" ref="topicCard">
<yun-input style="border:1px solid #EFEFEF;margin-top:12px" iconName="search" width='270px' @keydown.enter.native="clickToOpenPopup" @change="dataGetSearchTopic" placeholder="搜索话题" v-model="TopicValue"></yun-input> <yun-input style="border:1px solid #EFEFEF;margin-top:12px" iconName="search" width='270px' @change="dataGetSearchTopic" placeholder="搜索话题" v-model="TopicValue"></yun-input>
<div class="topic-content"> <div class="topic-content">
<div class="topic-content__c" v-for="(val,index) in topicList" :key="val.topicId" @click="clickToAddTopic(val.topicId,val.topicName)"> <div class="topic-content__c" v-for="(val,index) in topicList" :key="val.topicId" @click="clickToAddTopic(val.topicId,val.topicName)">
<p>#{{val.topicName}}#</p> <p>#{{val.topicName}}#</p>
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</div> </div>
<transition name="fade" > <transition name="fade" >
<comment-con style="margin-top: -16px" v-if="showCommentCon" :id="postId" type="dynamic"></comment-con> <comment-con @listioncommentConNumber="dataGet2ComNum" style="margin-top: -16px" v-if="showCommentCon" :id="postId" type="dynamic"></comment-con>
</transition> </transition>
</div> </div>
</transition> </transition>
...@@ -250,6 +250,10 @@ ...@@ -250,6 +250,10 @@
}, },
methods:{ methods:{
dataGet2ComNum(n){
this.commentNumber = this.commentNumber +n
},
MessageAlert(){ MessageAlert(){
this.$message({ this.$message({
type:'info', type:'info',
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<select-card selectType="2" :class-list="classList" @handleClass="handleClass" ref="blogClass" placeholder="请选择问题分类"></select-card> <select-card selectType="2" :class-list="classList" @handleClass="handleClass" ref="blogClass" placeholder="请选择问题分类"></select-card>
</div> </div>
<div class="answer-release__footer"> <div class="answer-release__footer">
<p>已自动存为草稿</p> <!-- <p>已自动存为草稿</p>-->
<button class="preview" @click="readScreen">预览</button> <button class="preview" @click="readScreen">预览</button>
<button class="submit" @click="dataPostQuestion">提交</button> <button class="submit" @click="dataPostQuestion">提交</button>
</div> </div>
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<input type="file" @change="(e)=>changeToUploadCover(e)" placeholder="上传项目封面图"> <input type="file" @change="(e)=>changeToUploadCover(e)" placeholder="上传项目封面图">
</p> </p>
<div class="footer__right"> <div class="footer__right">
<p>已自动存为草稿</p> <!-- <p>已自动存为草稿</p>-->
<button class="preview" @click="preview">预览</button> <button class="preview" @click="preview">预览</button>
<button class="submit" v-on:click="dataPost">提交</button> <button class="submit" v-on:click="dataPost">提交</button>
</div> </div>
......
...@@ -28,9 +28,8 @@ ...@@ -28,9 +28,8 @@
</div> </div>
</card-container> </card-container>
<card-container <card-container
style="margin-top: 16px; max-height: 426px;" style="padding-bottom:10px;margin-top: 16px; max-height: 426px;"
title="招聘速递" title="招聘速递"
more="更多"
width="302px" width="302px"
v-if="recruitmentList.length>0" v-if="recruitmentList.length>0"
...@@ -49,10 +48,9 @@ ...@@ -49,10 +48,9 @@
</div> </div>
</card-container> </card-container>
<card-container <card-container
style="margin-top: 16px; max-height: 426px;" style="padding-bottom:10px;margin-top: 16px; max-height: 426px;"
title="每周软件推荐" title="每周软件推荐"
label="周一3:00更新" label="周一3:00更新"
more="更多项目"
width="302px" width="302px"
v-if="recruitmentList.length>0" v-if="recruitmentList.length>0"
> >
...@@ -72,9 +70,8 @@ ...@@ -72,9 +70,8 @@
</card-container> </card-container>
<card-container <card-container
style="margin-top: 16px; max-height: 426px;" style="padding-bottom:10px;margin-top: 16px; max-height: 426px;"
title="软件更新" title="软件更新"
more="加载更多"
width="302px" width="302px"
v-if="recruitmentList.length>0" v-if="recruitmentList.length>0"
......
...@@ -39,17 +39,14 @@ ...@@ -39,17 +39,14 @@
<!-- <p class="line" v-if="selected==='评论'"></p>--> <!-- <p class="line" v-if="selected==='评论'"></p>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
<p class="tab__right"> <p class="tab__right" @click="dataPutReadAll">
全部标记为已读 全部标记为已读
</p> </p>
</div> </div>
<notice-card></notice-card> <notice-card v-for="(val,index) in message" :key="val.messageId" :info="val"></notice-card>
<notice-card></notice-card> <empty-card v-if="message.length===0" height="556px"></empty-card>
<notice-card></notice-card>
<notice-card></notice-card>
<notice-card></notice-card>
<notice-card></notice-card>
</div> </div>
</div> </div>
</template> </template>
...@@ -57,9 +54,11 @@ ...@@ -57,9 +54,11 @@
<script> <script>
import NoticeCard from '../../components/pc/noticeCard'; import NoticeCard from '../../components/pc/noticeCard2';
import NavWrap from "../../components/pc/nav/navWrap"; import NavWrap from "../../components/pc/nav/navWrap";
import config from "../../action/config"; import config from "../../action/config";
import EmptyCard from "../../components/pc/emptyCard";
export default { export default {
data() { data() {
...@@ -71,13 +70,14 @@ ...@@ -71,13 +70,14 @@
id: '我的消息' id: '我的消息'
} }
], ],
selected: '全部' selected: '全部',
message:[],
} }
}, },
components: { components: {
NoticeCard, NavWrap NoticeCard, NavWrap,EmptyCard
}, },
...@@ -94,36 +94,18 @@ ...@@ -94,36 +94,18 @@
} }
}).then((response) => { }).then((response) => {
this.message = response.data.dataList; this.message = response.data.dataList;
console.log(response.data.dataList);
}); });
}, },
dataPutRead() {
this.$axios.$put(config.api.put.Message.read).then((response) => {
if (this.message.length !== 0) {
this.$message({
type: 'success',
message: '已全部标记已读'
});
this.flag = 4
} else {
this.$message({
type: 'warning',
message: '没有未读信息'
});
}
})
},
dataPutReadAll() { dataPutReadAll() {
this.$axios.$put(config.api.put.Message.readAll).then((response) => { this.$axios.$put(config.api.put.Message.readAll).then((response) => {
if (this.message.length !== 0) { if(response.code===200){
this.$message({ this.$message({
type: 'success', type: 'success',
message: '已全部标记已读' message: '已全部标记已读'
}); });
this.flag = 4
} else { } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
...@@ -132,18 +114,8 @@ ...@@ -132,18 +114,8 @@
} }
}) })
}, },
dataDeleteMessage() {
this.$axios.$delete(config.api.delete.Messages.delete).then((response) => {
this.$message({
type: 'success',
message: '已全部清空'
});
this.message.length = 0;
})
},
mounted() { mounted() {
// this.$popupbox(); // this.$popupbox();
......
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
}, },
created() { created() {
this.$router.replace('/personal-center/person/following')
}, },
} }
</script> </script>
......
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
<input type="file" @change=" e =>changeToUploadCover(e)"> <input type="file" @change=" e =>changeToUploadCover(e)">
</p> </p>
<div class="footer__right"> <div class="footer__right">
<p>已自动存为草稿</p> <!-- <p>已自动存为草稿</p>-->
<button class="preview" >预览</button> <button class="preview" >预览</button>
<button class="submit" @click="postProject">提交</button> <button class="submit" @click="postProject">提交</button>
</div> </div>
......
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