wangguoyu 2 months ago
parent
commit
9de47593db
2 changed files with 67 additions and 62 deletions
  1. 11 0
      api/my.js
  2. 56 62
      pages/my/xuexiJilu.vue

+ 11 - 0
api/my.js

@@ -99,4 +99,15 @@ export function updataHead(data = {}) {
     data,
     timeout: 20000
   })
+}
+export function xuexiJilu(data = {}) {
+  return request({
+    'url': '/app/user/my/xuexi/jilu',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 56 - 62
pages/my/xuexiJilu.vue

@@ -14,20 +14,21 @@
 						class="cuoti-scroll-view">
 						<!--数学-->
 						<uni-list>
-							<uni-list-item v-for="item in data.shuxue.list" class="list-item-box">
+							<uni-list-item v-for="item in data.shuxue.list"  class="list-item-box">
 								<template v-slot:body>
-									<!-- 时间 -->
-									<view class="item-date-row">
-										<icon class="data-icon"></icon>
-										<text>{{ item.cdate }}</text>
+									<view @click="goDao(item)">
+										<view class="item-date-row">
+											<icon class="data-icon"></icon>
+											<text>{{ item.levelName }}</text>
+										</view>
+										<view>
+											<text>{{ item.zhangName }}</text>
+										</view>
+										<view>
+											<text>{{ item.jieName }}</text>
+										</view>
 									</view>
-									<!-- 数量 -->
-									<view class="item-cuoti-row">
-										<icon class="cuoti-icon"></icon>
-										<view class="cuoti-content">错题数:<text
-												class="cuoti-text">{{ item.count }}</text>题</view>
-									</view>
-									<view @click="getCuotiData(item)" class="cuoti-btn">查看错题</view>
+
 								</template>
 							</uni-list-item>
 							<uni-load-more :status="data.shuxue.state" @click="getMore(0)"
@@ -43,18 +44,19 @@
 						<uni-list>
 							<uni-list-item v-for="item in data.yingyu.list" class="list-item-box">
 								<template v-slot:body>
-									<!-- 时间 -->
-									<view class="item-date-row">
-										<icon class="data-icon"></icon>
-										<text>{{ item.cdate }}</text>
-									</view>
-									<!-- 数量 -->
-									<view class="item-cuoti-row">
-										<icon class="cuoti-icon"></icon>
-										<view class="cuoti-content">错题数:<text
-												class="cuoti-text">{{ item.count }}</text>题</view>
+									<view>
+										<view class="item-date-row">
+											<icon class="data-icon"></icon>
+											<text>{{ item.levelName }}</text>
+										</view>
+										<view>
+											<text>{{ item.zhangName }}</text>
+										</view>
+										<view>
+											<text>{{ item.jieName }}</text>
+										</view>
 									</view>
-									<view @click="getCuotiData(item)" class="cuoti-btn">查看错题</view>
+
 								</template>
 							</uni-list-item>
 							<uni-load-more :status="data.yingyu.state" @click="getMore(1)"
@@ -64,8 +66,6 @@
 				</view>
 			</view>
 		</view>
-
-		<cuoti ref="wrongRef" :subjectId="subjectId" :list="data.wrongList" @back="handleBackFromCuoti"></cuoti>
 		<CustomTabBar></CustomTabBar>
 	</view>
 </template>
@@ -76,8 +76,8 @@
 		ref
 	} from "vue";
 	import {
-		getWrongData
-	} from "@/api/wrong";
+		xuexiJilu
+	} from "@/api/my.js";
 	import {
 		onLoad
 	} from "@dcloudio/uni-app";
@@ -121,7 +121,13 @@
 		},
 		wrongList: [],
 	})
-	subjectId.value = data.current+1;
+	subjectId.value = data.current + 1;
+
+
+	function goDao(data) {
+		console.log('data', data);
+	}
+
 	function handleBack() {
 		uni.redirectTo({
 			url: '/pages/my/index'
@@ -137,7 +143,7 @@
 	function onChangeTab(e) {
 		if (data.current !== e.currentIndex) {
 			data.current = e.currentIndex;
-			subjectId.value = data.current+1;
+			subjectId.value = data.current + 1;
 			if (data.current == 0) {
 				data.shuxue.page = 0
 			} else if (data.current == 1) {
@@ -167,7 +173,7 @@
 			data.yingyu.page++;
 			opt.page = data.yingyu.page;
 		}
-		getWrongData(opt).then(res => {
+		xuexiJilu(opt).then(res => {
 			if (code == 0) {
 				data.shuxue.list = data.shuxue.list.concat(res.data.data);
 				data.shuxue.loading = false;
@@ -184,7 +190,7 @@
 					// 数学
 					data.shuxue.state = 'no-more';
 					data.shuxue.loading = false;
-				
+
 				}
 			} else if (code == 1) {
 				if (res.data.total > data.yingyu.list.length) {
@@ -230,7 +236,7 @@
 			data.yingyu.page++;
 			opt.page = data.yingyu.page;
 		}
-		getWrongData(opt).then(res => {
+		xuexiJilu(opt).then(res => {
 			if (code == 0) {
 				data.shuxue.list = data.shuxue.list.concat(res.data.data);
 				data.shuxue.loading = false;
@@ -248,7 +254,7 @@
 					// 数学
 					data.shuxue.state = 'no-more';
 					data.shuxue.state_text = '没有更多啦';
-				
+
 					data.shuxue.loading = false;
 				}
 			} else if (code == 1) {
@@ -261,7 +267,7 @@
 					// 英语
 					data.yingyu.state = 'no-more';
 					data.yingyu.state_text = '没有更多啦';
-			
+
 					data.yingyu.loading = false;
 				}
 			}
@@ -280,35 +286,23 @@
 		})
 	}
 
-	function formatListToUse(list) {
-		list.forEach((item, index) => {
-			item.mta_show = false;
-			if (item.type == 3) {
-				item.result = JSON.parse(item.result);
-				item.placeholders = item.result.map((item, cindex) => `[bank${cindex+1}]`)
-				item.reply = item.reply ? JSON.parse(item.reply) : item.result.map(() => '');
-			}
-
-      if (item.type == 4) {
-        // 特殊题型英语题
-        const audioList = item.audios ? item.audios.split(',') : [];
-        item.placeholders = audioList.map((item, cindex) => `[yingyu${cindex+1}]`)
-        item.audioList = audioList;
-      }
-		})
-	}
-
-	function getCuotiData(item) {
-		getWrongInfo({
-			subjectId: data.current + 1,
-			cdate: item.cdate
-		}).then(res => {
-			formatListToUse(res.data)
-			data.wrongList = res.data;
-			wrongRef.value.showPopup();
-		})
-	}
+	// function formatListToUse(list) {
+	// 	list.forEach((item, index) => {
+	// 		item.mta_show = false;
+	// 		if (item.type == 3) {
+	// 			item.result = JSON.parse(item.result);
+	// 			item.placeholders = item.result.map((item, cindex) => `[bank${cindex+1}]`)
+	// 			item.reply = item.reply ? JSON.parse(item.reply) : item.result.map(() => '');
+	// 		}
 
+	//      if (item.type == 4) {
+	//        // 特殊题型英语题
+	//        const audioList = item.audios ? item.audios.split(',') : [];
+	//        item.placeholders = audioList.map((item, cindex) => `[yingyu${cindex+1}]`)
+	//        item.audioList = audioList;
+	//      }
+	// 	})
+	// }
 	function onRefresh() {
 		if (data.current == 0) {
 			data.shuxue.page = 0;