mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-17 14:56:44 +08:00
笔记
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 我的笔记 -->
|
||||
<div class="mycote-content" v-if="notetab == 2">
|
||||
<div v-if="noteList.length > 0">
|
||||
<div v-if="notetab == 2">
|
||||
<div class="mycote-content" v-show="!isEdit">
|
||||
<div v-if="noteList.length > 0">
|
||||
<div style="border-bottom:1px solid #4444;padding-bottom:25px;" v-for="note in noteList"
|
||||
:key="note.id">
|
||||
<span class="mycote-time">{{note.sysCreateTime}}
|
||||
@@ -53,23 +54,45 @@
|
||||
</div>
|
||||
</div>
|
||||
<h6 class="mycote-dibu">已经到底啦</h6>
|
||||
</div>
|
||||
<div class="my-nonote" v-else>
|
||||
<img src="../../../public/images/no-note.png" alt="" />
|
||||
<h6 style="color: #666666;font-size: 14px;">你还没有记录此课程的笔记哦~</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-nonote" v-else>
|
||||
<img src="../../../public/images/no-note.png" alt="" />
|
||||
<h6 style="color: #666666;font-size: 14px;">你还没有记录此课程的笔记哦~</h6>
|
||||
<div v-show="isEdit">
|
||||
<p style="margin-top:37px">
|
||||
<span style="font-size: 14px;color: #333333;margin-left:10px;">{{mynoteData.sysCreateTime}}</span>
|
||||
<span class="sm">{{mynoteData.openType == 1?'公开':'私密'}}</span>
|
||||
<svg-icon style="float:right;font-size:26px;margin-top:16px" icon-class="spot"></svg-icon>
|
||||
</p>
|
||||
<div class="newcote-content" style="margin-top:10px;height:436px">
|
||||
<div class="newcote-time" v-if="mynoteData.playTime != 0">
|
||||
<img src="../../../public/images/coteplay.png" />
|
||||
{{formatSeconds(mynoteData.playTime)}}
|
||||
<img src="../../../public/images/cotedetel.png" @click="timeDel()" />
|
||||
</div>
|
||||
<div class="newcote-text">
|
||||
<el-input type="textarea" :autofocus="true" placeholder="好记性不如烂笔头,记录些什么吧~"
|
||||
v-model="mynoteData.content" maxlength="200" :autosize="{ minRows: 18, maxRows: 20}"
|
||||
show-word-limit>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="newcote-bottom" v-if="notetab == 1">
|
||||
<div class="newcote-bottom" v-if="notetab == 1 || isEdit">
|
||||
<span style="cursor: pointer;" @click="videoLocation"> <img src="../../../public/images/playtime.png"
|
||||
alt=""> 视频位置</span>
|
||||
<el-radio v-model="mynoteData.openType" :label="9">公开</el-radio>
|
||||
<el-radio v-model="mynoteData.openType" :label="1">私密</el-radio>
|
||||
<el-button size="small" v-show="isEdit" @click="isEdit = false">取消</el-button>
|
||||
<el-button type="primary" size="small" @click="saveNote()">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="animation-box" :class="inAnimation?'animation':''" @animationend="inAnimation=false">
|
||||
<div class="box-text">
|
||||
<img src="../../../public/images/success-note.png" />笔记保存成功,U币+2
|
||||
<img src="../../../public/images/success-note.png" />{{inAnimationText}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,6 +116,8 @@ export default {
|
||||
name: 'MyNote',
|
||||
data() {
|
||||
return {
|
||||
inAnimationText:'笔记保存成功,U币+2',
|
||||
isEdit:false,
|
||||
courseId:'',
|
||||
inAnimation: false,
|
||||
radio: '1',
|
||||
@@ -161,8 +186,10 @@ export default {
|
||||
}, 10000);
|
||||
},
|
||||
noteEdit(note) {
|
||||
console.log(note,'note');
|
||||
this.isEdit = true;
|
||||
this.mynoteData = note;
|
||||
this.notetabType(1);
|
||||
// this.notetabType(1);
|
||||
},
|
||||
noteDel(note) {
|
||||
this.$confirm('您确定要删除这条笔记吗?', '删除提示', {
|
||||
@@ -205,10 +232,31 @@ export default {
|
||||
return;
|
||||
}
|
||||
this.mynoteData.courseId = this.courseId;
|
||||
console.log(this.mynoteData,'this.mynoteData');
|
||||
apiNote.save(this.mynoteData).then(res => {
|
||||
if(this.isEdit) {
|
||||
apiNote.update(this.mynoteData).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.inAnimationText = '笔记编辑成功';
|
||||
this.inAnimation = true;
|
||||
this.isEdit = false;
|
||||
setTimeout(() => {
|
||||
this.getMyNote();
|
||||
this.mynoteData = {
|
||||
type: 1, //我发布的是1 我导入的是2
|
||||
content: '',
|
||||
playTime: '',
|
||||
courseId: '',// 课程id
|
||||
contentId: '',//课程内容id
|
||||
courseName: '',// 课程名称
|
||||
openType: 1,// 1表不公开 9表完全公开
|
||||
};
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
apiNote.save(this.mynoteData).then(res => {
|
||||
if (res.status == 200) {
|
||||
if (!this.mynoteData.id) {
|
||||
this.inAnimationText = '笔记保存成功,U币+2';
|
||||
this.inAnimation = true;
|
||||
if(this.mynoteData.openType != 9){
|
||||
return
|
||||
@@ -245,6 +293,9 @@ export default {
|
||||
}, 2000)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(this.mynoteData,'this.mynoteData');
|
||||
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
@@ -341,7 +392,17 @@ export default {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.sm {
|
||||
width: 50px;
|
||||
height: 22px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #3379FB;
|
||||
color: #3379FB;
|
||||
font-size: 12px;
|
||||
line-height: 50px;
|
||||
margin-left: 20px;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
.newcote-content {
|
||||
margin: 30px 0px;
|
||||
box-sizing: border-box;
|
||||
@@ -373,17 +434,7 @@ export default {
|
||||
font-size: 14px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
.sm {
|
||||
width: 50px;
|
||||
height: 22px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #3379FB;
|
||||
color: #3379FB;
|
||||
font-size: 12px;
|
||||
line-height: 50px;
|
||||
margin-left: 20px;
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
|
||||
.more {
|
||||
margin-top: 12px;
|
||||
|
||||
Reference in New Issue
Block a user