wangxy 5 miesięcy temu
rodzic
commit
7764c7668c
4 zmienionych plików z 36 dodań i 15 usunięć
  1. 2 2
      api/wrong.js
  2. 10 7
      pages/my/index.vue
  3. 5 1
      pages/unitTest/useUnit.js
  4. 19 5
      pages/wrong/index.vue

+ 2 - 2
api/wrong.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 export function getWrongData(data = {}) {
     return request({
-        'url': '/app/wrong/list',
+        'url': '/app/cuoti/index',
         headers: {
             isToken: true
         },
@@ -14,7 +14,7 @@ export function getWrongData(data = {}) {
 
 export function getWrongInfo(data = {}) {
     return request({
-        'url': '/app/wrong/info',
+        'url': '/app/cuoti/list',
         headers: {
             isToken: true
         },

+ 10 - 7
pages/my/index.vue

@@ -48,7 +48,7 @@
 	import {getCurrentInstance} from 'vue';
 	import {onLoad} from '@dcloudio/uni-app';
 	import {reactive,ref} from "vue";
-	import { toast } from "../../utils/common";
+	import { toast, getUserIdentity } from "../../utils/common";
 	import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
 	import {MESSAGE_VISITER_TO_LOGIN} from "@/utils/constant.js"
 	
@@ -66,12 +66,6 @@
 	const exitLogin = () => {
 		exitDialogRef.value.handleShow();
 	}
-	const wrongBtn = () => {
-		toast(MESSAGE_VISITER_TO_LOGIN);
-		uni.navigateTo({
-			url: '/pages/login/index'
-		});
-	}
 
 	const exitBtn = () => {
 		cacheManager.clearAll();
@@ -161,6 +155,15 @@
 	})
 
   function checkWrong() {
+	
+	const AuthCode = getUserIdentity();  
+	if (AuthCode == 'Visitor') {
+		toast(MESSAGE_VISITER_TO_LOGIN);
+		uni.navigateTo({
+			url: '/pages/login/index'
+		});
+		return;
+	}  
     uni.redirectTo({
       url: '/pages/wrong/index'
     })

+ 5 - 1
pages/unitTest/useUnit.js

@@ -112,7 +112,11 @@ export function useExam() {
 			result.push({reply: item.reply,stId: item.stId})
 		})
 		
-		const [error, cdata] =await catchError(httpUnit.getExamSubmit(result));
+		const [error, cdata] =await catchError(httpUnit.getExamSubmit({
+			jieId: data.jieId,
+			shitiList: result
+		}));
+
 		if (error) {
 			toast("单元测试数据提交异常");
 			return ;

+ 19 - 5
pages/wrong/index.vue

@@ -96,7 +96,13 @@
 
 	function onChangeTab(e) {
 		if (data.current !== e.currentIndex) {
-			data.current = e.currentIndex
+			data.current = e.currentIndex;
+			if (data.current == 0) {
+				data.shuxue.page = 0
+			} else if (data.current == 1){
+				data.yingyu.page = 0
+			}	 
+			getMore(data.current);
 		}
 	}
 
@@ -104,18 +110,19 @@
 		const opt = {
 			page: 1,
 			size: 10, // 固定查询10条
+			cardId: data.current+1// 前台索引加1为学科cardId
 		}
 
 		if (code == 0) {
+			// 数学
 			if (data.shuxue.state == 'no-more') return;
 			data.shuxue.state = 'loading';
-			// 数学
 			data.shuxue.page++;
 			opt.page = data.shuxue.page;
 		} else if (code == 1) {
+			// 英语
 			if (data.yingyu.state == 'no-more') return;
 			data.yingyu.state = 'loading';
-			// 英语
 			data.yingyu.page++;
 			opt.page = data.yingyu.page;
 		}
@@ -129,29 +136,36 @@
 
 			if (res.data.total * res.data.size >= res.data.length) {
 				if (code == 0) {
+					// 数学
 					data.shuxue.state = 'no-more';
 				} else if (code == 1) {
+					// 英语
 					data.yingyu.state = 'no-more';
 				}
 			} else {
 				if (code == 0) {
+					// 数学
 					data.shuxue.state = 'more';
 				} else if (code == 1) {
+					// 英语
 					data.yingyu.state = 'more';
 				}
 			}
 		}).catch(err => {
 			if (code == 0) {
+				// 数学
 				data.shuxue.state = 'more';
 			} else if (code == 1) {
+				// 英语
 				data.yingyu.state = 'more';
 			}
 		})
 	}
 
-	function getCuotiData(data) {
+	function getCuotiData(item) {
 		getWrongInfo({
-			id: data.id
+			cardId: data.current+1,
+			cdate: item.cdate
 		}).then(res => {
 			data.wrongList = res.data;
 			wrongRef.value.showPopup();