Commit a3b48279 authored by zhengke's avatar zhengke

修改

parent 65780cf2
......@@ -114,6 +114,12 @@
}
},{
"path": "test"
},{
"path":"wordStudy",
"style": {
"backgroundColor": "#f5f5f5",
"navigationBarBackgroundColor": "#f5f5f5"
}
}]
}
],
......
......@@ -49,6 +49,11 @@
color: #111111;
font-weight: bold;
font-size: 30rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.Course_Index {
......@@ -115,7 +120,7 @@
</view>
<view>
<van-rate :value="item.Score" :size="20" readonly color="#FAC217"
void-color="#b2b2b2" void-icon="star" icon="star" :count="3" />
void-color="#EBEBEB" void-icon="star" icon="star" :count="3" />
</view>
</view>
<view class="Course_Two" v-if="item.isShow">
......@@ -125,7 +130,7 @@
</view>
<view class="Course_Opera">课程回顾</view>
</view>
<view>
<view @click="goWordStudy(item)">
<view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/fuxi.png" alt="" />
</view>
......@@ -224,6 +229,14 @@
url: url,
});
},
goWordStudy(obj){
if(obj){
let url = `/pages/word/wordStudy?CourseId=${obj.ChapterTree.CourseId}&&ChapterId=${obj.ChapterTree.ChapterId}&&ReviewChapterId=0}`
uni.navigateTo({
url: url
});
}
}
}
onMounted(() => {
})
......
<template>
<view class="word">
<swiper class="swiper" next-margin="60rpx" @change="swiperChange" :current="current">
<swiper-item v-for="(item,index) in StudyList" :key="index" class="swiper-item">
<Pronunciation :item="item" :cur="index+1" :total="StudyList.length"></Pronunciation>
</swiper-item>
<swiper-item v-for="(item,index) in ReviewList" :key="index" class="swiper-item">
<Pronunciation :item="item" :cur="index+1" :total="ReviewList.length" :type="1"></Pronunciation>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
provide,
} from "vue";
import Pronunciation from '../../components/word/Pronunciation.vue'
export default {
components: {
Pronunciation
},
setup(props) {
let {
proxy
} = getCurrentInstance();
let data = reactive({
msg: {
ChapterId: 0, //当前章节编号
CourseId: 0,
ReviewChapterId: 0, //复习章节编号
},
StudyList: [],
ReviewList: [],
//当前学习索引
current: 0,
readMsg: {
Id: 0,
ClassId: 0,
CourseId: 0,
Stu_Account_Id: 0,
ChapterId: 0,
ReviewCourseChapterId: 0, //复习章节编号
PrepNum: 0, //预习数量
ReviewNum: 0, //复习单词数量
StudyNum: 0, //学习总单词数量
StudyType: 1, //1-预习,2-复习
},
})
let methods = {
getData() {
proxy.$request('/AppletWords/GetStudyWords', data.msg).then(res => {
data.StudyList = res.Data.StudyList
data.ReviewList = res.Data.ReviewList;
const total = data.StudyList.length + data.ReviewList.length;
if(res.Data.StartIndex>total||res.Data.StartIndex==total){
data.current = 0
}else{
data.current = res.Data.StartIndex;
}
})
},
swiperChange(val) {
data.current = val.detail.current
if (data.current <= data.StudyList.length) {
methods.completeRead(val.detail.current, 1)
} else if (data.current <= (data.ReviewList.length + data.StudyList.length)) {
methods.completeRead(val.detail.current, 2)
}
const total = data.StudyList.length + data.ReviewList.length + 1
if (val.detail.current + 1 == total && total > 1) {
}
},
completeRead(n, type) {
if (type == 1) {
data.readMsg.PrepNum = n
} else {
data.readMsg.ReviewNum = n-data.StudyList.length;
}
data.readMsg.StudyType = type;
proxy.$request('/AppletWords/SetStuWordsPrep', data.readMsg).then(res => {
if(res.Data.StudyNum==res.Data.TotalNum){
uni.navigateTo({
url: "/pages/word/studyComplete?CourseId=" + data.readMsg.CourseId + '&&ChapterId=' + data.readMsg.ChapterId +
'&&NextChapterId=' + '0'
})
}
})
}
}
onMounted(() => {
})
let that = methods;
return {
...toRefs(data),
...methods,
};
},
onLoad(options) {
console.log("options", options);
uni.setNavigationBarTitle({
title: '单词学习'
});
this.msg.ChapterId = options.ChapterId ?? 0;
this.msg.CourseId = options.CourseId ?? 0;
this.msg.ReviewChapterId = options.ReviewChapterId ?? 0;
if (options.ChapterId && options.CourseId && options.ReviewChapterId) {
this.getData();
}
const userInfo = uni.getStorageSync('userInfo');
this.readMsg.Stu_Account_Id = userInfo.Id ?? 0;
this.readMsg.CourseId = options.CourseId ?? 0;
this.readMsg.ReviewCourseChapterId = options.ReviewChapterId ?? 0;
this.readMsg.ChapterId = options.ChapterId ?? 0;
},
}
</script>
<style scoped>
.word {
min-height: 100vh;
background-color: #F5F5F5;
}
.word .swiper {
min-height: 100vh;
background-color: #F5F5F5;
}
.word .swiper-item {
min-height: 100vh;
background-color: #F5F5F5;
/* padding-left: 55rpx; */
}
</style>
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