This commit is contained in:
@fawn-nine
2024-08-01 11:55:51 +08:00
parent 634a0848b9
commit d10fe077f0
5 changed files with 229 additions and 99 deletions

View File

@@ -35,7 +35,7 @@
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="btn_box" >
<text @click="enterClass" v-show="item.state == '0'">一键加入</text>
<text v-show="item.state == '0'" @click="addClass(item.id)">一键加入</text>
<text class="seeInfo" @click="onPageJump('/pages/miniClass/classInfo',item.id,'isNotHave')">查看班内情况</text>
</view>
</view>
@@ -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);