Commit be795b78 authored by 罗超's avatar 罗超

2

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