Commit 61126524 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/xiangwei/educationstu into master

# Conflicts:
#	src/pages/word/test.vue
parents 8b0a53f0 6c4dc420
<template> <template>
<view class="wordTest"> <view class="wordTest">
<button class=""> <button class="" @click="submitWordsTest">
交卷 交卷
</button> </button>
<swiper class="swiper" @change="changeSwiper" :current="curTest"> <swiper class="swiper" @change="changeSwiper" :current="curTest">
<swiper-item v-for="(item,index) in reviewGroupList" :key="index" class="swiper-item"> <swiper-item
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next($event,item)"></Choice> v-for="(item, index) in reviewGroupList"
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next($event,item)"></FillIn> :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 v-for="(item,index) in prepGroupList" :key="index" class="swiper-item"> <swiper-item
<Choice v-if="item.QuestionTypeId==1" :item="item" @next="next($event,item)"></Choice> v-for="(item, index) in prepGroupList"
<FillIn v-if="item.QuestionTypeId==3" :item="item" @next="next($event,item)"></FillIn> :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-item> <swiper-item></swiper-item>
</swiper> </swiper>
...@@ -18,54 +42,59 @@ ...@@ -18,54 +42,59 @@
</template> </template>
<script> <script>
import { import { ref, reactive, toRefs, getCurrentInstance, onMounted } from "vue";
ref, import Choice from "../../components/word/choiceQuestion.vue";
reactive, import FillIn from "../../components/word/fillInTheBlanks.vue";
toRefs, export default {
getCurrentInstance,
onMounted,
} from "vue";
import Choice from '../../components/word/choiceQuestion.vue'
import FillIn from '../../components/word/fillInTheBlanks.vue'
export default {
components: { components: {
Choice, Choice,
FillIn FillIn,
}, },
setup(props) { setup(props) {
let { let { proxy } = getCurrentInstance();
proxy
} = getCurrentInstance();
let data = reactive({ let data = reactive({
msg: { msg: {
CourseId: 0, CourseId: 0,
ChapterId: 0, ChapterId: 0,
NextChapterId: 0 NextChapterId: 0,
}, },
curTest:0, curTest: 0,
reviewGroupList: [], reviewGroupList: [],
prepGroupList: [], prepGroupList: [],
}) });
let methods = { let methods = {
getList() { getList() {
proxy.$request('/AppletWords/CreateCourseExam', data.msg).then(res => { proxy
data.reviewGroupList=res.Data.reviewGroupList .$request("/AppletWords/CreateCourseExam", data.msg)
data.prepGroupList=res.Data.prepGroupList .then((res) => {
}) data.reviewGroupList = res.Data.reviewGroupList;
data.prepGroupList = res.Data.prepGroupList;
});
}, },
changeSwiper(val){ changeSwiper(val) {
data.curTest=val.detail.current data.curTest = val.detail.current;
}, },
next(val,item){ next(val, item) {
if(val){ if (val) {
item.IsTrue=val item.IsTrue = val;
} }
data.curTest+=1 data.curTest += 1;
} },
} //提交单词测试
onMounted(() => { submitWordsTest() {
var postMsg = {
}) ClassId: 1,
CourseId: 1,
ChapterId: 1,
ExamStartTime: "2021-01-12 10:00:00",
Details: data.reviewGroupList,
};
proxy.$request("/AppletWords/SubmitWordsExam", postMsg).then((res) => {
console.log("SubmitWordsExam", res);
});
},
};
onMounted(() => {});
let that = methods; let that = methods;
return { return {
...toRefs(data), ...toRefs(data),
...@@ -74,25 +103,25 @@ ...@@ -74,25 +103,25 @@
}, },
onLoad(options) { onLoad(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '单词测试' title: "单词测试",
}); });
const userInfo = uni.getStorageSync('userinfo'); const userInfo = uni.getStorageSync("userinfo");
this.msg.CourseId=options.CourseId this.msg.CourseId = options.CourseId;
this.msg.ChapterId=options.ChapterId this.msg.ChapterId = options.ChapterId;
this.msg.NextChapterId=options.NextChapterId this.msg.NextChapterId = options.NextChapterId;
this.getList() 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