瀏覽代碼

修复bug

chenxiong 3 年之前
父節點
當前提交
806b1391a4
共有 7 個文件被更改,包括 234 次插入85 次删除
  1. 1 0
      common/request.js
  2. 2 2
      common/socket.js
  3. 25 13
      pages2/bank/question_record.vue
  4. 63 1
      pages2/learn/my_learn.vue
  5. 64 32
      pages2/subject/collect.vue
  6. 62 33
      pages2/subject/wrong.vue
  7. 17 4
      pages3/polyv/detail.vue

+ 1 - 0
common/request.js

@@ -5,6 +5,7 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
+// export const BASE_URL = 'http://120.79.166.78:19009'   //预发布
 export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //dev
 

+ 2 - 2
common/socket.js

@@ -73,11 +73,11 @@ const sokcet = (sockeUrl) => {
 			uni.showToast({
 				icon:'none',
 				title:'用户在其他终端登录,强制下线',
-				duration:1000,
+				duration:3000,
 			})
 			setTimeout(() => {
 				method.exit();
-			},1000)
+			},3000)
 		}
 	});
 

+ 25 - 13
pages2/bank/question_record.vue

@@ -2,11 +2,11 @@
 	<view>
 		<nav-bar title="做题记录" class="nav"></nav-bar>
 		<view class="tabs">
-			<view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab">
+			<view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab(1)">
 				全部题库记录
 				<u-icon class="icon" :class="index ==1? 'animals':''" name="arrow-down"></u-icon>
 			</view>
-			<view class="tab" :class="{ active: index == 2 }" data-index="2" @click="tab">
+			<view class="tab" :class="{ active: index == 2 }" data-index="2" @click="tab(2)">
 				全部试卷类型
 				<u-icon class="icon" :class="index ==2? 'animals':''" name="arrow-down"></u-icon>
 			</view>
@@ -39,22 +39,27 @@
 
 		<view class="modal" :style="{top:modalTop+'px'}" v-if="index == 1">
 			<view class="content">
-				<view class="top" :class="activeIndex === 0 ? 'activesty' : ''" @click="testClick(3)">全部题库记录</view>
-				<view class="list">
-					<view class="item" :class="activeIndex == listItem.goodsId ? 'activesty' : ''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="testClick(listItem)">
-						{{ listItem.goodsName }}
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="top" :class="activeIndex === 0 ? 'activesty' : ''" @click="testClick(3)">全部题库记录</view>
+					<view class="list">
+						<view class="item" :class="activeIndex == listItem.goodsId ? 'activesty' : ''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="testClick(listItem)">
+							{{ listItem.goodsName }}
+						</view>
 					</view>
-				</view>
+				</scroll-view>
+				
 			</view>
 			<view class="modal_wrap" @click="index = 0"></view>
 		</view>
 		
 		<view class="modal" :style="{top:modalTop+'px'}" v-if="index == 2">
 			<view class="content">
-				<view class="top" :class="typeIndex === 0 ? 'activesty' : ''" @click="paperClick(3)">全部试卷类型</view>
-				<view class="list">
-					<view class="item" :class="typeIndex == listItem.paperId ? 'activesty' : ''" v-for="(listItem,listIndex) in list1" :key="listIndex" @click="paperClick(listItem)">{{ listItem.paperName }}</view>
-				</view>
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="top" :class="typeIndex === 0 ? 'activesty' : ''" @click="paperClick(3)">全部试卷类型</view>
+					<view class="list">
+						<view class="item" :class="typeIndex == listItem.paperId ? 'activesty' : ''" v-for="(listItem,listIndex) in list1" :key="listIndex" @click="paperClick(listItem)">{{ listItem.paperName }}</view>
+					</view>
+				</scroll-view>
 			</view>
 			<view class="modal_wrap" @click="index = 0"></view>
 		</view>
@@ -279,8 +284,13 @@ export default {
 				this.getExamRecordList();
 			}
 		},
-		tab(e) {
-			this.index = e.currentTarget.dataset.index;
+		tab(index) {
+			console.log(index,this.index)
+			if(this.index == index) {
+				this.index = 0;
+				return;
+			}
+			this.index = index;
 			console.log(this.index);
 		},
 
@@ -419,6 +429,8 @@ page {
 	width: 100%;
 
 	.content {
+		height:80%;
+		overflow: hidden;
 		position: relative;
 		z-index: 10;
 		background: #fff;

+ 63 - 1
pages2/learn/my_learn.vue

@@ -9,6 +9,7 @@
 				<view class="noData" v-if="listData.length == 0">您暂无相关学时审核记录哦~</view>
 				<view class="learnItem" v-for="(item, index) in listData" :key="index">
 					<view class="title">{{ item.goodsName }}</view>
+					{{item.periodStatus}}
 					<view class="status">
 						<view class="label">审核状态:</view>
 						<view
@@ -85,7 +86,7 @@
 					</view>
 					<view class="btnBox">
 						<view class="btn" @click="showPhoto(item)">电子照片</view>
-						<!-- <view class="btn" @click="downloadCard(item)">下载凭证</view> -->
+						<view class="btn" @click="saveEwm(item)">下载凭证</view>
 					</view>
 				</view>
 			</template>
@@ -257,6 +258,67 @@ export default {
 				}
 			});
 		},
