|
@@ -1,45 +1,54 @@
|
|
|
<template>
|
|
|
<view class="phone-list-page">
|
|
|
<view class="icon-title-bjcolor-navBar-box">
|
|
|
- <view @click="goUpPage" class="nav-bar-icon"></view>
|
|
|
+ <view @click="goUpPage" class="nav-bar-icon"></view>
|
|
|
<text class="nav-bar-title">考试管理</text>
|
|
|
</view>
|
|
|
<!-- 考试列表 -->
|
|
|
- <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
|
|
|
- :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
|
|
|
- class="phone-scroll-view client-kaoshi-scroll-view">
|
|
|
- <uni-list class="admin-list-box">
|
|
|
- <uni-list-item v-for="item in data.list" class="admin-list-item-box">
|
|
|
- <template v-slot:body>
|
|
|
- <!-- 考试项 -->
|
|
|
- <view class="item-card-row">
|
|
|
- <!-- 考试名 + 等级 -->
|
|
|
- <view class="ks-item-top">
|
|
|
- <view class="ks-name">{{item.zyName}}</view>
|
|
|
- <view class="ks-zyLevelName">{{item.zyLevelName}}</view>
|
|
|
+ <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.loading"
|
|
|
+ :refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
|
|
|
+ class="phone-scroll-view client-kaoshi-scroll-view">
|
|
|
+ <uni-list class="admin-list-box">
|
|
|
+ <uni-list-item v-for="item in data.list" class="admin-list-item-box">
|
|
|
+ <template v-slot:body>
|
|
|
+ <!-- 考试项 -->
|
|
|
+ <view class="item-card-row">
|
|
|
+ <!-- 考试名 + 等级 -->
|
|
|
+ <view class="ks-item-top">
|
|
|
+ <view class="ks-name">{{item.zyName}}</view>
|
|
|
+ <view class="ks-zyLevelName">{{item.zyLevelName}}</view>
|
|
|
+ </view>
|
|
|
+ <!-- 时间 -->
|
|
|
+ <view class="ks-totalTm">
|
|
|
+ <icon class="phone-time-icon" />时间:{{item.totalTm}}分钟
|
|
|
+ </view>
|
|
|
+ <view class="ks-totalTm">
|
|
|
+ <icon class="phone-cishu-icon" />次数:{{item.maxTimes ? item.maxTimes:'不限'}}次
|
|
|
+ </view>
|
|
|
+ <!-- 分数 -->
|
|
|
+ <view class="ks-score-content">
|
|
|
+ <view class="ks-score">
|
|
|
+ <icon class="phone-zongfen-icon" />总分:<text>{{item.ksScore}}</text>
|
|
|
</view>
|
|
|
- <!-- 时间 -->
|
|
|
- <view class="ks-totalTm"><icon class="phone-time-icon"/>时间:{{item.totalTm}}分钟</view>
|
|
|
- <view class="ks-totalTm"><icon class="phone-cishu-icon"/>次数:{{item.maxTimes ? item.maxTimes:'不限'}}次</view>
|
|
|
- <!-- 分数 -->
|
|
|
- <view class="ks-score-content">
|
|
|
- <view class="ks-score"><icon class="phone-zongfen-icon"/>总分:<text>{{item.ksScore}}</text></view>
|
|
|
- <view class="ks-okScore"><icon class="phone-jigefen-icon"/>及格分:<text>{{item.okScore}}</text></view>
|
|
|
+ <view class="ks-okScore">
|
|
|
+ <icon class="phone-jigefen-icon" />及格分:<text>{{item.okScore}}</text>
|
|
|
</view>
|
|
|
- <button type="primary" size="mini" @click="checkKsXz(item)" class="item-view-btn">查看内容</button>
|
|
|
</view>
|
|
|
- </template>
|
|
|
- </uni-list-item>
|
|
|
- <uni-load-more :status="data.state" @click="getMore(0)"
|
|
|
- :contentText="data.contentText"></uni-load-more>
|
|
|
- </uni-list>
|
|
|
- </scroll-view>
|
|
|
+ <button type="primary" size="mini" @click="checkKsXz(item)"
|
|
|
+ class="item-view-btn">查看内容</button>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </uni-list-item>
|
|
|
+ <uni-load-more :status="data.state" @click="getMore(0)" :contentText="data.contentText"></uni-load-more>
|
|
|
+ </uni-list>
|
|
|
+ </scroll-view>
|
|
|
<!-- 页面底端 -->
|
|
|
<customTabbarClientVue></customTabbarClientVue>
|
|
|
<!-- 考试须知 -->
|
|
|
<kaoshixuzhiVue ref="ksxzRef" @confirm="handleConfirmKs" key="1"></kaoshixuzhiVue>
|
|
|
<!-- 身份确认 -->
|
|
|
- <identificationVue ref="shenfenRef" @confirm="handleConfirmIdent" @changeData="handleChangeIdentification" key="2"></identificationVue>
|
|
|
+ <identificationVue ref="shenfenRef" @confirm="handleConfirmIdent" @changeData="handleChangeIdentification"
|
|
|
+ key="2"></identificationVue>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -47,19 +56,26 @@
|
|
|
import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-client.vue";
|
|
|
import kaoshixuzhiVue from "@/components/kaoshixuzhi/kaoshixuzhi.vue";
|
|
|
import identificationVue from "@/components/identification/identification.vue";
|
|
|
- import {useIdentificationTools} from "./examTools.js"
|
|
|
-
|
|
|
+ import {
|
|
|
+ useIdentificationTools
|
|
|
+ } from "./examTools.js"
|
|
|
+
|
|
|
import {
|
|
|
ref,
|
|
|
reactive
|
|
|
} from "vue";
|
|
|
import {
|
|
|
- onLoad, onShow
|
|
|
+ onLoad,
|
|
|
+ onShow
|
|
|
} from "@dcloudio/uni-app";
|
|
|
import * as kaoshiApi from "@/api/kaoshi.js";
|
|
|
-
|
|
|
- const { saveIdentCache, getIdentCache, removeIdentCache } = useIdentificationTools();
|
|
|
-
|
|
|
+
|
|
|
+ const {
|
|
|
+ saveIdentCache,
|
|
|
+ getIdentCache,
|
|
|
+ removeIdentCache
|
|
|
+ } = useIdentificationTools();
|
|
|
+
|
|
|
const ksxzRef = ref(null);
|
|
|
const shenfenRef = ref(null);
|
|
|
const activeks = ref(null);
|
|
@@ -78,41 +94,53 @@
|
|
|
},
|
|
|
from: ''
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
function goUpPage() {
|
|
|
- uni.redirectTo({
|
|
|
- url: '/pages/client/ShouYe/shouye'
|
|
|
- })
|
|
|
+
|
|
|
+ const pages = getCurrentPages();
|
|
|
+ if (pages.length > 1) {
|
|
|
+ uni.navigateBack()
|
|
|
+ } else {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: '/pages/client/ShouYe/shouye'
|
|
|
+ // })
|
|
|
+ history.back();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
// 修改身份
|
|
|
function handleChangeIdentification() {
|
|
|
+
|
|
|
uni.navigateTo({
|
|
|
- url:'/pages/client/my/myInfo?from=kaoshiList'
|
|
|
+ url: '/pages/client/my/myInfo?from=kaoshiList'
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function handleConfirmIdent(data) {
|
|
|
saveIdentCache(activeks.value.ksId, true);
|
|
|
ksxzRef.value.showDialog(activeks.value)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function handleConfirmKs(data) {
|
|
|
checkKaoshi(data)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function checkKsXz(data) {
|
|
|
activeks.value = data;
|
|
|
if (data.status == 3) {
|
|
|
// 考试中 直接进入考试
|
|
|
checkKaoshi(data)
|
|
|
return;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
const result = getIdentCache(data.ksId);
|
|
|
if (result) {
|
|
|
ksxzRef.value.showDialog(data)
|
|
|
} else {
|
|
|
- kaoshiApi.getClientUserInfo({ksId: data.ksId}).then(res => {
|
|
|
+ kaoshiApi.getClientUserInfo({
|
|
|
+ ksId: data.ksId
|
|
|
+ }).then(res => {
|
|
|
shenfenRef.value.showDialog(res.data);
|
|
|
})
|
|
|
}
|
|
@@ -125,7 +153,10 @@
|
|
|
|
|
|
function checkKaoshi(item) {
|
|
|
// #ifdef H5
|
|
|
- history.replaceState({ ...history.state, newKey: 'newValue' }, '', window.location.href);
|
|
|
+ history.replaceState({
|
|
|
+ ...history.state,
|
|
|
+ newKey: 'newValue'
|
|
|
+ }, '', window.location.href);
|
|
|
// #endif
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/client/Kaoshi/exam?ksId=${item.ksId}&zhuapai=${activeks.value.zhuapai}&from=kaoshiList`
|
|
@@ -161,7 +192,7 @@
|
|
|
} else {
|
|
|
data.state = 'no-more';
|
|
|
data.loading = false;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
data.state = 'more';
|
|
@@ -199,8 +230,8 @@
|
|
|
onLoad((options) => {
|
|
|
data.from = options.from
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
onShow(() => {
|
|
|
getMore()
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|