Commit a6717728 authored by zhengke's avatar zhengke

修改

parent a8eec79b
...@@ -94,16 +94,13 @@ ...@@ -94,16 +94,13 @@
dataList: [], dataList: [],
current: 0, //默认从第几个开始-用于从快捷菜单点入 current: 0, //默认从第几个开始-用于从快捷菜单点入
statusBarHeight: 0, statusBarHeight: 0,
isDati: false, isDati: false
}); });
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
watch(() => [...props.paperData], (val) => { watch(() => [...props.paperData], (val) => {
data.dataList = [...data.dataList, ...val]; data.dataList = [...data.dataList, ...val];
}) })
let methods = { let methods = {
stopTouchMove(){
return true
},
goBack() { goBack() {
uni.navigateBack(); uni.navigateBack();
}, },
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
font-size:40rpx; font-size:40rpx;
z-index: 999; z-index: 999;
" :style="{ top: `calc(${statusBarHeight}px + 105rpx)` }" @click="showAnswerSheet"></i> " :style="{ top: `calc(${statusBarHeight}px + 105rpx)` }" @click="showAnswerSheet"></i>
<div class="loading" v-if="loading">
<van-loading type="spinner" color="#fff" text-color="#fff" size="28rpx">题库加载中...</van-loading>
</div>
<swiper class="swiper-box" style="height:100vh" :current="current" @change="onchange"> <swiper class="swiper-box" style="height:100vh" :current="current" @change="onchange">
<swiper-item v-for="(item, index) in dataList" :key="index" :data-index="index"> <swiper-item v-for="(item, index) in dataList" :key="index" :data-index="index">
<singlenumber v-if="item.QuestionTypeKey=='single-number'||item.QuestionTypeKey=='single'" <singlenumber v-if="item.QuestionTypeKey=='single-number'||item.QuestionTypeKey=='single'"
...@@ -97,7 +100,8 @@ ...@@ -97,7 +100,8 @@
setMsg:{ setMsg:{
Id:0 Id:0
}, },
CommonType:-1 CommonType:-1,
loading:true
}); });
let UserInfo = uni.getStorageSync('userInfo'); let UserInfo = uni.getStorageSync('userInfo');
...@@ -137,12 +141,11 @@ ...@@ -137,12 +141,11 @@
if (res.Code == 1) { if (res.Code == 1) {
let TempData = res.Data.PageData; let TempData = res.Data.PageData;
data.dataList=TempData; data.dataList=TempData;
setTimeout(x=>{
// if(data.msg.pageSize==20){ if(data.dataList.length>0){
// data.dataList=TempData; data.loading=false;
// }else{ }
// data.dataList = [...data.dataList, ...TempData]; },2000)
// }
data.Count = res.Data.Count; data.Count = res.Data.Count;
} }
} }
...@@ -196,7 +199,7 @@ ...@@ -196,7 +199,7 @@
...methods, ...methods,
}; };
}, },
async onLoad(options) { async onLoad(options) {
if (options && options.BankId) { if (options && options.BankId) {
this.msg.BankId = options.BankId; this.msg.BankId = options.BankId;
this.startMsg.BankId = options.BankId; this.startMsg.BankId = options.BankId;
...@@ -209,20 +212,10 @@ ...@@ -209,20 +212,10 @@
this.msg.StudentId=''; this.msg.StudentId='';
this.isShowJx=false; this.isShowJx=false;
this.getList(); this.getList();
// let _that = this;
// setTimeout(function(){
// console.log('111');
// _that.msg.pageSize=1000;
// _that.getList();
// },2000)
} }
if(options.Type==2){ if(options.Type==2){
this.isShowJx=true; this.isShowJx=true;
this.getList(); this.getList();
// setTimeout(function(){
// this.msg.pageSize=1000;
// this.getList();
// },2000)
} }
//3 4 5 6从错题跳过来 //3 4 5 6从错题跳过来
if(options.Type==3){ if(options.Type==3){
...@@ -268,4 +261,16 @@ ...@@ -268,4 +261,16 @@
color: gray; color: gray;
font-size: 26rpx; font-size: 26rpx;
} }
.loading {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
</style> </style>
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<template #title> <template #title>
</template> </template>
</van-nav-bar> </van-nav-bar>
<div class="loading" v-if="loading">
<van-loading type="spinner" color="#fff" text-color="#fff" size="28rpx">题库加载中...</van-loading>
</div>
<view class="exam-con"> <view class="exam-con">
<!-- 单词 语法--> <!-- 单词 语法-->
<word :paperData="dataList" v-if="Type==1||Type==2" :Count="Count" :Times="Times" @getAfter="getAfter()" /> <word :paperData="dataList" v-if="Type==1||Type==2" :Count="Count" :Times="Times" @getAfter="getAfter()" />
...@@ -60,12 +63,14 @@ ...@@ -60,12 +63,14 @@
examMsg: { examMsg: {
PageIndex: 1, PageIndex: 1,
PageSize: 20, PageSize: 20,
BankType: 1, BankType: 1
StartId: 0
}, },
Count: 0, //题目总数 Count: 0, //题目总数
Type: 1, //1单词 2语法 3听力 4阅读 Type: 1, //1单词 2语法 3听力 4阅读
Times: 0 Times: 0,
loading: true,
StartId: 0,
StartIndex: ''
}); });
let methods = { let methods = {
//返回 //返回
...@@ -83,6 +88,10 @@ ...@@ -83,6 +88,10 @@
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.Count = res.Data.Count; this.Count = res.Data.Count;
this.StartIndex = this.dataList.findIndex(cItem => cItem.QuestionId == data.StartId);
if(this.dataList.length>0){
this.loading=false;
}
} }
}); });
}, },
...@@ -92,6 +101,10 @@ ...@@ -92,6 +101,10 @@
if (res.Code == 1) { if (res.Code == 1) {
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.Count = res.Data.Count; this.Count = res.Data.Count;
this.StartIndex = this.dataList.findIndex(cItem => cItem.QuestionId == data.StartId);
if(this.dataList.length>0){
this.loading=false;
}
} }
}); });
}, },
...@@ -111,6 +124,10 @@ ...@@ -111,6 +124,10 @@
} }
}); });
}); });
if(this.dataList.length>0){
this.loading=false;
}
this.StartIndex = this.dataList.findIndex(cItem => cItem.QuestionId == data.StartId);
this.Count = res.Data.Count; this.Count = res.Data.Count;
} }
}); });
...@@ -119,9 +136,12 @@ ...@@ -119,9 +136,12 @@
GetMyQuestionReading() { GetMyQuestionReading() {
let res = GetQuestionReading(data.examMsg).then(res => { let res = GetQuestionReading(data.examMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
console.log(res, '数据');
this.dataList = res.Data.PageData; this.dataList = res.Data.PageData;
this.Count = res.Data.Count; this.Count = res.Data.Count;
if(this.dataList.length>0){
this.loading=false;
}
this.StartIndex = this.dataList.findIndex(cItem => cItem.QuestionId == data.StartId);
} }
}); });
}, },
...@@ -159,7 +179,7 @@ ...@@ -159,7 +179,7 @@
this.examMsg.BankType = options.BankType; this.examMsg.BankType = options.BankType;
} }
if (options && options.StartId) { if (options && options.StartId) {
this.examMsg.StartId = options.StartId; this.StartId = options.StartId;
} }
if (options && options.Times){ if (options && options.Times){
this.Times = options.Times; this.Times = options.Times;
...@@ -194,4 +214,16 @@ ...@@ -194,4 +214,16 @@
margin-left: 30rpx; margin-left: 30rpx;
color: #000; color: #000;
} }
.loading {
position: fixed;
z-index: 9999;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
</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