diff --git a/src/api/phase2/guestbook.js b/src/api/phase2/guestbook.js index 6b256a9b..914640fc 100644 --- a/src/api/phase2/guestbook.js +++ b/src/api/phase2/guestbook.js @@ -25,12 +25,13 @@ const del=function (id){ /** * 回复或者删除留言 * @param{ - * id - * reply 回复内容 + * parentId 父id + * topId 一级id + * content 回复内容 * } * */ const answer=function (data){ - return ajax.post(baseURL,'/xboe/subgroup/m/guest/answer',data); + return ajax.postJson(baseURL,'/xboe/subgroup/m/guest/answer',data); } /** diff --git a/src/components/Article/ucItems.vue b/src/components/Article/ucItems.vue index 9c2ed7ad..3944fe8e 100644 --- a/src/components/Article/ucItems.vue +++ b/src/components/Article/ucItems.vue @@ -3,9 +3,15 @@
  • - + 累计学习

    {{userData.totalStudyHour}}小时

    -
    +
  • - 回复 + 回复
    -
    +
    @@ -40,10 +40,15 @@

    {{rep.content}}

    +
    回复
    -
    删除
    +
    删除
    +
    + + 回复 +
    @@ -111,23 +116,14 @@ }, delReplySon(item,index) { //子级的删除手动删掉,调用保存接口 //修改后,替换为下面的情况 - // apiGuestbook.del(item.id).then(res=>{ - // if(res.status==200){ - // item.replysList.splice(index,1); - // }else{ - // this.$message.error('删除失败'+res.message); - // } - // }); - 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('删除留言成功'); + apiGuestbook.del(item.id).then(res=>{ + if(res.status==200){ + item.replyList.splice(index,1); + this.$message.success('删除成功'); + }else{ + this.$message.error('删除失败'+res.message); } - }) + }); }, delReply(item) { this.$confirm('此操作将永久删除该留言, 是否继续?', '提示', { @@ -145,28 +141,54 @@ this.$message({type: 'info', message: '已取消删除'}); }); }, - isReplys(item,idx) { - item.isReplys = true; + showReplyInput(item,idx) { + //关闭其它的 + this.leavingList.forEach(top=>{ + if(top.id!=item.id){ + top.isReplys=false; + } + + top.replyList.forEach(reply=>{ + if(reply.id!=item.id){ + reply.isReplys=false; + } + + }) + }) + if(item.isReplys){ + item.isReplys =false; + }else{ + item.isReplys =true; + } + this.replysData.id = item.id; - this.replysData.reply = item.replysList; + //this.replysData.reply = item.replyList; }, - addReplys() { + addReplys(top,p) { if(this.replysContent.trim().length == 0) { return this.$message.warning('请填写内容!'); } - this.replysData.reply.push({ - content: this.replysContent, - authorInfo:this.userInfo, - praises:0, - }) - this.replysData.reply = JSON.stringify(this.replysData.reply); - apiGuestbook.answer(this.replysData).then(res=>{ + let postData={ + content:this.replysContent, + topId:top.id, + parentId:p.id, + level:2, + replys:0 + } + let $this=this; + apiGuestbook.answer(postData).then(res=>{ this.replysContent = ''; if(res.status == 200) { - this.$message.success('留言发布成功'); - this.leavingList.forEach(item=>{ - item.isReplys = false; - }) + this.$message.success('回复留言成功'); + p.isReplys = false; + res.result.authorInfo=$this.userInfo; + top.replyList.push(res.result); + //直接追加到列表后面 + // this.leavingList.forEach(item=>{ + // item.isReplys = false; + // }) + }else{ + this.$message.error('回复留言失败'); } }) }, @@ -175,19 +197,22 @@ apiGuestbook.givelist(this.page).then(res=>{ if(res.status == 200) { this.count = res.result.count; + let ids=[]; res.result.list.forEach(item=>{ - if(!item.replysList){ - item.replysList = []; + if(!item.replyList){ + item.replyList = []; } + ids.push(item.sysCreateAid); item.isReplys = false; item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' } - if(item.replys != '' && item.replys.length>10) { - item.replysList = JSON.parse(item.replys); - } - //if() + item.replyList.forEach(child=>{ + child.isReplys=false; + child.authorInfo= { aid: "",name: "",orgInfo: "",avatar: "",sex: null,sign:'' } + ids.push(child.sysCreateAid); + }) }) this.leavingList = res.result.list; - this.getUserData(res.result.list); + this.getUserData(ids,this.leavingList); } }) }, @@ -210,46 +235,37 @@ } }) }, - getUserData(list) { - if(this.pageId == this.userInfo.aid) { - 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); - } - }); - } else { - let ids = list.map(item=> item.sysCreateAid); - 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.sysCreateAid) { - item.authorInfo = author; - return true; - } else { - return false; - } - }); - }); - } else { - this.$message.error(res.message); - } - }); - } + getUserData(ids,list) { + + 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.sysCreateAid) { + item.authorInfo = author; + return true; + } else { + return false; + } + }); + item.replyList.forEach(child=>{ + res.result.some(author => { + if (author.aid == child.sysCreateAid) { + child.authorInfo = author; + return true; + } else { + return false; + } + }); + }) + }); + } else { + this.$message.error(res.message); + } + }); + + }, handleSizeChange(val) { this.page.pageSize = val; @@ -278,6 +294,7 @@ position: relative; .lea-btn { float: right; + cursor: pointer; margin-top: 26px; width: 80px; height: 30px; @@ -333,6 +350,7 @@ margin-top: 40px; .replys-icon{ width: 50px; + cursor: pointer; color: #6E7B84; font-size: 12px; margin-right: 22px; diff --git a/src/views/homepage/page.vue b/src/views/homepage/page.vue index 4198706c..6f4c26ef 100644 --- a/src/views/homepage/page.vue +++ b/src/views/homepage/page.vue @@ -16,30 +16,58 @@ +
    + +

    还没有动态

    +
    课程 +
    + +

    还没有课程

    +
    案例 +
    + +

    还没有案例

    +
    笔记 +
    + +

    还没有笔记

    +
    提问 +
    + +

    还没有提问

    +
    回答 +
    + +

    还没有回答

    +
    文章 +
    + +

    还没有文章

    +
    关注 diff --git a/src/views/portal/course/Micro.vue b/src/views/portal/course/Micro.vue index 3b1ed95d..9d725e98 100644 --- a/src/views/portal/course/Micro.vue +++ b/src/views/portal/course/Micro.vue @@ -293,7 +293,7 @@ export default { studyId: "", tags: [], numberToLetter: numberToLetter, - fileBaseUrl: this.$xpage.constants.fileBaseUrl, + fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL, blobUrl:'',//播放的文件地址,新添加,采用blob方式 getType: getType, courseType, diff --git a/src/views/portal/follow/index.vue b/src/views/portal/follow/index.vue index 4c4035ea..5102b2e9 100644 --- a/src/views/portal/follow/index.vue +++ b/src/views/portal/follow/index.vue @@ -29,21 +29,45 @@ +
    + +

    暂时没有动态

    +
    +
    + +

    暂时没有动态

    +
    +
    + +

    暂时没有动态

    +
    +
    + +

    暂时没有动态

    +
    +
    + +

    暂时没有动态

    +
    +
    + +

    暂时没有动态

    +
    + 所有用户学习天数TOP排行榜单,每活跃学习1天可累计学习天数
    @@ -53,9 +60,9 @@ 累计 - 本周 +
@@ -65,7 +72,7 @@ 累计排名 : {{currentUserRankingTotalData.rankNo}}
- 累计经验值 : {{currentUserRankingTotalData.rankValue}} + 累计学习天数 : {{currentUserRankingTotalData.rankValue}}
@@ -87,7 +94,7 @@
排名
姓名
部门
-
经验值
+
学习天数
+ + + + + + + + +
@@ -334,7 +350,7 @@ getRanking() { let data = { aid: this.userInfo.aid, // #用户id - statType: 20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 + statType: 11, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 field: this.cycle, // #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 num: 5, // #显示的条数 } @@ -351,10 +367,10 @@ this.getUserData([res.result.currentUserRankingData.aid], [res.result.currentUserRankingData]) this.currentUserRankingData = res.result.currentUserRankingData; if(this.cycle == 'total'){ - this.current = this.experienceValue(res.result.currentUserRankingData.total); + // this.current = this.experienceValue(res.result.currentUserRankingData.total); this.currentUserRankingTotalData.rankNo = res.result.currentUserRankingData.rankingNo; this.currentUserRankingTotalData.rankValue = res.result.currentUserRankingData.total; - this.currentUserRankingTotalData.endValue = this.current.endValue; + // this.currentUserRankingTotalData.endValue = this.current.endValue; } } diff --git a/src/views/user/Noteedit.vue b/src/views/user/Noteedit.vue index 823816d1..6d7817fb 100644 --- a/src/views/user/Noteedit.vue +++ b/src/views/user/Noteedit.vue @@ -200,12 +200,10 @@ export default { this.timer = null; this.$router.go(-1); } - } + } }).catch(()=>{ - this.isShowTip = '当前网络异常,内容已离线保存,请尝试连接网络后重新自动上传!'; - setTimeout(()=>{ - this.isShowTip = ''; - },10000 * 2) + this.isShowTip = '当前网络异常,内容已离线保存,请尝试连接网络后重新保存!'; + setTimeout(()=>{ this.isShowTip = ''; },10000 * 2) sessionStorage.setItem('isShowTip',this.editdata.content); }) } diff --git a/src/views/user/Setting.vue b/src/views/user/Setting.vue index 186f5218..1e74de98 100644 --- a/src/views/user/Setting.vue +++ b/src/views/user/Setting.vue @@ -35,7 +35,7 @@

{{form.sign}} - +

取消 @@ -47,9 +47,9 @@

个人主页设置

-
- 关闭个人主页 - 打开个人主页 +
+ 关闭个人主页 + 打开个人主页 取消 保存 @@ -61,9 +61,9 @@

动态可见范围

- 全部动态 - 最近半年动态 - 最近三个月动态 + 全部动态 + 最近半年动态 + 最近三个月动态 取消 保存 diff --git a/src/views/user/ranking.vue b/src/views/user/ranking.vue index 3da9b764..ca80bb42 100644 --- a/src/views/user/ranking.vue +++ b/src/views/user/ranking.vue @@ -1,5 +1,6 @@