|
|
|
@ -619,6 +619,14 @@ |
|
|
|
$(window).scrollTop(elementTop); |
|
|
|
$(window).scrollTop(elementTop); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
processCourseJson(data) { |
|
|
|
|
|
|
|
this.course = api.convertCourseJson(data); |
|
|
|
|
|
|
|
this.course.live = this.live; |
|
|
|
|
|
|
|
this.lessons = data.lessons.map((lessonJson) => { |
|
|
|
|
|
|
|
return api.convertLessonJson(lessonJson); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.course.duration = this.course.duration || ''; |
|
|
|
|
|
|
|
}, |
|
|
|
loadCourseDraft() { |
|
|
|
loadCourseDraft() { |
|
|
|
//console.log('loadCourseDraft'); |
|
|
|
//console.log('loadCourseDraft'); |
|
|
|
if(this.live) { return; } |
|
|
|
if(this.live) { return; } |
|
|
|
@ -628,12 +636,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
response |
|
|
|
response |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
this.course = api.convertCourseJson(response.data); |
|
|
|
this.processCourseJson(response.data); |
|
|
|
this.course.live = this.live; |
|
|
|
|
|
|
|
this.courseLoading = false; |
|
|
|
this.courseLoading = false; |
|
|
|
this.lessons = response.data.lessons.map((lessonJson) => { |
|
|
|
|
|
|
|
return api.convertLessonJson(lessonJson); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
.catch((err) => { |
|
|
|
this.courseLoading = false; |
|
|
|
this.courseLoading = false; |
|
|
|
@ -653,21 +657,10 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
request |
|
|
|
request |
|
|
|
.then((response) => { |
|
|
|
.then((response) => { |
|
|
|
this.course = api.convertCourseJson(response.data); |
|
|
|
this.processCourseJson(response.data); |
|
|
|
this.course.live = this.live; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if (this.live && this.course.date) { |
|
|
|
|
|
|
|
this.course.date = _.find(this.scheduleOptions, (item) => { |
|
|
|
|
|
|
|
return item.value == this.course.date; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.courseLoading = false; |
|
|
|
this.courseLoading = false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.lessons = response.data.lessons.map((lessonJson) => { |
|
|
|
|
|
|
|
return api.convertLessonJson(lessonJson); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
.catch((err) => { |
|
|
|
this.courseLoading = false; |
|
|
|
this.courseLoading = false; |
|
|
|
@ -1025,7 +1018,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
displayPrice: { |
|
|
|
displayPrice: { |
|
|
|
get: function () { |
|
|
|
get: function () { |
|
|
|
return this.course.is_paid ? (this.course.price || 0) : 0; |
|
|
|
return this.course.is_paid ? (this.course.price || '') : ''; |
|
|
|
}, |
|
|
|
}, |
|
|
|
set: function (value) { |
|
|
|
set: function (value) { |
|
|
|
this.course.price = value || 0; |
|
|
|
this.course.price = value || 0; |
|
|
|
|