diff --git a/pages.json b/pages.json index bf82692..0074535 100644 --- a/pages.json +++ b/pages.json @@ -581,7 +581,21 @@ "path" : "pages/miniClass/classList", "style" : { - "navigationBarTitleText" : "班级列表" + "navigationBarTitleText" : "主任班级列表" + } + }, + { + "path" : "pages/miniClass/courseClassList", + "style" : + { + "navigationBarTitleText" : "课程下可加入班级列表" + } + }, + { + "path" : "pages/miniClass/myClassList", + "style" : + { + "navigationBarTitleText" : "用户的班级列表" } } ], diff --git a/pages/course/courseDetail.vue b/pages/course/courseDetail.vue index d1bec56..820e29a 100644 --- a/pages/course/courseDetail.vue +++ b/pages/course/courseDetail.vue @@ -70,16 +70,16 @@ - + - 50 + {{linkClassList.length}} 个班级正在学习本门课程 - 前往查看 >> + 前往查看 >> @@ -462,24 +462,7 @@ fatherIndex: null, supportFlag: false, selectGoodsData: {}, - buyOptions: [ - // { - // icon: 'chat', - // text: '客服' - // }, - // { - // icon: 'shop', - // text: '店铺', - // // info: 2, - // infoBackgroundColor: '#007aff', - // infoColor: "#f5f5f5" - // }, - // { - // icon: 'cart', - // text: '购物车', - // info: 2 - // } - ], + buyOptions: [], customButtonGroup1: [{ with: 200, text: "立即购买", @@ -493,6 +476,7 @@ }, isAndorid: true, oprateOsName:'', + linkClassList:[], // 关联班级数组 }; }, //第一次加载 @@ -504,7 +488,7 @@ console.log(e, "传入分类id"); this.getUserInfo(); this.courseId = e.id; - // this.getCateList(this.courseId) + this.getLinkClassList() // await this.getData(e.id); this.getSayList(); this.getOS() @@ -564,6 +548,35 @@ }, //方法 methods: { + // 获得课程关联的班级 + getLinkClassList(){ + this.$http + .request({ + url: 'common/class/getClassByCourseIdNoUser', + method: "POST", + data: { + "courseId": this.courseId, + "state": '0', //小班状态0待开班1已开班2完成 + "type": '0' + }, + header: { + //默认 无 说明:请求头 + "Content-Type": "application/json", + }, + }) + .then(async (res) => { + if (res.code == 0 && res.result.length > 0) { + this.linkClassList = res.result + }else{ + this.linkClassList = [] + } + }).catch(e => { + uni.showToast({ + title:'获取班级列表错误', + icon:'none' + }) + }) + }, // 获得操作系统 getOS() { let oprateOs = ""; @@ -1164,7 +1177,9 @@ this.courseList = []; // console.log("at line 1167:", "调用了几次"); var that = this; - + uni.showLoading({ + title:'正在加载' + }) await $http .request({ url: "sociology/course/getCourseDetail", @@ -1250,8 +1265,10 @@ // console.log("list at line 1233:", list); } } + uni.hideLoading() }) .catch((e) => { + uni.hideLoading() console.log(e, "获取目录数据报错"); }); }, diff --git a/pages/course/myCourse.vue b/pages/course/myCourse.vue index c4d3714..22d9b71 100644 --- a/pages/course/myCourse.vue +++ b/pages/course/myCourse.vue @@ -217,8 +217,8 @@ flag: false }, oldValue : '', - cartList:[] - + cartList:[], + addLearnFlag:false, }; }, //第一次加载 @@ -640,6 +640,14 @@ // } }, addCollection(val,index){ + if(this.addLearnFlag){ + uni.showToast({ + title:'请勿频繁操作哦', + icon:'none' + }) + return + } + this.addLearnFlag = true $http.request({ url: "medical/course/addUserCourseStudying", method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 @@ -652,6 +660,7 @@ }, }) .then(res => { + this.addLearnFlag = false if(res.code == 0){ uni.showToast({ title:'加入成功', @@ -665,7 +674,8 @@ } }) - .catch(e => { + .catch(e => { + this.addLearnFlag = false console.log('加入在学习', e) uni.showToast({ title:'加入失败', diff --git a/pages/mine/mine/index.vue b/pages/mine/mine/index.vue index 03dbc06..5605eb6 100644 --- a/pages/mine/mine/index.vue +++ b/pages/mine/mine/index.vue @@ -1,102 +1,65 @@ + .mine_box { + width: 100%; + position: absolute; + // top: 90rpx; + left: 0; + padding: 0 0rpx; + } + + .list_box { + // background: #d8f8e4 !important; + padding: 20rpx 0; + margin-top: -10rpx; + } + + .pay_item_img { + display: flex; + color: #333; + // color: #dac4b7; + align-items: center; + // width: 80rpx; + // height: 80rpx; + padding: 8rpx; + box-sizing: border-box; + font-weight: bold; + // float: left; + // margin-right: 20rpx; + margin: 0 auto; + margin-bottom: 10rpx; + //margin-top:-10rpx; + } + + .popup_box { + padding-bottom: 20rpx; + width: 88vw; + overflow: hidden; + position: relative; + height: auto; + + .title { + font-family: PangMenZhengDaoBiaoTiTiMianFeiBan; + font-weight: normal; + font-size: 46rpx; + color: $themeColor; + background-color: #f5f5f5; + // line-height: 46rpx; + padding: 20rpx; + // border-leradius: 6px; + border-top-left-radius: 6px; + border-top-right-radius: 6px; + } + + .content { + font-size: 26rpx; + letter-spacing: 0.15rpx; + padding: 20rpx; + color: #3f3f3f; + + .top { + margin: 30rpx 0; + } + + .center { + line-height: 40rpx; + // padding:0 10rpx; + } + + .bottom { + width: 100%; + margin-top: 60rpx; + + font-size: 24rpx; + line-height: 26rpx; + color: #b0b0b0; + } + } + + .button_box { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 20rpx; + + .u-button { + margin-left: 40rpx; + } + + .u-button:nth-child(1) { + margin-left: 0; + } + } + } + + .user_vip_box { + min-width: 130rpx; + + position: absolute; + bottom: -20rpx; + display: flex; + align-items: center; + justify-content: center; + } + + .user_vip { + z-index: 1; + color: #fff; + font-size: 24rpx; + width: auto; + padding: 4rpx 10rpx; + font-weight: 800; + border-radius: 20rpx; + background: linear-gradient(60deg, #8265f9 30%, #016dea 100%); + } + + .super { + background: linear-gradient(to right, #5bc9c1 0%, #258feb 100%); + color: #f4f2e4; + } + \ No newline at end of file diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index 7babfd7..aab3ef6 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -1,32 +1,546 @@ - + .flexbox{display: flex;} + .bottomBox{position: fixed; padding: 20rpx 0; text-align: center; bottom: 100rpx; left: 0; z-index: 2; width: 100%; background-color: #fff; + button{width: 80%; } + } + .mainContent { + color: #333; + padding: 0 20rpx; padding-bottom: 20rpx; + background-image: linear-gradient(30deg, #d4eaf0 0%, #d4eaf0 50%, #fdf0ed 100%); + min-height: 100vh; + } + .classMateBox{ + .zmVip{background-image: linear-gradient(-60deg, #53966a 0%, #e1feef 50%, #e1feef 100%);} + .wumenVip{background-image: linear-gradient(-60deg, #578df0 0%, #f1f4fd 50%, #f1f4fd 100%);} + .superVip{background-image: linear-gradient(-60deg, #965af0 0%, #fdf0ed 50%, #fdf0ed 100%);} + .item{width: 100%; position: relative; + .textItems{width: 100%; align-items: center; + .txt555{font-size: 28rpx; color: #333; } + .userType{position: absolute; right: 30rpx; top: 30rpx; color: #fff;} + } + } + } + .classmateImg{width:80rpx; margin-right: 40rpx; height: 80rpx; border-radius: 100rpx; + image{ + width:80rpx; height: 80rpx; + } + } + .mainBox{ + margin-top: 40rpx; + .tabList{border-radius: 20rpx; overflow: hidden; margin-bottom: 20rpx;} + // background-color: #f4f7ff; + } + .newBox { + + .item { + margin-bottom: 20rpx; + background-color: #fff; + border-radius: 20rpx; + @include ptop_bottm(10px); + @include pleft_right(10px); + + @include mshadow(10px, 1) + .imgcontainer { + display: block; + width: 80rpx; + margin-right: 20rpx; + // background-size: cover; + // background-position: center; + height: 120rpx; + flex-grow: 1; + // @include ptop_bottm(10px); + overflow: hidden; + // @include pleft_right(10px); + image { + width: 100%; + height: 120rpx; + } + } + .btn_box{ text-align: right; + text{ + border-radius: 20rpx; + padding: 3px 5px; @include theme("btn_bg"); + font-size: 28rpx; color: #fff; + } + } + .buyItems { + width: 60%; + } + + .jianjie { + line-height: 30rpx; height: 60rpx; overflow: hidden; + overflow: hidden!important; + margin-top: 10rpx; + font-size: 24rpx; + @include bov(); + color: #9c9c9c; + } + + .txt555 { + font-size: 30rpx; + color: #000; + @include bov() + } + } + } + .otherItems { + // border: 1px solid #dadada; + padding: 20rpx; background-color: rgba(255, 255, 255, .5); + border-radius: 20rpx; + justify-content: space-between; + margin: 20rpx 0; + text { + display: block; + font-size: 28rpx; + } + + .ciyao { + color: #999; + margin-bottom: 10rpx; + } + } + + .guanli { + .item { color: #333; + margin-bottom: 20rpx; + + .personbox { + display: inline-block; color: #666; + } + + } + + .arryItem { + .arryItemSub { + display: inline-block; color: #666; + // padding-left: 80rpx; + } + } + + text { + font-size: 30rpx; + } + } + .adminName {color: #333; + font-size: 30rpx; + font-weight: bold; + } + .banjiJianjie{ color: #666; font-size: 30rpx; margin-top: 20rpx;} + .className { + padding: 30rpx 0; + position: relative; + + h3 { + font-size: 36rpx; + } + + text { + color: #fff; + display: inline-block; + padding: 10rpx 20rpx; + border-radius: 10rpx; + position: absolute; + right: 0; + top: 20rpx; + z-index: 1; + } + + text.kaiban { + background-color: #67c23a; + } + + text.jieban { + background-color: $themeColor + } + text.tuichu { + background-color: #f4a2a6; + } + } + \ No newline at end of file diff --git a/pages/miniClass/classList.vue b/pages/miniClass/classList.vue index b4cf57f..49186ab 100644 --- a/pages/miniClass/classList.vue +++ b/pages/miniClass/classList.vue @@ -172,21 +172,7 @@ }, surl(imageurl) { return `url(${imageurl})` - }, - goCreateClass(){ - console.log('this.addType',this.addType); - if(this.addType != undefined){ - uni.navigateTo({ - url:`/pages/miniClass/addClass?type=${this.addType}&name=add` - }) - }else{ - uni.showToast({ - title:'请选择班级的类型', - icon:'none' - }) - return - } - }, + }, fatherClick(e) { console.log('点击', e) this.page = 1 @@ -201,12 +187,7 @@ this.page = 1 this.getData(this.subTabId); }, - getData(id) { - // if (!this.flag) { - // console.log('正在执行,未完成') - // return - // } - + getData(id) { this.status = 1 this.flag = false uni.showLoading({ @@ -218,6 +199,7 @@ data: { "state": this.subTabId, //小班状态0待开班1已开班2完成 "type": this.curTagId // 班类型 0小班 1联合班 2精英班 + }, header: { //默认 无 说明:请求头 'Content-Type': 'application/json' diff --git a/pages/miniClass/courseClassList.vue b/pages/miniClass/courseClassList.vue new file mode 100644 index 0000000..d81f2b9 --- /dev/null +++ b/pages/miniClass/courseClassList.vue @@ -0,0 +1,420 @@ + + + + \ No newline at end of file diff --git a/pages/miniClass/miniClassMan.vue b/pages/miniClass/miniClassMan.vue index c0cce7c..3749757 100644 --- a/pages/miniClass/miniClassMan.vue +++ b/pages/miniClass/miniClassMan.vue @@ -26,8 +26,8 @@ @click="curseClick(item)" :key="index">{{item.title}} - - + + @@ -45,15 +45,16 @@ - 一键加入 - 查看班内情况 + + 进入班级 - + + + + @@ -128,7 +129,7 @@ tabList: [ {name:'普通小班', id:'0'},{name:'联合班', id:'1'},{name:'精英班',id:'2'}], curTagId: 0, - courseList: [], + classList: [], status: 3, // 0 不显示, 1 加载中,2 加载全部完成,3 暂无数据 page: 1, flag: true, // 函数是否执行完 @@ -161,7 +162,7 @@ console.log('下拉刷新') // this.status = 3 // this.page = 1 - this.courseList = [] + this.classList = [] this.getData() uni.stopPullDownRefresh() }, @@ -222,7 +223,7 @@ }, curseClick(item) { this.subTabId = item.id - this.courseList = [] + this.classList = [] this.page = 1 this.getData(this.subTabId); }, @@ -251,16 +252,16 @@ .then(res => { if (res.code == 0) { if (res.classEntityList.length > 0) { - this.courseList = res.classEntityList + this.classList = res.classEntityList // var list = res.classEntityList - // this.courseList = this.courseList.concat(list) + // this.classList = this.classList.concat(list) // if (res.courses.pages > this.page) { // this.status = 0 // } else { // this.status = 2 // } }else{ - this.courseList = [] + this.classList = [] } // else if (this.page > 1) { // this.status = 2 // 加载完成 diff --git a/pages/miniClass/myClassList.vue b/pages/miniClass/myClassList.vue new file mode 100644 index 0000000..c23cbd6 --- /dev/null +++ b/pages/miniClass/myClassList.vue @@ -0,0 +1,439 @@ + + + + \ No newline at end of file diff --git a/pages/user/login.vue b/pages/user/login.vue index 2225291..8348111 100644 --- a/pages/user/login.vue +++ b/pages/user/login.vue @@ -614,10 +614,11 @@ }); }, 1000); }).catch(e => { - uni.showToast({ - title:'登陆失败', - icon:'none' - }) + console.log('zouzhelima'); + // uni.showToast({ + // title:e.msg, + // icon:'none' + // }) this.submitClickNum += 1 }); }