diff --git a/src/api/phase2/note.js b/src/api/phase2/note.js index 2fccdf34..2926ae86 100644 --- a/src/api/phase2/note.js +++ b/src/api/phase2/note.js @@ -44,7 +44,7 @@ const del=function (id){ * } * */ const coursePage=function (query){ - return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/course',query); + return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/course-page',query); } /** diff --git a/src/api/phase2/stat.js b/src/api/phase2/stat.js index 640666df..4c406210 100644 --- a/src/api/phase2/stat.js +++ b/src/api/phase2/stat.js @@ -47,14 +47,6 @@ const userDynamicList = function(data) { return ajax.post(baseURL,'/xboe/m/stat/userdynamic/list',data); } -/** - * 获取用户最近 x 天的U币记录 - * @param {String} aid 用户的id - * @param {Integer} days x天的记录,默认为7天 - */ -const userCoinList = function(aid,days) { - return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days); -} /** * 获取用户全部勋章 * @param {String} aid 用户的id @@ -113,6 +105,15 @@ const exportUserCoinRecord = function(aid) { return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/export?aid='+aid); } +/** + * 获取用户最近 x 天的U币记录 + * @param {String} aid 用户的id + * @param {Integer} days x天的记录,默认为7天 + */ + const userCoinList = function(aid,days) { + return ajax.get(baseURL,'/xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days); +} + export default { sendEvent, diff --git a/src/components/Course/myNote.vue b/src/components/Course/myNote.vue index b1cc7f3f..31c3257e 100644 --- a/src/components/Course/myNote.vue +++ b/src/components/Course/myNote.vue @@ -2,8 +2,8 @@
-
新增笔记
-
我的笔记
+
新增笔记
+
我的笔记
@@ -86,8 +86,8 @@ export default { default: () => { } }, score: { - type:String, - default:'' + type:Number, + default:0 } }, name: 'MyNote', @@ -114,8 +114,9 @@ export default { ...mapGetters(['intTimeNote', 'userInfo']), }, mounted() { - this.mynoteData.courseId = this.data.courseId; - this.mynoteData.contentId = this.data.id; + console.log(this.data,'data111'); + // this.mynoteData.courseId = this.data.courseId; + // this.mynoteData.contentId = this.data.id; // if(localStorage.getItem("NOTE_TEXT") !=''){ // this.mynoteData.content = localStorage.getItem("NOTE_TEXT"); // this.notetab = 1; @@ -125,6 +126,13 @@ export default { }, watch: { + data(val){ + if(val.id) { + console.log(val,'val'); + this.mynoteData.courseId = this.data.courseId; + this.mynoteData.contentId = this.data.id; + } + }, intTimeNote(val) { this.mynoteData.playTime = val; } @@ -405,7 +413,7 @@ export default { flex: 1; } - .noteactive a { + .noteactive span { font-weight: 600; color: #333333; padding-bottom: 7px; diff --git a/src/components/Portal/noteComment.vue b/src/components/Portal/noteComment.vue index 4c916bf2..0aee5e76 100644 --- a/src/components/Portal/noteComment.vue +++ b/src/components/Portal/noteComment.vue @@ -15,7 +15,7 @@
- +
@@ -30,17 +30,6 @@
- - - - - - - - - - -
@@ -76,13 +65,6 @@
- - - -
@@ -163,6 +145,7 @@ import apiComment from '@/api/modules/comments.js' import apiUser from '@/api/system/user.js' import authorInfo from '@/components/Portal/authorInfo.vue'; + import apiNote from '@/api/phase2/note.js'; // import author from '@/components/Portal/author.vue'; import { mapGetters } from 'vuex'; export default { @@ -209,14 +192,14 @@ isAuthor: false, authorList:[],//当前页面存储的用户信息,如果已经存在就不再重新请求了 toUserId: '', - loadStatus:'more',//more,loading,noMore - pageSize:10, - pageIndex:1, + loadStatus:'more',//more,loading,noMore + pageSize:10, + pageIndex:1, total:0, listShow:true, - inputValue:'', - list:[], - replyParent:{}, + inputValue:'', + list:[], + replyParent:{}, replyShow:false, btnsShowRowId:'', replyInfo:{ @@ -282,31 +265,13 @@ mounted() { this.author = this.authorId; this.loadData(false); - //在中文输入法状态下输入光标不在文字最后,同时会被遮挡两个文字大小的长度 - // let vm=document.querySelector('.hideControl input') - // vm.addEventListener('compositionstart',(e)=>{ - // vm.style.padding='0 63px 0 0' - // vm.size=100 - //以上两种方式都未解决 - // }) }, methods: { loadMore() { this.pageIndex +=1; this.loadData(true); }, - // lookYourself() {// 只看作者 - // this.pageIndex =1; - // this.isAuthor = !this.isAuthor; - // if(this.isAuthor){ - // this.author = this.authorId; - // } else{ - // this.author = ''; - // } - // this.loadData(); - // }, loadAuthorInfo(list,ids){ //加载作者信息,头像,机构信息 - // console.log(list,ids) if(ids.length==0){ return; } @@ -319,6 +284,7 @@ item.avatar=author.avatar; item.orgInfo=author.orgInfo; item.sex=author.sex; + item.name=author.name; return true; }else{ return false; @@ -349,18 +315,19 @@ let params={ pageIndex:this.pageIndex, pageSize:this.pageSize, - type:this.objType, - id:this.objId, - author: this.author, + openType:1, + courseId:this.objId, } let $this=this; - apiComment.pageQuery(params).then(res=>{ + apiNote.coursePage(params).then(res=>{ if(res.status==200){ let ids=[]; let allList=[]; res.result.list.forEach(item=>{ + item.replyList = []; item.avatar=''; item.orgInfo=''; + item.name=''; item.isAll=false; //item.sex=null; allList.push(item); @@ -369,12 +336,39 @@ item.replyList.forEach(reply=>{ reply.avatar=''; reply.orgInfo=''; + reply.name=''; reply.sex=null; reply.isAll=false; allList.push(reply); ids.push(reply.sysCreateAid); }) } + + let query={ + pageIndex:this.pageIndex, + pageSize:this.pageSize, + type:6, + id:item.id, + // author: this.author, + } + // console.log(item,'item'); + apiComment.pageQuery(query).then(res=>{ + if(res.status == 200 && res.result.list.length > 0) { + let ids = []; + res.result.list.forEach(it=>{ + ids.push(item.sysCreateAid); + it.replyList = []; + it.avatar=''; + it.orgInfo=''; + it.name=''; + it.isAll=false; + }) + // let ids = res.result.list.map(item=>item.sysCreateAid); + const noReapetIds=[...new Set(ids)] + this.loadAuthorInfo(res.result.list,noReapetIds); + item.replyList.push(...res.result.list); + } + }) }); this.loadAuthorInfo(allList,ids); this.total=res.result.count; @@ -460,12 +454,14 @@ item.isAll=!item.isAll; }, showReply(item){ - console.log("9999999999"); this.replyInfo.objType=this.objType; - this.replyInfo.objId=this.objId; + this.replyInfo.objId=item.id; this.replyInfo.parentId=item.id; this.replyInfo.replyAid=item.sysCreateAid; this.replyInfo.replyName=item.sysCreateBy; + this.replyInfo.toAid=''; + this.replyInfo.toAname=''; + this.replyInfo.clevel=1; this.replyShow=true; }, cancelReply(){ @@ -480,11 +476,11 @@ if(this.replyInfo.content==''){ return; } - this.replyInfo.commentId=comment.id; - if(comment.replyList==''){ - comment.replyList=[]; - } - apiComment.reply(this.replyInfo).then(res=>{ + // this.replyInfo.commentId=comment.id; + // if(comment.replyList==''){ + // comment.replyList=[]; + // } + apiComment.add(this.replyInfo).then(res=>{ if(res.status==200){ res.result.sex = null; res.result.isAll=false; diff --git a/src/utils/tools.js b/src/utils/tools.js index c112d75f..1e9fc864 100644 --- a/src/utils/tools.js +++ b/src/utils/tools.js @@ -238,3 +238,28 @@ export function testType(type) { //此方法移到tools中 } return text; } +// u币key + const uTypeMaps = { + 'PublishArticle': '发表文章', + 'ViewArticle': '阅读文章', + 'StudyCourse': '学习课程', + 'PublishCourse': '发布课程', + 'PulishQuestion': '发布问题', + 'ReadQuestion': '阅读问题', + 'AnswerQuestion': '回答问题', + 'PublishNote': '发布笔记', + 'PublishComment': '发表评论', + 'ReplyComment': '回复评论', + 'Praise': '点赞', + 'ScoreCourse':'课程评分', + 'Feedback':'意见反馈', + 'VideoStudyDayStat':'试听学习时长', + 'ViewCase':'阅读案例', + 'ViewArticle':'阅读文章', + 'DeleteQuestion':'删除问题', + 'other':'其他' +}; +export function getUType(type) { + let name = uTypeMaps[type]; + return name; +} diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index d44f8487..a7a1c1ff 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -114,13 +114,8 @@
- - +
-
@@ -151,7 +146,7 @@
-
+
diff --git a/src/views/ucurrency/Index.vue b/src/views/ucurrency/Index.vue index 8490f3f6..6f022656 100644 --- a/src/views/ucurrency/Index.vue +++ b/src/views/ucurrency/Index.vue @@ -3,41 +3,22 @@
我的U币:367
U币规则 - 导出记录 + 导出记录
-
-
U币历史记录
(最多保留近7天的记录) +
+
+
U币历史记录
(最多保留近7天的记录) +
+
+
+

{{day.dayNmae}}

+
+
{{getUType(info.eventKey)}}
+
{{info.uvalue > 0? '+':''}} {{info.uvalue}}
+
+
-
-

5月31日

-
-
发布笔记
-
+5
-
-
-
回答问题
-
+5
-
-
-
意见反馈
-
+5
-
-
-
-

5月29日

-
-
发布笔记
-
+5
-
-
-
回答问题
-
+5
-
-
-
意见反馈
-
+5
-
-
+
@@ -51,11 +32,10 @@ 累计 - 黄金糕 - 狮子头 - 螺蛳粉 - 双皮奶 - 蚵仔煎 + 累计 + 本周 + 本月 + 本年
@@ -186,6 +166,8 @@ @@ -314,7 +383,7 @@ } .myubi{ flex: 1; - margin-right: 107px; + margin-right: 84px; } .omit{ padding-left: 20px; diff --git a/src/views/user/ranking.vue b/src/views/user/ranking.vue index baea86c6..d4ebc9e4 100644 --- a/src/views/user/ranking.vue +++ b/src/views/user/ranking.vue @@ -1,5 +1,5 @@