Commit be795b78 authored by 罗超's avatar 罗超

2

parent 5e7cb6e7
...@@ -6,14 +6,15 @@ ...@@ -6,14 +6,15 @@
} }
.stuComTop { .stuComTop {
height: 100%;
display: flex; display: flex;
align-items: center;
color: #FFFFFF; color: #FFFFFF;
padding-top: 60rpx;
} }
.studyMain { .studyMain {
width: 85%; width: 85%;
height: 65vh; height: 50vh;
background-color: #fff; background-color: #fff;
border-radius: 24rpx; border-radius: 24rpx;
margin: auto; margin: auto;
...@@ -147,23 +148,26 @@ ...@@ -147,23 +148,26 @@
</style> </style>
<template> <template>
<view class="studyCompleta"> <view class="studyCompleta">
<view class="stuComTop"> <Navbar bg="transparent">
<view style="margin-left:20rpx;flex-shrink: 0;"> <view class="stuComTop">
<van-icon name="arrow-left" color="#FFF" @click="goIndex" /> <!-- <view style="margin-left:20rpx;flex-shrink: 0;">
<van-icon name="arrow-left" color="#FFF" @click="goIndex" />
</view> -->
<view style="width:100%; font-size: 32rpx; text-align: center;font-weight: 500;">学习小结</view>
</view> </view>
<view style="width:100%;text-align: center;">学习小结</view> </Navbar>
</view>
<view class="studyMain"> <view class="studyMain">
<view class="starList"> <view class="starList">
<van-rate v-model="stars" :size="40" :disabled="true" disabled-color="#FAC217" color="#FAC217" <van-rate :value="score" :size="40" readonly color="#FAC217"
void-color="#b2b2b2" :count="3" /> void-color="#EBEBEB" void-icon="star" icon="star" :count="3" />
</view> </view>
<view class="studyContra">恭喜你</view> <view class="studyContra">恭喜你</view>
<view class="study_Success"> <view class="study_Success">
成功获得<text class="study_Score">3</text>个积分 成功获得<text class="study_Score">{{score}}</text>个积分
</view> </view>
<view class="study_Time"> <view class="study_Time">
2<text class="study_Danwei">min</text> {{time}}<text class="study_Danwei">min</text>
</view> </view>
<img class="study_Piao" <img class="study_Piao"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/piao1.png" alt="" /> src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/piao1.png" alt="" />
...@@ -177,7 +181,8 @@ ...@@ -177,7 +181,8 @@
<view class="study_Jiyi">记忆时长</view> <view class="study_Jiyi">记忆时长</view>
<!-- <view class="study_GoCeshi" @click="goTest(url)">马上去测试</view> <!-- <view class="study_GoCeshi" @click="goTest(url)">马上去测试</view>
<view class="study_GoLearn">再学习一次</view> --> <view class="study_GoLearn">再学习一次</view> -->
<view class="studyBack" @click="goIndex">返回首页</view> <!-- <view class="studyBack" @click="goIndex">返回首页</view> -->
<view class="study_GoCeshi" @click="goIndex">返回首页</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -194,14 +199,18 @@ ...@@ -194,14 +199,18 @@
onMounted, onMounted,
provide, provide,
} from "vue"; } from "vue";
import Navbar from '../../components/navbar.vue'
export default { export default {
components:{
Navbar
},
setup(props) { setup(props) {
let { let {
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
let data = reactive({ let data = reactive({
stars: 2, score: 2,
url:'', time:'1',
}) })
let methods = { let methods = {
back() { back() {
...@@ -214,11 +223,11 @@ ...@@ -214,11 +223,11 @@
url: '/pages/index/index' url: '/pages/index/index'
}); });
}, },
goTest(url) { // goTest(url) {
uni.navigateTo({ // uni.navigateTo({
url: url, // url: url,
}); // });
}, // },
} }
onMounted(() => { onMounted(() => {
...@@ -230,9 +239,9 @@ ...@@ -230,9 +239,9 @@
}; };
}, },
onLoad(options) { onLoad(options) {
// const obj=JSON.parse() const obj=JSON.parse(decodeURIComponent(options.data))
this.score=obj.score
console.log(226, decodeURIComponent(options.data)) this.time=obj.time
// this.url=`/pages/word/test?CourseId=${options.CourseId}&&ChapterId=${options.ChapterId} &&NextChapterId=${options.NextChapterId}` // this.url=`/pages/word/test?CourseId=${options.CourseId}&&ChapterId=${options.ChapterId} &&NextChapterId=${options.NextChapterId}`
} }
} }
......
<template> <template>
<view class="wordTest"> <view class="wordTest">
<button class="" @click="submitWordsTest"> <swiper class="swiper" @change="changeSwiper" :current="curTest">
交卷 <swiper-item v-for="(item, index) in reviewGroupList" :key="index" class="swiper-item">
</button> <Choice v-if="item.QuestionTypeId == 1" :item="item" @next="next($event, item)"></Choice>
<swiper class="swiper" @change="changeSwiper" :current="curTest"> <FillIn v-if="item.QuestionTypeId == 3" :item="item" @next="next($event, item)"></FillIn>
<swiper-item </swiper-item>
v-for="(item, index) in reviewGroupList" <swiper-item v-for="(item, index) in prepGroupList" :key="index" class="swiper-item">
:key="index" <Choice v-if="item.QuestionTypeId == 1" :item="item" @next="next($event, item)"></Choice>
class="swiper-item" <FillIn v-if="item.QuestionTypeId == 3" :item="item" @next="next($event, item)"></FillIn>
> </swiper-item>
<Choice <swiper-item>
v-if="item.QuestionTypeId == 1" <van-popup :show="true" position="center" custom-style="background-color: transparent;">
:item="item" <van-loading size="50rpx" type="spinner" color="#ffffff"> <text style="color:#ffffff">交卷中...</text></van-loading>
@next="next($event, item)" </van-popup>
></Choice> </swiper-item>
<FillIn </swiper>
v-if="item.QuestionTypeId == 3" </view>
:item="item"
@next="next($event, item)"
></FillIn>
</swiper-item>
<swiper-item
v-for="(item, index) in prepGroupList"
:key="index"
class="swiper-item"
>
<Choice
v-if="item.QuestionTypeId == 1"
:item="item"
@next="next($event, item)"
></Choice>
<FillIn
v-if="item.QuestionTypeId == 3"
:item="item"
@next="next($event, item)"
></FillIn>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
</template> </template>
<script> <script>
import { ref, reactive, toRefs, getCurrentInstance, onMounted } from "vue"; import {
import {getCurrentTime} from '../../utils/date.js' ref,
import Choice from "../../components/word/choiceQuestion.vue"; reactive,
import FillIn from "../../components/word/fillInTheBlanks.vue"; toRefs,
export default { getCurrentInstance,
components: { onMounted
Choice, } from "vue";
FillIn, import {
}, getCurrentTime
setup(props) { } from '../../utils/date.js'
let { proxy } = getCurrentInstance(); import Choice from "../../components/word/choiceQuestion.vue";
let data = reactive({ import FillIn from "../../components/word/fillInTheBlanks.vue";
msg: { export default {
CourseId: 0, components: {
ChapterId: 0, Choice,
NextChapterId: 0, FillIn,
}, },
startTime:"", setup(props) {
curTest: 33, let {
reviewGroupList: [], proxy
prepGroupList: [], } = getCurrentInstance();
}); let data = reactive({
let methods = { msg: {
getList() { CourseId: 0,
proxy ChapterId: 0,
.$request("/AppletWords/CreateCourseExam", data.msg) NextChapterId: 0,
.then((res) => { },
data.reviewGroupList = res.Data.reviewGroupList; startTime: "",
data.prepGroupList = res.Data.prepGroupList; curTest: 33,
}); reviewGroupList: [],
}, prepGroupList: [],
changeSwiper(val) { });
data.curTest = val.detail.current; let methods = {
const total=data.reviewGroupList.length+data.prepGroupList.length getList() {
console.log(data.curTest,total) proxy
if(data.curTest== total){ .$request("/AppletWords/CreateCourseExam", data.msg)
.then((res) => {
// methods.submitWordsTest() data.reviewGroupList = res.Data.reviewGroupList;
data.curTest=total-1 data.prepGroupList = res.Data.prepGroupList;
} });
console.log(2,data.curTest,total) },
}, changeSwiper(val) {
next(val, item) { data.curTest = val.detail.current;
if (val) { const total = data.reviewGroupList.length + data.prepGroupList.length
item.IsTrue = val;
} if (data.curTest == total) {
data.curTest += 1; console.log('wan', data.curTest, total)
}, methods.submitWordsTest()
//提交单词测试 data.curTest = total - 1
submitWordsTest() { }
const indexData = uni.getStorageSync("indexData"); console.log(2, data.curTest, total)
let postMsg = { },
ClassId: indexData.ClassId, next(val, item) {
CourseId: data.msg.CourseId, if (val) {
ChapterId: data.msg.ChapterId, item.IsTrue = val;
ExamStartTime: data.startTime, }
Details: data.reviewGroupList, data.curTest += 1;
}; },
proxy.$request("/AppletWords/SubmitWordsExam", postMsg).then((res) => { //提交单词测试
console.log("SubmitWordsExam", res); submitWordsTest() {
const obj={ const indexData = uni.getStorageSync("indexData");
score:res.Data.Score, let postMsg = {
time:2 ClassId: indexData.ClassId,
} CourseId: data.msg.CourseId,
uni.navigateTo({ ChapterId: data.msg.ChapterId,
url:"/pages/word/studyComplete?data="+encodeURIComponent(JSON.stringify(obj)) ExamStartTime: data.startTime,
}) Details: data.reviewGroupList,
}); };
}, proxy.$request("/AppletWords/SubmitWordsExam", postMsg).then((res) => {
}; const obj = {
onMounted(() => { score: res.Data.Score,
data.startTime=getCurrentTime() time: res.Data.ExamMinutes
}); }
let that = methods; uni.navigateTo({
return { url: "/pages/word/studyComplete?data=" + encodeURIComponent(JSON.stringify(
...toRefs(data), obj))
...methods, })
}; });
}, },
onLoad(options) { };
uni.setNavigationBarTitle({ onMounted(() => {
title: "单词测试", data.startTime = getCurrentTime()
}); });
const userInfo = uni.getStorageSync("userinfo"); let that = methods;
this.msg.CourseId = options.CourseId; return {
this.msg.ChapterId = options.ChapterId; ...toRefs(data),
this.msg.NextChapterId = options.NextChapterId; ...methods,
this.getList(); };
}, },
}; onLoad(options) {
uni.setNavigationBarTitle({
title: "单词测试",
});
const userInfo = uni.getStorageSync("userinfo");
this.msg.CourseId = options.CourseId;
this.msg.ChapterId = options.ChapterId;
this.msg.NextChapterId = options.NextChapterId;
this.getList();
},
};
</script> </script>
<style scoped> <style scoped>
.wordTest { .wordTest {
min-height: 100vh; min-height: 100vh;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.wordTest .swiper { .wordTest .swiper {
min-height: 100vh; min-height: 100vh;
background-color: #f5f5f5; background-color: #f5f5f5;
} }
</style> </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