cma_search/client_mp/pages/exam/result.vue

98 lines
2.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<image class="examImage" :src="imageSrc" mode="aspectFit"></image>
<view class="finishText">
恭喜您完成考试
</view>
<view class="finishText">
<view><text>{{currentExam.name}}</text></view>
<!-- 练习类型{{paperRecord.paperName}} -->
<view>总分<text>{{currentExam.total_score}}</text></view>
<!-- <view>答对<text>{{paperRecord.rightQueNum}}</text></view> -->
<view>得分<text>{{currentExam.score}}</text> </view>
</view>
<view class="btnArea">
<u-button class="btnClass" type="primary" :ripple="true" shape="circle" @click="goDetail">查看答卷</u-button>
<u-button class="btnClass" :ripple="true" shape="circle" @click="backToHome">返回首页</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
imageSrc: '/static/exam/result.png',
currentExam:{}
}
},
methods: {
goDetail(){
uni.showLoading({
title:"正在获取答题详情",
})
this.$u.api.getExamRecordDetail(this.currentExam.id).then(res=>{
uni.hideLoading()
uni.setStorageSync('currentExam', res.data)
uni.redirectTo({
url:'/pages/exam/detail?examrecord='+this.currentExam.id
})
}).catch(e=>{
})
},
backToHome(){
uni.reLaunch({
url:'/pages/index/index'
})
}
},
onLoad(options){
this.currentExam = uni.getStorageSync('currentExam')
},
}
</script>
<style lang="scss" scoped>
.examImage {
width: 100%;
display: flex;
justify-content: center;
// background-color: #000000;
margin-top: 100rpx;
height: 300rpx;
}
.finishText {
// margin: 100rpx 200rpx;
padding: 50rpx;
letter-spacing: 0.2em;
font-size: 32rpx;
display: flex;
flex-direction: column;
align-items: center;
text {
color: $theme-color;
font-weight: bold;
}
}
.btnArea {
display: flex;
margin-top: 50rpx;
justify-content: center;
align-items: center;
.btnClass {
width: 300rpx;
}
}
.infoArea {
display: flex;
flex-direction: column;
justify-content: center;
}
</style>