123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <template>
- <yf-more-list url="/api/user/exam/my-paging" :params="queryParams" ref="moreList">
- <template v-slot:item="{ data }">
- <uni-list-item>
- <view slot="body">
- <view class="list-body">
- <view class="list-flex">
- <view style="flex-grow: 1;">
- <view style="font-weight: 700;">{{data.title}}</view>
- <view style="color: #666;">最高分:{{data.maxScore}}</view>
- <view style="color: #888; font-size: 10px;">最近考试:{{data.updateTime}}</view>
- </view>
- <view>
- <view v-if="data.passed" class="pass">通过</view>
- <view v-else class="fail">不通过</view>
- </view>
- </view>
- <view class="list-flex">
- <view style="width: 49%; ">
- <button type="warn" @click="navtoBook(data.examId)">错题训练</button>
- </view>
- <view style="width: 49%;">
- <button type="primary" @click="navtoPaper(data.examId)">考试记录</button>
- </view>
- </view>
- </view>
- </view>
- </uni-list-item>
- </template>
-
- </yf-more-list>
- </template>
- <script>
- export default {
- data() {
- return {
- queryParams: {
-
- }
- }
- },
- onReachBottom() {
- // 加载数据
- this.$refs.moreList.loadData()
- },
- onShow() {
- if(this.$refs.moreList){
- this.$refs.moreList.initData()
- }
- },
- onBackPress(e) {
- //正常返回页面
- uni.switchTab({
- url: "/pages/user/index"
- })
- return true;
- },
- methods: {
- // 考试详情页
- navtoBook(id) {
- uni.navigateTo({
- url: '/pages/paper/book?id=' + id
- });
- },
- navtoPaper(id) {
- uni.navigateTo({
- url: '/pages/paper/list?id=' + id
- });
- }
- }
- }
- </script>
- <style scoped>
- .list-body {
- width: calc(100vw - 32px);
- }
- .list-flex {
- display: flex;
- align-items: center;
- margin-bottom: 10px;
- justify-content: space-between;
- }
- .pass {
- color: #007AFF !important;
- margin-right: 5px;
- }
- .fail {
- color: #ff0000 !important;
- margin-right: 5px;
- }
- </style>
|