exam-h5/pages/examlist/examlist.vue
2025-07-16 10:31:41 +08:00

178 lines
3.8 KiB
Vue

<template>
<view class="">
<u-navbar :is-back="false" title="考试列表" :background="background" title-color="white">
<view class="navbar-right" slot="right" @click="signup">
新增考试
</view>
</u-navbar>
<view class="app">
<view class="items" v-if="list.length>0">
<view class="item" v-for="(item,index) in list">
<view class="title">
<view class="text">
{{item.title}}
</view>
<view class="image">
<image src="../../static/jinbi.png" mode=""></image>
<span v-if="item.examFee&&item.examFee>=0">
{{item.examFee}}
</span>
<span v-else>
0
</span>
</view>
</view>
<view class="time" style="margin-top: 20rpx;color: #EA706A;font-weight:600">
考试费用:{{item.examFee}}
</view>
<view class="time">
考试日期:{{item.startDate}}至{{item.endDate}}
</view>
<view class="time">
考试时间:{{item.startTime}}至{{item.endTime}}
</view>
<view class="time">
考试时长:{{item.totalTime}}分钟
</view>
<view class="time">
试卷总分:{{item.totalScore}}
</view>
<view class="time">
考试人员:{{user.name}}
</view>
<view class="time">
身份证:{{user.cardNo}}
</view>
<view class="time">
手机号:{{user.phone}}
</view>
<view class="time" style="font-weight:700;font-size: 34rpx;">
考试状态:{{item.finishState==0?'未考试':""}}{{item.finishState==1?'已考试':""}}
</view>
</view>
</view>
<view v-else class="" style="margin-top: 100rpx;">
<u-empty text="暂无工单" mode="list" icon-size='240' font-size='32'></u-empty>
</view>
<u-toast ref="uToast" />
</view>
</view>
</template>
<script>
import {
getRegExamList
} from '@/api/examlist/index.js'
export default {
data() {
return {
user: uni.getStorageSync('examh5user'),
background: {
backgroundColor: "#4C7BC9",
},
list: [], //项目list
total: 0,
}
},
methods: {
//考试报名
signup() {
uni.navigateTo({
url: "/pages/addexam/addexam"
})
},
//list请求
info() {
getRegExamList().then(res => {
this.list = res.data
})
},
},
onLoad() {},
onShow() {
this.info();
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {}
},
onPullDownRefresh() { //下拉刷新
this.info();
setTimeout(() => {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
.navbar-right {
color: #fff;
padding-right: 20rpx;
}
.app {
padding: 0;
.items {
width: 96%;
margin: 20rpx auto;
.item {
margin: 10rpx auto;
background-color: #fff;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
padding: 10rpx;
width: 100%;
position: relative;
color: #333333;
font-size: 30rpx;
padding-bottom: 60rpx;
.time {
font-size: 30rpx;
}
.title {
line-height: 100rpx;
border-bottom: 1rpx solid #E6E6E6;
font-size: 38rpx;
color: #333333;
position: relative;
height: 100rpx;
.text {
height: 100%;
overflow: hidden; //超出的文本隐藏
display: -webkit-box;
-webkit-line-clamp: 1; // 超出多少行
-webkit-box-orient: vertical;
width: calc(100% - 170rpx);
}
.image {
position: absolute;
right: 0%;
top: 50%;
transform: translateY(-50%);
display: inline-block;
font-size: 30rpx;
color: #EA706A;
span {
display: inline-block;
width: 100rpx;
}
image {
transform: translateY(20%);
width: 40rpx;
height: 40rpx;
padding-right: 10rpx;
}
}
}
}
}
}
</style>