Tang пре 4 година
родитељ
комит
2f8f7bca7c
6 измењених фајлова са 446 додато и 74 уклоњено
  1. 23 0
      common/httpList/bank.js
  2. 28 1
      common/httpList/collect.js
  3. 1 1
      common/request.js
  4. 54 6
      pages2/bank/detail.vue
  5. 329 65
      pages2/bank/question.vue
  6. 11 1
      pages2/course/detail.vue

+ 23 - 0
common/httpList/bank.js

@@ -87,4 +87,27 @@ export default {
 			method: 'get',
 		})
 	},
+	//新增用户的做题历史
+	questiondetailrecord(data) {
+		return myRequest({
+			url:'/bank/record',
+			method: 'post',
+			data: data,
+		})
+	},
+	//查询用户的做题历史列表
+	questiondetailrecordlist(data) {
+		return myRequest({
+			url:'/bank/record/list',
+			method: 'get',
+			data: data,
+		})
+	},
+	//获取用户的做题历史详细信息
+	questionrecord(data) {
+		return myRequest({
+			url: '/bank/record/' + data,
+			method: 'get',
+		})
+	}
 }

+ 28 - 1
common/httpList/collect.js

@@ -32,14 +32,41 @@ export default {
 			data: data,
 		})
 	},
-	//查询收藏题库列表
+
+
+
+
+	//新增收藏题库
+	bankCollectsadd(data) {
+		return myRequest({
+			url: '/collect/bank',
+			method: 'post',
+			data: data,
+		})
+	},
+	//删除收藏题库
+	bankCollectdelete(data) {
+		return myRequest({
+			url: '/collect/bank/delete/' + data,
+			method: 'post',
+		})
+	}, //查询收藏题库列表
 	bankCollectList(data) {
 		return myRequest({
 			url: '/collect/bank/list',
 			method: 'get',
 			data: data,
 		})
+	}, //判断是否收藏题库
+	bankCollects(data) {
+		return myRequest({
+			url: '/collect/bank/' + data,
+			method: 'get',
+		})
 	},