+		saveEwm(item){
+			//获取相册授权
+			   uni.getSetting({
+				 success:(res) => {
+				   if (!res.authSetting['scope.writePhotosAlbum']) {
+					 uni.authorize({
+					   scope: 'scope.writePhotosAlbum',
+					   success() {
+						 //这里是用户同意授权后的回调
+						 this.saveImgToLocal(item);
+					   },
+					   fail() {//这里是用户拒绝授权后的回调
+					   
+					   }
+					 })
+				   } else {//用户已经授权过了
+					 this.saveImgToLocal(item);
+				   }
+				 }
+			   })
+		},
+		saveImgToLocal(item){
+			
+			uni.showModal({
+				title: '提示',
+				content: '确定保存到相册吗',
+				success: (res) => {
+					if (res.confirm) {
+						
+						uni.downloadFile({
+								url: this.$method.splitImgHost(item.certificatePath,true,1000),//图片地址
+								success: (res) =>{
+									if (res.statusCode === 200){
+										uni.saveImageToPhotosAlbum({
+											filePath: res.tempFilePath,
+											success: function() {
+												uni.showToast({
+													title: "保存成功",
+													icon: "none"
+												});
+											},
+											fail: function() {
+												uni.showToast({
+													title: "保存失败",
+													icon: "none"
+												});
+											}
+										});
+									} 
+								}
+							})
+						
+						
+					} else if (res.cancel) {
+						
+					}
+				}
+			});
+			
+		},
+
 		downloadCard(item) {
 			console.log(this.$method.splitImgHost(item.certificatePath,true))
 			uni.downloadFile({

+ 64 - 32
pages2/subject/collect.vue

@@ -1,19 +1,25 @@
 <template>
 	<view class="safeArea">
-		<nav-bar title="收藏集"></nav-bar>
+		<nav-bar title="收藏集" class="nav"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
 			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2 ? 'animals':''"  name="arrow-down"></u-icon></view>
 		</view>
-		<view class="sceenModel" v-if="sceenType">
+		<view class="sceenModel" v-if="sceenType"  :style="{top:modalTop+'px'}" >
 			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain">
-				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-				</template>
-				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-				</template>
+			<view class="sceenMain" >
+				<scroll-view scroll-y="true" style="height:100%">
+					<div class="sceenMainContent">
+						<template v-if="sceenType===1">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
+						</template>
+						<template v-if="sceenType===2">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
+						</template>
+					</div>
+					
+				</scroll-view>
+				
 			</view>
 		</view>
 		<view class="wrap">
@@ -86,6 +92,7 @@ export default {
 			],
 			type:1,
 			total:0,
+			modalTop:0,
 			testList:[],
 			typeList:[],
 			goodsid:'',
@@ -98,6 +105,21 @@ export default {
 		this.listGoodsUserQuestion();
 		this.examaperList();
 		this.getData();
+		
+		uni.getSystemInfo({
+			success:(e) => {
+				let info = uni.createSelectorQuery().select(".nav");
+				info.boundingClientRect((navData) => { //data - 各种参数
+				
+					let info = uni.createSelectorQuery().select(".sceenBox");
+					info.boundingClientRect((tabData) => { //data - 各种参数
+						this.modalTop = navData.height + tabData.height
+						console.log(navData) // 获取元素宽度
+						console.log(tabData) // 获取元素宽度
+					}).exec()
+				}).exec()
+			}
+		})
 	},
 	methods: {
 		getData() {
@@ -151,6 +173,10 @@ export default {
 			})
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		/**
@@ -227,8 +253,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -242,30 +269,35 @@ page {
 		position: relative;
 		z-index: 999;
 		background: #fff;
-		margin-top: 80rpx;
-		display: flex;
-		flex-wrap: wrap;
-		padding: 8rpx;
-		justify-content: space-between;
-		.item{
-			width: 350rpx;
-			background: #F5F5F5;
-			border-radius: 16rpx;
-			padding: 25rpx 19rpx;
-			margin: 8rpx;
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #666666;
-			&.active{
-				background: #007AFF;
-				color:#fff;
-			}
-			&:first-child{
-				width:100%;
-				text-align: center;
+		height:80%;
+		.sceenMainContent {
+			
+			display: flex;
+			flex-wrap: wrap;
+			padding: 8rpx;
+			justify-content: space-between;
+			
+			.item{
+				width: 350rpx;
+				background: #F5F5F5;
+				border-radius: 16rpx;
+				padding: 25rpx 19rpx;
+				margin: 8rpx;
+				font-size: 32rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #666666;
+				&.active{
+					background: #007AFF;
+					color:#fff;
+				}
+				&:first-child{
+					width:100%;
+					text-align: center;
+				}
 			}
 		}
+		
 	}
 }
 .wrap{

+ 62 - 33
pages2/subject/wrong.vue

@@ -1,19 +1,24 @@
 <template>
 	<view class="safeArea">
-		<nav-bar title="错题集"></nav-bar>
+		<nav-bar title="错题集"  class="nav"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
 			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2? 'animals':''"  name="arrow-down"></u-icon></view>
 		</view>
-		<view class="sceenModel" v-if="sceenType">
+		<view class="sceenModel" v-if="sceenType" :style="{top:modalTop+'px'}" >
 			<view class="sceenModelBg" @click="hideSceen"></view>
 			<view class="sceenMain">
-				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-				</template>
-				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-				</template>
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="sceenMainContent">
+						<template v-if="sceenType===1">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
+						</template>
+						<template v-if="sceenType===2">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
+						</template>
+					</view>
+				</scroll-view>
+				
 			</view>
 		</view>
 		<view class="wrap">
@@ -90,6 +95,7 @@ export default {
 			goodsid:'',
 			paperid:'',
 			total:0,
+			modalTop:0,
 		};
 	},
 	onPullDownRefresh() {},
@@ -99,6 +105,21 @@ export default {
 	onLoad(option) {
 		this.listGoodsUserQuestion();
 		this.examaperList();
+		
+		uni.getSystemInfo({
+			success:(e) => {
+				let info = uni.createSelectorQuery().select(".nav");
+				info.boundingClientRect((navData) => { //data - 各种参数
+				
+					let info = uni.createSelectorQuery().select(".sceenBox");
+					info.boundingClientRect((tabData) => { //data - 各种参数
+						this.modalTop = navData.height + tabData.height
+						console.log(navData) // 获取元素宽度
+						console.log(tabData) // 获取元素宽度
+					}).exec()
+				}).exec()
+			}
+		})
 	},
 	methods: {
 		getData() {
@@ -157,6 +178,10 @@ export default {
 			this.getData();
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		hideSceen(){
@@ -226,8 +251,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -241,30 +267,33 @@ page {
 		position: relative;
 		z-index: 999;
 		background: #fff;
-		margin-top: 80rpx;
-		display: flex;
-		flex-wrap: wrap;
-		padding: 8rpx;
-		justify-content: space-between;
-		.item{
-			width: 350rpx;
-			background: #F5F5F5;
-			border-radius: 16rpx;
-			padding: 25rpx 19rpx;
-			margin: 8rpx;
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #666666;
-			&.active{
-				background: #007AFF;
-				color:#fff;
-			}
-			&:first-child{
-				width:100%;
-				text-align: center;
-			}
-		}
+		height:80%;
+		.sceenMainContent {
+			
+			display: flex;
+			flex-wrap: wrap;
+			padding: 8rpx;
+			justify-content: space-between;
+				.item{
+					width: 350rpx;
+					background: #F5F5F5;
+					border-radius: 16rpx;
+					padding: 25rpx 19rpx;
+					margin: 8rpx;
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #666666;
+					&.active{
+						background: #007AFF;
+						color:#fff;
+					}
+					&:first-child{
+						width:100%;
+						text-align: center;
+					}
+				}
+		}		
 	}
 }
 .wrap{

+ 17 - 4
pages3/polyv/detail.vue

@@ -217,12 +217,14 @@
 
 		</u-mask>
 		
-		<u-popup v-model="noticeShow" class="notice_modal"  mode="center"  border-radius="14"  width="500rpx" height="600rpx">
+		<u-popup v-model="noticeShow" class="notice_modal"  mode="center"  border-radius="14"  width="700rpx" height="900rpx">
 			<div class="content">
 				
 				<scroll-view scroll-y="true" style="height: 100%;">
-					<text>
-						{{goodsData.buyNote}}</text>
+					<view class="title">学员须知</view>
+					<text class="text">
+						{{goodsData.buyNote}}
+					</text>
 				</scroll-view>
 			</div>
 			
@@ -836,7 +838,7 @@ export default {
 				// let initSpace = 0
 				//没有历史拍照间隔数据
 				if(this.photoList.length==0){
-					if(totalVideoTime >= 1500) { //大于15分钟
+					if(totalVideoTime >= 900) { //大于15分钟
 						if(photoNum == 1) { //开头拍1张
 							this.photoList.push(1)
 						} else if(photoNum == 3){ //拍3张
@@ -2403,6 +2405,17 @@ page {
 		width:100%;
 		height:100%;
 		padding:20rpx;
+		
+		.title {
+			color:#333;
+			line-height: 40rpx;
+			font-size: 30rpx;
+			text-align: center;
+			font-weight: bold;
+		}
+		.text {
+			line-height: 40rpx;
+		}
 	}
 }
 </style>