From 6cb6d8ee06c886dc2a8079709a169c03652237ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B1=AA?= <781521347@qq.com> Date: Thu, 16 Dec 2021 10:52:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/knowledge.js | 11 +++- api/user.js | 2 +- pages.json | 3 +- pages/Loading/index.vue | 10 ++-- pages/course/detail.vue | 49 ++++++++-------- pages/home/index.vue | 33 +++++------ pages/knowledge/detail.vue | 2 +- pages/shop/GoodsClass/index.vue | 8 +-- pages/study/dabang.vue | 74 +++++++++++++++++------- pages/study/editDabang.vue | 96 ++++++++++++++++++++++---------- pages/user/User/index.vue | 67 +++------------------- pages/user/myCourses/index.vue | 2 +- static/loading.gif | Bin 0 -> 3897 bytes store/index.js | 5 +- utils/index.js | 5 +- utils/request.js | 2 +- 16 files changed, 204 insertions(+), 165 deletions(-) create mode 100644 static/loading.gif diff --git a/api/knowledge.js b/api/knowledge.js index 040f275..d22c493 100644 --- a/api/knowledge.js +++ b/api/knowledge.js @@ -62,7 +62,7 @@ export function enterStudyList(data) { * 获取榜单打榜进度 */ export function myProgress(data) { - return request.get("/StudyList/myProgress?studyListId="+data); + return request.get("/StudyList/myProgress",data); } /** @@ -72,6 +72,13 @@ export function studyListPublish(data) { return request.post("/StudyList/studyListPublish",data); } +/** + * 补卡打榜分享 + */ +export function studyListRepublish(data) { + return request.post("/StudyList/studyListRepublish",data); +} + /** * 发布打榜点赞 */ @@ -104,7 +111,7 @@ export function getCourseDetail(data) { * 报名 */ export function enterCourse(data) { - return request.post("/user/enterCourse",data); + return request.post("/lession/enterCourse",data); } /** diff --git a/api/user.js b/api/user.js index 885a438..1d48d61 100644 --- a/api/user.js +++ b/api/user.js @@ -439,7 +439,7 @@ export function getRechargeApi() { * 获取我的课程列表 * */ export function getMyCourseList(q) { - return request.get('/Course/listCoursesByMemberId?type='+q) + return request.get('/lession/myLessionList?type='+q) } /* diff --git a/pages.json b/pages.json index bda8b40..3f73251 100644 --- a/pages.json +++ b/pages.json @@ -164,7 +164,8 @@ { "path": "pages/user/User/index", "style": { - "navigationBarTitleText": "我的" + "navigationBarTitleText": "我的", + "enablePullDownRefresh": true } }, diff --git a/pages/Loading/index.vue b/pages/Loading/index.vue index 3ab16d8..c5d46fd 100644 --- a/pages/Loading/index.vue +++ b/pages/Loading/index.vue @@ -1,7 +1,7 @@ @@ -23,13 +23,12 @@ export default { return {} }, onShow() { - console.log('getUser',this.userInfo) var url = handleQrCode() if (!url) { url = handleUrlParam(getCurrentPageUrlWithArgs()) } - console.log(url) - console.log('判断是否是分销') + // console.log(url) + // console.log('判断是否是分销') // 判断是否是分销 if (url) { let urlSpread = parseInt(url.spread) @@ -109,7 +108,8 @@ export default { } #lottie { - width: 35%; + width: 42rpx; + height: 42rpx; display: block; overflow: hidden; transform: translate3d(0, 0, 0); diff --git a/pages/course/detail.vue b/pages/course/detail.vue index 03c9499..fd4ef20 100644 --- a/pages/course/detail.vue +++ b/pages/course/detail.vue @@ -50,7 +50,7 @@ 课程简介 - + @@ -131,7 +131,6 @@ 座位号:{{detail.seat}} - 距离截止时间还剩 @@ -140,9 +139,6 @@ - @@ -335,20 +331,23 @@ test(){ let yhStatus = 0; let detail = this.detail; + let enterEndTime = detail.enterEndTime.replace(/-/g, '/') + let enterStartTime = detail.enterStartTime.replace(/-/g, '/') + let courseEndTime = detail.courseEndTime.replace(/-/g, '/') if ( !detail.enterState ){ yhStatus = 0; - if( new Date(detail.enterEndTime) >= new Date() && new Date(detail.enterStartTime) <= new Date() ){ + if( new Date(enterEndTime) >= new Date() && new Date(enterStartTime) <= new Date() ){ yhStatus = 1; // 可报名 - }else if(new Date(detail.enterEndTime) < new Date()){ + }else if(new Date(enterEndTime) < new Date()){ yhStatus = 2; // 超过报名时间 - }else if(new Date(detail.enterStartTime) > new Date()){ + }else if(new Date(enterStartTime) > new Date()){ yhStatus = 3; // 报名时间没开始 } }else{ // 是否已经超过课程时间 if (detail.status == 1 && detail.courseType == 1){ - if( new Date(detail.courseEndTime) >= new Date() ){ + if( new Date(courseEndTime) >= new Date() ){ yhStatus = 4; // 直播中 }else{ yhStatus = 5; //查看回放 @@ -360,12 +359,13 @@ yhStatus = 7; //已签到 } }else { - if ( detail.status == 0 ){ + if (detail.status == 0 ){ yhStatus = 8; // 报名没有被确认 } } } this.yhStatus = yhStatus; + // console.log(this.yhStatus) }, getDetail(){ uni.showLoading({ @@ -374,18 +374,19 @@ let nowTime = Date.parse(new Date())/1000; getCourseDetail({id:this.courseId}).then((res)=>{ uni.hideLoading() - //res.data.courseIntroduce = res.data.courseIntroduce.replace(/\{ + this.test(); }) }, @@ -423,7 +424,7 @@ }) } else if(type == 1){ //已报名等待确认 联系服务老师 uni.makePhoneCall({ - phoneNumber: this.userInfo.sellerPhone + phoneNumber: this.userInfo.seller.phone }); } else{ this.sign() @@ -432,10 +433,6 @@ }, sign(){ - if(!this.userInfo.spreadUid){ - this.maskDialog = true - return - } enterCourse({ lessionId: this.courseId }).then((res)=>{ @@ -449,11 +446,14 @@ },1500) } else if(res.data.state == 2){ this.payment(res.data.payData) + } else if(res.data.status == 4045){ + this.maskDialog = true + return } else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 + uni.showModal({ + title: '提示!', + content: res.msg, + showCancel:false }); } }) @@ -1036,8 +1036,9 @@ background: #F99C10; } .call-btn{ - width: 268rpx; + min-width: 230rpx; height: 80rpx; + padding: 0 20rpx; background: #F99C10; border-radius: 44rpx; text-align: center; diff --git a/pages/home/index.vue b/pages/home/index.vue index b467548..a88c3a7 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -1,16 +1,16 @@ @@ -112,15 +112,31 @@ finishTimes: 0, progress: 0, rank: 0, - studyListRecordDtos:[], memberIntegralRankVos:[], - } + }, + studyListRecordDtos:[], + page: 0, + pagesize: 10, + isLoad: true, + loadingStatus: '没有更多了...' } }, onLoad() { this.studyId = this.$yroute.query.id; this.getProgress(); }, + onReachBottom(){ + this.page = this.page + 1 + this.getProgress() + console.log('上拉加载') + }, + + onPullDownRefresh() { + this.studyListRecordDtos = [] + this.page = 0; + this.isLoad = true; + this.getProgress(); + }, methods:{ previewImage(imgArr,idx) { //预览图片 @@ -130,18 +146,34 @@ }); }, getProgress(){ - uni.showLoading({ - title: "正在加载中..." - }) - myProgress(this.studyId).then((res)=>{ - if(res.success){ - res.data.studyListDto.listStartTime = res.data.studyListDto.listStartTime.split(" ")[0]; - res.data.studyListDto.listEndTime = res.data.studyListDto.listEndTime.split(" ")[0] - this.detail = res.data; - uni.hideLoading() - uni.stopPullDownRefresh(); + if(this.isLoad){ + uni.showLoading({ + title: "正在加载中..." + }) + this.loadingStatus = '加载中...' + const data = { + page: this.page, + size: this.pagesize, + studyListId: this.studyId } - }) + myProgress(data).then((res)=>{ + if(res.success){ + res.data.studyListDto.listStartTime = res.data.studyListDto.listStartTime.split(" ")[0]; + res.data.studyListDto.listEndTime = res.data.studyListDto.listEndTime.split(" ")[0]; + this.detail = res.data; + this.studyListRecordDtos = this.studyListRecordDtos.concat(res.data.studyListRecordDtos.content) + uni.hideLoading() + uni.stopPullDownRefresh(); + if(this.pagesize <= res.data.studyListRecordDtos.content.length){ + this.isLoad = true; + this.loadingStatus = '上拉加载更多...' + } else{ + this.isLoad = false; + this.loadingStatus = '没有更多了...' + } + } + }) + } }, voteClick(item){ let id = item.id, @@ -188,14 +220,16 @@ } }) }, - onPullDownRefresh() { - this.getProgress(); - } } }