|
@@ -69,23 +69,27 @@ export default defineComponent({
|
|
|
switch(props.listType){
|
|
|
//本地的错误保存
|
|
|
case "localWrong":
|
|
|
- submitResVisible.value = true
|
|
|
- trueNum.value =0
|
|
|
- falseNum.value =0
|
|
|
- props.subjectList.forEach((item:any,index)=>{
|
|
|
- let answers = item.answer.split("-")
|
|
|
- if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
- ++trueNum.value
|
|
|
- }
|
|
|
- else if(item.userAnswer.length==0){
|
|
|
-
|
|
|
- }
|
|
|
- else{
|
|
|
- ++falseNum.value
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+ Dialog.confirm({
|
|
|
+ message: "确认交卷吗?",
|
|
|
})
|
|
|
-
|
|
|
+ .then(() => {
|
|
|
+ let wrongSet = props.subjectList.filter((item:any,index)=>{
|
|
|
+ let answers = item.answer.split("-")
|
|
|
+ return JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())
|
|
|
+
|
|
|
+ })
|
|
|
+ window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ console.log(props.subjectList,"props")
|
|
|
+ });
|
|
|
+
|
|
|
break;
|
|
|
//本地的错误保存
|
|
|
|
|
@@ -135,26 +139,26 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
};
|
|
|
- // const showSubmitResVisible = ()=>{
|
|
|
- // submitResVisible.value = true
|
|
|
- // trueNum.value =0
|
|
|
- // falseNum.value =0
|
|
|
- // props.subjectList.forEach((item:any,index)=>{
|
|
|
- // let answers = item.answer.split("-")
|
|
|
- // if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
- // ++trueNum.value
|
|
|
- // }
|
|
|
- // else if(item.userAnswer.length==0){
|
|
|
+ const showSubmitResVisible = ()=>{
|
|
|
+ submitResVisible.value = true
|
|
|
+ trueNum.value =0
|
|
|
+ falseNum.value =0
|
|
|
+ props.subjectList.forEach((item:any,index)=>{
|
|
|
+ let answers = item.answer.split("-")
|
|
|
+ if(JSON.stringify(answers.sort()) == JSON.stringify(typeof item.userAnswer === 'string' ? [item.userAnswer] : item.userAnswer.sort())){
|
|
|
+ ++trueNum.value
|
|
|
+ }
|
|
|
+ else if(item.userAnswer.length==0){
|
|
|
|
|
|
- // }
|
|
|
- // else{
|
|
|
- // ++falseNum.value
|
|
|
- // }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ ++falseNum.value
|
|
|
+ }
|
|
|
|
|
|
- // })
|
|
|
+ })
|
|
|
|
|
|
|
|
|
- // }
|
|
|
+ }
|
|
|
const wrongReDo = ()=>{
|
|
|
|
|
|
let wrongSet = props.subjectList.filter((item:any,index)=>{
|
|
@@ -175,10 +179,8 @@ export default defineComponent({
|
|
|
_item.status =0
|
|
|
})
|
|
|
|
|
|
- })
|
|
|
- let localVuex = JSON.parse(window.localStorage.getItem('vuex')||'{}')
|
|
|
- let tempUserWrongKey = localVuex.userData.openid+'_用户临时错题_'+subject
|
|
|
- window.sessionStorage.setItem(tempUserWrongKey,JSON.stringify(wrongSet))
|
|
|
+ })
|
|
|
+ window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
|
|
|
if(wrongSet.length){
|
|
|
emit('redo')
|
|
|
}
|
|
@@ -252,7 +254,7 @@ export default defineComponent({
|
|
|
|
|
|
<van-tabbar-item
|
|
|
onClick={() => {
|
|
|
- goWrongPreviewScore()
|
|
|
+ showSubmitResVisible()
|
|
|
}}
|
|
|
v-slots={{
|
|
|
icon: () => <m-icon type="jiaojuan" />,
|