Selaa lähdekoodia

我的题库通+进入刷题+刷题统计

chen 3 vuotta sitten
vanhempi
commit
85994f9562

+ 20 - 0
pages.json

@@ -278,6 +278,16 @@
 					}
 				}
 			},
+			{
+				"path": "bank/question_detail",
+				"style": {
+					"navigationBarTitleText": "进入刷题",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "msg/index",
 				"style": {
@@ -288,6 +298,16 @@
 					}
 				}
 			},
+			{
+				"path": "bank/question_statistics",
+				"style": {
+					"navigationBarTitleText": "做题统计",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "bank/questionBank",
 				"style": {

+ 1 - 1
pages/index/index.vue

@@ -27,7 +27,7 @@ export default {
 	},
 	methods: {
 		jumpBank() {
-			this.$navTo.togo('/pages2/bank/question_record');
+			this.$navTo.togo('/pages2/bank/question_statistics');
 		},
 		getDict() {
 		

+ 15 - 2
pages2/bank/my_question.vue

@@ -20,7 +20,9 @@
 						<u-line-progress active-color="#007AFF" :percent="70"></u-line-progress>
 					</view>
 					<view>
-						<u-button type="primary" size="mini">进入刷题</u-button>
+						<navigator url="/pages2/bank/question_detail">
+							<view class="btn">进入刷题</view>
+						</navigator>
 					</view>
 				</view>
 			</view>
@@ -61,13 +63,24 @@
 			background: #EAEEF1;
 		}
 </style>
-<style scope>
+<style lang="scss" scope>
 	
 	.box_progress{
 		display: flex;
 		justify-content:space-between;
 		align-items: center;
 		margin-top: 20rpx;
+		
+		.btn {
+			width: 165rpx;
+			height: 48rpx;
+			background: #007AFF;
+			border-radius: 16rpx;
+			line-height: 48rpx;
+			text-align: center;
+			color:#fff;
+			font-size: 30rpx;
+		}
 	}
 	.bottomBox{
 		background: #FFFFFF;

+ 41 - 0
pages2/bank/questionBankTest.vue

@@ -68,6 +68,11 @@
 				</view>
 			</view>
 		</u-popup>
+		
+		<view class="dialog" v-if="showDialog">
+			<view class="text">左右滑动切换上下题</view>
+			<view class="btn" @click="hideDialog">我知道了</view>
+		</view>
 	</view>
 </template>
 
@@ -80,6 +85,7 @@ export default {
 			ans:[1,2,3,4,1],
 			ques:['','','','',''],
 			show: false,
+			showDialog:true,
 			bankList: [
 				[
 					{
@@ -178,6 +184,9 @@ export default {
 		openFooterTab() {
 			this.show = true;
 		},
+		hideDialog() {
+			this.showDialog = false
+		},
 		changeIndex(e) {
 			let index = e.currentTarget.dataset.index
 			if(index >= 5) {
@@ -376,4 +385,36 @@ export default {
 	font-size: 30rpx;
 	color: #666;
 }
+
+.dialog {
+	position: fixed;
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	background-color: rgba(0,0,0,0.8);
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+	z-index: 20000;
+	
+	.text {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		text-align: center;
+	}
+	
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #FFFFFF;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin:41rpx auto;
+		color:#fff;
+		font-size: 32rpx;
+	}
+}
 </style>

+ 284 - 0
pages2/bank/question_detail.vue

@@ -0,0 +1,284 @@
+<template>
+	<view>
+		<view class="top">
+			<navigator url="/pages2/bank/question_statistics">
+				<view class="left">
+					<view class="title">做题统计</view>
+					<view class="progress">
+						<view class="item-left">
+							<view class="desc">
+								<text>总进度</text>
+							</view>
+							<view class="percent">
+								68
+								<text class="per">%</text>
+							</view>
+						</view>
+						<view class="item-right">
+							<view class='up'>
+								<text class="orange">58</text>
+								<text>/100</text>
+							</view>
+							
+							<view class='down'>
+								<text class="orange">已答</text>
+								<text>/未答</text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</navigator>
+			<view class="right">
+				<view class="title">
+					错题集 >
+				</view>
+				<view class="number">
+					35
+				</view>
+			</view>
+			<view class="right">
+				<view class="title">
+					收藏集 >
+				</view>
+				<view class="number">
+					1
+				</view>
+			</view>
+		</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/questionBankTest">
+							<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>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+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,
+			}]
+		};
+	},
+	onUnload() {
+		
+	},
+	computed: { ...mapGetters(['userInfo']) },
+	onLoad(option) {
+
+	},
+	onShow() {
+		
+	},
+	methods: {
+		
+		changeItem(e) {
+			let index = e.currentTarget.dataset.index
+			this.outline.forEach((arrItem,i) => {
+				if(i == index) {
+					arrItem.showList = !arrItem.showList
+				}
+			})
+			
+		}
+	}
+};
+</script>
+<style >
+	page{
+		background-color: #EAEEF1;
+	}
+</style>
+<style lang="scss" scope>
+	
+	.top {
+		padding:16rpx 16rpx 0;
+		display: flex;
+		justify-content: space-between;
+		.left {
+			width: 326rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
+			border-radius: 16rpx;
+			background:#fff;
+			padding:20rpx;
+			
+			.title {
+				font-size: 24rpx;
+				line-height: 24rpx;
+				color: #333333;
+			}
+			
+			.progress {
+				margin-top:10rpx;
+				display: flex;
+				
+				.item-left {
+					flex:1;
+					border-right:1rpx solid #EEEEEE;
+					.desc {
+						text {
+							line-height: 24rpx;
+							font-size: 24rpx;
+							color: #999999;
+						}
+					}
+					
+					.percent {
+						margin-top:10rpx;
+						line-height: 64rpx;
+						font-size: 64rpx;
+						font-weight: bold;
+						color: #007AFF;
+					}
+					
+					.per {
+						font-size: 30rpx;
+						color: #007AFF;
+					}
+				}
+				
+				.item-right {
+					padding-left:10rpx;
+					flex:1;
+					
+					text {
+						
+						line-height: 24rpx;
+						font-size: 24rpx;
+						color: #999999;
+					}
+					
+					.orange {
+						line-height: 24rpx;
+						font-size: 24rpx;
+						font-weight: bold;
+						color: #FF9500;
+					}
+					
+					.down {
+						margin-top:40rpx;
+					}
+				}
+			}
+		}
+		
+		.right {
+			width: 180rpx;
+			height: 180rpx;
+			background: #FFFFFF;
+			box-shadow: 0px 0px 16rpx 4rpx rgba(145, 156, 178, 0.1);
+			background:#fff;
+			padding:20rpx;
+			
+			.title {
+				font-size: 24rpx;
+				line-height: 24rpx;
+				color: #333333;
+			}
+			
+			.number {
+				font-weight: bold;
+				text-align: center;
+				margin-top:46rpx;
+				font-size: 64rpx;
+				line-height: 64rpx;
+				color: #007AFF;
+			}
+		}
+	}
+	
+	.title-list {
+		background: #EAEEF1;
+		padding:16rpx 16rpx 124rpx;
+		.content {
+			
+			.list {
+				background:#fff;
+				margin-bottom:30rpx;
+				overflow: hidden;
+				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;
+					}
+					
+					&.up {
+						border:0;
+						&::before {
+							transform: rotate(180deg);
+						}
+					}
+				}
+				
+				.article {
+					height:80rpx;
+					display: flex;
+					align-items: center;
+					margin-left:88rpx;
+					font-size: 24rpx;
+					color: #666666;
+					border-bottom: 1rpx solid #EEEEEE;
+					
+					.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;
+					}
+					
+					&:nth-last-of-type(1) {
+						border:0;
+					}
+					
+					&.active {
+						color:#007AFF;
+					}
+				}
+			}
+		}
+	}
+	
+</style>

+ 313 - 0
pages2/bank/question_statistics.vue

@@ -0,0 +1,313 @@
+<template>
+	<view>
+		<view class="top">
+			<view class="title">
+				做题统计
+				<text>(不含简答和案例题)</text>
+			</view>
+			
+			<view class="circle-wrap">
+				<view class="circle-list">
+					<view class="item">
+						<canvas class="canvas" canvas-id="Canvas1"></canvas>
+						<view class="text">正确率</view>
+					</view>
+					<view class="item">
+						<canvas  canvas-id="Canvas2"></canvas>
+						<view class="text">做题进度</view>
+					</view>
+					<view class="numbers">
+						<view class="blue">已答  65</view>
+						<view>总数  650</view>
+					</view>
+				</view>
+			</view>
+			
+		</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" v-for="(article,index1) in item1.list">
+						<view class="flex-auto">
+							<view class="tit">施工承发包模式-施工合同与物资采购合同二</view>
+							<view class="desc">
+								<view class="flex-auto">
+									正确率
+									<text class="green">65%</text>
+								</view>
+								<view class="flex-auto">
+									已完成
+									<text class="blue">65%</text>
+								</view>
+							</view>
+						</view>
+						
+						<navigator url="/pages2/bank/questionBankTest">
+							<view v-if="index1 == 0" class="btn">
+								做题
+							</view>
+							<view v-if="index1 == 1" class="btn">
+								继续
+							</view>
+						</navigator>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+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,
+			}]
+		};
+	},
+	onUnload() {
+		
+	},
+	computed: { ...mapGetters(['userInfo']) },
+	onLoad(option) {
+
+	},
+	onShow() {
+		uni.getSystemInfo({
+			success:(res) => {
+				var winW = res.screenWidth;
+				var winH = res.screenHeight;
+				 uni.createSelectorQuery().in(this).select('.canvas').boundingClientRect().exec((newRes)=>{  
+					  var width = newRes[0].width;
+					  var height = newRes[0].height;
+					  var caculateX = winW/750;
+					  var caculateY = winH/1334;
+					  console.log(caculateX)
+					  var context1 = uni.createCanvasContext('Canvas1')
+					  context1.setStrokeStyle("#EEEEEE")
+					  context1.setLineWidth(caculateX * 20)
+					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true)
+					  context1.stroke()
+						context1.beginPath()
+					  context1.setStrokeStyle("#32D74B")
+					  context1.setFillStyle('#32D74B')
+					  context1.setTextAlign('center')
+					  context1.setLineCap('round')
+					  context1.setFontSize(caculateX * 32)
+					  context1.fillText('10%', caculateX * 90, caculateX * 90, caculateX * 180)
+					  context1.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0,  Math.PI, true)
+					  context1.stroke()
+					  context1.draw()
+					  
+					  
+					  
+					  
+					  var context2 = uni.createCanvasContext('Canvas2')
+					  context2.setStrokeStyle("#EEEEEE")
+					  context2.setLineWidth(caculateX * 20)
+					  context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0, 2 * Math.PI, true)
+					  context2.stroke()
+						context2.beginPath()
+					  context2.setStrokeStyle("#007AFF")
+					  context2.setFillStyle("#007AFF")
+					  context2.setTextAlign('center')
+					  context2.setLineCap('round')
+					  context2.setFontSize(caculateX * 32)
+					  context2.fillText('10%', caculateX * 90, caculateX * 90, caculateX * 180)
+					  context2.arc(caculateX * 90, caculateX * 90, caculateX * 80, 0,  Math.PI, true)
+					  context2.stroke()
+					  context2.draw()
+				})  
+				
+			}
+		})
+		
+	},
+	methods: {
+		changeItem(e) {
+			let index = e.currentTarget.dataset.index
+			this.outline.forEach((arrItem,i) => {
+				if(i == index) {
+					arrItem.showList = !arrItem.showList
+				}
+			})
+			
+		}
+	}
+};
+</script>
+<style >
+	page{
+		background-color: #EAEEF1;
+	}
+</style>
+<style lang="scss" scope>
+	
+	.top {
+		margin:16rpx;
+		border-radius: 16rpx;
+		background:#fff;
+		padding:24rpx;
+		.title {
+			font-size: 24rpx;
+			line-height: 24rpx;
+			color: #333333;
+			
+			text {
+				font-size: 30rpx;
+				color: #999999;
+			}
+		}
+		
+		.circle-wrap {
+			margin-top:20rpx;
+			
+			.circle-list {
+				display: flex;
+				
+				.item {
+					flex:1;
+					padding-left:30rpx;
+					
+					canvas {
+						margin:0 auto;
+						width:180rpx;
+						height:180rpx;
+					}
+					
+					.text {
+						text-align: center;
+						margin-top:16rpx;
+						font-size: 24rpx;
+						color: #333333;
+					}
+				}
+				.numbers {
+					display: flex;
+					color:#999999;
+					font-size: 24rpx;
+					align-items: center;
+					justify-content: center;
+					flex-direction: column;
+					
+					.blue {
+						margin-bottom:40rpx;
+						color: #007AFF;
+					}
+				}
+			}
+		}
+	}
+	
+	.title-list {
+		background: #EAEEF1;
+		padding:16rpx 16rpx 124rpx;
+		.content {
+			
+			.list {
+				background:#fff;
+				margin-bottom:30rpx;
+				overflow: hidden;
+				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;
+					}
+					
+					&.up {
+						border:0;
+						&::before {
+							transform: rotate(180deg);
+						}
+					}
+				}
+				
+				.article {
+					padding:24rpx 0 10rpx;
+					display: flex;
+					align-items: center;
+					margin-left:88rpx;
+					font-size: 24rpx;
+					color: #666666;
+					border-bottom: 1rpx solid #EEEEEE;
+					
+					.flex-auto {
+						flex:1;
+						margin-right:30rpx;
+						
+						.desc {
+							width: 480rpx;
+							padding:0 14rpx;
+							margin-top:20rpx;
+							height: 40rpx;
+							border: 1px solid #EEEEEE;
+							border-radius: 16rpx;
+							font-size: 26rpx;
+							display: flex;
+							align-items: center;
+							
+							.blue {
+								font-size: 26rpx;
+								color:#007AFF;
+								
+							}
+							.green {
+								font-size: 26rpx;
+								color:#32D74B;
+								
+							}
+						}
+					}
+					
+					.btn {
+						width: 96rpx;
+						height: 48rpx;
+						line-height: 48rpx;
+						text-align: center;
+						color:#fff;
+						font-size: 30rpx;
+						border-radius:24rpx;
+						background: #007AFF;
+						border-radius: 24rpx;
+					}
+					
+					&:nth-last-of-type(1) {
+						border:0;
+					}
+					
+					&.active {
+						color:#007AFF;
+					}
+				}
+			}
+		}
+	}
+	
+	
+	
+</style>