Commit 036fc508 authored by zhengke's avatar zhengke

修改

parent ba23f732
<style scoped>
.studyCourse {
/* width: 100%; */
/* height: 100vh; */
min-height: 100vh;
background: #F5F5F5;
padding: 32rpx;
box-sizing: border-box;
......@@ -34,7 +34,7 @@
.Course_List {
width: 100%;
height: auto;
border-bottom:1px solid #F5F5F5;
border-bottom: 1px solid #F5F5F5;
}
.CourseList_One {
......@@ -42,7 +42,7 @@
display: flex;
align-items: center;
background-color: #FFFFFF;
padding:0 30rpx;
padding: 0 30rpx;
}
.Course_Name {
......@@ -61,95 +61,103 @@
font-size: 22rpx;
margin-top: 28rpx;
}
.Course_SeName{
width:50%;
margin:0 20rpx;
.Course_SeName {
width: 50%;
margin: 0 20rpx;
}
.Course_Two{
.Course_Two {
background-color: #EBEBEB;
height:200rpx;
width:100%;
height: 200rpx;
width: 100%;
display: flex;
align-items: center;
}
.Course_Two>view{
flex:0 0 33.3%;
.Course_Two>view {
flex: 0 0 33.3%;
text-align: center;
}
.Course_Two img{
width:90rpx;
height:90rpx;
.Course_Two img {
width: 90rpx;
height: 90rpx;
}
.Course_Opera{
.Course_Opera {
color: #666666;
font-size:22rpx;
font-size: 22rpx;
text-align: center;
margin-top:5rpx;
margin-top: 5rpx;
}
.loading {
position: fixed;
z-index: 9999;
left:0;
top:0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
</style>
<template>
<view class="studyCourse">
<view class="Course_Top">
<view class="CourseBan">{{CourseName}}</view>
<view class="CourseTotal" v-if="TotalHours>0">{{TotalHours}}</view>
</view>
<div class="loading" v-if="isShowLoad">
<van-loading type="spinner" color="#fff" />
</div>
<view class="Course_Bottom" v-if="ChapterList.length>0">
<view class="Course_List" v-for="(item,index) in ChapterList" :key="index">
<view class="CourseList_One" @click="getReview(index)">
<view>
<van-circle :value="item.StudyProgress" layer-color="#E4E5FB" :size="75" color="#4C50E7" :rate="100" :speed="100" :text="getSpeed(item.StudyProgress)" />
</view>
<view class="Course_SeName">
<view class="Course_Name">{{item.ChapterTree.ChapterName}}</view>
<view class="Course_Index">{{item.ChapterTree.ChapterNo}}</view>
</view>
<view>
<van-rate :value="item.Score" :size="20" readonly color="#FAC217"
void-color="#EBEBEB" void-icon="star" icon="star" :count="3" />
</view>
</view>
<view class="Course_Two" v-if="item.isShow" @click="goWordStudy(item,1)">
<view>
<template v-if="ChapterList.length>0">
<view class="Course_Top">
<view class="CourseBan">{{CourseName}}</view>
<view class="CourseTotal" v-if="TotalHours>0">{{TotalHours}}</view>
</view>
<div class="loading" v-if="isShowLoad">
<van-loading type="spinner" color="#fff" />
</div>
<view class="Course_Bottom">
<view class="Course_List" v-for="(item,index) in ChapterList" :key="index">
<view class="CourseList_One" @click="getReview(index)">
<view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/review.png" alt="" />
<van-circle :value="item.StudyProgress" layer-color="#E4E5FB" :size="75" color="#4C50E7"
:rate="100" :speed="100" :text="getSpeed(item.StudyProgress)" />
</view>
<view class="Course_SeName">
<view class="Course_Name">{{item.ChapterTree.ChapterName}}</view>
<view class="Course_Index">{{item.ChapterTree.ChapterNo}}</view>
</view>
<view class="Course_Opera">课程回顾</view>
</view>
<view @click="goWordStudy(item,2)">
<view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/fuxi.png" alt="" />
<van-rate :value="item.Score" :size="20" readonly color="#FAC217" void-color="#EBEBEB"
void-icon="star" icon="star" :count="3" />
</view>
<view class="Course_Opera">单词</view>
</view>
<view>
<view @click="jumpPage(`/pages/word/test?CourseId=0`)">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/ceshi.png" alt="" />
<view class="Course_Two" v-if="item.isShow" @click="goWordStudy(item,1)">
<view>
<view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/review.png"
alt="" />
</view>
<view class="Course_Opera">课程回顾</view>
</view>
<view @click="goWordStudy(item,2)">
<view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/fuxi.png"
alt="" />
</view>
<view class="Course_Opera">单词</view>
</view>
<view>
<view @click="jumpPage(`/pages/word/test?CourseId=0`)">
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/ceshi.png"
alt="" />
</view>
<view class="Course_Opera">练习</view>
</view>
<view class="Course_Opera">练习</view>
</view>
</view>
</view>
</view>
<van-empty v-else
class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无数据"
/>
</template>
<van-empty description="暂无数据" v-else />
</view>
</template>
......@@ -171,75 +179,77 @@
uni.setNavigationBarTitle({
title: "所有单词",
});
if(options.ClassId&&options.CourseId){
if (options.ClassId && options.CourseId) {
this.msg.ClassId = options.ClassId;
this.msg.CourseId = options.CourseId
this.getChapterList();
}
if(options.CourseName){
if (options.CourseName) {
this.CourseName = options.CourseName
}
if(options.TotalHours){
if (options.TotalHours) {
this.TotalHours = options.TotalHours
}
},
setup(props) {
let { proxy } = getCurrentInstance();
let {
proxy
} = getCurrentInstance();
let data = reactive({
ChapterList: [], //课程列表
msg:{
ClassId:0,
CourseId:0
msg: {
ClassId: 0,
CourseId: 0
},
CourseName:'',
TotalHours:0,
isShowLoad:false
CourseName: '',
TotalHours: 0,
isShowLoad: false
})
let methods = {
async getChapterList() {
data.isShowLoad=true;
proxy.$request("/AppletIndex/GetMyStudyCourseChapterList", data.msg).then((res) => {
data.isShowLoad=false;
if(res.Code==1){
data.ChapterList = res.Data;
data.ChapterList.forEach(x=>{
x.isShow=false
})
}
});
data.isShowLoad = true;
proxy.$request("/AppletIndex/GetMyStudyCourseChapterList", data.msg).then((res) => {
data.isShowLoad = false;
if (res.Code == 1) {
data.ChapterList = res.Data;
data.ChapterList.forEach(x => {
x.isShow = false
})
}
});
},
getSpeed(score){
if(score<100){
return score+'%'
}else{
getSpeed(score) {
if (score < 100) {
return score + '%'
} else {
return '已学完'
}
},
//点击展开
getReview(index){
data.ChapterList.forEach((x,i)=>{
if(index!=i){
x.isShow=false;
getReview(index) {
data.ChapterList.forEach((x, i) => {
if (index != i) {
x.isShow = false;
}
})
data.ChapterList[index].isShow=!data.ChapterList[index].isShow;
data.ChapterList[index].isShow = !data.ChapterList[index].isShow;
},
jumpPage(url) {
uni.navigateTo({
url: url,
});
},
goWordStudy(obj,Type){
if(obj){
let url = `/pages/word/wordStudy?CourseId=${obj.ChapterTree.CourseId}&&ChapterId=${obj.ChapterTree.ChapterId}&&ReviewChapterId=0&&Type=${Type}`
goWordStudy(obj, Type) {
if (obj) {
let url =
`/pages/word/wordStudy?CourseId=${obj.ChapterTree.CourseId}&&ChapterId=${obj.ChapterTree.ChapterId}&&ReviewChapterId=0&&Type=${Type}`
uni.navigateTo({
url: url
url: url
});
}
}
}
onMounted(() => {
})
onMounted(() => {})
let that = methods;
return {
...toRefs(data),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment