Browse Source

字段调整

wangxy 5 months ago
parent
commit
68f8353993

+ 2 - 6
components/catalogue/catalogue.vue

@@ -43,16 +43,12 @@
 	} from "@/utils/common.js"
 	import {getUserIdentity} from "@/utils/common.js"
 	import {MESSAGE_VISITER_TO_LOGIN,MESSAGE_BEFORE_PAY} from "@/utils/constant.js"
-    import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
+  import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
 	
 
 	const $emit = defineEmits(['change-zhang'])
 
-	const {
-		nianji,
-		xueke,
-		getCatalogue,
-	} = useCatalogue(props);
+	const { getCatalogue} = useCatalogue(props);
 
 	const popupRef = ref(null); // 索引
 	const confirmDialogRef = ref(null);

+ 4 - 8
components/catalogue/useCatalogue.js

@@ -1,29 +1,25 @@
 import {
 	reactive,
-	ref,
 	toRefs
 } from "vue";
 import {
-	onLoad
-} from '@dcloudio/uni-app'
-import {
 	catchError
 } from "@/utils/common.js"
 import * as httpCatalogue from "@/api/catalogue.js"
 import {useXuekeNianji} from "@/utils/cacheManager.js"
 
-export function useCatalogue(props) {
+export function useCatalogue() {
 	const {getXueke} = useXuekeNianji();
 	
-	const { xueke = null, nianji = null } = getXueke()
+	const { cardId = null, nianji = null } = getXueke()
 	
 	const data = reactive({
 		xueke: null,
 		nianji: null
 	})
 
-	data.nianji = xueke;
-	data.xueke = nianji;
+	data.nianji = nianji;
+	data.xueke = cardId;
 
 	async function getCatalogue() {
 		return await catchError(httpCatalogue.getCatalogue({

+ 5 - 14
pages/selectGradesTerms/index.vue

@@ -27,7 +27,6 @@
 	import {
 		nianji_list,
 		xueke_list,
-		SHUXUE,YINGYU
 	} from "@/utils/constant.js";
 	import {
 		onLoad
@@ -44,14 +43,14 @@
 			activeXueke: null, // 当前学期
 		});
 
-		onLoad((options) => {
+		onLoad(() => {
 			const {
 				nianji,
-				xueke
-			} = getXueke() || {};
+				cardId
+			} = getXueke();
 			
 			data.activeNianji = nianji;
-			data.activeXueke = xueke;
+			data.activeXueke = cardId;
 		});
 
 		// 选择 年级+学期
@@ -72,19 +71,11 @@
 				return;
 			}
 
-			const options = {
-				nianji: data.activeNianji,
-				xueke: data.activeXueke,
-			};
-
 			goDAOToStudy(options);
 		}
 
 		// 跳转 岛 学习
-		function goDAOToStudy({
-			nianji,
-			xueke,
-		}) {
+		function goDAOToStudy() {
 			updateXueke(data.activeNianji, data.activeXueke)
 			// 数序
 			uni.redirectTo({

+ 1 - 9
pages/unitTest/index.vue

@@ -27,8 +27,7 @@
 		
 
 		<!-- 答卷 -->
-		<chengji ref="chengjiRef" :list="list" :jieId="jieId" :zhangId="zhangId" @back="handleBack"
-			:nianji="nianji" :xueke="xueke"></chengji>
+		<chengji ref="chengjiRef" :list="list"  @back="handleBack"></chengji>
 
 		<!-- 分数弹窗 -->
 		<uniPointsVue ref="uniPointsRef" @checkAnswer="checkAnswer" @goStudy="goStudyContinue" :showContinue="zhangType== 'last'"></uniPointsVue>
@@ -37,7 +36,6 @@
 </template>
 
 <script setup>
-	import questionJiexi from '@/components/questionJiexi/questionJiexi.vue';
 	import wSwiper from '@/components/wSwiper/wSwiper.vue';
 	import danxuan from "@/components/question/danxuan.vue";
 	import panduan from "@/components/question/panduan.vue";
@@ -47,19 +45,13 @@
 	import * as httpUnit from "@/api/unitTest.js"
 	import {
 		catchError,
-		toast
 	} from "@/utils/common.js"
 	import {
 		useExam
 	} from './useUnit';
 	import {
 		ref,
-		onMounted
 	} from "vue";
-	import {
-		getAuth
-	} from '@/utils/auth.js';
-	import { SHUXUE,YINGYU } from "@/utils/constant.js"
 
 	const {
 		count,

+ 3 - 4
pages/unitTest/useUnit.js

@@ -41,7 +41,6 @@ function useJifen() {
 export function useExam() {
 	// 缓存
 	const {getXueke} = useXuekeNianji();
-	const { updateTishi, getTishi} = useUnitTestTishi();
 
 	const {	showTishi, handleCloseTishi, handleShowTishi} = useTishiLeftRight()
 	const {rightAnswer,wrongAnswer,jifen, updateJifen} = useJifen();
@@ -58,14 +57,14 @@ export function useExam() {
 		xueke: null,
 	})
 	onLoad((options) => {
-		const { xueke } = getXueke();
+		const { cardId } = getXueke();
 		const {
 			jieId,zhangId,nianji
 		} = options;
 		data.jieId = jieId; // 需要路由参数 节Id
 		data.zhangId = zhangId;// 需要路由参数 章Id
 		data.nianji = nianji; // 需要年纪Id 来执行返回页面
-		data.xueke = xueke; // 需要年纪Id 来执行返回页面
+		data.xueke = cardId; // 需要年纪Id 来执行返回页面
 	
 		
 		// 初始化页面数据
@@ -144,7 +143,7 @@ export function useExam() {
 
 // 提示信息显示隐藏
 function useTishiLeftRight() {
-	
+	const { updateTishi, getTishi} = useUnitTestTishi();
 	const showTishi = ref(false);
 	// 大鹅关闭追加缓存 --- 单独针对当前手机的缓存提示
 	function handleCloseTishi() {