+
+
+
 	//查询收藏重点列表
 	courseNoteList(data) {
 		return myRequest({

+ 1 - 1
common/request.js

@@ -1,5 +1,5 @@
-
 const BASE_URL = 'http://192.168.0.222:8088'   //
+// const BASE_URL = 'http://192.168.0.145:8088'   //
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1

+ 54 - 6
pages2/bank/detail.vue

@@ -184,8 +184,8 @@
 		<view class="footer_tab">
 			<u-line color="#D6D6DB" />
 			<view style="height: 100%;display: flex;align-items: center;position: relative;">
-				<view style="text-align: center;margin-left: 30rpx;">
-					<image src="/static/sc.png" class="sc"></image>
+				<view style="text-align: center;margin-left: 30rpx;" @click="favorites">
+					<image :src="collecStatus ? '/static/star.png' : '/static/sc.png'" class="sc"></image>
 					<view class="sc_t">收藏</view>
 				</view>
 
@@ -233,6 +233,7 @@ export default {
 					name: '相关推荐'
 				}
 			],
+			collecStatus:false,
 			current: 0,
 			activeStatus: false, //课程目录下拉样式变化是否开启
 			activeStatusCata: 0, //当前选中章节
@@ -242,12 +243,14 @@ export default {
 			infoData: [], //当前页面章节数据
 			pageData: [], //传入数据
 			teachersList: [], //教师数据
-			recommendListS: [] //推荐列表
+			recommendListS: [], //推荐列表
+			id:0
 		};
 	},
 	onLoad(option) {
 		this.drawProgressbg();
 		this.drawCircle(1.3); // 0-2
+		this.id = option.id
 		var options = {};
 		this.$api.bankInfo(option.id).then(res => {
 			options = res.data.data;
@@ -261,7 +264,12 @@ export default {
 			this.recommendList(options);
 		});
 	},
-	onShow() {},
+	onShow() {
+		if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
+		} else {
+			this.favoritesStatus();
+		}
+	},
 	methods: {
 		getBankDList(options) {
 			var data = {
@@ -353,14 +361,54 @@ export default {
 		jumpExam() {
 			if (this.pageData.typeId === 1) {
 				this.$navTo.togo('/pages2/bank/question', {
-					bankSectionId: this.infoData.bankSectionId
+					bankSectionId: this.infoData.bankSectionId,
+					bankId: this.pageData.bankId,
+					typeId: this.pageData.typeId,
 				});
 			} else {
 				this.$navTo.togo('/pages2/bank/question', {
-					examId: this.infoData.examId
+					examId: this.infoData.examId,
+					bankId: this.pageData.bankId,
+					typeId: this.pageData.typeId,
 				});
 			}
 		},
+		favoritesStatus() {
+			this.$api.bankCollects(this.id).then(result => {
+				console.log(1)
+				if (result.data.data === undefined) {
+					this.collecStatus = false;
+				} else {
+					this.collecStatus = true;
+				}
+			});
+		},
+		//收藏
+		favorites() {
+			var self = this;
+			if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				});
+			} else {
+				if (this.collecStatus) {
+					this.$api.bankCollects(self.id).then(results => {
+						console.log(results)
+						self.$api.bankCollectdelete(results.data.data.collectBankId).then(resz => {
+							self.favoritesStatus();
+						});
+					});
+				} else {
+					var data = {
+						userId: this.$store.state.userInfo.userId,
+						bankId: self.id
+					};
+					this.$api.bankCollectsadd(data).then(res => {
+						self.favoritesStatus();
+					});
+				}
+			}
+		},
 		drawProgressbg() {
 			// 使用 wx.createContext 获取绘图上下文 context
 			var ctx = wx.createCanvasContext('canvasProgressbg', this);

+ 329 - 65
pages2/bank/question.vue

@@ -1,13 +1,13 @@
 <template>
-	<view>
+	<view class="bigBox">
 		<view v-if="nowPageData.type === 4" class="contentList">
 			<view class="headerTitle">
 				<view class="leftIcon" v-for="(item, index) in titleS" :key="index" v-if="item.value === nowPageData.type">
 					<span>{{ item.label }}</span>
 				</view>
 				<view class="right">
-					1
-					<span class="lengNum">/10</span>
+					{{ numIndex + 1 }}
+					<span class="lengNum">/{{ list.length }}</span>
 				</view>
 			</view>
 			<view class="content">
@@ -23,18 +23,16 @@
 						<span>{{ item.label }}</span>
 					</view>
 				</view>
-				<!-- <view class="content">
-					<view class="contentTitle">{{ nowPageData.jsonStr[indexst].content }}</view>
-					<view class="imageBox" v-if="nowPageData.jsonStr[indexst].imgUrl && nowPageData.jsonStr[indexst].imgUrl !== null">
-						<image :src="$method.splitImgHost(nowPageData.jsonStr[indexst].imgUrl)" mode="aspectFit"></image>
-					</view>
+				<view class="content">
+					<view class="contentTitle">{{ itemst.content }}</view>
+					<view class="imageBox" v-if="itemst.imgUrl && itemst.imgUrl !== null"><image :src="$method.splitImgHost(itemst.imgUrl)" mode="aspectFit"></image></view>
 				</view>
 				<view
 					class="banksChiList"
-					v-for="(items, indexs) in nowPageData.jsonStr[indexst].answer"
+					v-for="(items, indexs) in itemst.answer"
 					:key="indexs"
-					:class="replyL.indexOf(indexs) !== -1 ? 'activeListBt' : ''"
-					@click="activeList(items, indexs)"
+					@click="activeListSitem(items, indexs, indexst)"
+					:class="replyL[indexst].selectId.indexOf(indexs) !== -1 ? 'activeListBt' : ''"
 				>
 					<view class="leftIndex">{{ alphabet[indexs] }}.</view>
 					<view class="bankTie">
@@ -42,18 +40,20 @@
 						<image v-if="items.imgUrl && items.imgUrl !== null" :src="$method.splitImgHost(items.imgUrl)" mode="aspectFit"></image>
 					</view>
 				</view>
-				<view v-if="nowPageData.jsonStr[indexst].type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePD(1)">正确</view>
-				<view v-if="nowPageData.jsonStr[indexst].type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePD(0)">错误</view>
-				<view class="jxTit">
+				<view v-if="itemst.type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePDs(1, indexst)">正确</view>
+				<view v-if="itemst.type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePDs(0, indexst)">错误</view>
+				<view class="jxTit" style="margin-bottom: 10rpx;" @click="showTitles(indexst)">
 					<span class="jxSpan">查看解析</span>
 					<u-icon name="info-circle" color="#999999" size="40"></u-icon>
-				</view> -->
+				</view>
+				<view v-if="showJXanli.indexOf(indexst) !== -1 ? true : false" class="jxslis">{{ itemst.analysisContent }}</view>
 			</view>
 			<!-- -案例内容end -->
-			<view class="jxTit">
+			<view class="jxTit" @click="showTitle(nowPageData.questionId)">
 				<span class="jxSpan">查看解析</span>
 				<u-icon name="info-circle" color="#999999" size="40"></u-icon>
 			</view>
+			<view v-if="showJX.indexOf(nowPageData.questionId) !== -1 ? true : false" class="jxslis">{{ nowPageData.analysisContent }}</view>
 			<u-button type="primary" @click="submitChi">提交</u-button>
 		</view>
 		<view v-else class="contentList">
@@ -62,8 +62,8 @@
 					<span>{{ item.label }}</span>
 				</view>
 				<view class="right">
-					1
-					<span class="lengNum">/10</span>
+					{{ numIndex + 1 }}
+					<span class="lengNum">/{{ list.length }}</span>
 				</view>
 			</view>
 			<view class="content">
@@ -87,11 +87,12 @@
 			</view>
 			<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 1 ? 'activeListBt' : ''" @click="activePD(1)">正确</view>
 			<view v-if="nowPageData.type === 3" class="banksChiList" :class="isWrong === 0 ? 'activeListBt' : ''" @click="activePD(0)">错误</view>
-			<view class="jxTit">
+			<view class="jxTit" @click="showTitle(nowPageData.questionId)">
 				<span class="jxSpan">查看解析</span>
 				<u-icon name="info-circle" color="#999999" size="40"></u-icon>
 			</view>
-			<u-button type="primary" @click="submitChi">提交</u-button>
+			<view v-if="showJX.indexOf(nowPageData.questionId) !== -1 ? true : false" class="jxslis">{{ nowPageData.analysisContent }}</view>
+			<u-button type="primary" @click="submitChi">下一题</u-button>
 		</view>
 		<view class="footer_tab">
 			<u-line color="#D6D6DB" />
@@ -114,7 +115,7 @@
 				</u-col>
 				<u-col span="4">
 					<view class="box">
-						<view style="text-align: center;margin-right: 30rpx;position: absolute;right: 20rpx;">
+						<view style="text-align: center;margin-right: 30rpx;position: absolute;right: 20rpx;" @click="carryOut">
 							<image src="/static/jj.png" class="sc"></image>
 							<view class="sc_t">交卷</view>
 						</view>
@@ -125,7 +126,7 @@
 		<u-popup v-model="show" mode="bottom" :safe-area-inset-bottom="true">
 			<view class="popup_box">
 				<scroll-view scroll-y="true" class="popup_list">
-					<view v-for="(item, index) in list" :key="index" class="btn_num" :class="index % 2 == 0 ? 'btn_bac2' : 'btn_bac1'">
+					<view v-for="(item, index) in list" :key="index" class="btn_num" :class="index === numIndex ? 'btn_bac2' : 'btn_bac1'" @click="changeTM(index, 2)">
 						<text class="">{{ index + 1 }}</text>
 					</view>
 				</scroll-view>
@@ -138,10 +139,15 @@
 export default {
 	data() {
 		return {
-			type: 1,
+			bankSectionId: null,
+			examId: null,
+			typeId: null,
+			numIndex: 0,
 			show: false,
 			list: [],
-			nowPageData: {},
+			nowPageData: {
+				jsonStr: []
+			},
 			titleS: [
 				{
 					label: '单选',
@@ -162,43 +168,150 @@ export default {
 			],
 			alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
 			replyL: [],
-			isWrong: -1
+			isWrong: -1,
+			answerList: [], //总提交列表
+			bankId: 0, //题库ID
+			selects: [], //当前做了哪些题目
+			showJX: [], // 展开解析列表
+			showJXanli: [] // 展开案例解析列表
 		};
 	},
 	onLoad(option) {
 		this.titleListFn(option);
+		this.bankId = option.bankId;
+		this.typeId = option.typeId;
+		if (option.bankSectionId) {
+			this.bankSectionId = option.bankSectionId;
+		}
+		if (option.examId) {
+			this.examId = option.examId;
+		}
 	},
 	onShow() {},
 	methods: {
+		// 查看解析start
+		showTitle(ids) {
+			var self = this;
+			if (this.showJX.indexOf(ids) !== -1) {
+				var ats = self.showJX.indexOf(ids);
+				self.showJX.splice(ats, 1);
+			} else {
+				self.showJX.push(ids);
+			}
+		},
+		//案例解析
+		showTitles(int) {
+			var self = this;
+			if (this.showJXanli.indexOf(int) !== -1) {
+				var ats = self.showJXanli.indexOf(int);
+				self.showJXanli.splice(ats, 1);
+			} else {
+				self.showJXanli.push(int);
+			}
+		},
+		changeTM(index, int) {
+			var self = this;
+			if (int === 1) {
+				this.numIndex = index + 1;
+			} else {
+				this.numIndex = index;
+			}
+			this.initDatas();
+			this.initLint();
+			this.getCooieds();
+		},
+		initDatas() {
+			this.isWrong = -1;
+			this.showJX = [];
+			this.showJXanli = [];
+			this.selects = [];
+		}, //数据清空
+		getCooieds() {
+			var self = this;
+			if (this.answerList.length) {
+				self.answerList.forEach((item, index) => {
+					if (item.questionId === self.nowPageData.questionId) {
+						if (self.nowPageData.type === 4) {
+							self.replyL = item.replyStr;
+						} else if (self.nowPageData.type === 3) {
+							self.isWrong = item.isRight;
+						} else {
+							self.replyL = item.selectIds;
+						}
+						console.log(self.replyL);
+					}
+				});
+			}
+		},
+		initLint() {
+			var self = this;
+			self.replyL = [];
+			if (self.list[self.numIndex].type === 4) {
+				for (var i = 0; i < self.list[self.numIndex].jsonStr.length; i++) {
+					self.replyL.push({ selectId: [] });
+				}
+			}
+			self.nowPageData = self.list[self.numIndex];
+		},
 		submitChi() {
-			var yesList = []; //记录正确项索引
-			this.nowPageData.jsonStr.forEach((item, index) => {
-				if (item.optionAnswer === 1) {
-					yesList.push(index);
+			var self = this;
+			if (self.nowPageData.type === 1 || self.nowPageData.type === 2 || self.nowPageData.type === 3) {
+				var yesList = []; //记录正确项索引
+				self.nowPageData.jsonStr.forEach((item, index) => {
+					if (item.optionAnswer === 1) {
+						yesList.push(index);
+					}
+				});
+				var strYesList = yesList.sort().toString();
+				var isRight = strYesList == self.replyL.sort().toString() ? 1 : 0; //记录是否选择正确
+				if (self.nowPageData.type === 3) {
+					if (self.isWrong === self.nowPageData.answerQuestion) {
+						isRight = 1;
+					} else {
+						isRight = 0;
+					}
 				}
-			});
-			var strYesList = yesList.sort().toString();
-			var isRight = strYesList == this.replyL.sort().toString(); //记录是否选择正确
-			if (this.nowPageData.type === 3) {
-				if (this.isWrong === this.nowPageData.answerQuestion) {
-					isRight = 1;
-				} else {
-					isRight = 0;
+				var objslit = []; //记录选中的选项对象
+				for (let i = 0; i < self.replyL.length; i++) {
+					objslit.push(self.nowPageData.jsonStr[self.replyL[i]]);
 				}
+				var objList = {
+					bankId: self.bankId,
+					questionId: self.nowPageData.questionId,
+					selectIds: self.replyL,
+					replyStr: objslit,
+					isRight: isRight
+				};
+				self.answerList[self.numIndex] = objList;
 			}
-
-			var objslit = []; //记录选中的选项对象
-			for (let i = 0; i < this.replyL.length; i++) {
-				objslit.push(this.nowPageData.jsonStr[this.replyL[i]]);
+			if (self.nowPageData.type === 4) {
+				for (var i = 0; i < self.replyL.length; i++) {
+					if (self.replyL[i].selectId.length) {
+						self.replyL[i].selectId = self.replyL[i].selectId;
+					}
+				}
+				var objList = {
+					bankId: self.bankId,
+					questionId: self.nowPageData.questionId,
+					replyStr: self.replyL,
+					selectIds: self.selects
+				};
+				self.answerList[self.numIndex] = objList;
 			}
-
-			var objList = {
-				questionId: this.nowPageData.questionId,
-				selectIds: this.replyL.toString(),
-				replays: objslit,
-				isRight: isRight
-			};
-			console.log(objList);
+			if (self.numIndex === self.list.length - 1) {
+				uni.showModal({
+					title: '提示',
+					content: '是否确定交卷',
+					success: function(res) {
+						if (res.confirm) {
+							self.carryOut();
+						} else if (res.cancel) {
+						}
+					}
+				});
+				return;
+			}
+			self.changeTM(self.numIndex, 1);
 		},
 		titleListFn(option) {
 			if (option.bankSectionId) {
@@ -211,44 +324,191 @@ export default {
 					examId: option.examId
 				};
 			}
+			console.log(option);
 			this.$api.questiondetailList(data).then(res => {
 				if (res.data.rows.length) {
+					let self = this;
 					res.data.rows.forEach((items, indexs) => {
 						items.jsonStr = JSON.parse(items.jsonStr);
 					});
-					this.nowPageData = res.data.rows[3];
-					console.log(this.nowPageData);
-					this.list = res.data.rows;
+					if (res.data.rows[self.numIndex].type === 4) {
+						self.replyL = [];
+						for (var i = 0; i < res.data.rows[self.numIndex].jsonStr.length; i++) {
+							self.replyL.push({ selectId: [] });
+						}
+					}
+					self.nowPageData = res.data.rows[self.numIndex];
+					self.list = res.data.rows;
 				} else {
-					uni.showToast({
-						title: '没有内容',
-						icon: 'none',
-						duration: 2000
+					uni.showModal({
+						title: '提示',
+						content: '没有题目',
+						showCancel: false,
+						confirmText: '返回上级',
+						success: function(res) {
+							if (res.confirm) {
+								uni.navigateBack({
+									delta: 1
+								});
+							}
+						}
 					});
 				}
 			});
 		},
 		activeList(data, int) {
-			if (this.nowPageData.type === 1) {
-				this.replyL = [int];
-			} else if (this.nowPageData.type === 2) {
-				if (this.replyL.indexOf(int) !== -1) {
-					for (var i = 0; i < this.replyL.length; i++) {
-						if (this.replyL[i] === int) {
-							this.replyL.splice(i, 1);
+			var self = this;
+			if (self.nowPageData.type === 1) {
+				self.replyL = [int];
+			} else if (self.nowPageData.type === 2) {
+				if (self.replyL.indexOf(int) !== -1) {
+					for (var i = 0; i <= self.replyL.length; i++) {
+						if (self.replyL[i] === int) {
+							self.replyL.splice(i, 1);
 						}
 					}
 				} else {
-					this.replyL.push(int);
+					self.replyL.push(int);
 				}
 			}
-			console.log(this.replyL);
 		},
 		activePD(int) {
 			this.isWrong = int;
 		},
+		activePDs(int, fatInt) {
+			this.isWrong = int;
+			if (this.replyL[fatInt] === undefined) {
+				this.replyL[fatInt] = {};
+			}
+			if (int === this.nowPageData.jsonStr[fatInt].answerQuestion) {
+				this.replyL[fatInt].isRight = 1;
+			} else {
+				this.replyL[fatInt].isRight = 0;
+			}
+			if (this.selects.indexOf(fatInt) === -1) {
+				this.selects.push(fatInt);
+			}
+		},
+		activeListSitem(data, int, fatInt) {
+			var self = this;
+			if (self.replyL[fatInt] === undefined) {
+				self.replyL[fatInt] = {};
+			}
+			if (self.nowPageData.jsonStr[fatInt].type === 1) {
+				self.replyL[fatInt].selectId = [int];
+
+				var objNums = [];
+				self.nowPageData.jsonStr[fatInt].answer.forEach((itemta, indexta) => {
+					if (itemta.optionAnswer === 1) {
+						objNums.push(indexta);
+					}
+				});
+				var strYesList = objNums.sort().toString();
+				var isRight = strYesList == self.replyL[fatInt].selectId.sort().toString();
+				if (isRight) {
+					self.replyL[fatInt].isRight = 1;
+				} else {
+					self.replyL[fatInt].isRight = 0;
+				}
+				self.replyL[fatInt].repley = [data];
+
+				if (self.replyL[fatInt].repley.length) {
+					if (self.selects.indexOf(fatInt) === -1) {
+						self.selects.push(fatInt);
+					}
+				}
+			} else if (self.nowPageData.jsonStr[fatInt].type === 2) {
+				if (self.replyL[fatInt].selectId === undefined) {
+					self.replyL[fatInt].selectId = [];
+				}
+				if (self.replyL[fatInt].selectId.indexOf(int) !== -1) {
+					for (var i = 0; i < self.replyL[fatInt].selectId.length; i++) {
+						if (self.replyL[fatInt].selectId[i] === int) {
+							self.replyL[fatInt].selectId.splice(i, 1);
+						}
+					}
+				} else {
+					self.replyL[fatInt].selectId.push(int);
+				}
+				var objNums = [];
+				self.nowPageData.jsonStr[fatInt].answer.forEach((itemta, indexta) => {
+					if (itemta.optionAnswer === 1) {
+						objNums.push(indexta);
+					}
+				});
+				var strYesList = objNums.sort().toString();
+				var isRight = strYesList == self.replyL[fatInt].selectId.sort().toString();
+				if (isRight) {
+					self.replyL[fatInt].isRight = 1;
+				} else {
+					self.replyL[fatInt].isRight = 0;
+				}
+				var objst = [];
+				for (let i = 0; i < self.replyL[fatInt].selectId.length; i++) {
+					objst.push(self.nowPageData.jsonStr[fatInt].answer[self.replyL[fatInt].selectId[i]]);
+				}
+				self.replyL[fatInt].repley = objst;
+
+				if (self.replyL[fatInt].repley.length) {
+					if (self.selects.indexOf(fatInt) === -1) {
+						self.selects.push(fatInt);
+					}
+				} else {
+					var numt = self.selects.indexOf(fatInt);
+					self.selects.splice(numt, 1);
+				}
+			}
+		},
 		menu() {
 			this.show = true;
+		},
+		//交卷
+		carryOut() {
+			this.answerList.forEach((item, index) => {
+				item.selectIds = item.selectIds.toString();
+				item.replyStr.forEach((items, indexs) => {
+					if (items.selectId) {
+						items.selectId = items.selectId.toString();
+					}
+				});
+				item.replyStr = JSON.stringify(item.replyStr);
+			});
+			var data = {
+				bankId: this.bankId,
+				type: this.typeId,
+				answerList: this.answerList
+			};
+			if (this.examId !== null) {
+				data.examId = this.examId;
+			}
+			if (this.simulateId !== null) {
+				data.simulateId = this.bankSectionId;
+			}
+			this.$api.questiondetailrecord(data).then(res => {
+				console.log(res);
+				if (res.data.code === 200) {
+					uni.showModal({
+						title: '提示',
+						content: '提交成功返回上级',
+						showCancel: false,
+						confirmText: '返回上级',
+						success: function(ress) {
+							if (ress.confirm) {
+								uni.navigateBack({
+									delta: 1
+								});
+							}
+						}
+					});
+				} else {
+					uni.showToast({
+						title: '提交失败',
+						icon: 'none',
+						duration: 2000
+					});
+				}
+			});
+			console.log(data);
 		}
 	}
 };
@@ -265,6 +525,10 @@ export default {
 }
 </style>
 <style scope>
+.bigBox > .contentList {
+	padding-top: 15rpx;
+	padding-bottom: 96rpx;
+}
 .activeListBt {
 	border: 2rpx solid #32467b !important;
 }

+ 11 - 1
pages2/course/detail.vue

@@ -222,7 +222,7 @@ export default {
 			infoData: {},
 			chapterList: [], //章列表
 			teacherInfo: {},
-			faceGetState: true, //模拟今天是否人脸识别
+			faceGetState: false, //模拟今天是否人脸识别
 			showBox: false,
 			boxList: [], //章节弹窗列表
 			payStatus: true, //是否购买该课程
@@ -242,6 +242,14 @@ export default {
 		});
 		this.getChapter(this.id);
 		this.getcommendList(this.id);
+		let time = uni.getStorageSync('face')
+		if(time){
+			let nowTime = (new Date).getTime()/1000
+			if((nowTime-time)<24*3600){
+				this.faceGetState = true
+			}
+			
+		}
 	},
 	onShow() {
 		if (!uni.getStorageSync('union_id') && this.$store.state.token === '') {
@@ -433,6 +441,8 @@ export default {
 			} else {
 				//模拟今天是否人脸识别
 				if (!this.faceGetState) {
+					let time = (new Date()).getTime()/1000
+					uni.setStorageSync("face",time)
 					this.certification();
 					return;
 				}