Browse Source

对接答题和收藏

chen 3 năm trước cách đây
mục cha
commit
93737a6e87

+ 42 - 2
common/httpList/goods.js

@@ -28,8 +28,31 @@ export default {
 		return myRequest({
 			url: '/collect/question',
 			data:data,
-			method: 'get',
-			noToken: true
+			method: 'POST'
+		})
+	},
+	
+	deleteCollectQuestion(data) {
+		return myRequest({
+			url: '/collect/question/delete/'+data,
+			method: 'POST',
+		})
+	},
+	
+	
+
+	listGoodsUserQuestion(data) {
+		return myRequest({
+			url: '/bank/question/listGoodsUserQuestion',
+			data:data,
+			method: 'get'
+		})
+	},
+	getCollectInfo(data) {
+		return myRequest({
+			url: '/collect/question/getInfo',
+			data:data,
+			method: 'get'
 		})
 	},
 	
@@ -50,6 +73,23 @@ export default {
 			noToken: true
 		})
 	},
+	
+	goodsCollectExamList(data) {
+		return myRequest({
+			url: '/collect/question/exam_list',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	goodsCollectList(data) {
+		return myRequest({
+			url: '/collect/question/list',
+			method: 'get',
+			data:data
+		})
+	},
+	
 	goodsExamList(data) {
 		return myRequest({
 			url: '/app/common/bank/exam/list',

+ 1 - 1
common/request.js

@@ -4,7 +4,7 @@
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
-export const BASE_URL = 'http://192.168.1.222:5055'//接口api
+export const BASE_URL = 'http://42.192.164.187:19005'//接口api
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'//图片上传api  'https://file.xyyxt.net/
 export const tenantId = '867735392558919680'
 export const myRequest = (options) => {

+ 32 - 20
pages2/bank/my_question.vue

@@ -1,31 +1,32 @@
 <template>
 	<view style="padding: 30rpx;">
 		<view v-for="(item, index) in list" :key="index"  style="margin-bottom: 30rpx;">
-			<navigator url="/pages2/bank/detail">
+			<navigator :url="'/pages2/bank/question_detail?id='+item.goodsId">
+			<!-- <navigator url="/pages2/bank/detail"> -->
 				<view class="class_item">
-					<image src="/static/login_bg.jpg" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
+					<image class="img" :src="$method.splitImgHost(item.coverUrl, true)"></image>
 					<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
-						2020年二建建筑工程管理与实务(实务专题
-						班)
+						{{item.goodsName}}
 					</view>
 					<view class=".content_box">
 						<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-						学习有效期:<text class="content"> 2020.11.20 - 2021.12.19 </text>
+						学习有效期:<text class="content"> {{$method.timestampToTime(item.studyStartTime)}} - {{$method.timestampToTime(item.studyEndTime)}} </text>
 					</view>
 				</view>
-			</navigator>
-			<view class="bottomBox">
-				<view class="box_progress">
-					<view style="width: 60%;">
-						<u-line-progress active-color="#007AFF" :percent="70"></u-line-progress>
-					</view>
-					<view>
-						<navigator url="/pages2/bank/question_detail">
-							<view class="btn">进入刷题</view>
-						</navigator>
+			<!-- </navigator> -->
+				<view class="bottomBox">
+					<view class="box_progress">
+						<view style="width: 60%;">
+							<u-line-progress active-color="#007AFF" :percent="70"></u-line-progress>
+						</view>
+						<view>
+							<!-- <navigator :url="'/pages2/bank/question_detail?id='+item.goodsId"> -->
+								<view class="btn">进入刷题</view>
+							<!-- </navigator> -->
+						</view>
 					</view>
 				</view>
-			</view>
+			</navigator>
 			
 		</view>
 	</view>
@@ -35,19 +36,24 @@
 	export default {
 		data() {
 			return {
-				list:[
-					1,2,3
-				]
+				list:[]
 				
 			}
 		},
 		onLoad(option) {
-			// this.getDict()
+			this.listGoodsUserQuestion();
 		},
 		onShow(){
 			
 		},
 		methods: {
+			listGoodsUserQuestion() {
+				this.$api.listGoodsUserQuestion({
+					
+				}).then(res => {
+					this.list = res.data.rows;
+				})
+			},
 			studyIn(){
 				this.$navTo.togo('/pages2/verify/input');
 			},
@@ -115,5 +121,11 @@
 		padding: 20rpx;
 		z-index: 999;
 		position: relative;
+		
+		.img {
+			width:100%;
+			border-radius: 24rpx;
+			height: 316rpx;
+		}
 	}
 </style>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 675 - 245
pages2/bank/questionBank.vue


+ 13 - 29
pages2/bank/questionBankTest.vue

@@ -520,14 +520,14 @@ export default {
 		},
 		changeIndex(e) {
 			let index = e.currentTarget.dataset.index
-			if(index >= 5) {
-				uni.showToast({
-				    title: '返回详情购买后即可继续',
-				    duration: 2000,
-					icon:'none'
-				});
-				return;
-			}
+			// if(index >= 5) {
+			// 	uni.showToast({
+			// 	    title: '返回详情购买后即可继续',
+			// 	    duration: 2000,
+			// 		icon:'none'
+			// 	});
+			// 	return;
+			// }
 			
 			this.current = e.currentTarget.dataset.index
 		},
@@ -546,12 +546,11 @@ export default {
 		},
 		
 		collect() {
-			// uni.showToast({
-			//     title: '返回详情购买后即可收藏~',
-			//     duration: 2000,
-			// 	icon:'none'
-			// });
-			this.collectQuestion()
+			uni.showToast({
+			    title: '返回详情购买后即可收藏~',
+			    duration: 2000,
+				icon:'none'
+			});
 			return;
 		},
 		
@@ -738,21 +737,6 @@ export default {
 			this.$set(this.questionList[bankindex],'current',index)
 			
 			console.log(this.questionList[bankindex])
-		},
-		
-		collectQuestion() {
-			this.$api.collectQuestion({
-				examId:this.id
-			}).then(res => {
-				if(res.data.code==200){
-					
-					uni.showToast({
-						title: '收藏成功',
-						duration: 2000,
-						icon:'none'
-					});
-				}
-			})
 		}
 	}
 };

+ 189 - 60
pages2/bank/question_detail.vue

@@ -47,19 +47,64 @@
 		</view>
 		<view class="title-list">
 			<view class="content">
-				<view class="list" v-for="(item1,index) in outline">
-					<view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
-						2Z106010 施工承发包的模式-2Z106020 施工合同...
-					</view>
-					<view class="article" v-if="item1.showList" :class="{active:index1 == 0}" v-for="(article,index1) in item1.list">
-						施工承发包模式-施工合同与物资采购合同二
-						<navigator url="/pages2/bank/questionBank">
-							<view v-if="index1 == 0" class="btn">做题</view>
-							<view v-if="index1 == 1" class="btn">继续</view>
-							<view v-if="index1 == 2" class="btn">重做</view>
-						</navigator>
+				<view class="list" v-for="(item1,index1) in bankList" :key="index1">
+					<template v-if="item1.type==1">
+						<view class="moduleItem" @click="clickModule(item1.majorId,index1)">
+							<view class="courseName">{{item1.name}}</view>
+							<view>
+								<image src="/static/icon/up.png" class="icon_up" v-if="!item1.showList"></image>
+								<image src="/static/icon/down.png" class="icon_up" v-if="item1.showList"></image>
+							</view>
+						</view>
 						
-					</view>
+						<template v-if="item1.showList">
+							<view v-for="(item2,index2) in item1.list" :key="index2" >
+								<view class="section" @click="changeItem(index1,item2.chapterExamId,item1.type)">
+									<image src="/static/icon/up1.png" class="icon_up" v-if="!item2.showList"></image>
+									<image src="/static/icon/down1.png" class="icon_up" v-if="item2.showList"></image>
+									{{item2.name}}
+								</view>
+								<view  v-if="item2.showList">
+									<view class="article" :class="{active:index3 == 0}"  v-for="(article,index3) in item2.list" :key="index3">
+										<view class="flex_auto">{{article.examName}}</view>
+										<navigator :url="'/pages2/bank/questionBank?id='+article.examId+'&goodsid='+goodsData.goodsId">
+											<view class="btn">做题</view>
+										</navigator>
+									</view>
+								</view>
+								<u-line></u-line>
+							</view>
+						</template>
+						
+						
+					</template>
+					
+					<template v-if="item1.type ==2">
+						<view class="section" @click="changeItem(index1,item1.majorId,item1.type)">
+							<image src="/static/icon/up1.png" class="icon_up" v-if="!item1.showList"></image>
+							<image src="/static/icon/down1.png" class="icon_up" v-if="item1.showList"></image>
+							{{item1.name}}
+						</view>
+						<view v-if="item1.showList" >
+							<view class="article" :class="{active:index2 == 0}"  :key="index3" v-for="(article,index2) in item1.list">
+								<view class="flex_auto">{{item1.name}}</view>
+								<navigator :url="'/pages2/bank/questionBank?id='+article.majorId+'&goodsid='+goodsData.goodsId">
+									<view class="btn">做题</view>
+								</navigator>
+								
+							</view>
+						</view>
+					</template>
+					
+					<template v-if="item1.type ==3">
+						<view class="article active" >
+							<view class="flex_auto">{{item1.name}}</view>
+							<navigator :url="'/pages2/bank/questionBank?id='+item1.majorId+'&goodsid='+goodsData.goodsId">
+								<view class="btn">做题</view>
+							</navigator>
+							
+						</view>
+					</template>
 				</view>
 			</view>
 		</view>
@@ -71,19 +116,9 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
-			outline:[{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			},{
-				list:[1,2,3],
-				showList:false,
-			}]
+			goodsData:{},
+			bankList:[],
+			id:'',
 		};
 	},
 	onUnload() {
@@ -91,20 +126,82 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-
+		this.id = option.id
+		this.getDetail();
+		this.goodsBankList()
 	},
 	onShow() {
 		
 	},
 	methods: {
+		getDetail(){
+			this.$api.goodsDetail(this.id).then(res => {
+				console.log(res)
+				this.goodsData = res.data.data;
+				 
+			})
+		},
 		
-		changeItem(e) {
-			let index = e.currentTarget.dataset.index
-			this.outline.forEach((arrItem,i) => {
-				if(i == index) {
-					arrItem.showList = !arrItem.showList
-				}
+		goodsBankList() {
+			this.$api.goodsBankList({
+				goodsId:this.id
+			}).then(res => {
+				console.log(res)
+				this.bankList = res.data.data;
+			})
+		},
+		clickModule(id,index) {
+			
+			
+			if(this.bankList[index].list) {
+				this.$set(this.bankList[index],'showList',!this.bankList[index].showList)
+				return;
+			}
+			
+			this.$api.goodsChapterList({
+				moduleExamId:id
+			}).then(res => {
+				this.$set(this.bankList[index],'showList',true)
+				this.$set(this.bankList[index],'list',res.data.data)
+				 
 			})
+		},
+		changeItem(index1,id,type) {
+			
+			if(type == 1) {
+				if(this.bankList[index1].list[index2].list) {
+					this.$set(this.bankList[index1].list[index2],'showList',!this.bankList[index1].list[index2].showList)
+					return;
+				}
+				
+				this.$api.goodsExamList({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1].list[index2],'showList',true)
+					this.$set(this.bankList[index1].list[index2],'list',res.data.data)
+					
+					 
+				})
+				
+			} else if(type == 2) {
+				if(this.bankList[index1].list) {
+					this.$set(this.bankList[index1],'showList',!this.bankList[index1].showList)
+					return;
+				}
+				
+				this.$api.goodsExamList({
+					chapterExamId:id
+				}).then(res => {
+					
+					this.$set(this.bankList[index1],'showList',true)
+					this.$set(this.bankList[index1],'list',res.data.data)
+					
+					 
+				})
+			}
+			
+			
 			
 		}
 	}
@@ -215,6 +312,30 @@ export default {
 		}
 	}
 	
+	
+	.courseName{
+		white-space:nowrap;
+		overflow:hidden;
+		text-overflow:ellipsis; 
+	}
+	
+	
+	.moduleItem{
+		height: 80rpx;
+		color: #333333;
+		font-size: 32rpx;
+		line-height: 80rpx;
+		font-weight: bold;
+		display: flex;
+		justify-content: space-between;
+	
+	}
+	
+	.icon_up{
+		width: 32rpx;
+		height: 32rpx;
+	}
+	
 	.title-list {
 		background: #EAEEF1;
 		padding:16rpx 16rpx 124rpx;
@@ -227,46 +348,40 @@ export default {
 				border-radius: 16rpx;
 				padding:10rpx 16rpx;
 				
-				.section {
-					padding:30rpx 0;
-					border-bottom: 1rpx solid #EEEEEE;
-					font-size: 24rpx;
-					color: #666666;
-					
-					&::before {
-						content:'^';
-						display: inline-block;
-						margin-right:20rpx;
-					}
+				.module {
+					font-size: 30rpx;
+					color: #333333;
 					
-					&.up {
-						border:0;
-						&::before {
-							transform: rotate(180deg);
-						}
+					.icon {
+						margin-right:10rpx;
 					}
 				}
 				
+				.section {
+					font-size: 30rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #333333;
+					white-space:nowrap;
+					overflow:hidden;
+					text-overflow:ellipsis; 
+					margin: 20rpx 0;
+					display: flex;
+					align-items: center;
+				}
+				
 				.article {
 					height:80rpx;
 					display: flex;
 					align-items: center;
-					margin-left:88rpx;
+					margin-left:72rpx;
 					font-size: 24rpx;
 					color: #666666;
 					border-bottom: 1rpx solid #EEEEEE;
+					display: flex;
 					
-					.btn {
-						width: 96rpx;
-						height: 48rpx;
-						line-height: 48rpx;
-						text-align: center;
-						color:#fff;
-						font-size: 30rpx;
-						border-radius:24rpx;
-						background: #007AFF;
-						margin-left:36rpx;
-						border-radius: 24rpx;
+					.flex_auto{
+						flex:1;
 					}
 					
 					&:nth-last-of-type(1) {
@@ -275,6 +390,20 @@ export default {
 					
 					&.active {
 						color:#007AFF;
+						
+						
+						.btn {
+							width: 96rpx;
+							height: 48rpx;
+							line-height: 48rpx;
+							text-align: center;
+							color:#fff;
+							font-size: 30rpx;
+							border-radius:24rpx;
+							background: #007AFF;
+							margin-left:36rpx;
+							border-radius: 24rpx;
+						}
 					}
 				}
 			}

+ 47 - 4
pages2/subject/collect.vue

@@ -23,10 +23,25 @@
 				</view>
 			</view>
 			<view class="wrongTab">
-				<view class="item active">试卷归类</view>
-				<view class="item">题型归类</view>
+				<view class="item" :class="{active:type == 1}" @click="selectType(1)">试卷归类</view>
+				<view class="item" :class="{active:type == 2}" @click="selectType(2)">题型归类</view>
 			</view>
-			<view class="wrongList">
+			<view class="wrongList" v-if="type == 1">
+				<view class="item" v-for="(item,index) in testList" :key="index">
+					<view class="title">{{item.examName}}</view>
+					<view class="bt">
+						<view class="left">错题数<text class="num">23</text></view>
+						<view class="right">
+							<navigator :url="'/pages2/bank/questionBank?id='+item.examId">
+								<view class="btn">重做</view>
+							</navigator>
+							<!-- <view class="btn">解析</view> -->
+						</view>
+					</view>
+				</view>
+			</view>
+			
+			<view class="wrongList" v-if="type == 2">
 				<view class="item" v-for="(item,index) in 5" :key="index">
 					<view class="title">试卷名称可换行我也不知道最多多少个字总之可以换行就对了</view>
 					<view class="bt">
@@ -55,13 +70,41 @@ export default {
 			scennList2:[
 				{id: 1, name: '全部试卷类型', checked: true},{id: 1, name: '模拟卷'},{id: 1, name: '真题'},{id: 1, name: '练习'}
 			],
+			type:1,
+			testList:[],
+			typeList:[]
 		};
 	},
 	onPullDownRefresh() {},
-	onLoad(option) {},
+	onLoad(option) {
+		this.goodsCollectExamList()
+	},
 	methods: {
+		goodsCollectExamList() {
+			this.$api.goodsCollectExamList({
+				
+			}).then(res => {
+				this.testList = res.data.rows; 
+			})
+		},
+		goodsCollectList() {
+			this.$api.goodsCollectList({
+				
+			}).then(res => {
+				this.typeList = res.data.rows; 
+			})
+		},
 		showSceen(type){
 			this.sceenType = type
+			
+		},
+		selectType(type) {
+			this.type = type;
+			// if(type == 1) {
+			// 	this.goodsCollectExamList()
+			// } else if(type == 2) {
+			// 	this.goodsCollectList();
+			// }
 		},
 		hideSceen(){
 			this.sceenType = null

+ 6 - 4
pages2/wd/question_bank.vue

@@ -9,10 +9,12 @@
 			</view>
 		</navigator>
 		<view class="bottom">
-			<view class="item collect">
-				<view class="text">收藏集></view>
-				<image class="img" src="/static/sc.png"></image>
-			</view>
+			<navigator url="/pages2/subject/collect">
+				<view class="item collect">
+					<view class="text">收藏集></view>
+					<image class="img" src="/static/sc.png"></image>
+				</view>
+			</navigator>
 			<view class="item list">
 				<navigator url="/pages2/bank/question_record">
 					<view class="list-in">

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác