dedsudiyu 1 week ago
parent
commit
5474f212bb

+ 7 - 1
.claude/claude.md

@@ -38,4 +38,10 @@ id="screen-approval" 的内容重构至E:\git\2021项目\v3-小程序\pages_safe
 
 
 1. 重构E:\git\2021项目\v3-小程序\.claude\mobile_exam.html文件内 ID为screen-exam-detail的内容 至E:\git\2021项目\v3-小程序\pages_safetyEducationExamination\views\exam\onlineExamInfo.vue内 要求符合uni-app 微信小程序 并且还原完整样式与原型不要擅自更改样式与原型
 1. 重构E:\git\2021项目\v3-小程序\.claude\mobile_exam.html文件内 ID为screen-exam-detail的内容 至E:\git\2021项目\v3-小程序\pages_safetyEducationExamination\views\exam\onlineExamInfo.vue内 要求符合uni-app 微信小程序 并且还原完整样式与原型不要擅自更改样式与原型
 页面数据将会从上级列表页面的exam/user/exam/list接口中取值并且传入本页面 写好接参
 页面数据将会从上级列表页面的exam/user/exam/list接口中取值并且传入本页面 写好接参
-同时写好在pages_safetyEducationExamination/views/exam/index页面考试任务状态时点击列表内容跳转到此页面的方法与传参 
+同时写好在pages_safetyEducationExamination/views/exam/index页面考试任务状态时点击列表内容跳转到此页面的方法与传参 
+
+
+
+1. 重构E:\git\2021项目\v3-小程序\.claude\mobile_exam.html文件内 ID为screen-mock-detail的内容 至E:\git\2021项目\v3-小程序\pages_safetyEducationExamination\views\exam\mockExamInfo.vue内 要求符合uni-app 微信小程序 并且还原完整样式与原型不要擅自更改样式与原型
+页面数据将会从上级列表页面的exam/user/exam/mockList接口中取值并且传入本页面 写好接参
+同时写好在pages_safetyEducationExamination/views/exam/index页面模拟考试状态时点击列表内容跳转到此页面的方法与传参 

+ 9 - 1
.claude/settings.local.json

@@ -3,7 +3,15 @@
     "allow": [
     "allow": [
       "WebFetch(domain:s.apifox.cn)",
       "WebFetch(domain:s.apifox.cn)",
       "Bash(curl -s \"https://s.apifox.cn/f4dade51-c892-44e5-9663-d952b24d899e/500978963e0\")",
       "Bash(curl -s \"https://s.apifox.cn/f4dade51-c892-44e5-9663-d952b24d899e/500978963e0\")",
-      "Bash(powershell -Command \":*)"
+      "Bash(powershell -Command \":*)",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' log --all --oneline -S'/exam/user/exam/mockList' -- 'pages_safetyEducationExamination' '.claude')",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' log --all --oneline -- '*mock*' '*exam*')",
+      "WebSearch",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' log --all --oneline -- 'pages_safetyEducationExamination/views/exam/index.vue')",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' branch --all --no-color)",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' status --short)",
+      "Bash(git -C 'E:/git/2021项目/v3-小程序' diff -- pages_safetyEducationExamination/api/index.js pages_safetyEducationExamination/views/exam/index.vue)",
+      "Bash(curl.exe -L --fail --max-time 20 -sS 'https://s.apifox.cn/f4dade51-c892-44e5-9663-d952b24d899e/500978964e0.md')"
     ]
     ]
   }
   }
 }
 }

+ 5 - 1
pages_safetyEducationExamination/views/exam/index.vue

