From d10fe077f00ee7971e0fceedce9cc089a98ba77c Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Thu, 1 Aug 2024 11:55:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/bookShop/settlement.vue | 2 +- pages/course/courseSet.vue | 2 +- pages/goods/order/index.vue | 4 +- pages/miniClass/classInfo.vue | 285 +++++++++++++++++++--------- pages/miniClass/courseClassList.vue | 35 +++- 5 files changed, 229 insertions(+), 99 deletions(-) diff --git a/pages/bookShop/settlement.vue b/pages/bookShop/settlement.vue index 92f0063..844664c 100644 --- a/pages/bookShop/settlement.vue +++ b/pages/bookShop/settlement.vue @@ -95,7 +95,7 @@ - + {{item.title}} - + diff --git a/pages/goods/order/index.vue b/pages/goods/order/index.vue index 935749f..684d5bf 100644 --- a/pages/goods/order/index.vue +++ b/pages/goods/order/index.vue @@ -96,7 +96,7 @@ @@ -140,7 +140,7 @@ diff --git a/pages/miniClass/classInfo.vue b/pages/miniClass/classInfo.vue index aab3ef6..b9a57eb 100644 --- a/pages/miniClass/classInfo.vue +++ b/pages/miniClass/classInfo.vue @@ -5,22 +5,131 @@ -

{{thisClass.title}}

- 开班 - 结班 +

{{thisClass.title}}

+ 开班 + 结班 退出班级
创建日期{{thisClass.createTime.substring(0,10)}} + class="mainTxt">{{thisClass.createTime.substring(0,10)}} + 班级类型 普通小班 联合班 精英班 班级人数{{thisClass.number}}人 + 管理成员点击查看
+ + + 教学目标/班级简介 + + + + + + + + + + + + + + + + + + + {{item.title}} + + + + + + + + + + + + 班内问答 + + + + + + + + + + + + + {{item.nickname}} + + + + + 匿名用户 + + 超级VIP用户 + 医学VIP用户 + 国学VIP用户 + + + + + + + + + + + + {{item.name}} + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +

班内管理人员

班长: @@ -63,81 +172,7 @@ 暂未设置 - - 教学目标/班级简介 - - - - - - - - - - - - - - - - - - {{item.title}} - - - - - - - - - - - - 班内问答 - - - - - - - - - - - - - {{item.nickname}} - - - 匿名用户 - - 超级VIP用户 - 医学VIP用户 - 国学VIP用户 - - - - - - - - - - - 班内提交 - - -
- - - +
@@ -195,25 +230,36 @@ isMonitor:false, // 是管理者 isDirector:false, // 是主任 isHave:false, + showMan:false, + tijiaoTitleList:[ + {name:'班内任务', id:'0'}, + {name:'医案', id:'1'}, + {name:'心得', id:'2'}, + ], + tijiaoTitleId:'0' } }, onLoad(e) { + uni.hideTabBar(); this.classId = e.id this.getUserInfo() - this.getClassInfo() - if(e.have == 'isNotHave'){ - this.isHave = false // 未加入 - }else if(e.have == 'have'){ - this.isHave = true // 已加入 - } + + // if(e.have == 'isNotHave'){ + // this.isHave = false // 未加入 + // }else if(e.have == 'have'){ + // this.isHave = true // 已加入 + // } }, onShow() { - + this.getClassInfo() }, computed: { ...mapState(["userInfo"]), }, methods: { + titleClick(item){ + this.tijiaoTitleId = item.id + }, getUserInfo() { // 获取个人信息 if (this.userInfo.id != undefined) { @@ -239,6 +285,39 @@ console.log('e', e); this.tabId = e.id }, + formatRichText(html) { + if(html == ''){ + return + } + //控制图片大小 + let newContent = html.replace(/]*>/gi, function (match, capture) { + match = match + .replace(/style="[^"]+"/gi, "") + .replace(/style='[^']+'/gi, ""); + match = match + .replace(/width="[^"]+"/gi, "") + .replace(/width='[^']+'/gi, ""); + match = match + .replace(/height="[^"]+"/gi, "") + .replace(/height='[^']+'/gi, ""); + return match; + }); + newContent = newContent.replace( + /style="[^"]+"/gi, + function (match, capture) { + match = match + .replace(/width:[^;]+;/gi, "max-width:100%;") + .replace(/width:[^;]+;/gi, "max-width:100%;"); + return match; + } + ); + newContent = newContent.replace(/]*\/>/gi, ""); + newContent = newContent.replace( + /\ { if (res.code == 0) { - this.isHave = true + that.isHave = true uni.showToast({ title: `退出成功!`, icon: 'success' }) setTimeout(()=>{ - + uni.navigateTo({ + url:'/pages/miniClass/myClassList' + }) },200) } }).catch(e => { @@ -314,6 +403,10 @@ } } }); + }, + // 踢出班级 + removeStudent(item){ + }, getClassInfo() { uni.showLoading({ @@ -332,6 +425,7 @@ .then(res => { this.refresh = false if (res.code == 0) { + this.isHave = res.result.isJoin this.thisClass = res.result.class this.admins.list = res.result.admins this.admins.monitor = {} @@ -387,8 +481,9 @@ @import "@/style/mixin.scss"; .flexbox{display: flex;} + .nobg{background-color: transparent !important; } .bottomBox{position: fixed; padding: 20rpx 0; text-align: center; bottom: 100rpx; left: 0; z-index: 2; width: 100%; background-color: #fff; - button{width: 80%; } + button{width: 80%; margin: 0 auto; border-radius: 40rpx; } } .mainContent { color: #333; @@ -472,7 +567,8 @@ } .otherItems { // border: 1px solid #dadada; - padding: 20rpx; background-color: rgba(255, 255, 255, .5); + padding: 20rpx; + // background-color: rgba(255, 255, 255, .5); border-radius: 20rpx; justify-content: space-between; margin: 20rpx 0; @@ -486,8 +582,13 @@ margin-bottom: 10rpx; } } - + .tijiaoTitle{ justify-content: space-between; + text{display: block; width: 30%; padding: 8rpx 0; border-radius: 10rpx; text-align: center; border: 1px solid $themeColor; color:$themeColor;} + text.active{background-color: $themeColor; color: #fff;} + } .guanli { + padding: 40rpx; + h3{text-align: center; margin-bottom: 20rpx; color: #333;} .item { color: #333; margin-bottom: 20rpx; diff --git a/pages/miniClass/courseClassList.vue b/pages/miniClass/courseClassList.vue index d81f2b9..6540b83 100644 --- a/pages/miniClass/courseClassList.vue +++ b/pages/miniClass/courseClassList.vue @@ -35,7 +35,7 @@ - 一键加入 + 一键加入 查看班内情况
@@ -162,8 +162,37 @@ //方法 methods: { // 加入班级 - enterClass(){ - + // 加入班级 + addClass(classId){ + $http.request({ + url: "common/class/joinClass", + method: "POST", + data: { + "classId": this.classId , + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }) + .then(res => { + if (res.code == 0) { + this.isHave = true + uni.showToast({ + title: `加入成功!`, + icon: 'success' + }) + setTimeout(()=>{ + this.getClassInfo() + },200) + } + }).catch(e => { + console.log(e, '数据报错') + // this.status = 3 + uni.showToast({ + title: `加入失败`, + icon: 'error' + }) + }); }, selectChange(e){ console.log("e:", e);