ソースを参照

增加新规题的标签

zhangyujun 2 年 前
コミット
4618b0fa2b

+ 25 - 26
src/components/m-exercise/components/subjectContext.vue

@@ -3,6 +3,7 @@
 	import { defineComponent } from "vue";
 
 	export default defineComponent({
+		name:"subjectContext",
 		props: {
 			currentSubject: Object as any,
 			currentSubjectIndex: { require: true, type: Number, default: 0 },
@@ -17,6 +18,8 @@
 				return (
 					<div class="problem">
 						<span class="type">{props.currentSubject.type}</span>
+						
+						{props.currentSubject.isNew==1?<span class="type">{'新规题'}</span>:<span></span>}
 						<span class="text">
 							{props.currentSubjectIndex + 1}、{props.currentSubject.explain}
 						</span>
@@ -29,31 +32,27 @@
 </script>
 
 <style lang="scss" scoped>
-	.problem {
-		.type {
-			width: 47px;
-			height: 24px;
-			background: #498ef5;
-			border-radius: 10px 10px 0px 10px;
-			font-size: 14px;
-			padding: 2px 7px;
-			margin-right: 5px;
-			color: #fff;
-			
-			
-		}
-		.text {
-			font-family: PingFang SC;
-			font-weight: 400;
-			color: #0a1a33;
-			letter-spacing: 0.3px;
-			font-size: 18px;
-			
-			
-		}
-		.img {
-			width: 100%;
-			margin-top: 10px;
-		}
+.problem {
+	.type {
+		width: 47px;
+		height: 24px;
+		background: #498ef5;
+		border-radius: 10px 10px 0px 10px;
+		font-size: 14px;
+		padding: 2px 7px;
+		margin-right: 5px;
+		color: #fff;
 	}
+	.text {
+		font-family: PingFang SC;
+		font-weight: 400;
+		color: #0a1a33;
+		letter-spacing: 0.3px;
+		font-size: 18px;
+	}
+	.img {
+		width: 100%;
+		margin-top: 10px;
+	}
+}
 </style>

+ 13 - 7
src/components/m-exercise/index.vue

@@ -53,7 +53,7 @@
 						</template>
 					</van-checkbox>
 				</van-checkbox-group>
-				<van-button round type="primary" class="checkbox-btn"  @click="userAnswerChange">确定</van-button>
+				<van-button round type="primary" class="checkbox-btn" @click="userAnswerChange">确定</van-button>
 			</div>
 		</div>
 		<!-- 展示答题后选择内容 -->
@@ -120,14 +120,22 @@
 	<!-- 底部操作栏 -->
 	<bottomBar :audioPause="audioPause" :currentSubjectIndex="currentSubjectIndex" :subjectTotal="subjectTotal" :trueNum="trueNum" :falseNum="falseNum" v-model:showSubjectChangePopup="showSubjectChangePopup" v-model:officialShow="officialShow" @lastSubject="lastSubject" @nextSubject="nextSubject" />
 </template>
-
+<script lang="ts">
+import { defineComponent,defineAsyncComponent } from "vue";
+export default defineComponent({
+	name: "mExercise",
+	components: {
+		subjectContext:defineAsyncComponent(()=>import('./components/subjectContext.vue')),
+	},
+});
+</script>
 <script lang="ts" setup>
 import { ref, defineProps, computed } from "vue";
 import subjectChangePopup from "./components/subjectChangePopup.vue";
 import { useTopicMode, useAudioSet, useSubjectShowLogic } from "@/hooks/exercise";
-import {exerciseTitle} from "@/hooks/text/title"
+import { exerciseTitle } from "@/hooks/text/title";
 import { RouterBus } from "@/hooks";
-import subjectContext from "./components/subjectContext.vue";
+// import subjectContext from "./components/subjectContext.vue";
 import functionList from "./components/functionList.vue";
 import explainJq from "./components/explainJq.vue";
 import explainJs from "./components/explainJs.vue";
@@ -141,9 +149,7 @@ const {
 
 const props = defineProps<{
 	listType: ExerciseType.ListType;
-	hideFunctionList:Boolean
-
-
+	hideFunctionList: Boolean;
 }>();
 
 const isVip = store.getters.getIsVip;

+ 2 - 2
src/main.ts

@@ -11,10 +11,10 @@ import VConsole from "vconsole";
 if (import.meta.env.MODE === "development") new VConsole();
 
 const app = createApp(App);
-
+app.use(components);
 app.config.compilerOptions.isCustomElement = tag => tag.startsWith('wx-open-launch-weapp')
 app.use(store);
 app.use(router);
-app.use(components);
+
 app.use(Vant);
 app.mount("#app");