mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
提交修改
This commit is contained in:
@@ -68,10 +68,10 @@ const formRequest=axios.create({
|
||||
console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
message = "网络异常,接口连接异常";
|
||||
}
|
||||
else if (message.includes("timeout")) {
|
||||
message = "系统接口请求超时";
|
||||
message = "网络异常或接口错误,请求超时";
|
||||
}
|
||||
else if (message.includes("Request failed with status code")) {
|
||||
message = "系统接口" + message.substr(message.length - 3) + "异常";
|
||||
|
||||
@@ -100,6 +100,10 @@ export default {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
},
|
||||
current:{ //当前是否是可编辑的
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
height:{
|
||||
type: Number,
|
||||
default: 200
|
||||
@@ -112,7 +116,9 @@ export default {
|
||||
name: 'MyNote',
|
||||
data() {
|
||||
return {
|
||||
inAnimationText:'笔记保存成功,U币+2',
|
||||
inAnimationText:'笔记保存成功,U币+5',
|
||||
localSaveHandle:null,//本地保存的timeout对象
|
||||
localKey:'NOTE_TEXT',//本地存储的key
|
||||
isEdit:false,
|
||||
inputHeight:70,
|
||||
listHeight:170,
|
||||
@@ -122,7 +128,6 @@ export default {
|
||||
btnPlayTime:false,//是否显示添加视频时间
|
||||
radio: '1',
|
||||
notetab: 1,
|
||||
autoSave: null,
|
||||
mynoteData: {
|
||||
type: 1, //我发布的是1 我导入的是2
|
||||
content: '',
|
||||
@@ -152,8 +157,7 @@ export default {
|
||||
watch: {
|
||||
//内容的高度
|
||||
height(val){
|
||||
|
||||
//$this.controlHeight=h-
|
||||
//$this.controlHeight=h-
|
||||
this.listHeight=val-95;
|
||||
this.inputHeight=(val-220);
|
||||
|
||||
@@ -161,13 +165,14 @@ export default {
|
||||
if(this.inputRows>20){
|
||||
this.inputRows=20;
|
||||
}
|
||||
|
||||
//console.log(this.inputHeight,this.inputRows,this.listHeight,'my note height');
|
||||
|
||||
if(this.inputHeight>500){
|
||||
this.inputHeight=500;
|
||||
}
|
||||
},
|
||||
isedit(val){
|
||||
this.isEdit=val;
|
||||
},
|
||||
selected:{
|
||||
handler(val,old){
|
||||
this.$emit('change',this.selected)
|
||||
@@ -181,10 +186,7 @@ export default {
|
||||
this.mynoteData.courseName = this.data.name;
|
||||
// this.mynoteData.contentId = this.data.id;
|
||||
}
|
||||
},
|
||||
// intTimeNote(val) {
|
||||
// this.mynoteData.playTime = val;
|
||||
// }
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick(){
|
||||
@@ -194,8 +196,7 @@ export default {
|
||||
//这里应该加上内容的id
|
||||
this.$emit('onPlayVideo',conId,time);
|
||||
},
|
||||
|
||||
// 取消编辑
|
||||
//取消编辑
|
||||
editCancel(){
|
||||
this.isEdit = false; // 关闭编辑框
|
||||
this.getMyNote(); // 重新渲染对应课程的笔记列表
|
||||
@@ -205,7 +206,6 @@ export default {
|
||||
let h = Math.floor(result / 3600);
|
||||
let m = Math.floor((result / 60 % 60));
|
||||
let s = Math.floor((result % 60));
|
||||
|
||||
let res = '';
|
||||
if (h > 0) {
|
||||
res += `${h}:${m}:${s}`;
|
||||
@@ -225,10 +225,14 @@ export default {
|
||||
timeDel() {
|
||||
this.mynoteData.playTime = 0;
|
||||
},
|
||||
autoSaveNote() {
|
||||
this.autoSave = setInterval(() => {
|
||||
localStorage.setItem("NOTE_TEXT", this.mynoteData.content);
|
||||
}, 10000);
|
||||
autoSaveNote(){
|
||||
let $this=this;
|
||||
if(this.notetab==1){
|
||||
localStorage.setItem($this.localKey, $this.mynoteData.content);
|
||||
}
|
||||
// this.localSaveHandle = setInterval(() => {
|
||||
|
||||
// }, 10000);
|
||||
},
|
||||
noteEdit(note) {
|
||||
this.isEdit = true;
|
||||
@@ -334,6 +338,7 @@ export default {
|
||||
} else {
|
||||
this.mynoteData.content = this.content_new; //赋值笔记内容
|
||||
let curOpenType=this.mynoteData.openType;
|
||||
let $this=this;
|
||||
apiNote.save(this.mynoteData).then(res => {
|
||||
if (res.status == 200) {
|
||||
if (!this.mynoteData.id) {
|
||||
@@ -345,8 +350,8 @@ export default {
|
||||
return
|
||||
}
|
||||
setTimeout(() => {
|
||||
localStorage.setItem("NOTE_TEXT", '');
|
||||
// clearInterval(this.autoSave);
|
||||
localStorage.setItem($this.localKey, '');
|
||||
// clearInterval(this.localSaveHandle);
|
||||
that.getMyNote();
|
||||
that.notetabType(2);
|
||||
that.mynoteData = {
|
||||
@@ -378,13 +383,21 @@ export default {
|
||||
}
|
||||
|
||||
}
|
||||
}).catch(function(error) {
|
||||
//
|
||||
this.$message.error('当前网络异常,内容已离线保存');
|
||||
//
|
||||
localStorage.setItem(this.localKey, this.mynoteData.content);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
// clearInterval(this.autoSave);
|
||||
this.autoSave = null;
|
||||
if(this.localSaveHandle!=null){
|
||||
clearInterval(this.localSaveHandle);
|
||||
clearTimeout(this.localSaveHandle)
|
||||
}
|
||||
this.localSaveHandle = null;
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -406,7 +406,7 @@ export function translate(field) {
|
||||
export function formatUserNumber(num) {
|
||||
let rsNum =0;
|
||||
if(num<5){
|
||||
return 0;
|
||||
return num;
|
||||
}
|
||||
if(num<95){
|
||||
rsNum=Math.round((num+5)/10)*10;
|
||||
|
||||
@@ -88,7 +88,9 @@
|
||||
<a :href="toCourseDetail(cinfo)">
|
||||
<div class="course-image-box">
|
||||
<course-image :course="cinfo"></course-image>
|
||||
<span v-if="cinfo.type == 20 || 10" class="course-type-left">录播课</span>
|
||||
<span v-if="cinfo.type == 20 || 10" class="course-type-left">录播课</span>
|
||||
<span v-if="cinfo.type == 30" class="course-type-left">线下课</span>
|
||||
<span v-if="cinfo.type == 40" class="course-type-left">学习项目</span>
|
||||
</div>
|
||||
<div style="width:80%" class="course-title two-line-ellipsis" :title="cinfo.title" v-html="cinfo.name"></div>
|
||||
<div class="course-info">
|
||||
|
||||
Reference in New Issue
Block a user