Commit b328904e authored by zhengke's avatar zhengke

1

parent daf9ff75
...@@ -109,6 +109,30 @@ export function GetQuestionWords(data) { ...@@ -109,6 +109,30 @@ export function GetQuestionWords(data) {
}) })
} }
/**
* 获取语法
* @param {JSON参数} data
*/
export function GetQuestionGrammar(data) {
return request({
url: '/Exam/GetQuestionGrammar',
method: 'post',
data
})
}
/**
* 获取听力
* @param {JSON参数} data
*/
export function GetQuestionListening(data) {
return request({
url: '/Exam/GetQuestionListening',
method: 'post',
data
})
}
/** /**
* 点击答案提交答题 * 点击答案提交答题
* @param {JSON参数} data * @param {JSON参数} data
......
<template>
<!-- 听力题 -->
<view class="listen">
<view class="item" style="padding: 0 20px">
<van-nav-bar fixed>
<template #left>
<van-icon name="cross" size="32rpx" @click="goBack()" />
</template>
<template #title>
<text class="Exam_Current">{{current+1}}</text><text class="Exam_Count">/{{Count}}</text>
</template>
</van-nav-bar>
<swiper class="swiper-box" :style="{height: `calc(100vh - 300rpx)`}"
:current="current" @change="onchange">
<swiper-item v-for="(item1, index1) in dataList" :key="index1">
<audio style="text-align: left"
poster="https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/7fbf26a0-4f4a-11eb-b680-7980c8a877b8.png"
:src="item1.Src" name="日语听力" :action="audioAction" controls v-if="!isIOS"></audio>
<view class="item1" :style="{ height: `calc(100vh - 414rpx - ${statusBarHeight}px)` }">
<view class="flex flex_start_center" v-if="isIOS">
<view class="audioBox flex flex_center_center" @click="audioManage(item1.Src)">
<image style="width: 26rpx; height: 22rpx"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/horn.png" />
<van-count-down :time="audioTime" :auto-start="false" class="flex flex_center_center"
style="color: #00acf9" ref="listenCountdown" format="mm:ss" />
</view>
</view>
<view class="questionView">
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" class="item2">
<view class="flex questionTitle">
<view>{{ index2 + 1 }}、({{item2.QuestionName.slice(0, 2)}})</view>
<view v-html="item2.SubTitle"></view>
</view>
<view v-for="(item3, index3) in item2.SubAnwser" :key="index3">
<!-- 单选 、判断-->
<view class="flex flex_start_center item3" v-if="item2.QuestionKey === 'single'">
<template v-if="isOperate">
<view class="chooseNum" :class="{ myAnswer: item3.IsAnswer }"
@click="singerChange(item2, item3)">{{ item3.Name }}
</view>
<view class="chooseName" @click="singerChange(item2, item3)"
v-html="item3.Content"></view>
</template>
<template v-else>
<view class="chooseNum" :class="{ isTrueAnswer: item3.IsAnswer }">
{{ item3.Name }}
</view>
<view class="chooseName" :class="{ isTrueAnswer: item3.IsAnswer }"
v-html="item3.Content"></view>
</template>
</view>
</view>
<template v-if="!isOperate">
<view class="AnswerContent">
<view>
<text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{item1.QuestionAnswerList[index2].SubAnswer}}</text>
<text>
您的答案:
<template v-if="item1.AnswerList[index2].SubAnswer != ''">
<text v-if="item1.QuestionAnswerList[index2].SubAnswer == item1.AnswerList[index2].SubAnswer" class="isTrueAnswer">
{{ item1.AnswerList[index2].SubAnswer }},回答正确
</text>
<text v-else class="isNotAnswer">
{{ item1.AnswerList[index2].SubAnswer }},回答错误
</text>
</template>
<template v-else>
<text class="isNotAnswer">未回答</text>
</template>
</text>
</view>
</view>
</template>
</view>
</view>
<view class="AnswerContent" v-if="!isOperate && item1.AnswerParse">
<view style="word-wrap: break-word">
<text style="color: #8c8a94">解析:</text>
<view style="color: #000; display: inline-block" v-html="item1.AnswerParse"></view>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view class="AnswerBtn clear">
<view class="AnswerBtnFirst" @click="getBeforeExam()" v-if="current!=0">
上一题</view>
<view class="AnswerBtnSecond" v-if="current!=dataList.length" @click="getNextExam()">下一题</view>
</view>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
onUnmounted,
} from "vue";
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
export default {
props: {
paperData: Array,
Count: Number
},
setup(props, context) {
let {
refs
} = getCurrentInstance();
console.log(163, refs);
let data = reactive({
dataList: props.paperData,
current: 0, //默认从第几个开始-用于从快捷菜单点入
statusBarHeight: 0,
isCanNext: false,//判断是否能点击下一题
audioAction: {
method: "pause"
},
isOperate:true,
isIOS: false,
});
let sys = uni.getSystemInfoSync().system;
watch(() => [...props.paperData], (val) => {
data.dataList = [...data.dataList, ...val];
})
if (sys.indexOf("iOS") != -1) {
data.isIOS = true;
} else {
data.isIOS = false;
}
console.log(327, sys, data.isIOS);
data.dataList.map((item) => {
let arr = item.Title.split(" "); //按空格分段
arr.map((e) => {
if (e.indexOf("src") != -1) {
item.Src = decodeURIComponent(e.split("url=")[1].slice(0, -1));
}
});
});
let methods = {
jumpPage() {
uni.navigateTo({
url: "/pages/exam/examPaper",
});
},
goBack() {
uni.navigateBack();
},
//获取总时长
getTotalTime(url) {
innerAudioContext.src = url;
var Inner = "";
innerAudioContext.onCanplay(() => {
innerAudioContext.duration;
let t = innerAudioContext.duration;
let Time = t;
var second = parseInt(Time);
var hours = Math.floor(second / 3600);
second = second - hours * 3600;
var mimute = Math.floor(second / 60);
second = second - mimute * 60;
// let aa = hours + ':' + ('0' + mimute).slice(-2) + ':' + ('0' + second).slice(-2);
let TotalTime =
("0" + mimute).slice(-2) + ":" + ("0" + second).slice(-2);
return TotalTime;
});
},
audioManage(url) {
innerAudioContext.src = url;
innerAudioContext.onCanplay(() => {
// 必须。可以当做是初始化时长
innerAudioContext.duration;
// 必须。不然也获取不到时长
setTimeout(() => {
let t = innerAudioContext.duration;
data.audioTime = t * 1000;
}, 100);
});
if (innerAudioContext.currentTime === innerAudioContext.duration) {
data.isPlay = true;
}
if (data.isPlay) {
innerAudioContext.play();
// refs.listenCountdown.start();
console.log("开始播放");
data.isPlay = false;
} else {
innerAudioContext.stop();
console.log("停了");
data.isPlay = true;
}
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
},
//----------------------------------------选题----------------------------------
// 单选or判断
singerChange(item2, item3) {
item2.SubAnwser.map((e) => {
if (e.Name == item3.Name) {
e.IsAnswer = true;
item2.IsRes = true; //答题标记
} else {
e.IsAnswer = false;
}
});
},
// 多选
multipleChange(item2, item3) {
item3.IsAnswer = !item3.IsAnswer;
//标记已回答
item2.IsRes = item2.SubAnwser.some((e) => {
return e.IsAnswer;
});
},
AnswerChange(item) {
item.IsRes = item.SubAnwser.some((e) => {
return e.Content && e.Content != "";
});
},
onchange(e) {
innerAudioContext.stop();
innerAudioContext.onCanplay(() => {
// 必须。可以当做是初始化时长
innerAudioContext.duration;
// 必须。不然也获取不到时长
setTimeout(() => {
data.audioTime = 999;
}, 100);
});
data.isPlay = true;
data.ExamIndex = e.detail.current;
if (data.sortIndex == 1) {
data.ExamIndex = e.detail.current + 1;
}
if (data.ExamIndex === data.data.DetailsList.length + 1) {
this.$emit("getAfterTopic");
}
if (e.detail.current == 0 && data.sortIndex != 1) {
this.$emit("getBeforeTopic");
}
},
//点击上一题
getBeforeExam() {
data.current = data.current - 1;
},
//点击下一题
getNextExam() {
data.current = data.current + 1;
},
};
onMounted(() => {
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
});
onUnmounted(() => {
innerAudioContext.stop();
data.isPlay = true;
});
let that = methods;
return {
...toRefs(data),
...methods,
};
},
};
</script>
<style scoped>
.AnswerBtn {
margin-top: 20rpx;
}
.clear {
clear: both;
}
.AnswerBtnFirst {
width: 250rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 10rpx;
border: 1px solid #00acf9;
color: #00acf9;
float: left;
}
.AnswerBtnSecond {
width: 250rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 10rpx;
background-color: #00acf9;
color: #fff;
float: right;
}
.name {
height: 90rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 800;
color: #111111;
display: flex;
align-items: center;
justify-content: space-between;
}
.ExamIndex_Box {
margin-right: 40rpx;
}
.Single_Before {
font-size: 30rpx;
font-weight: bold;
color: #da7878;
}
.isTrueAnswer {
color: green !important;
}
.isNotAnswer {
color: red !important;
}
.AnswerContent {
font-size: 30rpx;
padding: 25rpx;
background-color: #f4f4f4;
border-radius: 5px;
}
.viewAnswerContent {
width: 100%;
min-height: 44rpx;
border-bottom: 1px solid #d1d1d1;
padding-bottom: 5px;
}
.Exam_Total {
font-size: 25rpx;
color: gray;
}
.swiper-box {
height: calc(100vh - 270rpx);
box-sizing: border-box;
}
.num {
font-size: 30rpx;
font-family: PingFang SC;
color: #111111;
}
.item {
/* margin-bottom: 40rpx; */
position: relative;
}
.item1 {
/* margin: 25rpx 0; */
align-items: center;
overflow-y: auto;
margin-top: 30rpx;
}
.questionView {
overflow-y: auto;
}
.audioBox {
width: 120rpx;
height: 30rpx;
background: #b4ddfe;
border: 1px solid #35b4fb;
border-radius: 4rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #00acf9;
}
.item2 {
box-sizing: border-box;
margin: 30rpx 0;
/* padding: 0 30rpx; */
}
.item3 {
padding-left: 25rpx;
margin: 20rpx 0;
}
.myAnswer {
background-color: #00acf9 !important;
color: #ffffff !important;
}
.chooseNum {
width: 50rpx;
height: 50rpx;
text-align: center;
line-height: 50rpx;
border-radius: 50%;
border: 1px solid #e2e2e2;
margin-right: 30rpx;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.chooseName {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.chooseName2 {
flex-grow: 1;
border-bottom: 1px solid #111;
}
.questionTitle {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.listen .van-count-down {
font-size: 22rpx !important;
color: #00acf9 !important;
}
.Exam_Score {
color: #999999;
font-size: 28rpx;
}
</style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
<view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2" <view v-for="(item2, index2) in item1.QuestionContentObj" :key="index2"
class="flex item2 flex_start_center"> class="flex item2 flex_start_center">
<template v-if="item1.StundetAnswer==''"> <template v-if="item1.StundetAnswer.length==0">
<view class="chooseNum" @click="change(item1, item2)">{{ item2.ShowName }} <view class="chooseNum" @click="change(item1, item2)">{{ item2.ShowName }}
</view> </view>
<view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view> <view class="chooseName" @click="change(item1, item2)" v-html="item2.Content"></view>
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
</view> </view>
</template> </template>
</view> </view>
<view class="AnswerContent" v-if="item1.StundetAnswer!=''"> <view class="AnswerContent" v-if="item1.StundetAnswer.length>0">
<view> <view>
<text style="color: #8c8a94">正确答案:</text> <text style="color: #8c8a94">正确答案:</text>
<text class="isTrueAnswer">{{ item1.QuestionAnswerList[0] }}</text> <text class="isTrueAnswer">{{ item1.QuestionAnswerList[0] }}</text>
<text>您的答案是: <text>您的答案是:
<template v-if="item1.StundetAnswer != ''"> <template v-if="item1.StundetAnswer.length>0">
<text v-if="item1.StundetAnswer == item1.QuestionAnswerList[0]" <text v-if="item1.StundetAnswer[0] == item1.QuestionAnswerList[0]"
class="isTrueAnswer"> class="isTrueAnswer">
{{ item1.StundetAnswer }},回答正确 {{ item1.StundetAnswer }},回答正确
</text> </text>
<text v-else class="isNotAnswer">{{ item1.StundetAnswer }},回答错误</text> <text v-else class="isNotAnswer">{{ item1.StundetAnswer[0] }},回答错误</text>
</template> </template>
<template v-else> <template v-else>
<text>未作答</text> <text>未作答</text>
...@@ -98,9 +98,6 @@ ...@@ -98,9 +98,6 @@
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
watch(() => [...props.paperData], (val) => { watch(() => [...props.paperData], (val) => {
val.forEach(x => {
x.StundetAnswer = '';
})
data.dataList = [...data.dataList, ...val]; data.dataList = [...data.dataList, ...val];
}) })
let methods = { let methods = {
...@@ -116,9 +113,9 @@ ...@@ -116,9 +113,9 @@
}, },
//点击选择答案 //点击选择答案
change(item1, item2) { change(item1, item2) {
item1.StundetAnswer = item2.Name; item1.StundetAnswer[0] = item2.Name;
if (item1.QuestionAnswerList && item1.QuestionAnswerList.length > 0) { if (item1.QuestionAnswerList && item1.QuestionAnswerList.length > 0) {
if (item1.StundetAnswer == item1.QuestionAnswerList[0]) { if (item1.StundetAnswer[0] == item1.QuestionAnswerList[0]) {
data.current += 1; data.current += 1;
} }
} }
...@@ -131,18 +128,19 @@ ...@@ -131,18 +128,19 @@
QuestionContent: item1.QuestionContentObj, QuestionContent: item1.QuestionContentObj,
QuestionTypeId: item1.QuestionTypeId, QuestionTypeId: item1.QuestionTypeId,
QuestionTypeKey: item1.QuestionTypeKey, QuestionTypeKey: item1.QuestionTypeKey,
Answer: item1.StundetAnswer, StudentAnswer: item1.StundetAnswer,
Answer: item1.Answer,
AnswerParse: item1.AnswerParse, AnswerParse: item1.AnswerParse,
LevelType:item1.LevelType, LevelType:item1.LevelType,
IsAnswer: 0, IsAnswer: 0,
IsWrong: 0 IsWrong: 0
} }
if(item1.StundetAnswer){ if(item1.StundetAnswer.length>0){
msg.IsAnswer=1; msg.IsAnswer=1;
}else{ }else{
msg.IsAnswer=0; msg.IsAnswer=0;
} }
if(item1.StundetAnswer==item1.QuestionAnswerList[0]){ if(item1.StundetAnswer[0]==item1.QuestionAnswerList[0]){
msg.IsWrong=0; msg.IsWrong=0;
}else{ }else{
msg.IsWrong=1; msg.IsWrong=1;
...@@ -157,8 +155,8 @@ ...@@ -157,8 +155,8 @@
}, },
//判断是否为正确答案 //判断是否为正确答案
getErrorAnswer(item1, Number) { getErrorAnswer(item1, Number) {
if (item1.StundetAnswer != item1.QuestionAnswerList[0]) { if (item1.StundetAnswer[0] != item1.QuestionAnswerList[0]) {
if (item1.StundetAnswer == Number) { if (item1.StundetAnswer[0] == Number) {
return true return true
} }
} }
......
...@@ -206,12 +206,12 @@ ...@@ -206,12 +206,12 @@
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.wordsFinishCount}}/{{TypeObj.wordsTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.wordsFinishCount}}/{{TypeObj.wordsTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png" alt="" />
</view> </view>
<view class="Ques_Circle"> <view class="Ques_Circle" @click="goExam(2)">
<view class="Ques_Top">语法</view> <view class="Ques_Top">语法</view>
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.grammarFinishCount}}/{{TypeObj.grammarTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.grammarFinishCount}}/{{TypeObj.grammarTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png" alt="" />
</view> </view>
<view class="Ques_Circle"> <view class="Ques_Circle" @click="goExam(3)">
<view class="Ques_Top">听力</view> <view class="Ques_Top">听力</view>
<view class="Ques_Num" v-if="TypeObj">{{TypeObj.listeningFinishCount}}/{{TypeObj.listeningTotalCount}}</view> <view class="Ques_Num" v-if="TypeObj">{{TypeObj.listeningFinishCount}}/{{TypeObj.listeningTotalCount}}</view>
<img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png" alt="" /> <img src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png" alt="" />
...@@ -369,6 +369,8 @@ ...@@ -369,6 +369,8 @@
}, },
async onLoad(options) { async onLoad(options) {
await this.getLevels(); await this.getLevels();
},
async onShow(){
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
this.TypeMsg.StudentId = UserInfo.AccountId; this.TypeMsg.StudentId = UserInfo.AccountId;
await this.getLevelTotal(); await this.getLevelTotal();
......
<template> <template>
<view :style="{ 'padding-top': `${statusBarHeight}px` }"> <view :style="{ 'padding-top': `${statusBarHeight}px` }">
<view style="height: 100rpx"></view> <view style="height: 100rpx"></view>
<van-nav-bar fixed> <van-nav-bar fixed>
<template #left> <template #left>
<van-icon name="cross" size="32rpx" @click="goBack()" /> <van-icon name="cross" size="32rpx" @click="goBack()" />
</template> </template>
<template #title> <template #title>
</template> </template>
</van-nav-bar> </van-nav-bar>
<view class="exam-con"> <view class="exam-con">
<!-- 单词 --> <!-- 单词 语法-->
<word :paperData="dataList" v-if="Type==1" :Count="Count" @getAfter="getAfter()" /> <word :paperData="dataList" v-if="Type==1||Type==2" :Count="Count" @getAfter="getAfter()" />
<!-- 阅读理解 --> <!-- 听力 -->
<readingCompre :paperData="dataList" v-if="Type==4" :Count="Count" @getAfter="getAfter()" /> <listen :paperData="dataList" v-if="Type==3" :Count="Count" @getAfter="getAfter()" />
</view> <!-- 阅读理解 -->
<van-toast id="van-toast" /> <readingCompre :paperData="dataList" v-if="Type==4" :Count="Count" @getAfter="getAfter()" />
</view> </view>
</view>
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
toRef, toRef,
getCurrentInstance, getCurrentInstance,
watch, watch,
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { GetQuestionReading } from "../../api/exam"; import {
import { changeNumToHan } from "../../utils/index"; submitPaper,
import { submitPaper,GetQuestionWords } from "../../api/exam"; GetQuestionWords,
GetQuestionGrammar,
import readingCompre from "../../components/question/readingCompre"; GetQuestionListening,
import word from "../../components/question/word.vue"; GetQuestionReading,
export default { } from "../../api/exam";
components: { import readingCompre from "../../components/question/readingCompre";
word, import word from "../../components/question/word.vue";
readingCompre import listen from "../../components/question/listen.vue";
}, export default {
setup(props, context) { components: {
let { refs } = getCurrentInstance(); word,
console.log(refs); listen,
let data = reactive({ readingCompre
statusBarHeight: 0, },
dataList: [], setup(props, context) {
changeIndex: 0, //大题序号 let {
isOperate: true, //考试状态 判断是考试还是查看答案 refs
isAutoTime: false, } = getCurrentInstance();
examMsg:{ console.log(refs);
PageIndex: 1, let data = reactive({
PageSize:20, statusBarHeight: 0,
BankType: 1, dataList: [],
StartId:0 changeIndex: 0, //大题序号
}, isOperate: true, //考试状态 判断是考试还是查看答案
Count:0, //题目总数 isAutoTime: false,
Type: 1, //1单词 2语法 3听力 4阅读 examMsg: {
}); PageIndex: 1,
let methods = { PageSize: 20,
changeNumToHan, BankType: 1,
//返回 StartId: 0
goBack(){ },
uni.navigateBack(); Count: 0, //题目总数
}, Type: 1, //1单词 2语法 3听力 4阅读
jumpPage() { });
uni.navigateTo({ let methods = {
url: "/pages/exam/examPaper", //返回
}); goBack() {
}, uni.navigateBack();
GetWords(){ },
let res = GetQuestionWords(data.examMsg).then(res=>{ jumpPage() {
if (res) { uni.navigateTo({
if (res.Code == 1) { url: "/pages/exam/examPaper",
this.dataList = res.Data.PageData; });
this.Count = res.Data.Count; },
} //单词
} GetWords() {
}); let res = GetQuestionWords(data.examMsg).then(res => {
}, if (res.Code == 1) {
GetMyQuestionReading() { this.dataList = res.Data.PageData;
let res = GetQuestionReading(data.examMsg).then(res=>{ this.Count = res.Data.Count;
if (res) { }
if (res.Code == 1) { });
console.log(res,'数据'); },
this.dataList = res.Data.PageData; //语法
this.Count = res.Data.Count; getGrammar() {
} let res = GetQuestionGrammar(data.examMsg).then(res => {
} if (res.Code == 1) {
}); this.dataList = res.Data.PageData;
}, this.Count = res.Data.Count;
//往后追加题 }
getAfter(){ });
data.examMsg.PageIndex++; },
if(data.Type==1){ //听力
this.GetWords(); getListen() {
} let res = GetQuestionListening(data.examMsg).then(res => {
if(data.Type==4){ if (res.Code == 1) {
this.GetMyQuestionReading(); this.dataList = res.Data.PageData;
} this.Count = res.Data.Count;
}, }
//获取答案改变后的数据 });
getAnswerChange(val, index) { },
// data.peaperDetail.Paper.GroupList[index] = val; //阅读
}, GetMyQuestionReading() {
//交卷 let res = GetQuestionReading(data.examMsg).then(res => {
async savePaper() { if (res.Code == 1) {
console.log(res, '数据');
}, this.dataList = res.Data.PageData;
}; this.Count = res.Data.Count;
onMounted(() => { }
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; });
}); },
return { //往后追加题
...toRefs(data), getAfter() {
...methods, data.examMsg.PageIndex++;
}; if (data.Type == 1) {
}, this.GetWords();
async onLoad(options) { }
console.log(options,'options'); if (data.Type == 2) {
if(options&&options.Type){ this.getGrammar();
this.Type = options.Type; }
} if (data.Type == 3){
if(options&&options.BankType){ this.getListen();
this.examMsg.BankType = options.BankType; }
} if (data.Type == 4) {
if(options&&options.StartId){ this.GetMyQuestionReading();
this.examMsg.StartId = options.StartId; }
} },
//获取单词 };
if(this.Type==1){ onMounted(() => {
this.GetWords(); data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
} });
if(this.Type==4){ return {
this.GetMyQuestionReading(); ...toRefs(data),
} ...methods,
}, };
}; },
async onLoad(options) {
console.log(options, 'options');
if (options && options.Type) {
this.Type = options.Type;
}
if (options && options.BankType) {
this.examMsg.BankType = options.BankType;
}
if (options && options.StartId) {
this.examMsg.StartId = options.StartId;
}
//获取单词
if (this.Type == 1) {
this.GetWords();
}
//获取语法
if (this.Type == 2) {
this.getGrammar();
}
//获取听力
if (this.Type == 3) {
this.getListen();
}
if (this.Type == 4) {
this.GetMyQuestionReading();
}
},
};
</script> </script>
<style scoped> <style scoped>
.exam-con { .exam-con {
box-sizing: border-box; box-sizing: border-box;
} }
.answerSheet { .answerSheet {
font-size: 40rpx; font-size: 40rpx;
margin-left: 30rpx; margin-left: 30rpx;
color: #000; color: #000;
} }
</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