| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <!-- 考试任务 -->
- <template>
- <view class="examTask-component">
- <view class="card">
- <view class="card-header">
- <view class="header-left">
- <view class="card-title">考试任务</view>
- <view class="header-subtitle">待完成的学习考试任务</view>
- </view>
- <text class="header-link" @click="goToPage('1')">更多 ›</text>
- </view>
- <view class="card-body">
- <view class="for-max-box" @click="goToPage('2',item)"
- v-for="(item,index) in onlineExamList" :key="index">
- <view class="left-box">
- <view>{{item.examName}}</view>
- <view>待完成</view>
- </view>
- <view class="right-box">›</view>
- </view>
- <view v-if="!onlineExamList[0]" class="empty-tip">暂无考试任务</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- examUserExamStudyTaskList,
- } from '@/pages_safetyEducationExamination/api/index.js'
- export default {
- data() {
- return {
- onlineExamList:[],
- }
- },
- created() {
- },
- mounted() {
- this.examUserExamStudyTaskList();
- },
- methods: {
- goToPage(type,item){
- if(type == 1){
- //考试列表
- }else if(type == 2){
- //开始考试相关业务
- }
- },
- async examUserExamStudyTaskList() {
- try {
- let obj = { page: 1, pageSize: 1, examStatus: 2, isSpecialExam: false };
- const { data } = await examUserExamStudyTaskList(obj);
- if (data.code === 200) {
- this.$set(this,'onlineExamList',data.data.records);
- }
- } catch (e) { console.error('获取考试任务失败', e); }
- },
- },
- }
- </script>
- <style lang="stylus" scoped>
- .examTask-component {
- margin: 0 32rpx 32rpx;
- .card {
- background: #fff;
- border-radius: 24rpx;
- overflow: hidden;
- margin-bottom: 24rpx;
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
- border: 1px solid #dde3ed;
- }
- .card-header {
- padding: 20rpx 28rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- .card-title {
- font-size: 28rpx;
- color: #333;
- }
- .header-subtitle{
- margin-top:10rpx;
- font-size:22rpx;
- color:#8896a7;
- }
- .header-link {
- padding:10rpx 20rpx;
- font-size: 24rpx;
- color: #1857d4;
- }
- }
- .card-body {
- padding: 0 28rpx 24rpx;
- .for-max-box:nth-child(1){
- margin-top:0;
- }
- .for-max-box{
- margin-top:20rpx;
- display: flex;
- background-color:#f4f6fa;
- padding: 20rpx 24rpx;
- border-radius: 16rpx;
- .left-box{
- flex:1;
- view:nth-child(1){
- font-size:26rpx;
- margin-bottom:4rpx;
- }
- view:nth-child(2){
- font-size:22rpx;
- color:#8896a7;
- }
- }
- .right-box{
- line-height:60rpx;
- font-size:40rpx;
- color:#8896a7;
- }
- }
- .empty-tip{
- text-align: center;
- line-height:40rpx;
- color:#8896a7;
- font-size:24rpx;
- }
- }
- }
- </style>
|