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/components/orderCoupon.vue b/components/orderCoupon.vue new file mode 100644 index 0000000..78d478f --- /dev/null +++ b/components/orderCoupon.vue @@ -0,0 +1,267 @@ + + + + + \ No newline at end of file diff --git a/config/baseUrl.js b/config/baseUrl.js index 34b1545..647c20e 100644 --- a/config/baseUrl.js +++ b/config/baseUrl.js @@ -19,7 +19,8 @@ if (process.env.NODE_ENV === 'development') { // baseUrl = "http://59.110.212.44:9100/pb/"; // baseUrl = "https://testapi.nuttyreading.com/"; // baseUrl = "http://192.168.110.110:9200/pb/";//磊哥 - baseUrl = "https://api.nuttyreading.com/"; //1 + // baseUrl = "https://api.nuttyreading.com/"; //1 + baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑 // baseUrl = "ws://twin-ui.com:6001/"; // socketUrl = "ws://twin-ui.com:6001/"; } diff --git a/pages.json b/pages.json index 411f79d..1f80f4e 100644 --- a/pages.json +++ b/pages.json @@ -741,7 +741,21 @@ { "navigationBarTitleText" : "我的证书" } - } + }, + { + "path" : "pages/selfStudy/selfStudy", + "style" : + { + "navigationBarTitleText" : "自考考试" + } + }, + { + "path" : "pages/mine/wallet/couponList", + "style" : + { + "navigationBarTitleText" : "用户优惠券列表" + } + } ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/bookShop/orderLCont.vue b/pages/bookShop/orderLCont.vue index b6a2e31..bdab518 100644 --- a/pages/bookShop/orderLCont.vue +++ b/pages/bookShop/orderLCont.vue @@ -166,6 +166,23 @@
+ + + + + {{ orderContet.remark }} + + + + +
+
+
+
运费 : - {{ orderContet.shippingMoney }} + {{ orderContet.shippingMoney }} + + 优惠券 : + + - ¥{{ orderContet.couponAmount }} + 积分 : @@ -888,11 +911,33 @@ export default { orderTabCLi(e) { this.orderListTab = e; }, + async getCouponDetail(id){ + await this.$http + .request({ + url: "common/coupon/getCouponHistoryInfo", + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + id + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + if(res.code != 0) return this.$commonJS.showToast(res.errMsg); + this.orderContet.couponAmount = res.couponHistory.couponEntity.couponAmount + + }).catch(e => { + console.log(e); + this.$commonJS.showToast(e.errMsg); + }) + }, // 获取订单详情 - getOrderList() { + async getOrderList() { console.log("this.orderType", this.orderType); - this.$http + await this.$http .request({ url: "common/buyOrder/commonOrderDetail", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 @@ -904,12 +949,16 @@ export default { "Content-Type": "application/json", }, }) - .then((res) => { + .then(async (res) => { this.customButton = []; console.log("订单详情", res); this.orderContet = res.data.buyOrder; this.goodsList = res.data.productInfo; this.consigneeShow = true; + // 存在优惠券信息,就查询优惠券集体金额 + if(this.orderContet.couponId && this.orderContet.couponId != null){ + await this.getCouponDetail(this.orderContet.couponId) + } if ( this.orderContet.orderStatus == 2 && this.sheetList.length > 0 && diff --git a/pages/bookShop/orderList.vue b/pages/bookShop/orderList.vue index 66510f9..872f716 100644 --- a/pages/bookShop/orderList.vue +++ b/pages/bookShop/orderList.vue @@ -128,7 +128,40 @@ > + + + + + + {{ slotProps.row.remark }} + + + + + + + { - // console.log(res, "内容获取成功"); + console.log("订单列表内容获取成功",res ); that.pagination.total = res.data.total; if (res.data.total == 0) { this.isLoadingHide = true; @@ -1001,6 +1036,7 @@ export default { }, // 取消订单 canceOrder(item) { + console.log('item.orderSn',item); uni.showModal({ title: "提示", content: "确定要取消订单吗?", @@ -1011,7 +1047,9 @@ export default { success: (res) => { if (res.confirm) { this.$http - .get("book/buyOrder/cancelOrder?orderSn=" + item.orderSn) + .post( + "book/buyOrder/appDelete?orderId=" + item.orderId + ) .then((res) => { if (res.code == 0) { uni.showToast({ diff --git a/pages/certificate/certificate.vue b/pages/certificate/certificate.vue index 6d562d8..839f761 100644 --- a/pages/certificate/certificate.vue +++ b/pages/certificate/certificate.vue @@ -10,13 +10,14 @@

编号:{{item.certificateNo}}

- - 立即获取证书 - + 获得时间:{{item.createTime.substring(0, 10)}}
+ + 立即获取证书 + + @@ -243,7 +244,10 @@ $http.request({ url: "common/userCertificate/getUserCertificateList", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 - data: {}, + data: { + "type":"", //证书类型A a证 B b证 ZK自考 + "courseId":"" //课程id + }, header: { //默认 无 说明:请求头 'Content-Type': 'application/json' }, diff --git a/pages/component/commonComponents/selectGoods.vue b/pages/component/commonComponents/selectGoods.vue index bd64bf9..916fc9d 100644 --- a/pages/component/commonComponents/selectGoods.vue +++ b/pages/component/commonComponents/selectGoods.vue @@ -44,8 +44,8 @@ - - + + - + @@ -51,50 +51,154 @@ - - {{ isHideCourseInfo ? "展开" : "收起" }} - + "> + {{ isHideCourseInfo ? "展开" : "收起" }} + - - - - - - - - 加入班级开始更加系统的学习 + + + + + + + + + 课程学习进度大于等于70%时,您可以参与本门课程的自考考试,考试成绩大于60分即可获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学 + + + + 第{{index + 1}}次自考成绩 + {{item.score}}分 + + + 查看试卷 + + + + {{zhedieTestRecode ? '收起' : '展开'}} + + + + + + + + 恭喜!您已通过自考考试获得本门课程的自考证书,如您想获得本门课程的A级或B级证书可参加小班教学 + + + + + + + + + + + + - - 前往查看 >> - - - - - - - - 班级:{{classInfo.title}} - - - 进入班级 >> - + + + + + 恭喜!您在小班学习中取得了本课程的{{classCertificate[0].type}}级证书 + + {{item.title}} - + - VIP畅学权益生效中 @@ -193,10 +302,10 @@ - - - - + + + + @@ -237,7 +346,7 @@ - 发布留言 + 发布留言 @@ -350,17 +459,18 @@ - + - @@ -412,7 +522,8 @@ } from "vuex"; export default { data() { - return { + return { + zhedieTestRecode: false, // 是否折叠自考的记录 goodsList: [], currentCateIndex: 0, protocolShow: false, @@ -487,7 +598,7 @@ fatherIndex: null, supportFlag: false, selectGoodsData: {}, - + buyOptions: [ // { // icon: 'chat', @@ -516,11 +627,26 @@ list: "sociology/course/getCourseDetail", goodsList: "sociology/product/getProductListForCourse", startStudyForMF: "sociology/course/startStudyForMF", + newPayment:"common/courseRelearn/courseCatalogueCanRelearn", // 检查复读地址 + newPaymentList:"common/courseRelearn/relearnShopProductList", // 获取复读列表 }, isAndorid: true, - oprateOsName:'', - linkClassList:[], // 可加入关联班级数组 - classInfo:[] // 所在班级信息 + oprateOsName: '', + linkClassList: [], // 可加入关联班级数组 + classInfo: [], // 所在班级信息 + selfStudyCertificate: [], // 自考证书 + classCertificate: [], // 小班学习证书 + testingPaper: {}, // 当前课程正在考试信息 + timeDif: {}, + showCountDown: false, + showSecondTestBtn: false, // 先否显示二次考试按钮 + selfStudyPaperList: [], ///自考考试记录 + showNextTestDate: undefined, + canJoinTestTime: false, //时间上是否可以参加自考考试 + courseCompletion: undefined, // 课程学习进度 + showNewPayBtn:false, + newPaymentProList:[], + isFudu:false, // 是否复读 }; }, //第一次加载 @@ -536,8 +662,6 @@ // await this.getData(e.id); this.getSayList(); this.getOS() - - }, onPageScroll(e) { this.scrollTop = e.scrollTop; @@ -548,19 +672,21 @@ } }, computed: { - ...mapState(["userInfo"]), + ...mapState(["userInfo"]), }, //页面显示 async onShow() { // 隐藏原生的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() + // #endif + await this.request() + }, onUnload() { this.selectGoodsData = {}; @@ -577,7 +703,9 @@ // this.showSearchList = false // this.searchList = [] }, - onPullDownRefresh() { + async onPullDownRefresh() { + await this.getData(this.courseId); + await this.request() uni.stopPullDownRefresh() }, onReachBottom() { @@ -593,8 +721,229 @@ }, //方法 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) + } + }) + } + if(this.classCertificate.length <= 0){ // 已经在班级内获得证书就不再检查班级的情况了 + this.getLinkClassList() + } + 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 + } + if(this.course.canzk == '0'){ // 如果没有开启自考,就不走自考相关的逻辑 + console.log('没有打开自考开关'); + return + } + 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() { + var time = { + nextLongTime: 0, + nextZKTime: '' + } + await $http.request({ + url: "common/classExam/getNextZKTime", + method: "POST", + data: { + "courseId": parseInt(this.courseId) + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(async (res) => { + if (res.code != 0) { + uni.showToast({ + title: res.errMsg, + icon: 'none' + }) + return + } + if (res.code == 0) { + console.log('res', res); + time.nextZKTime = res.nextZKTime + time.nextLongTime = res.nextLongTime + } + }).catch(e => { + uni.showToast({ + title: e.errMsg, + icon: 'none' + }) + }); + return time + }, + seePaper(val) { + // console.log('点击了'); + uni.navigateTo({ + url: `/pages/miniClass/paperBack?id=${val}`, + }); + }, + async timeup() { + this.showCountDown = false + setTimeout(async () => { + var selfStudyPaperList = await this.getSelfStudyPaperList() + this.selfStudyPaperList = selfStudyPaperList + console.log('selfStudyPaperList', selfStudyPaperList); + if (selfStudyPaperList && selfStudyPaperList.length > 0) { + selfStudyPaperList.forEach((item, index) => { + if (item.score < 60 && index < 2) { + this.showSecondTestBtn = true + } else { + this.showSecondTestBtn = false + } + }) + } + }, 3000) + }, + // 获取自考试卷列表 + async getSelfStudyPaperList() { + var list = undefined + await $http.request({ + url: "common/classExam/getZKExamPaperList", + method: "POST", + data: { + "courseId": parseInt(this.courseId) + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(async (res) => { + if (res.code != 0) { + uni.showToast({ + title: res.errMsg, + icon: 'none' + }) + return + } + if (res.code == 0) { + console.log('res', res); + list = res.ZKExamUserList + } + }).catch(e => { + uni.showToast({ + title: e.errMsg, + icon: 'none' + }) + }); + return list + }, + // 获取服务器时间 + async getServerTime() { + var time = 0 + await $http.request({ + url: "common/classExam/getServerTime", + method: "POST", + data: {}, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(async (res) => { + if (res.code == 0) { + time = res.serverTime + } else { + time = -1 + } + }).catch(e => { + time = -1 + }); + 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 + } + }).catch(e => { + obj = undefined + }); + return obj + + }, // 获得课程关联的班级 - getLinkClassList(){ + getLinkClassList() { this.$http .request({ url: 'common/class/getClassByCourseIdNoUser', @@ -609,27 +958,28 @@ "Content-Type": "application/json", }, }) - .then(async (res) => { + .then(async (res) => { if (res.code == 0 && res.result.length > 0) { this.linkClassList = res.result - }else{ + this.classInfo = {} + } 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' @@ -637,15 +987,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 = {} }); }, @@ -654,7 +1004,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 { @@ -738,8 +1088,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") { @@ -749,7 +1099,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("请先购买课程"); @@ -760,13 +1110,14 @@ 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, navTitle: this.course.title, title: this.course.title, + isFudu: this.isFudu // sourceType: "curriculum", }); // 这里转换成 字符串 uni.navigateTo({ @@ -778,10 +1129,73 @@ this.pricespop = false; this.protocolShow = true; }, + // 查询课程复读列表 + async getNewPaymentList(id){ + uni.showLoading({ + title:'加载中' + }) + await this.$http + .request({ + url: this.urlList.newPaymentList, + method: "POST", + data: { + catalogueId: id, + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + console.log("复读列表", res); + uni.hideLoading() + if(res.code != 0){return this.$commonJS.showToast(res.errMsg);} + // if (res.code == 0) { + this.newPaymentProList = res.productList + // } + this.$forceUpdate(); + }).catch(e => { + uni.hideLoading() + console.log('e',e); + this.newPaymentProList = [] + this.$commonJS.showToast(e.errMsg); + }); + + }, + // 查询目录续费情况 + async checkRenewPayment(id){ + var ss = false + await this.$http + .request({ + url: this.urlList.newPayment, + method: "POST", + data: { + courseCatalogueId: id, + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + console.log("res at line 493:", res); + if(res.code != 0){return this.$commonJS.showToast(res.errMsg);} + if (res.code == 0) { + ss = res.canRelearn + } + this.$forceUpdate(); + }).catch(e => { + console.log('e',e); + ss = false + this.$commonJS.showToast(e.errMsg); + }); + return ss + }, + //获取相关关联课程商品 handleClickGetGoodsList(v) { // console.log("data at line 313:", data); - + if (v.type == 0) { //免费 this.$http @@ -797,47 +1211,51 @@ }, }) .then(async (res) => { - console.log("res at line 493:", res); + console.log("res at line 493:", res); if (res.code == 0) { - this.getCourseDescriptionData(); + this.getCourseDescriptionData(v); // 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 { - this.$http - .request({ - url: this.urlList.goodsList, - method: "POST", - data: { - id: v.id, - }, - header: { - //默认 无 说明:请求头 - "Content-Type": "application/json", - }, - }) - .then(async (res) => { - if (res.productList.length > 0) { - this.goodsList = res.productList; - this.selectGoodsData = this.goodsList[0]; - this.$refs.commonSelectGoods.open(); - this.show = true; - } else { - this.$commonJS.showToast("此课程暂无购买方式"); - } - - this.$forceUpdate(); - }) + } else { + this.getCourseDescriptionData(v); } }, + getCourseDescriptionData(v){ + this.isFudu = false + this.$http + .request({ + url: this.urlList.goodsList, + method: "POST", + data: { + id: v.id, + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + if (res.productList.length > 0) { + this.goodsList = res.productList; + this.selectGoodsData = this.goodsList[0]; + this.$refs.commonSelectGoods.open(); + this.show = true; + } else { + this.$commonJS.showToast("此课程暂无购买方式"); + } + + this.$forceUpdate(); + }) + }, getUserInfo() { this.$http.post("common/user/getUserInfo").then((res) => { console.log("res at line 505:", res); @@ -1247,103 +1665,124 @@ uni.navigateTo({ 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; + uni.showLoading({ + title:'获取课程信息' + }) + await $http + .request({ + url: "sociology/course/getCourseDetail", + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + id: id, + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + uni.hideLoading() + if(res.code != 0) { + uni.showToast({ + title:res.errMsg, + icon:'none' + }) + return + } + 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, "获取目录数据报错"); - // if(e.statusCode == 0){ - // uni.showToast({ - // title:'获取课程信息失败,请稍后尝试', - // icon:'none', - // duration: 5000 - // }) - // } - }); - }, + 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('首次加载'); + } + console.log('this.librayList[0]',this.librayList[0]); + this.clicklib(this.librayList[0], 0) + // 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) => { + uni.hideLoading() + console.log(e, "获取课程数据报错666"); + }); + }, goBuy() { $http .request({ @@ -1417,14 +1856,41 @@ console.log("datas at line 1300:", datas); return datas; }, - async clicklib(item, index) { - if (item.id == this.curId) { - return; + // 选择复读选项 + async goNewPay(item){ + this.showNewPayBtn ? await this.getNewPaymentList(item.id) : '' + if(this.newPaymentProList.length > 0){ + // this.getCourseDescriptionData(v); + this.goodsList = this.newPaymentProList; + this.selectGoodsData = this.goodsList[0]; + this.$refs.commonSelectGoods.open(); + this.isFudu = true + this.show = true; + }else{ + this.show = false + this.isFudu = false + this.$commonJS.showToast('暂无复读方案'); } + }, + async clicklib(item, index) { + console.log('hhhhhhhhhhhhhhhhhhh++++++++', item); + + // if (item.id == this.curId) { + // return; + // } this.catalogueId = item.id this.curIndex = index; this.curId = item.id; + + if(item.isBuy == 0 && this.userMsg.vip != 2 && this.userMsg.vip != 1 ){ + console.log('hhhhhhhhhhhhhhhhhhh++++++++'); + this.showNewPayBtn = await this.checkRenewPayment(item.id) + console.log('可以复读吗?', this.showNewPayBtn ); + }else{ // this.showNewPayBtn = await this.checkRenewPayment(item.id) + console.log('不用复读'); + } this.chapterList = await this.getChapterList(item.id); + }, toZhedie() { this.fold = true; @@ -1450,7 +1916,6 @@ }) .then(async (res) => { if (res.code == 0 && res.chapterList.length > 0) { - list = res.chapterList; // console.log("方法里面得到的章节列表:", list); } else { @@ -1467,36 +1932,118 @@ url: `${url}?id=${id}`, }); }, - goClassLIst(url, id,title){ - uni.navigateTo({ - url: `${url}?courseId=${id}&courseTitle=${title}`, - }); + // 查询证书情况 + 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 }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if (res.code != 0) { + uni.showToast({ + title: res.errMsg, + icon: 'none' + }) + return + } + if (res.code == 0) { + res.certificateList.forEach(item => { + item.certificateUrl && item.certificateUrl != '' ? item + .certificateUrlList = item.certificateUrl.split(',') : item + .certificateUrlList = [] + }) + list = res.certificateList + } + console.log('证书接口请求结果', res); + uni.hideLoading() + }).catch(e => { + uni.hideLoading() + console.log(e, '数据报错') + // this.status = 3 + uni.showToast({ + title: e.errMsg, + icon: 'none' + }) + }); + return list + }, + 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}} diff --git a/pages/goods/index/index.vue b/pages/goods/index/index.vue index 4471507..84cf914 100644 --- a/pages/goods/index/index.vue +++ b/pages/goods/index/index.vue @@ -1,208 +1,127 @@ + + + + + 商品规格 + - - - - - - - 商品规格 - - 共{{ goodsList.length }}种商品可选择 - - - - - - - - - - - 书籍信息 - + + + + + + + 书籍信息 + + - - + + + + + + + 课程信息 + + - - + + + - - - + + - - - + + + - - + - - - - - - + + - - - - - 相关课程 - - - - - - + @import '@/style/mixin.scss'; + + .tanchu { + padding: 0 30rpx 40rpx 30rpx; + position: relative; + // max-height: 60vh; + // overflow-y: scroll; + + .dp_title { + font-size: 32rpx; + margin-bottom: 50rpx; + color: #555; + text-align: center; + font-weight: bold; + } + + .dp_add { + position: absolute; + top: 40rpx; + right: 30rpx; + font-size: 22rpx; + background-color: #fd6004; + color: #fff; + border-radius: 10rpx; + padding: 5rpx 10rpx; + + .u-icon { + display: inline-block; + margin-right: 5rpx; + } + } + + .addressItem { + border: 2px dashed #d9d9d9; + border-radius: 10rpx; + width: 100%; + display: flex; + padding: 20rpx 10rpx; + margin: 25rpx 0 0 0; + align-items: center; + background-color: #fff; + + .addrContent { + margin-left: 40rpx; + flex: 1; + + .addrContentTop { + display: flex; + align-items: flex-end; + margin: 0 0 15rpx 0; + position: relative; + + .userName { + font-size: 35rpx; + font-weight: bold; + margin-right: 30rpx; + } + + .userTel { + font-size: 25rpx; + color: #888; + } + + .userMoren { + border: 1px solid #fd6004; + color: #fd6004; + padding: 3rpx 10rpx; + font-size: 22rpx; + border-radius: 10rpx; + margin: 0 0 0 20rpx; + } + + + .chooseCheck { + position: absolute; + top: 3rpx; + right: 6rpx; + } + } + + .addrContentBottom { + font-size: 32rpx; + } + } + } + + + .addressItem.addItem_style { + border-color: #fd6004; + } + + .youhuiItem { + border: 1px solid #d9d9d9; + border-radius: 10rpx; + width: 100%; + display: flex; + padding: 20rpx 10rpx; + margin: 25rpx 0 0 0; + align-items: center; + background-color: #fff; + font-size: 30rpx; + } + + .youhuiItem>view { + float: left; + } + + .youhuiItem.youItem_style { + border-color: #fd6004; + } + } + + .u-grid-list { + // height: 40rpx; + } + + .searchList { + .item { + font-size: 28rpx; + padding: 20rpx; + border-bottom: 1px solid #dadbde; + } + } + + .scroll-view_H { + background-color: #fff; + white-space: nowrap; + padding: 10rpx; + } + + .contentBox { + height: calc(100% - 50px); + + .statusList { + padding: 10rpx; + box-sizing: border-box; + justify-content: space-between; + + text { + text-align: center; + display: inline-block; + width: 32%; + padding: 20rpx 0; + font-size: 34rpx; + border-radius: 10rpx; + } + + .cur { + background-color: $themeColor; + color: #fff; + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); + } + } + + .twoCateList { + font-size: 28rpx; + margin-top: 20rpx; + + .grid-text { + padding: 10rpx 0rpx; + text-align: center; + } + + .cur { + color: $themeColor; + } + + // .u-grid-list{border: 0.5px solid #dadbde;} + } + + .dataList { + font-size: 26rpx; + padding-bottom: 40rpx; + // margin-top: 20rpx; + // padding: 32rpx 0rpx; + border-radius: 10rpx; + background-color: #fff; + box-sizing: border-box; + + .JFtitleItem { + background-color: #ffffff; + padding: 20rpx 10rpx; + width: 100%; + border-bottom: 0.5px solid #f8f9fa; + } + + .wmzhimg { + width: 220rpx; + height: 220rpx; + } + } + } + + .search_box { + margin: 0 auto; + overflow: hidden; + align-items: center; + width: calc(100% - 10px); + margin-top: 20rpx; + margin-bottom: 20rpx; + + .search { + height: 56upx; + display: flex; + width: 86%; + margin: 0 auto; + align-items: center; + padding: 0upx 40upx; + background-color: #fff; + border-radius: 20upx; + box-shadow: 0 0px 10px 1px #258feb33; + } + + .prompt { + color: #838383; + font-size: 24rpx; + } + + .icon_search { + background-image: url("@/static/icon/map_ic_search.png"); + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + width: 36upx; + height: 36upx; + margin-right: 20upx; + } + } + + .flexbox { + display: flex; + } + + .uni-modal .uni-modal__bd { + text-align: left; + } + + .limiTy { + font-size: 28rpx; + line-height: 46rpx; + } + + .chImage { + height: 100rpx; + } + + .dataList { + height: 100%; + } + + .titleList2 { + height: calc(100% - 150rpx); + } + + .priceDetail { + height: calc(100% - 180rpx) !important; + padding: 0rpx 0; + box-sizing: border-box; + } + + .componentPage { + height: calc(100% - 90rpx) !important; + } + + .dateReminder { + width: 100%; + font-size: 24rpx; + text-align: right; + line-height: 40rpx; + } + + .fdButtonBox { + border: 1rpx solid $themeColor; + background-color: $themeColor; + color: #fff; + // width: 100%; + float: right; + padding: 4rpx 14rpx; + font-size: 24rpx; + font-weight: 500; + line-height: 30rpx; + border-radius: 10rpx; + box-sizing: border-box; + + // margin-top: 20rpx; + // display: flex; + // align-items: center; + } + + .headImage { + // height: 400rpx !important; + } + + .commonDetailPage { + padding-bottom: 150rpx !important; + background-color: #f5f5f5 !important; + } + + .goods_box { + background-color: #fff; + // margin-top: 20rpx; + // padding: 40rpx 30rpx; + box-sizing: border-box; + width: 100%; + + .curriulum_title_box { + width: calc(100%) !important; + padding-bottom: 20rpx; + background-color: #fff; + + .curriulum_title { + width: calc(100%); + font-weight: 600; + font-size: 34rpx; + // line-height: 40rpx; + // display: flex; + // align-items: center; + margin-top: 80rpx; + margin-bottom: 0rpx; + // padding: 20rpx; + box-sizing: border-box; + } + } + } + + .dataList { + background-color: #fff !important; + padding: 0 30rpx 40rpx !important; + box-sizing: border-box; + } + + /deep/.titleItem { + // width: calc(100% - 120rpx) !important; + } + + /deep/.scroll-view-item:nth-child(2n-1) { + background-color: transparent !important; + } + + .dataList { + height: auto !important; + } + + .small_class_teaching_box { + padding-top: 20rpx; + width: 100%; + margin-top: 20rpx; + background: #fff; + + .small_class_teaching_top { + padding: 20rpx 20rpx 0 10rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + // background: #EDFCF7; + color: #8f8e8e; + + // box-shadow: 0px 0px 6rpx 0px #E9DCCC; + .icon1 { + width: 50rpx; + height: 50rpx; + } + + .small_class_teaching_top_left { + display: flex; + align-items: center; + color: #018f89; + + font-family: MicrosoftYaHei; + } + } + + .small_class_teaching_content { + margin-top: 20rpx; + // background: #EDFCF7; + padding-bottom: 10rpx; + + .top { + padding: 20rpx 20rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + border-bottom: 4rpx solid #fff; + + .top_item { + width: 23%; + font-family: PangMenZhengDaoBiaoTiTiMianFeiBan; + font-weight: normal; + font-size: 34rpx; + color: #018f89; + line-height: 80rpx; + background: #cef8ea; + text-align: center; + border-radius: 10rpx; + box-shadow: 0px 0px 6rpx 0px #E9DCCC; + } + } + + .schedule { + width: 100%; + overflow: hidden; + padding: 20rpx 20rpx; + box-sizing: border-box; + align-items: center; + color: #018f89; + + font-family: MicrosoftYaHei; + + .icon_box { + width: 100%; + display: flex; + align-items: center; + margin-bottom: 0rpx; + + .icon1 { + width: 50rpx; + height: 50rpx; + margin-right: 10rpx; + } + } + + .progress_box { + width: 100%; + display: flex; + align-items: center; + position: relative; + + .progress_icon { + width: calc(100% - 240rpx); + } + + .icon1 { + width: 60rpx; + height: 60rpx; + margin: 0 20rpx; + } + + .icon2 { + width: 140rpx; + height: 100rpx; + position: absolute; + right: 0; + // margin-top: -20rpx; + } + } + } + } + } + + .related_courses_box { + background-color: #fff; + + .small_class_teaching_content { + padding: 10rpx 20rpx; + box-sizing: border-box; + } + } + + .related_courses_name { + display: inline-block; + width: calc(100% - 0rpx) !important; + + .aui-text-danger { + display: inline-block; + float: right; + } + } + + .original_price { + font-size: 28rpx !important; + font-weight: 500; + color: #999 !important; + white-space: nowrap; + text-decoration: line-through; + float: left; + margin-top: 6rpx; + } + + .price { + font-size: 48rpx; + font-weight: 700; + float: left; + margin-right: 10rpx; + // font-family: PangMenZhengDaoBiaoTiTiMianFeiBan; + } + + .price_box { + width: 100%; + overflow: hidden; + } + + .commonTags { + margin-right: 20rpx; + margin-top: -5rpx !important; + } + + .sales_number { + text-decoration: none; + color: #b0b0b0; + font-weight: 500; + } + + .miaosha_box { + overflow: hidden; + + .countdown { + display: flex; + align-items: center; + color: #fff; + font-size: 24rpx; + } + + .price_left { + width: calc(100% - 300rpx); + float: left; + } + + .price_box { + .price { + color: #fff !important; + } + + .original_price { + color: #e4dede !important; + font-weight: 500; + margin-left: 20rpx; + font-size: 26rpx !important; + } + + .sales_number { + display: block; + width: 100%; + color: #fff !important; + font-weight: 500; + padding-left: 10rpx; + margin-left: 0rpx; + font-size: 24rpx !important; + } + + padding: 30rpx 20rpx 30rpx; + background: linear-gradient(to right, #ff2701, #fd8d024d); + // height: 100rpx; + } + + .curriulum_title { + padding: 20rpx 40rpx; + margin-top: 20rpx !important; + } + } + + .normal_box { + padding: 40rpx 30rpx; + } + + .xianshimaiosha_box { + width: 300rpx; + height: 100%; + float: right; + } + + .xianshimaiosha { + display: inline-block; + width: 100%; + line-height: 100rpx; + font-family: PangMenZhengDaoBiaoTiTiMianFeiBan; + font-weight: blod; + font-size: 64rpx; + color: red; + text-align: right; + padding-right: 20rpx; + box-sizing: border-box; + font-style: italic; + } + + // .common_curriculum_list{ + + // } + /deep/.common_curriculum_list { + margin-top: 20rpx; + padding: 20rpx 20rpx 20rpx; + + .content_item { + width: 100% !important; + margin-bottom: 0 !important; + padding: 15rpx 0 0rpx; + border-top: 1rpx solid #f1f0f0; + // height: 160rpx; + + .book_image { + width: 60rpx !important; + height: 60rpx !important; + float: left !important; + background-color: #f5f5f5; + } + + .common_curriculum_item { + width: calc(100% - 88rpx); + float: right; + display: block !important; + + // overflow: hidden; + + .related_courses_name { + width: 100% !important; + } + } + } + + .content_item:nth-child(1) { + border-top: none !important; + } + } + + /deep/.common_section { + padding: 0 !important; + padding-bottom: 20rpx !important; + } + + .goods_detail_list_title { + display: flex; + align-items: center; + justify-content: space-between; + + .left { + display: flex; + align-items: center; + } + + .right { + font-size: 24rpx; + font-weight: 500 !important; + color: #333; + font-family: none; + } + + // justify-content: space-between; + } + + .commonPageContentBox { + height: auto !important; + } + + .goods_item { + overflow: hidden; + display: flex; + align-items: center; + justify-content: space-between; + // margin-bottom: 20rpx; + padding: 10rpx 20rpx; + border: 2rpx solid #fff; + border-radius: 10rpx; + } + + .title { + box-sizing: border-box; + // font-weight: bold; + margin-bottom: 40rpx; + padding-left: 20rpx; + } + + .image_box { + width: 70rpx; + height: 70rpx; + float: left; + background-color: #f5f5f5; + } + + .goods_image { + width: 100%; + height: 100%; + } + + .goods_info { + width: calc(100%); + // padding: 10rpx 20rpx; + box-sizing: border-box; + // height: 100rpx; + display: flex; + align-items: center; + justify-content: space-between; + float: left; + + .name { + font-size: 26rpx; + // font-weight: 600; + color: #333; + } + + .price { + font-size: 26rpx; + color: #aaa; + } + } + + .isSelectGoods { + color: $themeColor !important; + + .name { + color: $themeColor !important; + } + + .price { + color: $themeColor !important; + } + + border: 2rpx solid $themeColor; + border-radius: 10rpx; + } + + /deep/.list_item { + // border-bottom: none; + padding: 10rpx 0 !important; + padding-right: 0 !important; + } + + + .parameterList { + /deep/.list_item { + // border-bottom: none; + padding: 0 !important; + border: none !important; + box-shadow: none !important; + } + + .parameter_box { + padding: 20rpx 0; + } + + .goods_item { + padding-top: 5rpx !important; + padding-bottom: 5rpx !important; + } + } + + .parameter_info_box { + padding: 0 20rpx; + } + + .parameter_info { + /deep/.list_item { + // border-bottom: none; + padding: 0 !important; + border: none !important; + box-shadow: none !important; + } + + .goods_item { + border: none !important; + } + } + + .goodsList { + .image_box { + width: 80rpx; + height: 80rpx; + float: left; + background-color: #f5f5f5; + } + } + + /deep/.u-popup__content { + background-color: transparent !important; + } + + /deep/.u-popup__content__close { + color: #fff !important; + } + + .title_box { + display: flex; + align-items: center; + justify-content: space-between; + padding-left: 0; + + .title_price { + color: #ef1224; + font-size: 40rpx; + font-weight: 700; + } + } + + .title_list { + margin-bottom: 20rpx; + } + + .book_box { + .image_box { + width: 160rpx; + height: 160rpx; + } + + .goods_info { + display: block; + } + } + \ No newline at end of file diff --git a/pages/goods/order/index.vue b/pages/goods/order/index.vue index f2ba75e..6fe6da6 100644 --- a/pages/goods/order/index.vue +++ b/pages/goods/order/index.vue @@ -89,7 +89,7 @@ - + @@ -133,7 +133,7 @@ - {{ v.text }} + + - + 可用积分({{ jfNumberMax }}分) @@ -360,12 +377,14 @@ @click="onHandleClickBuy" @buttonClick="onHandleClickBuy" /> - + + diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index 2730b38..6c8b96a 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -343,10 +343,8 @@ 匿名用户 + + + + 本次考试卷面成绩为:{{exameResult.score}} 分 + + + + - - + + + @@ -32,7 +54,7 @@ - 剩余时间: + 剩余时间:

考试说明

- + ①、每位学员共有两次考试的机会,考试成绩以两次成绩的最高分作为最终的卷面成绩,请认真对待每次考试;
②、请在倒计时结束前完成答题,倒计时结束后将自动交卷。
+ + ①、每位学员共有两次考试的机会,如第一次考试成绩达标则不用进行第二次的考试,请认真对待每次考试;
+ ②、请在倒计时结束前完成答题,倒计时结束后将自动交卷;
+ ③、考试时间为 45 分钟。
+
@@ -125,6 +152,7 @@ showPopup: false, code: 0, // 英文code classId: undefined, + courseId:undefined, testPaper: {}, curQuestion: { answerIds: [] @@ -139,7 +167,7 @@ step: 8, /// 步长 // questIndexList: [], nowPart: 1, - +selfStudyCertificate:[], maxNumber: 0, minNumber: 0, noAnswerList: [], @@ -150,12 +178,12 @@ questionList:[], answerIdsList:[], wantSubmit:false, // 想要提交 - + flag : false, } }, async onLoad(e) { console.log('收到得值',e); - this.classId = e.classId + // this.classId = e.classId this.examId = e.id this.wantSubmit = false this.getTestPage() @@ -180,6 +208,49 @@ }, methods: { ...mapMutations(['setPaperEndTime']), + // 查询证书情况 + 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 + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if (res.code != 0) { + uni.showToast({ + title: res.errMsg, + icon: 'none' + }) + return + } + if (res.code == 0) { + res.certificateList.forEach(item => { + item.certificateUrl && item.certificateUrl != '' ? item + .certificateUrlList = item.certificateUrl.split(',') : item + .certificateUrlList = [] + }) + list = res.certificateList + } + console.log('证书接口请求结果', res); + uni.hideLoading() + }).catch(e => { + uni.hideLoading() + console.log(e, '数据报错') + // this.status = 3 + uni.showToast({ + title: e.errMsg, + icon: 'none' + }) + }); + return list + }, async getServerTime() { var time = 0 await $http.request({ @@ -278,16 +349,22 @@ timeup() { this.isOvertime = true this.sumbitPaper() - let that = this + let that = this + var urll = '' + if(that.testPaper.type == '1'){ + urll = `/pages/miniClass/classInfo?id=${that.classId}` + }else if(that.testPaper.type == '2'){ + urll = `/pages/course/courseDetail?id=${that.courseId}` + } uni.showModal({ title: '提示', - content: "考试结束,系统已为您自动交卷,点击按钮返回所在班级", + content: "考试结束,系统已为您自动交卷,点击按钮返回", confirmText: '知道了', showCancel: false, success: (res) => { if (res.confirm) { uni.navigateTo({ - url: `/pages/miniClass/classInfo?id=${that.classId}` + url: urll }) } } @@ -324,49 +401,60 @@ },300) }, // q请求提交试卷 - sumbitPaper(ids) { + async sumbitPaper(ids) { + let that = this + if(that.flag){ + return + } + that.flag = true uni.showLoading({ title:'正在交卷' - }) - let that = this - $http.request({ + }) + await $http.request({ url: "common/classExam/submitExamPaper", method: "POST", data: { id: that.examId }, - header: { //默认 无 说明:请求头 + header: { //默认 无 说明:请求头1 'Content-Type': 'application/json' }, }) - .then(res => { + .then(async res => { uni.hideLoading() + if (res.code == 0) { console.log('交卷结果',res); uni.showToast({ title: '交卷成功', icon: 'success' }) - setTimeout( ()=>{ + setTimeout(async ()=>{ that.exameResult = res.examPaper // this.timeup() that.showQuestIndex = false that.secondTimeDif = 0 - that.isOvertime = true - uni.setStorage({ - key:'paperEndTime', - data:{ - time: 0, - examId: undefined - }, - success: function () { - console.log('时间存储成功'); + that.isOvertime = true + if(that.testPaper.type == '2' && that.exameResult.score >= 60) { + // if(that.exameResult.score >= 60){ + var newCertificate = await that.getCertificateInfo() + console.log('5555555证书资料', newCertificate); + that.selfStudyCertificate = [] + if (newCertificate && newCertificate.length > 0) { + newCertificate.forEach(item => { + if (item.classId != '' && item.classId > 0) { + // this.classCertificate.push(item) + } else { + that.selfStudyCertificate.push(item) + } + }) } - }) - + // } + } },300) }else{ + that.flag = false uni.showToast({ title: e.errMsg, icon: 'error' @@ -374,6 +462,7 @@ } }).catch(e => { + that.flag = true uni.hideLoading() console.log(e, '数据报错') // this.status = 3 @@ -493,6 +582,11 @@ this.haveAnswerList = this.gethaveAnswerList() // console.log('this.answerIdsList', this.answerIdsList); this.testPaper = res.examPaper + if(this.testPaper.type == '1'){ // 班级考试 + this.classId = this.testPaper.relationId + }else if(this.testPaper.type == '2'){ + this.courseId = this.testPaper.relationId + } // var planEndTimeDate = new Date(res.planEndTime) // this.endTime = planEndTimeDate.getTime(); this.endTime = res.planEndTime @@ -569,6 +663,12 @@ url: `/pages/miniClass/classInfo?id=${this.classId}` }) }, + goToCourse(){ + uni.navigateTo({ + // url: `/pages/miniClass/classInfo?id=${this.classId}` + url: `/pages/course/courseDetail?id=${this.courseId}` + }) + }, hidePopup() { this.showPopup = false this.showQuestIndex = false @@ -602,7 +702,17 @@ \ No newline at end of file diff --git a/pages/user/login.vue b/pages/user/login.vue index 53bc0d1..58b2ab8 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -267,12 +267,13 @@ }); this.getOS() // #endif + this.getCountyCode() + this.getSettlement() }, //页面显示 onShow() { // this.closeMusic() - this.getCountyCode() - this.getSettlement() + }, //方法 diff --git a/static/icon/fugou.png b/static/icon/fugou.png new file mode 100644 index 0000000..add72f0 Binary files /dev/null and b/static/icon/fugou.png differ diff --git a/static/icon/notbuy.png b/static/icon/notbuy.png new file mode 100644 index 0000000..e49fd25 Binary files /dev/null and b/static/icon/notbuy.png differ diff --git a/static/icon/xunzhang.png b/static/icon/xunzhang.png new file mode 100644 index 0000000..c11c5b7 Binary files /dev/null and b/static/icon/xunzhang.png differ diff --git a/static/icon/yesbuy.png b/static/icon/yesbuy.png new file mode 100644 index 0000000..313b4c9 Binary files /dev/null and b/static/icon/yesbuy.png differ