dev-hxf #31

Merged
huxiaofeng666 merged 2 commits from dev-hxf into master 1 year ago
  1. 31
      src/pages/questionBank/components/Question.vue
  2. 5
      src/pages/questionBank/practiceExams.vue
  3. 2
      src/pages/questionBank/practiceResult.vue
  4. 2
      src/pages/questionBank/questionBank.vue
  5. 21
      src/pages/questionBank/wrongQuestion.vue

@ -125,11 +125,11 @@
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text> <text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #00B74F;">{{type=='exam'?rightList.length:storageRightList.length}}</view> <view style="color: #00B74F;">{{navTitle !== '顺序答题'?rightList.length:storageRightList.length}}</view>
<text class="cor-666">答对</text> <text class="cor-666">答对</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #FF6E02;">{{type=='exam'?wrongList.length:storageWrongList.length}}</view> <view style="color: #FF6E02;">{{navTitle !== '顺序答题'?wrongList.length:storageWrongList.length}}</view>
<text class="cor-666">答错</text> <text class="cor-666">答错</text>
</view> </view>
<view class="text-center" @tap="popupShow=!popupShow"> <view class="text-center" @tap="popupShow=!popupShow">
@ -217,11 +217,11 @@
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text> <text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #00B74F;">{{type=='exam'?rightList.length:storageRightList.length}}</view> <view style="color: #00B74F;">{{navTitle !== '顺序答题'?rightList.length:storageRightList.length}}</view>
<text class="cor-666">答对</text> <text class="cor-666">答对</text>
</view> </view>
<view class="text-center"> <view class="text-center">
<view style="color: #FF6E02;">{{type=='exam'?wrongList.length:storageWrongList.length}}</view> <view style="color: #FF6E02;">{{navTitle !== '顺序答题'?wrongList.length:storageWrongList.length}}</view>
<text class="cor-666">答错</text> <text class="cor-666">答错</text>
</view> </view>
<view class="text-center" @tap="popupShow=!popupShow"> <view class="text-center" @tap="popupShow=!popupShow">
@ -313,14 +313,11 @@
isShowAll: { isShowAll: {
type: Boolean, type: Boolean,
default: true default: true
}, }
subject: {
type: [String, Number],
default: 1,
},
}, },
data() { data() {
return { return {
subject:'1',
showSkillInfo:'hidden', showSkillInfo:'hidden',
currentType:storage.get('carType') || '1001', currentType:storage.get('carType') || '1001',
onoff:'0', onoff:'0',
@ -768,10 +765,17 @@
// this.renderSwiper(0) // this.renderSwiper(0)
this.$emit('changeTab', index) this.$emit('changeTab', index)
}, },
getQuestionList(val, title) { getQuestionList(val, title, subject) {
if (title) { if (title) {
this.navTitle = title this.navTitle = title
} }
if(subject){
this.subject = subject
console.log(this.subject);
this.storageRightList=storage.get(`rightList_subject${subject}`) || []
this.storageWrongList=storage.get(`wrongList_subject${subject}`) || []
this.collectList=storage.get(`collectList_subject${subject}`) || []
}
if (val && val.length) { if (val && val.length) {
this.questionList = JSON.parse(val) this.questionList = JSON.parse(val)
} else { } else {
@ -779,7 +783,12 @@
} }
console.log(this.questionList); console.log(this.questionList);
if (this.navTitle === '顺序答题') { if (this.navTitle === '顺序答题') {
this.pickerTopic(this[`currentIndex_subject${this.subject}`]) if(subject){
this.pickerTopic(this[`currentIndex_subject${subject}`])
}else{
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
}
} else { } else {
this.pickerTopic(this.topicIndex) this.pickerTopic(this.topicIndex)
} }

@ -3,8 +3,7 @@
<!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true"> <!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true">
</u-navbar> --> </u-navbar> -->
<j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar> <j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar>
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll" <Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll" @changeTab="changeTab" />
:subject="subject" @changeTab="changeTab" />
</view> </view>
</template> </template>
@ -72,7 +71,7 @@
} }
} }
this.type = 'exam' this.type = 'exam'
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title) this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title,this.subject)
} }
}, },
computed: { computed: {

@ -6,7 +6,7 @@
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" /> <GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
<view class="top_box flex jc-c" style="flex-direction: column;"> <view class="top_box flex jc-c" style="flex-direction: column;">
<view class="wp100 text-center" style="margin-top: -80px;"> <view class="wp100 text-center" style="margin-top: -80px;">
<text v-if="Number(rightPencent)>=90">太棒了正确率很高了</text> <text v-if="Number(rightPencent * 100)>=90">太棒了正确率很高了</text>
<text v-else>继续努力吧正确率有点低~</text> <text v-else>继续努力吧正确率有点低~</text>
<view class="flex ai-c jc-c mt10"> <view class="flex ai-c jc-c mt10">
<view class="text-center wp50" @tap="toQuestionBank"> <view class="text-center wp50" @tap="toQuestionBank">

@ -77,7 +77,7 @@
} }
} }
this.loading = false this.loading = false
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle) this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle , this.subject)
this.$refs.question.getOriginArr(JSON.stringify(this.questionArr)) this.$refs.question.getOriginArr(JSON.stringify(this.questionArr))
} }
}, },

@ -68,7 +68,9 @@
<view class="flex ai-c jc-sb mt10" style="flex-wrap: wrap;"> <view class="flex ai-c jc-sb mt10" style="flex-wrap: wrap;">
<!-- 这个点击效果没加 --> <!-- 这个点击效果没加 -->
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10" @tap="toCategoryQuestion(item)"> <view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10" @tap="toCategoryQuestion(item)">
<text class="cor-000">{{item.categoryName}}</text> <view class="topic_cont_text" style="max-width: 75%;">
<text class="cor-000">{{item.categoryName}}</text>
</view>
<text class="cor-666">{{item.num}}</text> <text class="cor-666">{{item.num}}</text>
</view> </view>
</view> </view>
@ -139,8 +141,9 @@
}, },
toCategoryQuestion(item){ toCategoryQuestion(item){
const jsonString = JSON.stringify(item.errorQuestionIdList) const jsonString = JSON.stringify(item.errorQuestionIdList)
console.log(item);
uni.navigateTo({ uni.navigateTo({
url: "/pages/questionBank/questionBank?navTitle=" + item.categoryName + "&questionIdList=" + jsonString url: "/pages/questionBank/questionBank?navTitle=" + item.categoryName + "&questionIdList=" + jsonString+"&subject="+this.subject
}) })
}, },
toPractice() { toPractice() {
@ -264,4 +267,18 @@
left: 165.5rpx; left: 165.5rpx;
top: 78rpx top: 78rpx
} }
.topic_cont_text {
overflow: hidden;
word-break: break-all;
/* break-all(允许在单词内换行。) */
text-overflow: ellipsis;
/* 超出部分省略号 */
display: -webkit-box;
/** 对象作为伸缩盒子模型显示 **/
-webkit-box-orient: vertical;
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
-webkit-line-clamp: 1;
/** 显示的行数 **/
}
</style> </style>
Loading…
Cancel
Save