@@ -366,7 +366,11 @@
 				});
 				});
 			},
 			},
 			goToMockDetail(item) {
 			goToMockDetail(item) {
-				// 跳转模拟考试详情,传递 mockExamId
+				// 跳转模拟考试详情,传递完整模拟考试数据
+				const examData = encodeURIComponent(JSON.stringify(item));
+				uni.navigateTo({
+					url: `/pages_safetyEducationExamination/views/exam/mockExamInfo?examData=${examData}`
+				});
 			},
 			},
 			goToScoreDetail(item) {
 			goToScoreDetail(item) {
 				// 跳转成绩详情,传递 examId
 				// 跳转成绩详情,传递 examId

+ 205 - 2
pages_safetyEducationExamination/views/exam/mockExamInfo.vue

@@ -1,8 +1,211 @@
+<!-- 模拟考试详情 -->
 <template>
 <template>
+	<view class="mock-exam-info">
+		<scroll-view scroll-y class="scroll-content">
+			<view class="card">
+				<view class="exam-name">{{ examData.examName }}</view>
+				<view class="chip-row mb12">
+					<text class="tag tag-blue text-xs">{{ examData.examTypeName }}</text>
+					<text class="tag tag-orange text-xs">模拟卷</text>
+				</view>
+				<view class="info-grid mb14">
+					<view class="info-item">
+						<view class="text-xs text-gray mb4">题目总数</view>
+						<view class="text-blue fw500">{{ examData.totalQuestionNum || 0 }} 题</view>
+					</view>
+					<view class="info-item">
+						<view class="text-xs text-gray mb4">考试时长</view>
+						<view class="fw500">{{ examData.answerDuration }} 分钟</view>
+					</view>
+					<view class="info-item">
+						<view class="text-xs text-gray mb4">满分</view>
+						<view class="fw500">{{ examData.totalScore }} 分</view>
+					</view>
+					<view class="info-item">
+						<view class="text-xs text-gray mb4">及格分数</view>
+						<view class="text-orange fw500">{{ examData.passScore }} 分</view>
+					</view>
+				</view>
+				<view class="score-summary">
+					<view class="text-sm fw500 mb8">历次模拟成绩</view>
+					<view class="row-between mb4">
+						<text class="text-sm text-gray">第 {{ examData.attemptCount || 0 }} 次 {{ examData.attemptCount}}</text>
+						<text class="text-sm fw500" :class="examData.isPassed ? 'text-green' : 'text-red'">
+							最高 {{ examData.maxScore || 0 }} 分({{ examData.isPassed ? '已通过' : '未通过' }})
+						</text>
+					</view>
+					<view v-if="!examData.isPassed" class="text-xs text-gray">
+						还需提高 {{ scoreGap }} 分达到及格线
+					</view>
+				</view>
+				<view class="notice">模拟考试需达到及格分数({{ examData.passScore }}分)方可参加正式在线考试。</view>
+			</view>
+		</scroll-view>
+		<view class="bottom-bar" v-if="examData.needStudy||examData.examStudy||examData.mockExam">
+			<view class="btn-primary" @click="startMockExam">
+				{{examData.needStudy||examData.examStudy?'开始学习':(examData.mockExam?'开始模拟考试':'')}}
+			</view>
+		</view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import {
+		parseTime
+	} from '@/component/public.js'
+
+	export default {
+		data() {
+			return {
+				examData: {}
+			}
+		},
+		computed: {
+			scoreGap() {
+				return Math.max(0, (this.examData.passScore || 0) - (this.examData.maxScore || 0));
+			}
+		},
+		onLoad(options) {
+			if (options.examData) {
+				try {
+					this.examData = JSON.parse(decodeURIComponent(options.examData));
+					this.formatExamData();
+				} catch (e) {
+					console.error('解析模拟考试数据失败', e);
+				}
+			}
+		},
+		methods: {
+			formatExamData() {
+				if (this.examData.startTime) {
+					this.examData.startTime = parseTime(this.examData.startTime, '{y}-{m}-{d} {h}:{i}');
+				}
+				if (this.examData.endTime) {
+					this.examData.endTime = parseTime(this.examData.endTime, '{y}-{m}-{d} {h}:{i}');
+				}
+			},
+			startMockExam() {
+				uni.navigateTo({
+					url: `/pages_safetyEducationExamination/views/exam/mockExamPlay?examId=${this.examData.examId}&mockExamId=${this.examData.mockExamId || ''}&attemptId=${this.examData.attemptId || ''}`
+				});
+			}
+		}
+	}
 </script>
 </script>
 
 
-<style>
-</style>
+<style lang="stylus" scoped>
+	.mock-exam-info
+		height 100%
+		display flex
+		flex-direction column
+		background #f0f4fb
+
+	.scroll-content
+		flex 1
+		overflow hidden
+		padding-bottom 160rpx
+
+	.card
+		margin 24rpx
+		padding 28rpx
+		background #fff
+		border 1rpx solid #dde3ed
+		border-radius 20rpx
+
+	.exam-name
+		font-size 34rpx
+		font-weight 700
+		margin-bottom 16rpx
+
+	.chip-row
+		display flex
+		gap 12rpx
+
+	.tag
+		padding 6rpx 16rpx
+		border-radius 20rpx
+
+	.tag-blue
+		background #e6f4ff
+		color #1677ff
+		border 1rpx solid #91caff
+
+	.tag-orange
+		background #fff7e6
+		color #d46b08
+		border 1rpx solid #ffd591
+
+	.info-grid
+		display grid
+		grid-template-columns 1fr 1fr
+		gap 16rpx
+
+	.info-item
+		padding 20rpx
+		border 1rpx solid #dde3ed
+		border-radius 16rpx
+
+	.score-summary
+		padding 24rpx
+		margin-bottom 28rpx
+		background #f4f6fa
+		border-radius 16rpx
+
+	.notice
+		padding 20rpx
+		background #fff7e6
+		border-radius 16rpx
+		font-size 24rpx
+		line-height 1.6
+		color #d46b08
+
+	.row-between
+		display flex
+		justify-content space-between
+		align-items center
+
+	.bottom-bar
+		position fixed
+		bottom 0
+		left 0
+		right 0
+		padding 20rpx 24rpx
+		padding-bottom calc(20rpx + env(safe-area-inset-bottom))
+		background #fff
+		border-top 1rpx solid #eee
+
+	.btn-primary
+		height 88rpx
+		line-height 88rpx
+		text-align center
+		background #1857d4
+		border-radius 16rpx
+		color #fff
+		font-size 32rpx
+		font-weight 600
+
+	.text-xs
+		font-size 22rpx
+	.text-sm
+		font-size 24rpx
+	.text-gray
+		color #999
+	.text-blue
+		color #1857d4
+	.text-orange
+		color #d46b08
+	.text-green
+		color #52c41a
+	.text-red
+		color #ff4d4f
+	.fw500
+		font-weight 500
+	.mb4
+		margin-bottom 8rpx
+	.mb8
+		margin-bottom 16rpx
+	.mb12
+		margin-bottom 24rpx
+	.mb14
+		margin-bottom 28rpx
+</style>

+ 3 - 13
pages_safetyEducationExamination/views/exam/onlineExamInfo.vue

@@ -5,13 +5,13 @@
 			<view class="card">
 			<view class="card">
 				<view class="chip-row mb8">
 				<view class="chip-row mb8">
 					<text class="tag tag-orange text-xs">{{ examData.examTypeName }}</text>
 					<text class="tag tag-orange text-xs">{{ examData.examTypeName }}</text>
-					<text class="tag tag-orange text-xs">{{ getExamStatusText() }}</text>
+					<text class="tag tag-orange text-xs">{{ examData.examStatus == 2?'进行中':(examData.examStatus==1?'未开始':'') }}</text>
 				</view>
 				</view>
 				<view class="exam-title">{{ examData.examName }}</view>
 				<view class="exam-title">{{ examData.examName }}</view>
 				<view class="info-grid mb14">
 				<view class="info-grid mb14">
 					<view class="info-item">
 					<view class="info-item">
 						<view class="text-xs text-gray mb4">总题目数</view>
 						<view class="text-xs text-gray mb4">总题目数</view>
-						<view class="text-blue fw500">{{ examData.totalQuestionNum }}</view>
+						<view class="text-blue fw500">{{ examData.totalQuestionNum || 0 }}</view>
 					</view>
 					</view>
 					<view class="info-item">
 					<view class="info-item">
 						<view class="text-xs text-gray mb4">考试时长</view>
 						<view class="text-xs text-gray mb4">考试时长</view>
@@ -54,7 +54,7 @@
 		<!-- 底部按钮 -->
 		<!-- 底部按钮 -->
 		<view class="bottom-bar">
 		<view class="bottom-bar">
 			<view class="btn-primary" @click="startExam">
 			<view class="btn-primary" @click="startExam">
-				{{examData.needStudy||examData.examStudy?'开始学习':(examData.mockExam?'模拟考试':'开始考试')}}
+				{{examData.needStudy||examData.examStudy?'开始学习':(examData.mockExam?'开始模拟考试':'开始考试')}}
 				</view>
 				</view>
 		</view>
 		</view>
 	</view>
 	</view>
@@ -97,16 +97,6 @@
 					this.examData.endTime = parseTime(this.examData.endTime, '{y}-{m}-{d} {h}:{i}');
 					this.examData.endTime = parseTime(this.examData.endTime, '{y}-{m}-{d} {h}:{i}');
 				}
 				}
 			},
 			},
-			getExamStatusText() {
-				// 根据时间判断考试状态
-				const now = new Date().getTime();
-				const start = new Date(this.examData.startTime).getTime();
-				const end = new Date(this.examData.endTime).getTime();
-
-				if (now < start) return '未开始';
-				if (now > end) return '已结束';
-				return '进行中';
-			},
 			goToStudyHour() {
 			goToStudyHour() {
 				// 跳转到学时任务页面
 				// 跳转到学时任务页面
 				if (this.examData.knowledgePointIds && this.examData.knowledgePointIds.length > 0) {
 				if (this.examData.knowledgePointIds && this.examData.knowledgePointIds.length > 0) {