فهرست منبع

增加科目二和科目三2

zhangyujun 3 سال پیش
والد
کامیت
734643ed4e

+ 1 - 1
src/views/home/children/test/components/sujectThree.vue

@@ -8,7 +8,7 @@
 </template>
 
 <script setup>
-import { ref } from "@vue/reactivity";
+import { ref } from "vue";
 let sc = "script";
 let sty = "style";
 let wxHtml0 = ref(`	<wx-open-launch-weapp style="display: block;text-align:center;width:75%;height:48px;border: none;position:absolute;top:0.66rem;z-index:9999;opacity:0" id="launch-btn" username="gh_a994fd2f498e" path="pages/lightMock/index.html?living_code=LIVING_CODE">

+ 14 - 3
src/views/home/children/test/components/sujectTwo.vue

@@ -1,11 +1,22 @@
+
+
 <template>
 	<div class="container">
 		<van-button class="my-button" type="primary">前往观看视频</van-button>
+		<div v-html="wxHtml0"></div>
 	</div>
 </template>
 
-<script setup>
-
+<script lang="ts" setup>
+import { ref } from "vue";
+let sc = "script";
+let sty = "style";
+let wxHtml0 = ref(`	<wx-open-launch-weapp style="display: block;text-align:center;width:75%;height:48px;border: none;position:absolute;top:0.66rem;z-index:9999;opacity:0" id="launch-btn" username="gh_a994fd2f498e" path="pages/lightMock/index.html?living_code=LIVING_CODE">
+			<${sc} v-is="'script'" type="text/wxtag-template">
+				<${sty} v-is="'style'">.openbtn{background-color:#38f;color:#f40;width:100px;height:40px;line-height:40px;}</${sty}>
+				<div class="openbtn">跳转小程序</div>
+			</${sc}>
+		</wx-open-launch-weapp>`);
 </script>
 
 <style lang="scss" scoped>
@@ -13,9 +24,9 @@
 	width: 100%;
 	display: flex;
 	justify-content: center;
-	margin-top: 25px;
 }
 .my-button {
+	margin-top: 25px;
 	width: 75%;
 }
 </style>

+ 28 - 29
src/views/home/children/test/index.vue

@@ -15,10 +15,10 @@
 			</template>
 			<van-tabs class="test-type" animated>
 				<van-tab :title="sujectItem.name" v-for="(sujectItem, index) in carTypeItem.sujectList" :key="index" :name="sujectItem.name">
-					<component v-if="index == 0" :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></component>
-					<sujectTwo v-if="index == 1" :is="sujectTwo" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectTwo>
-					<sujectThree v-if="index == 2" :is="sujectThree" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectThree>
-					<component v-if="index == 3" :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></component>
+					<sujectOne v-if="index == 0"  :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectOne>
+					 <sujectTwo v-if="index == 1" ></sujectTwo>
+					<sujectThree v-if="index == 2" :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectThree>
+					<sujectOne v-if="index == 3"  :query="{ ...carTypeItem.query, ...sujectItem.query, title: '模拟考试' }"></sujectOne>
 				</van-tab>
 			</van-tabs>
 		</van-tab>
@@ -34,37 +34,36 @@ import swiper from "./components/swiper.vue";
 import { ref, nextTick, onBeforeMount } from "vue";
 import { useLogin, useUpdateUserInfo } from "@/hooks";
 import { useStore } from "vuex";
-import useWxSign from '@/hooks/wx/sign'
+import useWxSign from "@/hooks/wx/sign";
 import { Toast } from "vant";
 import { useRouter } from "vue-router";
 import { openApi } from "@/api/index";
 import wx from "weixin-js-sdk-ts";
 const store = useStore();
 const carTypeRef = ref<any>(null);
-const { createWxConfig } = useWxSign()
-	openApi
-			.jspapi({
-				url: window.location.href,
-		
-			})
-			.then((res) => {
-				// let wxConfig = {
-				// 	debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
-				// 	appId: res.data.data.appId as string, // 必填,公众号的唯一标识
-				// 	timestamp: res.data.data.timestamp as number, // 必填,生成签名的时间戳
-				// 	nonceStr: res.data.data.nonceStr as string, // 必填,生成签名的随机串
-				// 	signature: res.data.data.signature as string, // 必填,签名
-				// 	jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
-				// 	openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
-				// };
-				wx.config({
-					debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
-					appId: res.data.data.appId as string, // 必填,公众号的唯一标识
-					...createWxConfig(res.data.data.ticket as string),
-					jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
-					openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
-				});
-			});
+const { createWxConfig } = useWxSign();
+openApi
+	.jspapi({
+		url: '',
+	})
+	.then((res) => {
+		// let wxConfig = {
+		// 	debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
+		// 	appId: res.data.data.appId as string, // 必填,公众号的唯一标识
+		// 	timestamp: res.data.data.timestamp as number, // 必填,生成签名的时间戳
+		// 	nonceStr: res.data.data.nonceStr as string, // 必填,生成签名的随机串
+		// 	signature: res.data.data.signature as string, // 必填,签名
+		// 	jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
+		// 	openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
+		// };
+		wx.config({
+			debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
+			appId: res.data.data.appId as string, // 必填,公众号的唯一标识
+			...createWxConfig(res.data.data.ticket as string),
+			jsApiList: ["previewImage"], // 必填,需要使用的JS接口列表
+			openTagList: ["wx-open-launch-weapp"], // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
+		});
+	});
 //打印环境变量
 console.log(import.meta.env.MODE, "环境变量");
 nextTick(() => {

+ 97 - 84
src/views/mockTest/components/initMockTest.vue

@@ -24,108 +24,121 @@
 			<span>合格标准</span>
 			<span>90分及格</span>
 		</div>
+		<div class="class">
+			<span>学员姓名</span>
+			<span>
+				<input class="class-input" password="您的名字(选填)" type="text">
+			</span>
+		</div>
 		<div class="remind">答题后不可修改,累计错题扣分导致分数不及格时,系统自动交卷,考试不通过。</div>
 		<m-button class="start" width="266px" height="40px" text="开始考试" @click="gotoNextPage" />
 	</div>
 </template>
 
 <script lang="ts">
-	import { useRoute } from "vue-router";
+import { useRoute } from "vue-router";
 </script>
 
 <script lang="ts" setup>
-	import { defineEmits } from "vue";
-	const emits = defineEmits(["next"]);
-	const gotoNextPage = () => void emits("next");
-	const { query } = useRoute();
+import { defineEmits } from "vue";
+const emits = defineEmits(["next"]);
+const gotoNextPage = () => void emits("next");
+const { query } = useRoute();
 </script>
 
 <style scoped lang="scss">
-	.header-back {
-		width: 375px;
-		padding-bottom: 82px;
-		background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
-		border-radius: 0px 0px 82px 82px;
-		.header {
-			position: relative;
-			font-size: 15px;
-			padding: 15px;
-			color: #ffffff;
-			.title {
-				position: absolute;
-				left: 50%;
-				top: 50%;
-				transform: translate(-50%, -50%);
-			}
-		}
-		.user-data {
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			padding: 15px;
-			justify-content: space-between;
-			height: 80px;
-			color: #ffffff;
-			font-size: 15px;
-			font-family: PingFang SC;
-			font-weight: 400;
+.header-back {
+	width: 375px;
+	padding-bottom: 82px;
+	background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
+	border-radius: 0px 0px 82px 82px;
+	.header {
+		position: relative;
+		font-size: 15px;
+		padding: 15px;
+		color: #ffffff;
+		.title {
+			position: absolute;
+			left: 50%;
+			top: 50%;
+			transform: translate(-50%, -50%);
 		}
 	}
-
-	.content {
-		width: 345px;
-		background: #ffffff;
-		box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
-		border-radius: 10px;
-		position: relative;
-		left: 50%;
-		top: -52px;
-		transform: translateX(-50%);
-		padding: 38px 15px;
-		box-sizing: border-box;
+	.user-data {
 		display: flex;
 		flex-direction: column;
 		align-items: center;
-		.title {
-			font-size: 15px;
-			font-family: PingFang SC;
-			font-weight: 400;
-			color: #0a1a33;
-			margin-bottom: 5px;
-		}
-		.class {
-			font-size: 13px;
-			font-family: PingFang SC;
-			font-weight: 400;
-			display: flex;
-			justify-content: space-between;
-			width: 170px;
-			margin-top: 13px;
-			span {
-				&:nth-of-type(1) {
-					color: #8a9099;
-				}
-				&:nth-of-type(2) {
-					color: #5c6066;
-				}
+		padding: 15px;
+		justify-content: space-between;
+		height: 80px;
+		color: #ffffff;
+		font-size: 15px;
+		font-family: PingFang SC;
+		font-weight: 400;
+	}
+}
+.class-input{
+	width: 100px;
+	border: none;
+	background: #e2e2e2;
+	border-radius: 15px;
+	padding-left: 8px;
+
+}
+.content {
+	width: 345px;
+	background: #ffffff;
+	box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
+	border-radius: 10px;
+	position: relative;
+	left: 50%;
+	top: -52px;
+	transform: translateX(-50%);
+	padding: 38px 15px;
+	box-sizing: border-box;
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	.title {
+		font-size: 15px;
+		font-family: PingFang SC;
+		font-weight: 400;
+		color: #0a1a33;
+		margin-bottom: 5px;
+	}
+	.class {
+		font-size: 13px;
+		font-family: PingFang SC;
+		font-weight: 400;
+		display: flex;
+		justify-content: space-between;
+		width: 170px;
+		margin-top: 13px;
+		span {
+			&:nth-of-type(1) {
+				color: #8a9099;
+			}
+			&:nth-of-type(2) {
+				color: #5c6066;
 			}
 		}
-		.remind {
-			width: 315px;
-			background: rgba(255, 77, 83, 0.1);
-			font-size: 13px;
-			font-family: PingFang SC;
-			font-weight: 400;
-			line-height: 19px;
-			color: #ff4d53;
-			padding: 8px 12px;
-			box-sizing: border-box;
-			margin-top: 24px;
-		}
-		.start {
-			color: #ffffff;
-			margin-top: 30px;
-			background: #498ef5;
-		}
 	}
+	.remind {
+		width: 315px;
+		background: rgba(255, 77, 83, 0.1);
+		font-size: 13px;
+		font-family: PingFang SC;
+		font-weight: 400;
+		line-height: 19px;
+		color: #ff4d53;
+		padding: 8px 12px;
+		box-sizing: border-box;
+		margin-top: 24px;
+	}
+	.start {
+		color: #ffffff;
+		margin-top: 30px;
+		background: #498ef5;
+	}
+}
 </style>