mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
@@ -43,6 +43,19 @@ const pageList = function(query) {
|
||||
const detail = function(id,preview,course=false) {
|
||||
return ajax.get(`/xboe/m/course/portal/detail?id=${id}&preview=${preview}&course=${course}`);
|
||||
}
|
||||
/**
|
||||
* 课程的详细信息
|
||||
* @param {object} data
|
||||
* {
|
||||
* id:课程id,
|
||||
* preview,
|
||||
* course,
|
||||
* audiences:登录用户所有受众id
|
||||
* }
|
||||
*/
|
||||
const detailPost = function(data) {
|
||||
return ajax.post(`/xboe/m/course/portal/detail`,data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人气排行榜
|
||||
@@ -98,5 +111,6 @@ export default {
|
||||
getTeacherByCourseIDs,
|
||||
studyCounts,
|
||||
courseSearch,
|
||||
detailStudy
|
||||
detailStudy,
|
||||
detailPost
|
||||
}
|
||||
|
||||
@@ -69,6 +69,19 @@ const countSignup = function(courseId) {
|
||||
const studyIndex = function(courseId) {
|
||||
return ajax.get('/xboe/school/study/course/studyIndex?cid='+courseId+'&addView=true');
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {object} data
|
||||
* {
|
||||
* cid:课程id,
|
||||
* addView,
|
||||
* audiences:登录用户所有受众id
|
||||
* }
|
||||
* @returns
|
||||
*/
|
||||
const studyIndexPost = function(data) {
|
||||
return ajax.post('/xboe/school/study/course/studyIndex',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程学习,根据课程id来获取,
|
||||
@@ -414,5 +427,6 @@ export default {
|
||||
findByIds,
|
||||
deleteSignUp,
|
||||
ids,
|
||||
followIds
|
||||
followIds,
|
||||
studyIndexPost
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</el-checkbox-group> -->
|
||||
|
||||
<!-- 二级分类 -->
|
||||
<div class="field" v-if="twoList.length > 0" style="margin-top: 24px;">
|
||||
<!-- <div class="field" v-if="twoList.length > 0" style="margin-top: 24px;">
|
||||
<div style="line-height: 25px;padding-right: 10px;padding-left: 0;">
|
||||
<span class="item-title">二级分类</span>
|
||||
<span class="item-line"></span>
|
||||
@@ -48,9 +48,9 @@
|
||||
<div :class="item.fielclass ? 'fieldactive' : ''" @click="fieldswich(item, 2)"
|
||||
v-for="(item, idx) in twoList" :key="'b' + idx">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- 三级分类 -->
|
||||
<div class="field" v-if="threeList.length > 0" style="margin-top: 24px;">
|
||||
<!-- <div class="field" v-if="threeList.length > 0" style="margin-top: 24px;">
|
||||
<div style="line-height: 25px;padding-right: 10px;padding-left: 0;">
|
||||
<span class="item-title">三级分类</span>
|
||||
<span class="item-line"></span>
|
||||
@@ -60,7 +60,7 @@
|
||||
<div :class="item.fielclass ? 'fieldactive' : ''" @click="fieldswich(item, 3)"
|
||||
v-for="(item, idx) in threeList" :key="'c' + idx">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -573,6 +573,7 @@ export default {
|
||||
}
|
||||
console.log(isBack, 'isBack');
|
||||
// Promise.all([apiType.items("org_domain"), apiCase.majorTypes()]).then(rs => {
|
||||
// 90是测试环境,155是生产环境
|
||||
Promise.all([apiType.treeList(1,155,1), apiCase.majorTypes()]).then(rs => {
|
||||
if (rs[0].code == 200) {
|
||||
const {records} = rs[0].data
|
||||
|
||||
@@ -155,6 +155,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
audiences:'',
|
||||
cutOrgNamePath,
|
||||
userAvatarText,
|
||||
getType,
|
||||
@@ -180,6 +181,10 @@ export default {
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// 增加的用户受众id
|
||||
let localKey = "user_" + this.userInfo.sysId + "_gids";
|
||||
let hasIds = sessionStorage.getItem(localKey);
|
||||
this.audiences = hasIds ?? ''
|
||||
let id = this.$route.query.id;
|
||||
this.courseInfo.id=id;
|
||||
this.$watermark.set(this.userInfo.name+this.userInfo.loginName);
|
||||
@@ -188,7 +193,12 @@ export default {
|
||||
|
||||
let $this=this;
|
||||
//页面只支取一次,所以先直接写在这里面
|
||||
apiCoursePortal.detail(id,false,true).then(rs=>{
|
||||
apiCoursePortal.detailPost({
|
||||
id,
|
||||
preview:false,
|
||||
course:true,
|
||||
audiences:this.audiences
|
||||
}).then(rs=>{
|
||||
if(rs.status==200){
|
||||
|
||||
if(!rs.result.course.enabled || rs.result.course.deleted){
|
||||
|
||||
@@ -663,6 +663,17 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
let localKey = "user_" + this.userInfo.sysId + "_gids";
|
||||
apiUserbasic.getInAudienceIds().then(rs => {
|
||||
if (rs.status == 200) {
|
||||
this.audiences = rs.result;
|
||||
sessionStorage.setItem(localKey, this.audiences);
|
||||
} else {
|
||||
console.log(rs.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
let screenWidth = window.screen.availWidth;
|
||||
// if (screenWidth < 1280) {
|
||||
@@ -1524,6 +1535,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.couser-list-content{
|
||||
min-height: 110%;
|
||||
}
|
||||
// 标题
|
||||
.navTitle {
|
||||
margin-bottom: 20px;
|
||||
|
||||
@@ -320,6 +320,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
audiences:'',
|
||||
isCrowd:false,
|
||||
cutOrgNamePath,
|
||||
scormUrl:'',//当前播放的scormUrl
|
||||
@@ -396,6 +397,10 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 增加的用户受众id
|
||||
let localKey = "user_" + this.userInfo.sysId + "_gids";
|
||||
let hasIds = sessionStorage.getItem(localKey);
|
||||
this.audiences = hasIds ?? ''
|
||||
this.$watermark.set(this.userInfo.name + this.userInfo.loginName);
|
||||
this.courseId = this.$route.query.id;
|
||||
this.initContentId = this.$route.query.contentId;
|
||||
@@ -1141,7 +1146,11 @@
|
||||
// 获取数据信息
|
||||
loadData() {
|
||||
let $this=this;
|
||||
apiStudy.studyIndex(this.courseId).then(rs => {
|
||||
apiStudy.studyIndexPost({
|
||||
cid: this.courseId,
|
||||
addView:true,
|
||||
audiences:this.audiences
|
||||
}).then(rs => {
|
||||
if (rs.status == 200) {
|
||||
if(rs.result.contents.length==0){
|
||||
$this.$message.error('课程内容已删除或课程已不再使用');
|
||||
|
||||
Reference in New Issue
Block a user