This commit is contained in:
@fawn-nine
2024-07-31 16:43:52 +08:00
parent 4b61167932
commit 634a0848b9
10 changed files with 2343 additions and 957 deletions

View File

@@ -70,16 +70,16 @@
</view>
</view>
<!-- 小班入口 -->
<view class="classEntrance">
<view class="classEntrance" v-if="linkClassList.length > 0">
<view class="flex_box" style="justify-content: space-between;">
<view class="flex_box classTitleBox">
<image src="../../static/icon/class.png" mode="" style="width: 64rpx; height: 64rpx;"></image>
<text class="mainTxt">
<span style="font-weight: bold; padding: 0 16rpx;">50</span>
<span style="font-weight: bold; padding: 0 16rpx;">{{linkClassList.length}}</span>
个班级正在学习本门课程</text>
</view>
<view class="btntext">
<text @click="goClassLIst('/pages/miniClass/classList', course.id,course.title)">前往查看 >></text>
<text @click="goClassLIst('/pages/miniClass/courseClassList', course.id,course.title)">前往查看 >></text>
</view>
</view>
</view>
@@ -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, "获取目录数据报错");
});
},