wangguoyu 2 mesiacov pred
rodič
commit
de8daf3160
3 zmenil súbory, kde vykonal 387 pridanie a 46 odobranie
  1. 38 41
      pages.json
  2. 17 5
      pages/my/index.vue
  3. 332 0
      pages/my/xuexiJilu.vue

+ 38 - 41
pages.json

@@ -28,7 +28,7 @@
 				"navigationBarTitleText": "专题",
 				"navigationStyle": "custom"
 			}
-		},	
+		},
 		{
 			"path": "pages/zhuanti/zhuantiInfo",
 			"style": {
@@ -36,7 +36,7 @@
 				"navigationStyle": "custom"
 			}
 		},
-			{
+		{
 			"path": "pages/study/index",
 			"style": {
 				"navigationBarTitleText": "学习",
@@ -49,7 +49,7 @@
 				"navigationBarTitleText": "视频",
 				"navigationStyle": "custom"
 			}
-		},	{
+		}, {
 			"path": "pages/study/lookShipinNew",
 			"style": {
 				"navigationBarTitleText": "视频",
@@ -58,14 +58,14 @@
 		},
 		{
 			"path": "pages/game/index",
-				
+
 			"style": {
 				"navigationStyle": "custom",
 				"app-plus": {
 					"animationType": "none"
 				}
 			}
-		
+
 		},
 		{
 			"path": "pages/my/index",
@@ -78,18 +78,22 @@
 			"style": {
 				"navigationStyle": "custom"
 			}
-		},	
+		},
 		{
 			"path": "pages/my/sxtkPage",
 			"style": {
 				"navigationStyle": "custom"
 			}
+		}, {
+			"path": "pages/my/xuexiJilu",
+			"style": {
+				"navigationStyle": "custom"
+			}
 		},
 		{
-			"path" : "pages/unitTest/index",
-			"style" :
-			{
-				"navigationBarTitleText" : "单元测试",
+			"path": "pages/unitTest/index",
+			"style": {
+				"navigationBarTitleText": "单元测试",
 				"navigationStyle": "custom",
 				"app-plus": {
 					"softinputMode": "adjustResize",
@@ -98,46 +102,41 @@
 			}
 		},
 		{
-			"path" : "pages/pay/svip",
-			"style" : 
-			{
+			"path": "pages/pay/svip",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path" : "pages/pay/order",
-			"style" : 
-			{
+			"path": "pages/pay/order",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		},
-		
+
 		{
-			"path" : "pages/pay/orderPay",
-			"style" : 
-			{
+			"path": "pages/pay/orderPay",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path" : "pages/wrong/index",
-			"style" : 
-			{
+			"path": "pages/wrong/index",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		},
 		{
-			"path" : "pages/mall/mallPage",
-			"style" : 
-			{
+			"path": "pages/mall/mallPage",
+			"style": {
 				"navigationStyle": "custom"
 			}
 		}
 	],
-	 "tabBar": {
-	    "custom": true,
-	    "list": []
-	  },
+	"tabBar": {
+		"custom": true,
+		"list": []
+	},
 	// "tabBar": {
 	// 	"height": "90rpx",
 	// 	"iconWidth": "134rpx",
@@ -166,26 +165,24 @@
 		"navigationBarTitleText": "鹅状元",
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8",
-	//	"animationType": "none",
+		//	"animationType": "none",
 		//"animationDuration": "0",
 		//禁止滑动返回
 		"app-plus": {
-					// "popGesture": "none"
-				}
+			// "popGesture": "none"
+		}
 		/* "app-plus": {
 			"background": "#efeff4"
 		} */
 	},
 
 	"uniIdRouter": {},
-	"condition" : { //模式配置,仅开发期间生效
+	"condition": { //模式配置,仅开发期间生效
 		"current": 0, //当前激活的模式(list 的索引项)
-		"list": [
-			{
-				"name": "login", //模式名称
-				"path": "pages/login/index", //启动页面,必选
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			}
-		]
+		"list": [{
+			"name": "login", //模式名称
+			"path": "pages/login/index", //启动页面,必选
+			"query": "" //启动参数,在页面的onLoad函数里面得到
+		}]
 	}
 }

+ 17 - 5
pages/my/index.vue

@@ -43,6 +43,10 @@
 				<icon class="list-icon sxtk-icon"></icon>
 				<text>数学题库</text>
 			</view>
+			<view v-if="loginFlag" class="list-row" @click="xxjlClick">
+				<icon class="list-icon sxtk-icon"></icon>
+				<text>学习记录</text>
+			</view>
 			<view v-if="appleCode=='true'&&currentPlatform=='ios'" class="list-row" @click="duihuamaDuihuan">
 				<icon class="list-icon duihuanma-icon"></icon>
 				<text>兑换码</text>
@@ -77,7 +81,8 @@
 		<duihuanmaDialog ref="duihuanmaDialogRef" @confirm-btn="duihuanmaBtn" title="兑换"></duihuanmaDialog>
 		<tel-dialog @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
 		<agree-content-dialog ref="agreeContentDialogRef" :agreeType="agreeType"></agree-content-dialog>
-		<tip-small-dialog ref="kefuDialogRef" :title="kefuTitle" @confirm-btn="kefuBtn" :content="kefuContent" class="kefu-dialog"></tip-small-dialog>
+		<tip-small-dialog ref="kefuDialogRef" :title="kefuTitle" @confirm-btn="kefuBtn" :content="kefuContent"
+			class="kefu-dialog"></tip-small-dialog>
 	</view>
 </template>
 
@@ -163,7 +168,7 @@
 	const kefuDialogRef = ref(null);
 	const kefuTitle = '提示';
 	const kefuContent = '客服电话:17304117625';
-	
+
 	const exitLogin = () => {
 		exitDialogRef.value.handleShow();
 	}
@@ -241,10 +246,11 @@
 		agreeContentDialogRef.value.handleShow();
 	}
 
-	function kefudianhua(){
+	function kefudianhua() {
 		kefuDialogRef.value.handleShow();
 	}
-	function kefuBtn(){
+
+	function kefuBtn() {
 		kefuDialogRef.value.handleClose();
 	}
 	// 游客弹窗---确定
@@ -290,11 +296,17 @@
 	}
 
 
-	function sxtkClick(){
+	function sxtkClick() {
 		uni.redirectTo({
 			url: '/pages/my/sxtkPage'
 		});
 	}
+
+	function xxjlClick() {
+		uni.redirectTo({
+			url: '/pages/my/xuexiJilu'
+		});
+	}
 	// 产品商城
 	function cpscClick() {
 

+ 332 - 0
pages/my/xuexiJilu.vue

@@ -0,0 +1,332 @@
+<template>
+	<view class="ezy-cuoti-page">
+		<view class="icon-title-navBar-box">
+			<view @click="handleBack" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">学习记录</text>
+		</view>
+		<view class="ezy-tab-border">
+			<uni-segmented-control :current="data.current" :values="data.items" active-color="#3A7FE9"
+				@clickItem="onChangeTab" class="ezy-tab-box" />
+			<view class="cuoti-content-box">
+				<view v-if="data.current === 0">
+					<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.shuxue.loading"
+						:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
+						class="cuoti-scroll-view">
+						<!--数学-->
+						<uni-list>
+							<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>
+									<!-- 数量 -->
+									<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)"
+								:contentText="data.shuxue.contentText"></uni-load-more>
+						</uni-list>
+					</scroll-view>
+				</view>
+				<view v-if="data.current === 1">
+					<scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="data.yingyu.loading"
+						:refresher-threshold="50" refresher-background="transparent" @refresherrefresh="onRefresh"
+						class="cuoti-scroll-view">
+						<!--英语-->
+						<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 @click="getCuotiData(item)" class="cuoti-btn">查看错题</view>
+								</template>
+							</uni-list-item>
+							<uni-load-more :status="data.yingyu.state" @click="getMore(1)"
+								:contentText="data.yingyu.contentText"></uni-load-more>
+						</uni-list>
+					</scroll-view>
+				</view>
+			</view>
+		</view>
+
+		<cuoti ref="wrongRef" :subjectId="subjectId" :list="data.wrongList" @back="handleBackFromCuoti"></cuoti>
+		<CustomTabBar></CustomTabBar>
+	</view>
+</template>
+
+<script setup>
+	import {
+		reactive,
+		ref
+	} from "vue";
+	import {
+		getWrongData
+	} from "@/api/wrong";
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import cuoti from "@/components/chengji/chengji.vue";
+	import {
+		getWrongInfo
+	} from "@/api/wrong";
+	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+
+	const zhangId = ref(null);
+	const nianji = ref(null);
+	const subjectId = ref(null);
+
+	const wrongRef = ref(null);
+
+	const data = reactive({
+		items: ['数学', '英语'],
+		current: 0,
+		shuxue: {
+			page: 0,
+			list: [],
+			loading: false,
+			state: 'more',
+			contentText: {
+				contentdown: '查看更多',
+				contentrefresh: '加载中',
+				contentnomore: '没有更多'
+			}
+
+		},
+		yingyu: {
+			page: 0,
+			list: [],
+			loading: false,
+			state: 'more',
+			contentText: {
+				contentdown: '查看更多',
+				contentrefresh: '加载中',
+				contentnomore: '没有更多'
+			}
+		},
+		wrongList: [],
+	})
+	subjectId.value = data.current+1;
+	function handleBack() {
+		uni.redirectTo({
+			url: '/pages/my/index'
+		})
+		uni.$emit('back-outpage')
+	}
+
+	function handleBackFromCuoti() {
+		wrongRef.value.closePopup();
+		uni.$emit('back-outpage')
+	}
+
+	function onChangeTab(e) {
+		if (data.current !== e.currentIndex) {
+			data.current = e.currentIndex;
+			subjectId.value = data.current+1;
+			if (data.current == 0) {
+				data.shuxue.page = 0
+			} else if (data.current == 1) {
+				data.yingyu.page = 0
+			}
+			refreshData(data.current);
+		}
+	}
+
+	function refreshData(code) {
+		const opt = {
+			page: 1,
+			size: 10, // 固定查询10条
+			subjectId: data.current + 1 // 前台索引加1为学科cardId
+		}
+
+		if (code == 0) {
+			data.shuxue.list = [];
+			// 数学
+			data.shuxue.state = 'loading';
+			data.shuxue.page++;
+			opt.page = data.shuxue.page;
+		} else if (code == 1) {
+			data.yingyu.list = [];
+			// 英语
+			data.yingyu.state = 'loading';
+			data.yingyu.page++;
+			opt.page = data.yingyu.page;
+		}
+		getWrongData(opt).then(res => {
+			if (code == 0) {
+				data.shuxue.list = data.shuxue.list.concat(res.data.data);
+				data.shuxue.loading = false;
+			} else if (code == 1) {
+				data.yingyu.list = data.yingyu.list.concat(res.data.data);
+				data.yingyu.loading = false;
+			}
+			if (code == 0) {
+				if (res.data.total > data.shuxue.list.length) {
+					// 数学
+					data.shuxue.state = 'more';
+					data.shuxue.loading = false;
+				} else {
+					// 数学
+					data.shuxue.state = 'no-more';
+					data.shuxue.loading = false;
+				
+				}
+			} else if (code == 1) {
+				if (res.data.total > data.yingyu.list.length) {
+					// 英语
+					data.yingyu.state = 'more';
+					data.yingyu.loading = false;
+				} else {
+					// 英语
+					data.yingyu.state = 'no-more';
+					data.yingyu.loading = false;
+				}
+			}
+		}).catch(err => {
+			if (code == 0) {
+				// 数学
+				data.shuxue.state = 'more';
+				data.shuxue.loading = false;
+			} else if (code == 1) {
+				// 英语
+				data.yingyu.state = 'more';
+				data.yingyu.loading = false;
+			}
+		})
+	}
+
+	function getMore(code) {
+		const opt = {
+			page: 1,
+			size: 10, // 固定查询10条
+			subjectId: 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;
+		}
+		getWrongData(opt).then(res => {
+			if (code == 0) {
+				data.shuxue.list = data.shuxue.list.concat(res.data.data);
+				data.shuxue.loading = false;
+			} else if (code == 1) {
+				data.yingyu.list = data.yingyu.list.concat(res.data.data);
+				data.yingyu.loading = false;
+			}
+			if (code == 0) {
+				if (res.data.total > data.shuxue.list.length) {
+					// 数学
+					data.shuxue.state = 'more';
+					data.shuxue.state_text = '加载更多';
+					data.shuxue.loading = false;
+				} else {
+					// 数学
+					data.shuxue.state = 'no-more';
+					data.shuxue.state_text = '没有更多啦';
+				
+					data.shuxue.loading = false;
+				}
+			} else if (code == 1) {
+				if (res.data.total > data.yingyu.list.length) {
+					// 英语
+					data.yingyu.state = 'more';
+					data.yingyu.state_text = '加载更多';
+					data.yingyu.loading = false;
+				} else {
+					// 英语
+					data.yingyu.state = 'no-more';
+					data.yingyu.state_text = '没有更多啦';
+			
+					data.yingyu.loading = false;
+				}
+			}
+		}).catch(err => {
+			if (code == 0) {
+				// 数学
+				data.shuxue.state = 'more';
+				data.shuxue.state_text = '加载更多';
+				data.shuxue.loading = false;
+			} else if (code == 1) {
+				// 英语
+				data.yingyu.state = 'more';
+				data.yingyu.state_text = '加载更多';
+				data.yingyu.loading = false;
+			}
+		})
+	}
+
+	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 onRefresh() {
+		if (data.current == 0) {
+			data.shuxue.page = 0;
+			data.shuxue.list = [];
+			data.shuxue.loading = true;
+		} else if (data.current == 1) {
+			data.yingyu.page = 0;
+			data.yingyu.list = [];
+			data.yingyu.loading = true;
+		}
+		refreshData(data.current);
+	}
+
+	onLoad(() => {
+		getMore(data.current);
+	})
+</script>
+
+<style>
+
+</style>