You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhishifufei_uniapp/pages/learningCenter/brushQuestion.vue

207 lines
4.8 KiB

9 months ago
<template>
<BaseContainer class="brush-question">
<NavBar title="刷题过关" />
<advert :img="'/static/frontend/learning-advert.png'" :height="140" />
<view class="exam flex flex-center-x">
9 months ago
<image src="@/static/images/learning/exam-icon.png" mode="aspectFill" class="exam-icon"></image>
9 months ago
<view class="intro">
<view>组合卷考试</view>
<view>完成付费试题后可参加</view>
</view>
9 months ago
<image src="@/static/images/learning/to.png" mode="aspectFill" class="exam-to"></image>
9 months ago
</view>
<view class="list">
<template v-if="list.length > 0">
8 months ago
<view v-for="(item, index) in list" class="list-item flex flex-center-x" @click="toContent(item)">
9 months ago
<view class="item-left">
<view class="title">
<image src="@/static/images/learning/icon.png" mode="aspectFill"></image>
8 months ago
<text>{{ item.title }}</text>
9 months ago
</view>
<view class="content">
8 months ago
<view>题目数量{{ item.count || '' }}</view>
9 months ago
</view>
</view>
<view class="item-right">
8 months ago
<!-- <image v-if="item.type === 1" src="@/static/images/learning/nolock.png" mode="aspectFill"></image>
<image v-if="item.type === 2" src="@/static/images/learning/lock.png" mode="aspectFill"></image> -->
9 months ago
<view class="list-more"></view>
</view>
</view>
</template>
</view>
8 months ago
<view class="question-wrong" @click="toQuestionWrong">错题集</view>
9 months ago
</BaseContainer>
</template>
<script>
import Advert from '@/components/Advert/index.vue';
8 months ago
import { specialTestPaper } from '@/api/learning';
9 months ago
export default {
components: {
Advert,
},
data() {
return {
8 months ago
list: [],
9 months ago
};
},
8 months ago
onLoad(options) {
this.id = options.id;
this.specialTestPaper();
},
9 months ago
methods: {
8 months ago
toContent(item) {
9 months ago
uni.navigateTo({
8 months ago
url: `/pages/special/question_index?id=${item.id}&is_analysis=${1}`,
});
},
async specialTestPaper() {
try {
const { data } = await specialTestPaper({
special_id: 1 || this.id,
type: 2,
relationship: 6
});
console.log(data);
this.list = [...data];
} catch (err) {
console.log(err);
}
},
toQuestionWrong() {
uni.navigateTo({
url: '/pages/topic/question_wrong',
9 months ago
});
},
},
};
</script>
<style lang="scss" scoped>
.brush-question {
background: #f6f6f6;
.exam {
width: 690rpx;
margin: 32rpx 30rpx 0;
height: 180rpx;
9 months ago
background-color: #386FF4;
9 months ago
border-radius: 10rpx;
padding: 0 65rpx 0 50rpx;
9 months ago
background-image: url(@/static/images/learning/exam-bg.png);
background-repeat: no-repeat;
background-position: center center;
background-size: 100% 100%;
.exam-icon {
width: 54rpx;
9 months ago
height: 64rpx;
margin-right: 55rpx;
}
.intro {
margin-right: auto;
view {
font-size: 24rpx;
line-height: 24rpx;
color: #fff;
&:first-child {
font-size: 34rpx;
line-height: 34rpx;
font-weight: bold;
margin-bottom: 17rpx;
}
}
}
9 months ago
.exam-to {
9 months ago
width: 46rpx;
height: 46rpx;
border-radius: 50%;
}
}
.list {
width: 690rpx;
margin: 20rpx 30rpx 0;
.list-item {
width: 100%;
height: 158rpx;
background: #fff;
border-radius: 8rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(68,68,68,0.04);
align-items: center;
padding: 0 30rpx;
margin-bottom: 20rpx;
.item-left {
flex: 1;
.title {
color: #333;
font-size: 30rpx;
display: flex;
align-items: center;
image {
width: 44rpx;
height: 44rpx;
margin-right: 15rpx;
}
text {
width: 420rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.content {
display: flex;
align-items: center;
margin-top: 20rpx;
>view {
font-size: 20rpx;
color: #666666;
}
}
}
.item-right {
display: flex;
align-items: center;
.status {
width: 76rpx;
height: 39rpx;
background: #FFEDE9;
border-radius: 6rpx 0rpx 6rpx 0rpx;
text-align: center;
line-height: 39rpx;
font-size: 22rpx;
}
image {
width: 44rpx;
height: 44rpx;
}
.list-more {
width: 14rpx;
height: 14rpx;
border-width: 2px 2px 0 0;
border-color: #ccc;
border-style: solid;
-webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
vertical-align: top;
margin-left: 13rpx;
}
}
}
}
8 months ago
.question-wrong {
position: absolute;
width: 110rpx;
height: 110rpx;
background: linear-gradient(90deg, #4AA5FA 0%, #0F74BB 100%);
box-shadow: 0rpx 8rpx 22rpx 5rpx rgba(77,144,190,0.34);
border-radius: 50%;
right: 30rpx;
bottom: 245rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 22rpx;
color: #fff;
}
9 months ago
}
</style>