mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-06 17:36:45 +08:00
修改课程权限控制
This commit is contained in:
@@ -156,15 +156,17 @@
|
||||
<!--底部-->
|
||||
<interact-fixed v-if="courseInfo.id != ''" ref="fiexdbar" :type="1" :users="teachers" :data="courseInfo" :comments="isComments" @handle-comment="handleComment" @comment-success="refreshComments" :praises="false">
|
||||
<view class="" v-if="tabIndex !== 2">
|
||||
<view v-if="studyId == ''">
|
||||
<!-- 立即报名 -->
|
||||
<!-- btn-default -->
|
||||
<view class="btn btn-active" @click="submitSignup()">{{studyName}}</view>
|
||||
</view>
|
||||
<!--评论-->
|
||||
<view v-else>
|
||||
<view class="btn btn-active" @click="toStudy()">{{studyName}}</view>
|
||||
</view>
|
||||
<template v-if="isCrowd">
|
||||
<view v-if="studyId == ''">
|
||||
<!-- 立即报名 -->
|
||||
<!-- btn-default -->
|
||||
<view class="btn btn-active" @click="submitSignup()">{{studyName}}</view>
|
||||
</view>
|
||||
<!--评论-->
|
||||
<view v-else>
|
||||
<view class="btn btn-active" @click="toStudy()">{{studyName}}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
</interact-fixed>
|
||||
@@ -179,6 +181,8 @@
|
||||
import apiResOwner from '@/api/modules/resowner.js';
|
||||
import apiPraises from '@/api/modules/praises.js';
|
||||
import apiTrample from '@/api/modules/trample.js';
|
||||
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
import {
|
||||
getContentType,
|
||||
toScore
|
||||
@@ -186,6 +190,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isCrowd:false, //根据受众展示不展示
|
||||
audiences:'',
|
||||
isComments:true,
|
||||
courseId: '',
|
||||
studyId: '',
|
||||
@@ -232,10 +238,20 @@
|
||||
title: '未指定课程'
|
||||
});
|
||||
} else {
|
||||
this.loadDetail(this.courseId);
|
||||
if(this.audiences.length==0){
|
||||
apiUserbasic.getInAudienceIds(this.userInfo.aid).then(rs=>{
|
||||
this.audiences = rs.join(",");
|
||||
this.loadDetail(this.courseId);
|
||||
});
|
||||
}else{
|
||||
console.log(rs.message)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
catalogTree() {
|
||||
let treeList = [];
|
||||
let $this = this;
|
||||
@@ -287,7 +303,13 @@
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
apiCoursePortal.detail(id).then(rs => {
|
||||
apiCoursePortal.detailPost({id,audiences:this.audiences}).then(rs => {
|
||||
if(!rs.result.isCrowd){
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 100);
|
||||
}
|
||||
this.isCrowd = rs.result.isCrowd
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 100);
|
||||
@@ -374,7 +396,7 @@
|
||||
}
|
||||
//需要判断此内容是否已学习完成,如果已学习完成,不需要再请不说了
|
||||
}else{
|
||||
this.submitSignup();//直接报名
|
||||
// this.submitSignup();//直接报名
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
@@ -422,6 +444,9 @@
|
||||
// });
|
||||
this.studyId = res.result.studyId; //设置学习id
|
||||
this.tabIndex = 1;
|
||||
uni.navigateTo({
|
||||
url: '/pages/study/courseStudy?id=' + this.courseInfo.id
|
||||
});
|
||||
} else {
|
||||
this.$refs.messager.show({
|
||||
message: res.message,
|
||||
@@ -452,8 +477,11 @@
|
||||
}
|
||||
},
|
||||
toStudy() {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/study/onlineCourse?id=' + this.courseInfo.id + '&studyId=' + this.studyId
|
||||
// });
|
||||
uni.navigateTo({
|
||||
url: '/pages/study/onlineCourse?id=' + this.courseInfo.id + '&studyId=' + this.studyId
|
||||
url: '/pages/study/courseStudy?id=' + this.courseInfo.id
|
||||
});
|
||||
},
|
||||
toTestList() {
|
||||
|
||||
Reference in New Issue
Block a user