diff --git a/App.vue b/App.vue
index 3633f12..21ce195 100644
--- a/App.vue
+++ b/App.vue
@@ -26,7 +26,7 @@
onLaunch: function(e) {
// 检测自动更新
// #ifdef APP-PLUS
- updata();
+ // updata();
// #endif
uni.getSystemInfo({
diff --git a/config/baseUrl.js b/config/baseUrl.js
index cf9a6a3..647c20e 100644
--- a/config/baseUrl.js
+++ b/config/baseUrl.js
@@ -6,9 +6,9 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
- // baseUrl = "https://api.nuttyreading.com/"; // 线上正式
+ baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.110:9200/pb/"; // 磊哥
- baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
+ // baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
// baseUrl = "http://59.110.212.44:9200/pb/";
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/";
diff --git a/pages/course/courseDetail.vue b/pages/course/courseDetail.vue
index 4298424..b96490c 100644
--- a/pages/course/courseDetail.vue
+++ b/pages/course/courseDetail.vue
@@ -4,7 +4,7 @@
-
+
-
+
@@ -51,113 +51,151 @@
-
- {{ isHideCourseInfo ? "展开" : "收起" }}
-
+ ">
+ {{ isHideCourseInfo ? "展开" : "收起" }}
+
+
-
-
-
-
- 课程学习进度大于等于70%时,您可以参与本门课程的自考考试,考试成绩大于60分即可获得本门课程的B级证书,如您想获得本门课程的A级证书可参加小班教学
-
-
-
- 第{{index + 1}}次自考成绩
- {{item.score}}分
-
-
- 查看试卷
+ > -->
+ 查看试卷
+
+
+
+ {{zhedieTestRecode ? '收起' : '展开'}}
-
- {{zhedieTestRecode ? '收起' : '展开'}}
+
+
+
+
+
+ 恭喜!您已通过自考考试获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学
+
-
- 恭喜!您已通过自考考试获得本门课程的B级证书,如您想获得本门课程的A级证书可参加小班教学
-
-
-
-
-
-
-
-
-
-
-
-
- 查看证书
-
-
+
-
+ -->
+
-
-
-
-
-
-
- 加入班级开始更加系统的学习
-
-
- 暂无可加入的小班
-
-
- 前往查看 >>
-
+
+
+
+ 恭喜!您在小班学习中取得了本课程的{{classCertificate[0].type}}级证书
+ 前往查看
-
-
-
-
-
-
- 班级:{{classInfo.title}}
+
+
+
+
+
+
+
+
+ 加入班级开始更加系统的学习
+
+
+ 前往查看
+ >>
+
-
- 进入班级 >>
-
-
+
+
+
+
+
+
+
+
+ 班级:{{classInfo.title}}
+
+
+ 进入班级 >>
+
+
+
+
+
+
+
+
+
+
+ 暂无可加入的小班
+
+
+
+
{{item.title}}
-
+
@@ -174,14 +212,14 @@
v-if="librayList[curIndex].isBuy == 1 || userMsg.vip == 2 || userMsg.vip == 1">
-
-
+
+
VIP畅学权益有效期截止到:{{userMsg.userVip.endTime}}
-
- 当前目录还未开始学习
+
+ 当前目录还未开始学习
@@ -189,7 +227,7 @@
续费
-
+
@@ -211,7 +249,8 @@
-
VIP畅学权益生效中
@@ -256,10 +295,10 @@
-
-
-
-
+
+
+
+
@@ -300,7 +339,7 @@
- 发布留言
+ 发布留言
@@ -413,7 +452,8 @@
发 布
- 取 消
+ 取
+ 消
@@ -475,8 +515,8 @@
} from "vuex";
export default {
data() {
- return {
- zhedieTestRecode:false, // 是否折叠自考的记录
+ return {
+ zhedieTestRecode: false, // 是否折叠自考的记录
goodsList: [],
currentCateIndex: 0,
protocolShow: false,
@@ -551,7 +591,7 @@
fatherIndex: null,
supportFlag: false,
selectGoodsData: {},
-
+
buyOptions: [
// {
// icon: 'chat',
@@ -582,18 +622,19 @@
startStudyForMF: "sociology/course/startStudyForMF",
},
isAndorid: true,
- oprateOsName:'',
- linkClassList:[], // 可加入关联班级数组
- classInfo:[], // 所在班级信息
- selfStudyCertificate:[], // 自考证书
- classCertificate:[], // 小班学习证书
- testingPaper:{}, // 当前课程正在考试信息
+ oprateOsName: '',
+ linkClassList: [], // 可加入关联班级数组
+ classInfo: [], // 所在班级信息
+ selfStudyCertificate: [], // 自考证书
+ classCertificate: [], // 小班学习证书
+ testingPaper: {}, // 当前课程正在考试信息
timeDif: {},
showCountDown: false,
- showSecondTestBtn:false, // 先否显示二次考试按钮
- selfStudyPaperList:[], ///自考考试记录
- showNextTestDate:undefined,
- canJoinTestTime:false, //时间上是否可以参加自考考试
+ showSecondTestBtn: false, // 先否显示二次考试按钮
+ selfStudyPaperList: [], ///自考考试记录
+ showNextTestDate: undefined,
+ canJoinTestTime: false, //时间上是否可以参加自考考试
+ courseCompletion: undefined, // 课程学习进度
};
},
//第一次加载
@@ -626,68 +667,15 @@
// 隐藏原生的tabbar
uni.hideTabBar();
console.log('this.courseId', this.courseId);
+ this.canJoinTestTime = false
await this.getData(this.courseId);
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
this.getLinkClassList()
- var newCertificate = await this.getCertificateInfo()
- console.log('5555555证书资料', newCertificate);
- this.selfStudyCertificate = []
- this.classCertificate = []
- if(newCertificate && newCertificate.length > 0){
- newCertificate.forEach(item => {
- if(item.classId!= '' && item.classId > 0){
- this.classCertificate.push(item)
- }else{
- this.selfStudyCertificate.push(item)
- }
- })
- }
- var historyPaper = await this.getingPaper()
- console.log('historyPaper正在考试的信息',historyPaper);
- if(historyPaper && historyPaper.id && historyPaper.type == '2' && historyPaper.relationId == this.courseId){
- this.testingPaper = historyPaper
- var paperEndTime = historyPaper.planEndTime
- var severNowTime = await this.getServerTime()
- if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
- var secondTimeDif = paperEndTime - severNowTime
- this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
- this.timeDif.minutes = parseInt((secondTimeDif % (1000 * 60 * 60)) / (1000 * 60));
- this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000
- this.showCountDown = true
- console.log('时间符合吗?', this.showCountDown, secondTimeDif);
- } else {
- this.showCountDown = false
- }
- }
- var selfStudyPaperList = await this.getSelfStudyPaperList()
- this.selfStudyPaperList = selfStudyPaperList
- console.log('selfStudyPaperList',selfStudyPaperList);
- if(selfStudyPaperList && selfStudyPaperList.length > 0 && selfStudyPaperList.length < 2){
- this.canJoinTestTime = true
- }
- if(selfStudyPaperList && selfStudyPaperList.length > 0){
- selfStudyPaperList.forEach((item, index) => {
- if(item.score < 60 && index < 2){
- this.showSecondTestBtn = true
- }else{
- this.showSecondTestBtn = false
- }
- })
- }
- if(selfStudyPaperList.length >= 2 && this.selfStudyCertificate.length == 0){
- this.showNextTestDate = await this.getNextTestDate()
- console.log('下次考试时间',this.showNextTestDate);
- var now = new Date()
- if(this.showNextTestDate.nextLongTime < now){
- this.canJoinTestTime = true
- }else{
- this.canJoinTestTime = false
- }
- }
-
+ await this.request()
+
},
onUnload() {
this.selectGoodsData = {};
@@ -704,7 +692,9 @@
// this.showSearchList = false
// this.searchList = []
},
- onPullDownRefresh() {
+ async onPullDownRefresh() {
+ await this.getData(this.courseId);
+ await this.request()
uni.stopPullDownRefresh()
},
onReachBottom() {
@@ -720,98 +710,170 @@
},
//方法
methods: {
+ async request(){
+ var newCertificate = await this.getCertificateInfo()
+ console.log('5555555证书资料', newCertificate);
+ this.selfStudyCertificate = []
+ this.classCertificate = []
+ if (newCertificate && newCertificate.length > 0) {
+ newCertificate.forEach(item => {
+ if (item.classId != '' && item.classId > 0) {
+ this.classCertificate.push(item)
+ } else {
+ this.selfStudyCertificate.push(item)
+ }
+ })
+ }
+ var historyPaper = await this.getingPaper()
+ console.log('historyPaper正在考试的信息', historyPaper);
+ if (historyPaper && historyPaper.id && historyPaper.type == '2' && historyPaper.relationId == this
+ .courseId) {
+ // this.testingPaper = historyPaper
+ this.testingPaper = historyPaper
+ var paperEndTime = historyPaper.planEndTime
+ var severNowTime = await this.getServerTime()
+ if (severNowTime > -1 && paperEndTime - severNowTime > 0) {
+ var secondTimeDif = paperEndTime - severNowTime
+ this.timeDif.hour = parseInt((secondTimeDif % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))
+ this.timeDif.minutes = parseInt((secondTimeDif % (1000 * 60 * 60)) / (1000 * 60));
+ this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000
+ this.showCountDown = true
+ console.log('时间符合吗?', this.showCountDown, secondTimeDif);
+ } else {
+ this.showCountDown = false
+ }
+ }else{
+ this.testingPaper = {}
+ this.showCountDown = false
+ }
+ var selfStudyPaperList = await this.getSelfStudyPaperList()
+ this.selfStudyPaperList = selfStudyPaperList
+ console.log('selfStudyPaperList', selfStudyPaperList);
+ if (this.selfStudyCertificate.length <= 0) { // 没有获得自考证书时查询下次可以自考的时间
+ if (selfStudyPaperList && selfStudyPaperList.length <= 2) {
+ this.canJoinTestTime = true
+ }
+ if (selfStudyPaperList && selfStudyPaperList.length >= 2) {
+ if(selfStudyPaperList.length % 2 != 0){
+ this.canJoinTestTime = true
+ return
+ }
+ this.showNextTestDate = await this.getNextTestDate()
+ console.log('下次考试时间', this.showNextTestDate);
+ if (this.showNextTestDate.nextLongTime == null || this.showNextTestDate.nextLongTime == null) {
+ this.canJoinTestTime = false
+ }
+ var now = new Date()
+ if (this.showNextTestDate.nextLongTime < now) {
+ this.canJoinTestTime = true
+ } else {
+ this.canJoinTestTime = false
+ }
+ }
+ if (selfStudyPaperList && selfStudyPaperList.length > 0) {
+ selfStudyPaperList.forEach((item, index) => {
+ if (item.score < 60 && index % 2 != 0) {
+ this.showSecondTestBtn = true
+ } else {
+ this.showSecondTestBtn = false
+ }
+ })
+ }
+ }
+
+ },
// 查询下次可以考试的时间
- async getNextTestDate(){
+ async getNextTestDate() {
var time = {
- nextLongTime:0,
- nextZKTime:''
+ nextLongTime: 0,
+ nextZKTime: ''
}
await $http.request({
url: "common/classExam/getNextZKTime",
method: "POST",
data: {
- "courseId": parseInt(this.courseId)
+ "courseId": parseInt(this.courseId)
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
- if(res.code != 0) {
+ if (res.code != 0) {
uni.showToast({
- title:res.errMsg,
- icon:'none'
+ title: res.errMsg,
+ icon: 'none'
})
return
}
if (res.code == 0) {
- console.log('res',res);
- time.nextZKTime = res.nextZKTime
- time.nextLongTime = res.nextLongTime
- }
+ console.log('res', res);
+ time.nextZKTime = res.nextZKTime
+ time.nextLongTime = res.nextLongTime
+ }
}).catch(e => {
uni.showToast({
- title:e.errMsg,
- icon:'none'
+ title: e.errMsg,
+ icon: 'none'
})
});
- return time
+ return time
},
seePaper(val) {
- // console.log('点击了');
- uni.navigateTo({
- url: `/pages/miniClass/paperBack?id=${val}`,
- });
+ // console.log('点击了');
+ uni.navigateTo({
+ url: `/pages/miniClass/paperBack?id=${val}`,
+ });
},
async timeup() {
this.showCountDown = false
- setTimeout(async ()=>{
+ setTimeout(async () => {
var selfStudyPaperList = await this.getSelfStudyPaperList()
this.selfStudyPaperList = selfStudyPaperList
- console.log('selfStudyPaperList',selfStudyPaperList);
- if(selfStudyPaperList && selfStudyPaperList.length > 0){
+ console.log('selfStudyPaperList', selfStudyPaperList);
+ if (selfStudyPaperList && selfStudyPaperList.length > 0) {
selfStudyPaperList.forEach((item, index) => {
- if(item.score < 60 && index < 2){
+ if (item.score < 60 && index < 2) {
this.showSecondTestBtn = true
- }else{
+ } else {
this.showSecondTestBtn = false
}
})
}
- },3000)
+ }, 3000)
},
// 获取自考试卷列表
- async getSelfStudyPaperList(){
+ async getSelfStudyPaperList() {
var list = undefined
await $http.request({
url: "common/classExam/getZKExamPaperList",
method: "POST",
data: {
- "courseId": parseInt(this.courseId)
+ "courseId": parseInt(this.courseId)
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(async (res) => {
- if(res.code != 0) {
+ if (res.code != 0) {
uni.showToast({
- title:res.errMsg,
- icon:'none'
+ title: res.errMsg,
+ icon: 'none'
})
return
}
if (res.code == 0) {
- console.log('res',res);
+ console.log('res', res);
list = res.ZKExamUserList
- }
+ }
}).catch(e => {
uni.showToast({
- title:e.errMsg,
- icon:'none'
+ title: e.errMsg,
+ icon: 'none'
})
});
- return list
+ return list
},
// 获取服务器时间
async getServerTime() {
@@ -836,31 +898,34 @@
return time
},
// 获取进行中的考试
- async getingPaper(){
- var obj = undefined
- await $http.request({
- url: "common/classExam/examingPaper",
- method: "POST",
- data: {},
- header: { //默认 无 说明:请求头
- 'Content-Type': 'application/json'
- },
- })
- .then(async (res) => {
- console.log('考试中',res);
- if (res.code == 0 && res.classExamUser != null) {
- obj = {...res.classExamUser, planEndTime:res.planEndTime}
- }else{
- obj = undefined
+ async getingPaper() {
+ var obj = undefined
+ await $http.request({
+ url: "common/classExam/examingPaper",
+ method: "POST",
+ data: {},
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(async (res) => {
+ console.log('考试中', res);
+ if (res.code == 0 && res.classExamUser != null) {
+ obj = {
+ ...res.classExamUser,
+ planEndTime: res.planEndTime
}
- }).catch(e => {
+ } else {
obj = undefined
- });
- return obj
-
+ }
+ }).catch(e => {
+ obj = undefined
+ });
+ return obj
+
},
// 获得课程关联的班级
- getLinkClassList(){
+ getLinkClassList() {
this.$http
.request({
url: 'common/class/getClassByCourseIdNoUser',
@@ -875,27 +940,27 @@
"Content-Type": "application/json",
},
})
- .then(async (res) => {
+ .then(async (res) => {
if (res.code == 0 && res.result.length > 0) {
this.linkClassList = res.result
- }else{
+ } else {
this.linkClassList = []
// 查询是否有所在的班级
this.getClassList()
- }
+ }
}).catch(e => {
uni.showToast({
- title:'获取班级列表错误',
- icon:'none'
+ title: '获取班级列表错误',
+ icon: 'none'
})
})
},
- getClassList(){
+ getClassList() {
$http.request({
url: '/common/class/getClassByUser',
method: "POST",
data: {
- "courseId": this.courseId
+ "courseId": this.courseId
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
@@ -903,15 +968,15 @@
})
.then(res => {
this.classInfo = {}
- console.log('获取班级列表',res.result);
- if(res.code == 0 && res.result != null){
- if(res.result.id){
+ console.log('获取班级列表', res.result);
+ if (res.code == 0 && res.result != null) {
+ if (res.result.id) {
this.classInfo = res.result
}
}
- console.log('获取班级列表++++++',this.classList);
+ console.log('获取班级列表++++++', this.classList);
}).catch(e => {
- console.log('获取班级列表失败',e);
+ console.log('获取班级列表失败', e);
this.classInfo = {}
});
},
@@ -920,7 +985,7 @@
let oprateOs = "";
oprateOs = uni.getSystemInfoSync().platform;
this.oprateOsName = uni.getSystemInfoSync().platform;
- console.log('oprateOs',oprateOs)
+ console.log('oprateOs', oprateOs)
if (oprateOs == "android") {
this.isAndorid = true;
} else {
@@ -1004,8 +1069,8 @@
// if(this.oprateOsName == 'ios'){
// _myurl = '/pages/course/chapterDetail'
// }else{
- // h5 和安卓
- _myurl = '/pages/course/chapterDetailAndorid'
+ // h5 和安卓
+ _myurl = '/pages/course/chapterDetailAndorid'
// }
if (this.librayList[this.curIndex].isBuy == 1 || v.isAudition == 1 ||
this.vip.type == "1" || this.vip.type == "2") {
@@ -1015,7 +1080,7 @@
uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
- }else if(this.vip.type != "1" && this.librayList[this.curIndex].type == 2){
+ } else if (this.vip.type != "1" && this.librayList[this.curIndex].type == 2) {
this.$commonJS.showToast("请开通超V后观看本课程");
} else {
this.$commonJS.showToast("请先购买课程");
@@ -1026,8 +1091,8 @@
this.$forceUpdate();
},
onHandleClickBuy(e) {
- console.log("this.selectGoodsData at line 589:", this.selectGoodsData);
-
+ console.log("this.selectGoodsData at line 589:", this.selectGoodsData);
+
var mynavData = JSON.stringify({
goods: [this.selectGoodsData],
typeId: 0,
@@ -1047,7 +1112,7 @@
//获取相关关联课程商品
handleClickGetGoodsList(v) {
// console.log("data at line 313:", data);
-
+
if (v.type == 0) {
//免费
this.$http
@@ -1063,21 +1128,21 @@
},
})
.then(async (res) => {
- console.log("res at line 493:", res);
+ console.log("res at line 493:", res);
if (res.code == 0) {
this.getCourseDescriptionData();
// this.$commonJS.showToast("");
}
this.$forceUpdate();
});
- } else if(v.type == 2 && this.userMsg.vip != 1 ){
+ } else if (v.type == 2 && this.userMsg.vip != 1) {
uni.showModal({
- title:'提示',
- content:'当前课程目录是超V专享,开通超V可观看',
- confirmText:'好的',
- showCancel:false
+ title: '提示',
+ content: '当前课程目录是超V专享,开通超V可观看',
+ confirmText: '好的',
+ showCancel: false
})
- }else {
+ } else {
this.$http
.request({
url: this.urlList.goodsList,
@@ -1090,7 +1155,7 @@
"Content-Type": "application/json",
},
})
- .then(async (res) => {
+ .then(async (res) => {
if (res.productList.length > 0) {
this.goodsList = res.productList;
this.selectGoodsData = this.goodsList[0];
@@ -1514,95 +1579,111 @@
url: `/pages/course/myCourseLearn?id=${this.course.id}`,
});
},
- async getData(id) {
+ async getData(id) {
this.courseList = [];
// console.log("at line 1167:", "调用了几次");
- var that = this;
-
- await $http
- .request({
- url: "sociology/course/getCourseDetail",
- method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
- data: {
- id: id,
- },
- header: {
- //默认 无 说明:请求头
- "Content-Type": "application/json",
- },
- })
- .then(async (res) => {
- if (res.code == 0) {
- this.course = res.data.course;
- //0 购买 1 续费 2 升级
- // console.log("this.vip.type at line 1045:", this.vip);
- switch (this.vip.type) {
- case 0:
- this.goBuyTitle = "购买VIP,即可免费观看吴门医述所有课程";
- this.goBuyType = 0;
- break;
- case 1 || 2:
- var vipName = "";
- if (this.vip.type == 1) {
- vipName = "超级VIP";
- }
- if (this.vip.type == 2) {
- vipName = "吴门医述VIP";
- }
- //超级VIP
- this.goBuyTitle = `尊贵的${vipName},您的有效期到 ${
+ var that = this;
+
+ await $http
+ .request({
+ url: "sociology/course/getCourseDetail",
+ method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
+ data: {
+ id: id,
+ },
+ header: {
+ //默认 无 说明:请求头
+ "Content-Type": "application/json",
+ },
+ })
+ .then(async (res) => {
+ if (res.code == 0) {
+ this.course = res.data.course;
+ //0 购买 1 续费 2 升级
+ // console.log("this.vip.type at line 1045:", this.vip);
+ switch (this.vip.type) {
+ case 0:
+ this.goBuyTitle = "购买VIP,即可免费观看吴门医述所有课程";
+ this.goBuyType = 0;
+ break;
+ case 1 || 2:
+ var vipName = "";
+ if (this.vip.type == 1) {
+ vipName = "超级VIP";
+ }
+ if (this.vip.type == 2) {
+ vipName = "吴门医述VIP";
+ }
+ //超级VIP
+ this.goBuyTitle = `尊贵的${vipName},您的有效期到 ${
this.vip.endTime && this.vip.endTime.split(" ")[0]
}`;
- this.goBuyType = 1;
- break;
+ this.goBuyType = 1;
+ break;
- case 3:
- //众妙之门
- this.goBuyTitle =
- "尊贵的众妙之门VIP,升级至超级VIP,即可免费观看吴门医述所有课程";
+ case 3:
+ //众妙之门
+ this.goBuyTitle =
+ "尊贵的众妙之门VIP,升级至超级VIP,即可免费观看吴门医述所有课程";
- this.goBuyType = 2;
- break;
- }
- this.$forceUpdate();
- this.pageTitle = this.course.title;
- this.librayList = [...res.data.catalogues];
- console.log('获取课程详情=》',res.data);
- that.$forceUpdate();
- if (this.librayList.length > 0) {
- if(this.catalogueId){
- this.curId = this.catalogueId
- let _list = this.librayList
- _list = _list.map( item => item.id)
- // console.log('_list过滤后的_list',_list);
- this.curIndex = _list.findIndex((element) => element == this.catalogueId)
- console.log('其他页面返回来,_list过滤后的curIndex',this.curIndex,this.catalogueId);
- }else{
- this.catalogueId = this.librayList[0].id;
- this.curId = this.librayList[0].id;
- this.curIndex = 0
- console.log('首次加载');
- }
-
- this.chapterList = await this.getChapterList(this.catalogueId)
- // console.log('目录列表', this.librayList)
- // console.log('外面得到的方法列表', this.chapterList);
- if (
- res.data.shopProductList &&
- res.data.shopProductList.length > 0
- ) {
- this.tjProList = res.data.shopProductList;
- } else {
- this.tjProList;
- }
- // console.log("list at line 1233:", list);
- }
+ this.goBuyType = 2;
+ break;
}
- })
- .catch((e) => {
- console.log(e, "获取目录数据报错");
- });
- },
+ this.$forceUpdate();
+ this.pageTitle = this.course.title;
+ this.librayList = [...res.data.catalogues];
+ console.log('获取课程详情=》', res.data);
+ if (this.librayList.length > 0) {
+ var ll = this.librayList.map(item => item.completion)
+ var sums = 0
+ ll.forEach(item => {
+ sums += item
+ })
+ if (sums > 0) {
+ this.courseCompletion = (sums / ll.length).toFixed(2)
+ } else {
+ this.courseCompletion = 0
+ }
+
+ } else {
+ this.courseCompletion = 0
+ }
+ console.log('lllllll', this.courseCompletion);
+ that.$forceUpdate();
+ if (this.librayList.length > 0) {
+ if (this.catalogueId) {
+ this.curId = this.catalogueId
+ let _list = this.librayList
+ _list = _list.map(item => item.id)
+ // console.log('_list过滤后的_list',_list);
+ this.curIndex = _list.findIndex((element) => element == this.catalogueId)
+ console.log('其他页面返回来,_list过滤后的curIndex', this.curIndex, this.catalogueId);
+ } else {
+ this.catalogueId = this.librayList[0].id;
+ this.curId = this.librayList[0].id;
+ this.curIndex = 0
+ console.log('首次加载');
+ }
+
+ this.chapterList = await this.getChapterList(this.catalogueId)
+ // console.log('目录列表', this.librayList)
+ // console.log('外面得到的方法列表', this.chapterList);
+ if (
+ res.data.shopProductList &&
+ res.data.shopProductList.length > 0
+ ) {
+ this.tjProList = res.data.shopProductList;
+ } else {
+ this.tjProList;
+ }
+ // console.log("list at line 1233:", list);
+ }
+ }
+ })
+ .catch((e) => {
+ console.log(e, "获取目录数据报错");
+ });
+ },
goBuy() {
$http
.request({
@@ -1726,30 +1807,32 @@
});
},
// 查询证书情况
- async getCertificateInfo(){
+ async getCertificateInfo() {
var list = undefined
await $http.request({
url: "common/userCertificate/getUserCertificateList",
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
data: {
- "type":'', //证书类型A a证 B b证 ZK自考
- "courseId": this.courseId //课程id
+ "type": '', //证书类型A a证 B b证 ZK自考
+ "courseId": this.courseId //课程id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
- if(res.code != 0) {
+ if (res.code != 0) {
uni.showToast({
title: res.errMsg,
icon: 'none'
})
- return
+ return
}
if (res.code == 0) {
res.certificateList.forEach(item => {
- item.certificateUrl && item.certificateUrl != '' ? item.certificateUrlList = item.certificateUrl.split(',') : item.certificateUrlList = []
+ item.certificateUrl && item.certificateUrl != '' ? item
+ .certificateUrlList = item.certificateUrl.split(',') : item
+ .certificateUrlList = []
})
list = res.certificateList
}
@@ -1757,46 +1840,84 @@
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
- console.log(e, '数据报错')
+ console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: e.errMsg,
icon: 'none'
})
});
- return list
+ return list
+ },
+ goClassLIst(url, id, title) {
+ uni.navigateTo({
+ url: `${url}?courseId=${id}&courseTitle=${title}`,
+ });
},
- goClassLIst(url, id,title){
- uni.navigateTo({
- url: `${url}?courseId=${id}&courseTitle=${title}`,
- });
- },
},
};
\ No newline at end of file
diff --git a/pages/course/coursePrice.vue b/pages/course/coursePrice.vue
index f060b93..fa33f9e 100644
--- a/pages/course/coursePrice.vue
+++ b/pages/course/coursePrice.vue
@@ -21,7 +21,7 @@
-
@@ -31,8 +31,9 @@
size="24">{{item1.title}}
-
-
+
+
+
【{{item2.title}}】
@@ -40,11 +41,13 @@
height: 40rpx; text-align: center; line-height: 40rpx; color: #ffb861;">V
半年:¥{{item2.halfFee}} 元整年:¥{{item2.fee}} 元
+
立即购买
+ v-if="item2.isBuy == 0 && (userMsg.vip == 0 || userMsg.vip == 3)">立即购买
- 已购买
-
+ 已购买
diff --git a/pages/miniClass/classInfoMan.vue b/pages/miniClass/classInfoMan.vue
index 19d47e3..f487b87 100644
--- a/pages/miniClass/classInfoMan.vue
+++ b/pages/miniClass/classInfoMan.vue
@@ -290,6 +290,10 @@
匿名用户
+
+
+
+
- 剩余时间:
+ 剩余时间:
+
+ 开始时间:{{testPaper.startTime}}
结束时间:{{testPaper.endTime}}
+
@@ -223,8 +226,6 @@ checkAnswer(id){
if (res.code == 0) {
// that.isHave = true
var subOptions = JSON.parse(res.examPaper.subject)
-
-
subOptions.forEach(item => {
var code = 0
item.options.forEach(item1 => {
@@ -236,6 +237,7 @@ checkAnswer(id){
this.questionList = subOptions
this.testPaper = res.examPaper
+ console.log('试卷信息', this.testPaper);
this.answerIdsList = JSON.parse(res.examPaper.answer)
var newList = JSON.parse(res.examPaper.answer)
newList = newList.map(item => {
diff --git a/pages/miniClass/test.vue b/pages/miniClass/test.vue
index f5095a5..7c9e86f 100644
--- a/pages/miniClass/test.vue
+++ b/pages/miniClass/test.vue
@@ -32,7 +32,7 @@
- 剩余时间:
+ 剩余时间:
- 剩余时间:
+ 剩余时间: