diff --git a/src/components/Course/myNote.vue b/src/components/Course/myNote.vue index 31c3257e..776fd793 100644 --- a/src/components/Course/myNote.vue +++ b/src/components/Course/myNote.vue @@ -93,6 +93,7 @@ export default { name: 'MyNote', data() { return { + courseId:'', inAnimation: false, radio: '1', notetab: 1, @@ -114,23 +115,19 @@ export default { ...mapGetters(['intTimeNote', 'userInfo']), }, mounted() { - 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; - // } + // console.log(this.$route,'route'); + // console.log(this.data,'data111'); + this.courseId = this.$route.query.id; this.getMyNote(); - // this.autoSaveNote(); }, watch: { data(val){ if(val.id) { console.log(val,'val'); - this.mynoteData.courseId = this.data.courseId; - this.mynoteData.contentId = this.data.id; + this.mynoteData.courseId = this.courseId; + this.mynoteData.courseName = this.data.name; + // this.mynoteData.contentId = this.data.id; } }, intTimeNote(val) { @@ -187,7 +184,7 @@ export default { }, getMyNote() { - apiNote.myCourse(this.mynoteData.courseId).then(res => { + apiNote.myCourse(this.courseId).then(res => { if (res.status == 200) { this.noteList = res.result; } @@ -207,6 +204,7 @@ export default { this.$message({ type: 'info', message: '您还没有书写笔记!', offset: 50 }); return; } + this.mynoteData.courseId = this.courseId; console.log(this.mynoteData,'this.mynoteData'); apiNote.save(this.mynoteData).then(res => { if (res.status == 200) { diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 01d12f7d..9f7ca87f 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -147,7 +147,7 @@
- +
diff --git a/src/views/user/Mynotes.vue b/src/views/user/Mynotes.vue index 7098c434..42cb7e85 100644 --- a/src/views/user/Mynotes.vue +++ b/src/views/user/Mynotes.vue @@ -56,12 +56,12 @@ 导入笔记
-
+

{{ item.courseName }}

-
{{ getHMS(item.playTime) }}
- 私密 +
{{ getHMS(item.playTime) }}
+ {{item.openType == 9?'公开':'私密'}}
{{ item.sysUpdateTime }}
@@ -71,54 +71,7 @@ -
-
-
-

《高效能人士的7个习惯》

- -
导入
-
2022/05/21 16:28
-
-
- 我见过的策划们,不管是甲方企业的,还是广告代理都经常犯三大错误:找一个营销理论,做策略时直接向上套。不管是什么行业、企业处在什么发展阶段,都要照着这个理论的要求,做策略时直接向上套。不管是什么行业、企业处在什么来实。不管是么行业、企业处在什什么行业、企业处在发展发发发施营销传播,写PPT时 也要照着这个理论的框架来写。施营销传播,写PPT时 也要照着这个理论的框架来写施营销传播,写PPT时 也要照论。 -
- -
-
-
-

《高效能人士的7个习惯》

- -
导入
-
2022/05/21 16:28
-
-
- - -
- - - - -
-
-
-

{{ item.courseName }}

-
{{ getHMS(item.playTime) }}
- 私密 -
{{ item.sysUpdateTime }}
-
-
- {{ item.content }} - -
- -
-
- - -
-
-
-

{{ item.courseName }}

-
{{ getHMS(item.playTime) }}
- 私密 -
{{ item.sysUpdateTime }}
-
-
- {{ item.content }} - -
- -
-
- - { - // console.log(res); - this.datalist = res.result.list - // console.log(this.datalist,'111lmj') }) }, diff --git a/src/views/user/Noteedit.vue b/src/views/user/Noteedit.vue index ed395cfa..de94f3b0 100644 --- a/src/views/user/Noteedit.vue +++ b/src/views/user/Noteedit.vue @@ -3,12 +3,12 @@

笔记编辑

- 笔记自动保存成功 + {{isShowTip}}

{{ editdata.courseName }}

-
8:40
+
8:40
@@ -16,8 +16,10 @@
@@ -55,6 +57,7 @@ import apiNote from '@/api/phase2/note.js' export default { data () { return { + isShowTip:'', radio: '1', editdata:{ @@ -62,12 +65,15 @@ export default { histId:'', histdata:[], id:'', + timer:null, }; }, mounted(){ - this.id = this.$route.query.id; - this.notedetail() - + this.id = this.$route.query.id; + this.notedetail(); + this.timer = setInterval(()=>{ + this.savedata(1); + },300000); }, methods:{ comeback(){ @@ -75,16 +81,15 @@ export default { }, notedetail(){ apiNote.detail(this.id).then(res=>{ - let that = this; - that.editdata = res.result - console.log(res.result) - that.histId = res.result.id - that.hist(); + // let that = this; + this.editdata = res.result; + this.editdata.openTypeBackups = res.result.openType; + this.histId = res.result.id; + this.hist(); }) }, restore(item){ apiNote.restore(item.id).then(res=>{ - console.loh(res) this.$message({ message: '还原成功', type: 'success' @@ -94,21 +99,44 @@ export default { }, hist(){ apiNote.history(this.histId).then(res=>{ - console.log(res,'qqq') this.histdata = res.result }) }, - - savedata(){ + savedata(num){ + if(this.editdata.openTypeBackups == 1 && this.editdata.openType == 9) { + this.$message({ + message: '仅支持公开笔记转私密笔记!', + type: 'warning' + }); + this.editdata.openType == 1; + } apiNote.update(this.editdata).then(res=>{ - this.notedetail() - this.$message({ - message: '编辑成功', + if(res.status == 200) { + sessionStorage.setItem('isShowTip',''); + if(num ==1) {//自动保存 + this.isShowTip = '笔记自动保存成功'; + setTimeout(()=>{ + this.isShowTip = ''; + },10000) + } else { + this.notedetail() + this.$message({ + message: '笔记保存成功', type: 'success' }); + } + } else { + this.isShowTip = '当前网络异常,内容已离线保存,请尝试连接网络后重新自动上传!'; + sessionStorage.setItem('isShowTip',this.editdata.content); + } + }) } - } + }, + beforeDestroy() { + clearImmediate(this.timer); + }, + } @@ -128,7 +156,7 @@ export default { font-weight: 600; color: #333333; .histinfo{ - background: #F2F5F7; + // background: #F2F5F7; .hist-cont{ padding: 38px 32px; box-sizing: border-box;