wangxy 2 mesi fa
parent
commit
1aa1a4b656

+ 13 - 0
api/kaoshi.js

@@ -187,3 +187,16 @@ export function getAdminKsChengjiView(data = {}) {
     timeout: 20000
   })
 }
+
+
+export function getClientKaoshiBiaoji(data = {}) {
+  return request({
+    url: '/app/kaoshi/biaoji',
+    headers: {
+      isToken: false
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 13 - 0
api/shouye.js

@@ -0,0 +1,13 @@
+import request from '@/utils/request'
+
+export function getAppIndexInfo(data = {}) {
+  return request({
+    'url': '/app/index/info',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}

+ 23 - 4
components/listCard/kaoshiCard.vue

@@ -3,7 +3,7 @@
 		<!-- card title -->
 		<view class="card-head-box">
 			<view class="card-line-title">考试</view>
-			<view class="card-more">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
+			<view class="card-more" @click="checkMore">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
 		</view>
 		
 		<!-- kaoshi title -->
@@ -46,19 +46,38 @@
 		</view>
 		<!-- 底部 -->
 		<view class="card-bottom-box">
-			<button type="default" class="index-card-btn" v-if="data.status == 1">进行考试</button>
-			<button type="default" class="index-card-btn" v-if="data.status == 2">进行考试</button>
-			<button type="default" class="index-card-btn" v-if="data.status == 3">考试中</button>
+			<button type="default" class="index-card-btn" v-if="data.status == 1" @click="handleStart">进行考试</button>
+			<button type="default" class="index-card-btn" v-if="data.status == 2" @click="handleStart">进行考试</button>
+			<button type="default" class="index-card-btn" v-if="data.status == 3" @click="handleContinue">考试中</button>
 		</view>
+		
+		<!-- 考试须知 -->
+		<kaoshixuzhiVue ref="ksxzRef" @confirm="handleConfirmKs" key="1"></kaoshixuzhiVue>
+		<!-- 身份确认 -->
+		<identificationVue ref="shenfenRef" @confirm="handleConfirmIdent" @changeData="handleChangeIdentification" key="2"></identificationVue>
 	</view>
 </template>
 
 <script setup>
+	import kaoshixuzhiVue from "@/components/kaoshixuzhi/kaoshixuzhi.vue";
+	import identificationVue from "@/components/identification/identification.vue";
+	import {useIdentificationTools} from "@/pages/client/Kaoshi/examTools.js"
+	
 	defineProps({
 		data: {
 			type: Object,
 		}
 	})
+	
+	function checkMore() {
+		uni.redirectTo({
+			url: '/pages/client/Kaoshi/list'
+		})
+	}
+	
+	function handleStart() {}
+	
+	function handleContinue() {}
 </script>
 
 <style>

+ 2 - 2
pages/client/Chengji/ksScoreShijuan.vue

@@ -94,7 +94,7 @@
 	
 	import { onLoad } from "@dcloudio/uni-app";
 	import {ref,reactive,computed} from "vue"
-	import * as lxApi from "@/api/lianxi.js"
+	import * as ksApi from "@/api/kaoshi.js"
 	const {
 		checkDanxuanReply,
 		checkDuoxuanReply,
@@ -390,7 +390,7 @@
 	
 	
 	function initPage() {
-		lxApi.getClientKsChengjiView({hisId: hisId.value}).then(res => {
+		ksApi.getClientKsChengjiView({hisId: hisId.value}).then(res => {
 			const { duanluoList,ksName, zyLevelName,userScore,ksScore } = res.data;
 			data.ksName = ksName;
 			data.zyLevelName = zyLevelName;

+ 61 - 17
pages/client/ShouYe/shouye.vue

@@ -1,23 +1,67 @@
 <template>
-  <view className="client-shouye-page">
-	<view class="icon-title-bjcolor-navBar-box">
-		<text class="nav-bar-title">用户名</text>
+	<view className="client-shouye-page">
+		<view class="icon-title-bjcolor-navBar-box">
+			<text class="nav-bar-title">用户名</text>
+		</view>
+		<!-- 考试 -->
+		<kaoshiCardVue v-if="data.kaoshiList.length" :data="{ count: data.kaoshiCount, ...data.kaoshiList[0] }"></kaoshiCardVue>
+		<!-- 练习 -->
+		<lianxiCardVue v-if="data.lianxiList.length"  :data="{ count: data.lianxiCount,...data.lianxiList[0] }"></lianxiCardVue>
+		<!-- 课程 -->
+		<kechengCardVue v-if="data.kechengList.length"   :data="{ count: data.kechengCount,...data.kechengList[0] }"></kechengCardVue>
+		<!-- 底部区域 -->
+		<customTabbarClient></customTabbarClient>
 	</view>
-    <!-- 考试 -->
-    <kaoshiCardVue></kaoshiCardVue>
-    <!-- 练习 -->
-    <lianxiCardVue></lianxiCardVue>
-    <!-- 课程 -->
-    <kechengCardVue></kechengCardVue>
-    <!-- 底部区域 -->
-    <customTabbarClient></customTabbarClient>
-  </view>
 </template>
 
 <script setup>
-import kaoshiCardVue from '@/components/listCard/kaoshiCard.vue';
-import kechengCardVue from '@/components/listCard/kechengCard.vue';
-import lianxiCardVue from '@/components/listCard/lianxiCard.vue';
-import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-client.vue"
-</script>
+	import kaoshiCardVue from '@/components/listCard/kaoshiCard.vue';
+	import kechengCardVue from '@/components/listCard/kechengCard.vue';
+	import lianxiCardVue from '@/components/listCard/lianxiCard.vue';
+	import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-client.vue"
 
+	import * as httpApi from "@/api/shouye.js"
+	import {
+		onLoad
+	} from "@dcloudio/uni-app"
+	import {
+		reactive
+	} from "vue"
+
+	const {	saveIdentCache, getIdentCache, removeIdentCache } = useIdentificationTools();
+
+	const data = reactive({
+		kaoshiCount: 0,
+		kaoshiList: [],
+		kechengCount: 0,
+		kechengList: [],
+		lianxiCount: 0,
+		lianxiList: []
+	})
+
+
+	function initPage() {
+		httpApi.getAppIndexInfo().then(res => {
+			const {
+				kaoshiCount,
+				kaoshiList,
+				kechengCount,
+				kechengList,
+				lianxiCount,
+				lianxiList
+			} = res.data;
+			
+			data.kaoshiCount = kaoshiCount;
+			data.kaoshiList = kaoshiList;
+			data.kechengCount = kechengCount;
+			data.kechengList = kechengList;
+			data.lianxiCount = lianxiCount;
+			data.lianxiList = lianxiList;
+		})
+	}
+
+
+	onLoad(() => {
+		initPage()
+	})
+</script>