chenxiong 4 anni fa
parent
commit
d03da2ac17
80 ha cambiato i file con 8104 aggiunte e 4232 eliminazioni
  1. 4 0
      .hbuilderx/launch.json
  2. 2 2
      App.vue
  3. 2 0
      common/api.js
  4. 2 1
      common/httpList/answer.js
  5. 8 0
      common/httpList/base.js
  6. 32 0
      common/httpList/course.js
  7. 26 0
      common/httpList/goods.js
  8. 11 0
      common/httpList/myStudent.js
  9. 57 0
      common/httpList/order.js
  10. 1 1
      common/httpList/oss.js
  11. 8 0
      common/httpList/userInfo.js
  12. 53 13
      common/methodTool.js
  13. 45 11
      common/request.js
  14. 628 347
      components/course/courseChapter.vue
  15. 28 8
      components/course/courseModule.vue
  16. 201 10
      components/course/courseSection.vue
  17. 84 14
      pages.json
  18. 5 2
      pages/course/index.vue
  19. 199 153
      pages/index/index.vue
  20. 4 2
      pages/shopping/shoppingCart.vue
  21. 24 5
      pages/wd/index.vue
  22. 4 3
      pages2/appointment/appointment_success.vue
  23. 15 7
      pages2/appointment/index.vue
  24. 42 20
      pages2/appointment/kporder.vue
  25. 26 4
      pages2/appointment/order.vue
  26. 10 8
      pages2/bank/collectById.vue
  27. 78 33
      pages2/bank/detail.vue
  28. 4 3
      pages2/bank/my_question.vue
  29. 99 12
      pages2/bank/questionBank.vue
  30. 1 0
      pages2/bank/questionBankAllExplain.vue
  31. 91 8
      pages2/bank/questionBankContinue.vue
  32. 1 0
      pages2/bank/questionBankExplain.vue
  33. 1 0
      pages2/bank/questionBankExplainDetail.vue
  34. 10 5
      pages2/bank/questionBankTest.vue
  35. 1 0
      pages2/bank/questionBankWrongExplain.vue
  36. 67 25
      pages2/bank/question_detail.vue
  37. 77 43
      pages2/bank/question_record.vue
  38. 8 3
      pages2/bank/question_report.vue
  39. 21 13
      pages2/bank/question_statistics.vue
  40. 5 2
      pages2/bank/wrongById.vue
  41. 164 87
      pages2/class/questionBank.vue
  42. 1 0
      pages2/class/question_report.vue
  43. 4 3
      pages2/exam/exam_appointment.vue
  44. 2 1
      pages2/exam/exam_result.vue
  45. 1 0
      pages2/exam/index.vue
  46. 426 189
      pages2/invoice/index.vue
  47. 56 10
      pages2/learn/details.vue
  48. 2 1
      pages2/learn/menu.vue
  49. 185 32
      pages2/learn/my_learn.vue
  50. 151 106
      pages2/msg/detail.vue
  51. 3 1
      pages2/msg/index.vue
  52. 11 2
      pages2/order/confirm_list.vue
  53. 107 26
      pages2/order/confirm_pay.vue
  54. 6 2
      pages2/order/confirm_success.vue
  55. 136 28
      pages2/order/index.vue
  56. 61 38
      pages2/plan/create.vue
  57. 70 47
      pages2/plan/edit.vue
  58. 385 134
      pages2/plan/index.vue
  59. 6 3
      pages2/register/register.vue
  60. 68 34
      pages2/subject/collect.vue
  61. 11 2
      pages2/subject/collectBank.vue
  62. 11 2
      pages2/subject/collectTypeBank.vue
  63. 66 34
      pages2/subject/wrong.vue
  64. 10 1
      pages2/subject/wrongBank.vue
  65. 8 1
      pages2/subject/wrongTypeBank.vue
  66. 268 19
      pages2/verify/input.vue
  67. 11 10
      pages2/verify/input2.vue
  68. 28 17
      pages2/wd/avatar.vue
  69. 694 531
      pages2/wd/class.vue
  70. 312 141
      pages2/wd/course.vue
  71. 15 3
      pages2/wd/edu_info.vue
  72. 22 9
      pages2/wd/info.vue
  73. 1 0
      pages2/wd/menu.vue
  74. 27 2
      pages2/wd/question_bank.vue
  75. 45 10
      pages3/course/detail.vue
  76. 2699 1941
      pages3/polyv/detail.vue
  77. 1 1
      pages3/static/polyv-sdk/common/wxParse/wxParse.wxml
  78. 1 0
      pages3/static/polyv-sdk/components/live-player/live-player.wxml
  79. 2 1
      pages3/static/polyv-sdk/components/player/player.wxml
  80. 42 5
      store/index.js

+ 4 - 0
.hbuilderx/launch.json

@@ -6,6 +6,10 @@
      	{
      		"launchtype" : "local"
      	},
+     	"h5" : 
+     	{
+     		"launchtype" : "local"
+     	},
      	"mp-weixin" : 
      	{
      		"launchtype" : "local"

+ 2 - 2
App.vue

@@ -18,10 +18,10 @@
 	
 		},
 		onShow: function() {
-
+			
 		},
 		onHide: function() {
-			
+			uni.$emit('playPause')
 		}
 	}
 </script>

+ 2 - 0
common/api.js

@@ -20,6 +20,7 @@ import answer from './httpList/answer.js'
 import note from './httpList/note.js'
 import exam from './httpList/exam.js'
 import profileStamp from './httpList/profileStamp.js'
+import lock from './httpList/lock.js'
 
 export default {
 	...login,
@@ -44,4 +45,5 @@ export default {
 	...note,
 	...exam,
 	...profileStamp,
+	...lock
 }

+ 2 - 1
common/httpList/answer.js

@@ -7,7 +7,8 @@ export default {
 		return myRequest({
 			url: '/app/answer/list',
 			method: 'get',
-			data: data
+			data: data,
+			noLoading:true
 		})
 	},
 	postAnswer(data) {

+ 8 - 0
common/httpList/base.js

@@ -40,5 +40,13 @@ export default {
 			noToken: true
 		})
 	},
+	appCommonConfig(data) {
+		return myRequest({
+			url: '/app/common/config',
+			method: 'get',
+			data: data,
+			noToken: true
+		})
+	}
 	
 }

+ 32 - 0
common/httpList/course.js

@@ -120,6 +120,38 @@ export default {
 			data:data
 		})
 	},
+	faceCertificationIDCardOCR(data) {
+		return myRequest({
+			url: '/face/certification/IDCardOCR',
+			method: 'post',
+			data:data
+		})
+	},
+	
+	facCertificationImageRecognition(data) {
+		return myRequest({
+			url: '/face/certification/ImageRecognition',
+			method: 'post',
+			data:data
+		})
+	},
+	
+	faceCertificationCompareFace(data) {
+		return myRequest({
+			url: '/face/certification/CompareFace',
+			method: 'post',
+			data:data
+		})
+	},
+	
+	gradeCheckGoodsStudy(data) {
+		return myRequest({
+			url: '/grade/grade/checkGoodsStudy',
+			method: 'get',
+			data:data
+		})
+	},
+	
 	
 	
 	

+ 26 - 0
common/httpList/goods.js

@@ -187,6 +187,14 @@ export default {
 		})
 	},
 	
+	examRecordGroupList(data) {
+		return myRequest({
+			url: '/exam/record/group_list',
+			data:data,
+			method: 'GET',
+		})
+	},
+	
 	collectQuestionTypeList(data) {
 		return myRequest({
 			url: '/collect/question/type_list',
@@ -350,6 +358,24 @@ export default {
 		})
 	},
 	
+	studyRecordMenuAllList(data) {
+		return myRequest({
+			url: '/study/record/menuAllList',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	
+	
+	goodsTodayStudySectionNum(data) {
+		return myRequest({
+			url: '/goods/todayStudySectionNum',
+			method: 'get',
+			data:data
+		})
+	},
+	
 	goodsQuestionList(data) {
 		return myRequest({
 			url: '/app/common/bank/question/list',

+ 11 - 0
common/httpList/myStudent.js

@@ -26,4 +26,15 @@ export default {
 			data: data
 		})
 	},
+	/**
+	 * @param {Object} data
+	 * 查询用户证书列表
+	 */
+	getUserCertificateList(data) {
+		return myRequest({
+			url: '/user/certificate/list',
+			method: 'get',
+			data: data
+		})
+	},
 }

+ 57 - 0
common/httpList/order.js

@@ -18,6 +18,19 @@ export default {
 			data: data
 		})
 	},
+	/**
+	 * @param {Object} data
+	 * 查询订单商品退款列表
+	 */
+	orderRefundList(data) {
+		return myRequest({
+			url: '/order/refund/list',
+			method: 'get',
+			data: data
+		})
+	},
+	
+	
 	//查询订单列表
 	getorderlists(data) {
 		return myRequest({
@@ -46,5 +59,49 @@ export default {
 			method: 'post',
 			data: data
 		})
+	},
+	
+	orderInvoiceCanInvoiceList(data) {
+		return myRequest({
+			url: '/order/invoice/canInvoiceList',
+			method: 'get',
+			data: data
+		})
+	},
+	
+	orderInvoice(data) {
+		return myRequest({
+			url: '/order/invoice',
+			method: 'post',
+			data: data
+		})
+	},
+	
+	orderInvoiceList(data) {
+		return myRequest({
+			url: '/order/invoice/list',
+			method: 'get',
+			data: data
+		})
+	},
+	
+	orderInvoiceCancel(data) {
+		return myRequest({
+			url: '/order/invoice/cancel',
+			method: 'post',
+			data: data
+		})
+	},
+	orderInfo(data) {
+		return myRequest({
+			url: '/order/info',
+			method: 'get',
+			data: data
+		})
 	}
+	
+	
+	
+
+
 }

+ 1 - 1
common/httpList/oss.js

@@ -15,7 +15,7 @@ export default {
 		return myRequest({
 			url: '/aliyun/oss/policy',
 			method: 'get',
-			data: data
+			data: data,
 			// noToken: true
 		})
 	},

+ 8 - 0
common/httpList/userInfo.js

@@ -45,4 +45,12 @@ export default {
 			data: data,
 		})
 	},
+	getUserSubscribeRecentExam(data) {
+		return myRequest({
+			url: '/user/subscribe/recentExam',
+			method: 'get',
+			data: data,
+		})
+	},
+	
 }

+ 53 - 13
common/methodTool.js

@@ -21,8 +21,8 @@ export default {
 		}
 	},
 	isLogout() {
-		uni.removeStorageSync('user_account')
-		uni.removeStorageSync('token')
+		// uni.removeStorageSync('user_account')
+		// uni.removeStorageSync('token')
 	},
 	//提示
 	showToast(title, icon = 'none', time = 2000) {
@@ -61,18 +61,30 @@ export default {
 	 * @param timestamp
 	 * @returns {*}
 	 */
-	timestampToTime(timestamp, isDay = true) {
+	timestampToTime(timestamp, isDay = true,hasChinese) {
 		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-		var Y = date.getFullYear() + '-';
-		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-		var D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
+		var Y = date.getFullYear() + (hasChinese ? '' : '-');
+		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + (hasChinese ? '' : '-');
+		var D = date.getDate() < 10 ? '0' + date.getDate() + (hasChinese ? '' : ' ') : date.getDate() + (hasChinese ? '' :' ');
 		var h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
 		var m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
 		var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
 		if (isDay) {
-			return Y + M + D;
+			
+			if(hasChinese) {
+				return Y +'年'+ M +'月'+ D + '日';
+			} else {
+				return Y + M + D;
+			}
+			
+		}
+		
+		if(hasChinese) {
+			return Y +'年'+ M +'月'+ D + '日' + h + m + s;
+		} else {
+			return Y + M + D + h + m + s;
 		}
-		return Y + M + D + h + m + s;
+		
 	},
 	//当前时间距离目标时间还有多久
 	GetRTime(EndTime, isDay = true) {
@@ -124,19 +136,36 @@ export default {
 				success: async res => {
 					let canvasWidth = res.width; //图片原始长宽
 					let canvasHeight = res.height;
-					if (canvasWidth > 1000 || canvasHeight > 1000) {
+					if (canvasWidth > 2000 || canvasHeight > 2000) {
+						uni.compressImage({
+							src: url,
+							quality: 75,
+							width: '35%',
+							height: '35%',
+							success:async rest => {
+								const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+						console.log(waitUpload,'waitUpload')
+								resolve(waitUpload);
+							}
+						});
+					} else if(canvasWidth > 1000 || canvasHeight > 1000){
 						uni.compressImage({
 							src: url,
 							quality: 75,
 							width: '50%',
 							height: '50%',
-							success: rest => {
-								resolve(rest.tempFilePath);
+							success: async rest => {
+								const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+						console.log(waitUpload,'waitUpload')
+								resolve(waitUpload);
 							}
 						});
 					} else {
-						console.log('无需压缩', url);
-						resolve(url);
+						const waitUpload = await self.uploadFile(url, 0);
+						console.log(waitUpload,'waitUpload')
+						resolve(waitUpload);
+						// console.log('无需压缩', url);
+						// resolve(url);
 					}
 				}
 			});
@@ -287,4 +316,15 @@ export default {
          }
          return result;
      },
+	/**
+	 * @param {Object} length  长度
+	 * 获取随机字符串
+	 */
+	getRandomString(length) {
+	   var str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+	   var result = '';
+	   for (var i = length; i > 0; --i) 
+		 result += str[Math.floor(Math.random() * str.length)];
+	   return result;
+	 }
 }

+ 45 - 11
common/request.js

@@ -5,22 +5,31 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'http://42.192.164.187:19005'    //test
+// 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
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
+
+// export const socket_url = 'ws://42.192.164.187:19005/webSocket/'  //test
+// export const socket_url = 'ws://120.79.166.78:19009/webSocket/'  //预发布
+// export const socket_url = 'wss://api.xyyxt.net/webSocket/'  //release
+
+export const version = '5.2.1' 
 export const tenantId = '867735392558919680' 
 export const myRequest = (options) => {
-	if (store.state.allowLoading) {
+	if (store.state.allowLoading && !options.noLoading) {
 		uni.showLoading({
-			title: '拼命加载中...'
+			title: '拼命加载中...',
+			mask:true,
 		})
 	}
 
 	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('token')
+		
 		uni.request({
 			url: BASE_URL + options.url,
 			method: options.method || 'GET',
@@ -32,19 +41,37 @@ export const myRequest = (options) => {
 				TenantId: tenantId
 			},
 			success: async (res) => {
+				// if(num == 2) {
+				// 	return;
+				// } else {
+				// 	num++
+				// }
+				// doRequest(options)
+					
 				if (res.data.code == 401) {
 					if (num <= 2) {
 						if (!uni.getStorageSync('user_account')) {
-							uni.navigateTo({
-								url: '/pages/login/login'
-							});
+							var pages = getCurrentPages() // 获取栈实例
+							let currentRoute  = pages[pages.length-1].route; // 获取当前页面路由
+							if(currentRoute != 'pages/login/login') {
+								uni.navigateTo({
+									url: '/pages/login/login'
+								});
+							}
 						} else {
 							num++
 							res = await doRequest(options)
 						}
 
 					}else{
-						uni.removeStorageSync('user_account')
+						uni.removeStorageSync('user_account');
+						var pages = getCurrentPages() // 获取栈实例
+						let currentRoute  = pages[pages.length-1].route; // 获取当前页面路由
+						if(currentRoute != 'pages/login/login') {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							});
+						}
 					}
 				}
 				resolve(res)
@@ -63,8 +90,9 @@ export const myRequest = (options) => {
 		})
 	})
 	async function doRequest(response) {
+		let user_account = uni.getStorageSync('user_account')
 		var datas = {
-			url: '/refreshToken/' + uni.getStorageSync('user_account'),
+			url: '/refreshToken/' + user_account,
 			method: 'get',
 			noToken: true
 		}
@@ -79,13 +107,19 @@ export const myRequest = (options) => {
 			const resUser = await myRequest(userInfo)
 			if (resUser.data.code === 200) {
 				store.state.userInfo = resUser.data.data
+				uni.setStorageSync('user_account',user_account)
+				num = 1;
 			}
 			let onset = await myRequest(response)
 			return onset
 		} else {
-			uni.navigateTo({
-				url: '/pages/login/login'
-			});
+			var pages = getCurrentPages() // 获取栈实例
+			let currentRoute  = pages[pages.length-1].route; // 获取当前页面路由
+			if(currentRoute != 'pages/login/login') {
+				uni.navigateTo({
+					url: '/pages/login/login'
+				});
+			}
 		}
 	}
 }

+ 628 - 347
components/course/courseChapter.vue

@@ -1,366 +1,647 @@
 <template>
-	<view style="margin: 20rpx 0;">
-		<view class="title" @click="openChapter(menuItem)">
-		<image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
-		<image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image>
-		<text style="margin-left: 30rpx;">{{menuItem.name}}</text>
-		</view>
-		<view v-if="!down">
-			<view v-for="(itemM,indexM) in list" :key="indexM">
-				<view v-if="itemM.type!=2">
-					<courseSection :courseId="courseId" @playEnd="refreshList($event)" :goodsId="goodsId" :isBuy="isBuy" :nextMenuItem="findNextSection(indexM)" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
-					<u-line v-if="indexM<list.length-1"></u-line>
-				</view>
-				<view v-if="itemM.type==2">
-					<u-line ></u-line>
-					<view class="examBox"  @click="toDo(itemM.typeId,goodsId,itemM.moduleId,itemM.chapterId,itemM,indexM)">
-						<view class="exam">
-							<view class="eTag">{{itemM.doType==1?'练习':'考试'}}</view>
-							<view style="margin-left: 15rpx;">{{itemM.name}}</view>
-						</view>
-						<view v-if="isRebuild||itemM.rebuild>0" class="tagRe">待重修</view>
-						<view v-else>
-							<view :class="{tagGreen:itemM.learning == 1,tagRe:itemM.learning == 0 || itemM.rebuild>0}">
-								<text v-if="itemM.rebuild > 0">待重测</text>
-								<text v-else-if="itemM.learning == 1">合格</text>
-								<text v-else-if="itemM.learning == 0">不合格</text>
-							
-							</view>
-						</view>
-						
-					</view>
-				</view>
-			</view>
-			
-		</view>
-	</view>
+  <view style="margin: 20rpx 0">
+    <view class="title" @click="openChapter(menuItem)">
+      <image src="/static/icon/up1.png" class="icon_up" v-if="down"></image>
+      <image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image>
+      <text style="margin-left: 30rpx">{{ menuItem.name }}</text>
+    </view>
+    <view v-show="!down">
+      <view v-for="(itemM, indexM) in list" :key="indexM">
+        <view v-if="itemM.type != 2">
+          <courseSection
+						:orderGoodsId="orderGoodsId"
+            :sectionMaxNum="sectionMaxNum"
+            :preItem="list[indexM - 1] || preItem"
+            :learningOrder="learningOrder"
+            :courseId="courseId"
+            @playEnd="refreshList($event)"
+            :goodsId="goodsId"
+            :isBuy="isBuy"
+            :nextMenuItem="findNextSection(indexM)"
+            :isRebuild="isRebuild"
+            :gradeId="gradeId"
+            :menuItem="itemM"
+            :levelId="levelId + '-' + itemM.sectionId"
+          ></courseSection>
+          <u-line v-if="indexM < list.length - 1"></u-line>
+        </view>
+        <view v-if="itemM.type == 2">
+          <u-line></u-line>
+          <view
+            class="examBox"
+            @click="
+              toDo(
+                itemM.typeId,
+                goodsId,
+                itemM.moduleId,
+                itemM.chapterId,
+                itemM,
+                indexM
+              )
+            "
+          >
+            <view class="exam">
+              <view class="eTag">{{
+                itemM.doType == 1 ? "练习" : "考试"
+              }}</view>
+              <view style="margin-left: 15rpx">{{ itemM.name }}</view>
+            </view>
+            <view v-if="isRebuild || itemM.rebuild > 0" class="tagRe"
+              >待重修</view
+            >
+            <view v-else>
+              <view
+                :class="{
+                  tagGreen: itemM.learning == 1,
+                  tagRe: itemM.learning == 0 || itemM.rebuild > 0,
+                }"
+              >
+                <text v-if="itemM.rebuild > 0">待重测</text>
+                <text v-else-if="itemM.learning == 1">合格</text>
+                <text v-else-if="itemM.learning == 0">不合格</text>
+              </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
-import courseSection from '@/components/course/courseSection.vue';
+import { mapGetters, mapMutations } from "vuex";
+import courseSection from "@/components/course/courseSection.vue";
 export default {
-	name: 'courseChapter',
-	props: {
-		learningOrder:{ //是否设置学习顺序 0 设置 1不设置
-			type:Number,
-			default:1
+  name: "courseChapter",
+  props: {
+		orderGoodsId:{
+			default:0
 		},
-		menuItem: {
-			type: Object,
-			default: {}
-		},
-		isBuy: {
-			type: Boolean,
-			default: false
-		},
-		levelId: {
-			type: String,
-			default: ""
-		},
-		goodsId: {
-			type: Number,
-			default: 0
-		},
-		courseId: {
-			type: Number,
-			default: 0
-		},
-		isRebuild: {
-			type: Boolean,
-			default: false
-		},
-		gradeId: {
-			type: Number,
-			default: 0
-		}
-	},
-	components: {
-		courseSection
-	},
-	data() {
-		return {
-			down:true,
-			list:[],
-			examList:{},
-			canLearn:false, //是否全部视频看完才可以练习、测试
-		};
-	},
-	onLoad() {},
-	created() {
-	},
-	mounted() {
-		
-	},
-	onPageShow() {
-		this.refreshList({isRebuild:this.isRebuild});
-	},
-	methods: {
-		refreshList(isRebuild) {
-			console.log(9999)
-			let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
-			if(this.isRebuild){
-				this.getReSectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
-			}else{
-				this.getBuySectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
-//				this.getMenuExamList(item.id,item.courseId,moduleId)
-			}
-			
-			
-			this.$emit('playEnd',{isRebuild:isRebuild.isRebuild})
-			console.log(10000)
-			// let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
-			// this.getBuySectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
-		},
-		findNextSection(index){
-			for(let i=index+1;i<this.list.length;i++){
-				return this.list[i];
-			}
-			return {}
-		},
-		/**
-		 * 去做题
-		 */
-		async toDo(id,goodsId =0,moduleId = 0, chapterId = 0,item,index) {
-			
-			console.log(this.learningOrder)
-			if(this.learningOrder == 0) {
-				if(this.canLearn) {
-					
-					let num = await this.bankRecordDoNum(item.typeId)
-					//有次数限制
-					if(item.answerNum - num > 0 && item.answerNum > 0) {
-						// this.$set(this.list[index],'doNum',(item.doNum+1))
-						console.log(this.list[index])
-						uni.navigateTo({
-							url:'/pages2/class/questionBank?courseId='+this.courseId+'&gradeId='+this.gradeId+'&isFromVideo=1&id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
-						})
-					//没有答题次数限制
-					} else if(item.answerNum == 0) {
-						uni.navigateTo({
-							url:'/pages2/class/questionBank?courseId='+this.courseId+'&gradeId='+this.gradeId+'&isFromVideo=1&id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
-						}) 
-					} else {
-						uni.showToast({
-							icon:'none',
-							title:'该试卷只能答题'+item.answerNum+'次'
-						})
-						
-						return;
-					}
-				} else {
-					uni.showToast({
-						icon:'none',
-						title:'请学完视频课程再进行练习和测试'
-					})
-				}
-			} else {
-				let num = await this.bankRecordDoNum(item.typeId)
-				//有次数限制
-				if(item.answerNum - item.doNum > 0 && item.answerNum > 0) {
-					// this.$set(this.list[index],'doNum',(item.doNum+1))
-					console.log(this.list[index])
-					uni.navigateTo({
-						url:'/pages2/class/questionBank?courseId='+this.courseId+'&gradeId='+this.gradeId+'&isFromVideo=1&id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
-					})
-				//没有答题次数限制
-				} else if(item.answerNum == 0) {
-						uni.navigateTo({
-							url:'/pages2/class/questionBank?courseId='+this.courseId+'&gradeId='+this.gradeId+'&isFromVideo=1&id='+id+'&goodsid='+goodsId+'&moduleId='+moduleId+'&chapterId='+chapterId+''
-						})
-				} else {
-					uni.showToast({
-						icon:'none',
-						title:'该试卷只能答题'+item.answerNum+'次'
-					})
-					
-					return;
-				}
-			}
-			
-		},
-		bankRecordDoNum(examId) {
+    preItem: {
+      default: undefined,
+    },
+    learningOrder: {
+      //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
+      type: Number,
+      default: 0,
+    },
+    needOpen: {
+      //是否默认展开
+      type: Boolean,
+      default: false,
+    },
+    menuItem: {
+      type: Object,
+      default: {},
+    },
+    isBuy: {
+      type: Boolean,
+      default: false,
+    },
+    levelId: {
+      type: String,
+      default: "",
+    },
+    goodsId: {
+      type: Number,
+      default: 0,
+    },
+    courseId: {
+      type: Number,
+      default: 0,
+    },
+    isRebuild: {
+      type: Boolean,
+      default: false,
+    },
+    gradeId: {
+      type: Number,
+      default: 0,
+    },
+    sectionMaxNum: {
+      default: undefined,
+    },
+  },
+  components: {
+    courseSection,
+  },
+  data() {
+    return {
+      down: true,
+      list: [],
+      examList: {},
+      canLearn: false, //是否全部视频看完才可以练习、测试
+    };
+  },
+  onLoad() {},
+  created() {},
+  mounted() {
+    if (this.needOpen && this.chapterOpen) {
+      this.updateChapterOpen(false);
+      this.openChapter(this.menuItem);
+    }
+  },
+  onPageShow() {
+    if (this.isBuy) {
+      this.refreshList({ isRebuild: this.isRebuild });
+    }
+  },
+  methods: {
+    ...mapMutations(["updateChapterOpen"]),
+    goodsTodayStudySectionNum() {
+      return new Promise((resolve) => {
+        this.$api
+          .goodsTodayStudySectionNum({
+            goodsId: this.goodsId,
+            gradeId: this.gradeId,
+          })
+          .then((res) => {
+            if (res.data.code == 200) {
+              resolve(res.data.data);
+            }
+          });
+      });
+    },
+    refreshList(isRebuild) {
+      console.log(9999);
+      let moduleId = this.menuItem.moduleId ? this.menuItem.moduleId : 0;
+      if (this.isRebuild) {
+        this.getReSectionList(
+          this.menuItem.id,
+          this.menuItem.courseId,
+          moduleId
+        );
+      } else {
+        this.getBuySectionList(
+          this.menuItem.id,
+          this.menuItem.courseId,
+          moduleId
+        );
+        //				this.getMenuExamList(item.id,item.courseId,moduleId)
+      }
+
+      this.$emit("playEnd", { isRebuild: isRebuild.isRebuild });
+      console.log(10000);
+      // let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
+      // this.getBuySectionList(this.menuItem.id,this.menuItem.courseId,moduleId)
+    },
+    findNextSection(index) {
+      for (let i = index + 1; i < this.list.length; i++) {
+        return this.list[i];
+      }
+      return {};
+    },
+    studyRecordMenuAllList() {
+      return new Promise((resolve) => {
+        this.$api
+          .studyRecordMenuAllList({
+            courseId: this.courseId,
+            gradeId: this.gradeId,
+            goodsId: this.goodsId,
+          })
+          .then((res) => {
+            if (res.data.code == 200) {
+              resolve(res.data.data);
+            }
+          });
+      });
+    },
+		gradeCheckGoodsStudy(id) {
+			let moduleId = this.menuItem.moduleId || 0;
+			let chapterId = this.menuItem.chapterId || 0;
+			let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
 			return new Promise(resolve => {
-				this.$api.bankRecordDoNum({
+				this.$api.gradeCheckGoodsStudy({
 					goodsId:this.goodsId,
 					gradeId:this.gradeId,
-					chapterId:this.menuItem.id,
-					courseId:this.courseId,
-					moduleId:0,
-					examId:examId,
-				}).then(res => {
+					moduleId:this.menuItem.moduleId || 0,
+					chapterId:this.menuItem.chapterId || 0,
+					examId:id,
+				}).then( res => {
 					resolve(res.data.data)
 				})
 			})
 		},
-		openChapter(item){
-			this.down = !this.down
-			if(!this.down&&this.list.length==0){
-				console.log(item.id,69)
-				if(this.isBuy){
-					let moduleId = item.moduleId?item.moduleId:0
-					if(this.isRebuild){
-						this.getReSectionList(item.id,item.courseId,moduleId)
-					}else{
-						this.getBuySectionList(item.id,item.courseId,moduleId)
-		//				this.getMenuExamList(item.id,item.courseId,moduleId)
-					}
-				}else{
-					this.getSectionList(item.id)
-				}
-				
-			}
-		},
-		getMenuExamList(chapterId,courseId,moduleId) {
-			let self = this
-			this.$api.menuExamList({chapterId:chapterId,courseId:courseId,moduleId:moduleId}).then(res => {
-				if(res.data.code==200){
-					self.examList = res.data.rows
-				}
-			});
-		},
-		getSectionList(chapterId) {
-			let self = this
-			this.$api.sectionList(chapterId).then(res => {
-				if(res.data.code==200){
-					for(let i=0;i<res.data.data.length;i++){
-						let item = res.data.data[i]
-						item.id = item.sectionId
-						//判断是否试听
-						item.tryListen = false
-						if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
-							item.tryListen = true
-						}	
-					}
-					
-					let newArr = res.data.data.filter(item => {
-						console.log(item)
-						return item.type != 2;
-					})
-					this.canLearn = newArr.every(item => {
-						console.log(item)
-						if(item.learning == 1) {
-							return true;
-						} else {
-							return false;
-						}
-					})
-					self.list = res.data.data
-				}
-			});
-		},
-		getReSectionList(chapterId,courseId,moduleId) {
-			let self = this
-			this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,rebuild:1,moduleId:moduleId}).then(res => {
-				if(res.data.code==200){
-					for(let i=0;i<res.data.data.length;i++){
-						let item = res.data.data[i]
-						item.id = item.sectionId
-						//判断是否试听
-						item.tryListen = false
-						if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
-							item.tryListen = true
-						}	
-					}
-					let newArr = res.data.data.filter(item => {
-						console.log(item)
-						return item.type != 2;
-					})
-					this.canLearn = newArr.every(item => {
-						console.log(item)
-						if(item.learning == 1) {
-							return true;
-						} else {
-							return false;
-						}
-					})
-					self.list = res.data.data
-				}
-			});
-		},
-		getBuySectionList(chapterId,courseId,moduleId) {
-			let self = this
-			this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,moduleId:moduleId}).then(res => {
-				if(res.data.code==200){
-					for(let i=0;i<res.data.data.length;i++){
-						let item = res.data.data[i]
-						item.id = item.sectionId
-						//判断是否试听
-						item.tryListen = false
-						if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
-							item.tryListen = true
-						}	
-					}
-					let newArr = res.data.data.filter(item => {
-						return item.type != 2;
-					})
-					this.canLearn = newArr.every(item => {
-						console.log(item)
-						if(item.learning == 1) {
-							return true;
-						} else {
-							return false;
-						}
-					})
-					self.list = res.data.data
-				}
-			});
-		},
-	},computed: { ...mapGetters(['goodsAuditionConfigIdList']) },
+    /**
+     * 去做题
+     */
+    async toDo(id, goodsId = 0, moduleId = 0, chapterId = 0, item, index) {
+      let learnNum = await this.goodsTodayStudySectionNum()
+			let hasLearn = await this.gradeCheckGoodsStudy(id);
+
+      if(this.sectionMaxNum > 0) {
+      	if(learnNum >= this.sectionMaxNum && !hasLearn) {
+      		uni.showToast({
+      			icon:'none',
+      			title:`每天最多学习${this.sectionMaxNum}节`
+      		})
+      		return;
+      	}
+      }
+      console.log(this.learningOrder, "this.learningOrder");
+      if (this.learningOrder == 1) {
+        if (this.canLearn) {
+          let num = await this.bankRecordDoNum(item.typeId);
+          //有次数限制
+          if (item.answerNum - num > 0 && item.answerNum > 0) {
+            // this.$set(this.list[index],'doNum',(item.doNum+1))
+            console.log(this.list[index]);
+            uni.navigateTo({
+              url:
+                "/pages2/class/questionBank?courseId=" +
+                this.courseId +
+                "&gradeId=" +
+                this.gradeId +
+                "&isFromVideo=1&id=" +
+                id +
+                "&goodsid=" +
+                goodsId +
+                "&moduleId=" +
+                moduleId +
+                "&chapterId=" +
+                chapterId +
+                "&orderGoodsId=" + this.orderGoodsId,
+            });
+            //没有答题次数限制
+          } else if (item.answerNum == 0) {
+            uni.navigateTo({
+              url:
+                "/pages2/class/questionBank?courseId=" +
+                this.courseId +
+                "&gradeId=" +
+                this.gradeId +
+                "&isFromVideo=1&id=" +
+                id +
+                "&goodsid=" +
+                goodsId +
+                "&moduleId=" +
+                moduleId +
+                "&chapterId=" +
+                chapterId +
+                "&orderGoodsId=" + this.orderGoodsId,
+            });
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: "该试卷只能答题" + item.answerNum + "次",
+            });
+
+            return;
+          }
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: "请按顺序学完视频课程再进行练习和测试",
+          });
+        }
+      } else if (this.learningOrder == 2 && !item.rebuild) {
+        let canLearn = this.list[index - 1].learning == 1;
+        let rows = await this.studyRecordMenuAllList();
+        let isStop = false;
+        let newRows = [];
+        for (let i = 0; i < rows.length; i++) {
+          let moduleTrue = rows[i].moduleId == moduleId;
+          let chapterTrue = rows[i].chapterId == chapterId;
+          if (moduleTrue && chapterTrue) {
+            isStop = true;
+            if (rows[i].sectionType != 2) {
+              //忽略直播
+              newRows.push(rows[i]);
+            }
+          } else {
+            if (!isStop) {
+              if (rows[i].sectionType != 2) {
+                //忽略直播
+                newRows.push(rows[i]);
+              }
+            } else {
+              break;
+            }
+          }
+        }
+        console.log(newRows);
+        let isAllLearn = newRows.every((item) => {
+          return item.studyStatus == 1;
+        });
+
+        if (isAllLearn) {
+          //之前的都学完了
+
+          // if(canLearn) { //视频的上一节学完
+
+          let num = await this.bankRecordDoNum(item.typeId);
+          //有次数限制
+          if (item.answerNum - num > 0 && item.answerNum > 0) {
+            // this.$set(this.list[index],'doNum',(item.doNum+1))
+            console.log(this.list[index]);
+            uni.navigateTo({
+              url:
+                "/pages2/class/questionBank?courseId=" +
+                this.courseId +
+                "&gradeId=" +
+                this.gradeId +
+                "&isFromVideo=1&id=" +
+                id +
+                "&goodsid=" +
+                goodsId +
+                "&moduleId=" +
+                moduleId +
+                "&chapterId=" +
+                chapterId +
+                "&orderGoodsId=" + this.orderGoodsId,
+            });
+            //没有答题次数限制
+          } else if (item.answerNum == 0) {
+            uni.navigateTo({
+              url:
+                "/pages2/class/questionBank?courseId=" +
+                this.courseId +
+                "&gradeId=" +
+                this.gradeId +
+                "&isFromVideo=1&id=" +
+                id +
+                "&goodsid=" +
+                goodsId +
+                "&moduleId=" +
+                moduleId +
+                "&chapterId=" +
+                chapterId +
+                "&orderGoodsId=" + this.orderGoodsId,
+            });
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: "该试卷只能答题" + item.answerNum + "次",
+            });
+
+            return;
+          }
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: "请学完视频课程再进行练习和测试",
+          });
+        }
+      } else {
+        let num = await this.bankRecordDoNum(item.typeId);
+        //有次数限制
+        if (item.answerNum - item.doNum > 0 && item.answerNum > 0) {
+          // this.$set(this.list[index],'doNum',(item.doNum+1))
+          console.log(this.list[index]);
+          uni.navigateTo({
+            url:
+              "/pages2/class/questionBank?courseId=" +
+              this.courseId +
+              "&gradeId=" +
+              this.gradeId +
+              "&isFromVideo=1&id=" +
+              id +
+              "&goodsid=" +
+              goodsId +
+              "&moduleId=" +
+              moduleId +
+              "&chapterId=" +
+              chapterId +
+              "&orderGoodsId=" + this.orderGoodsId,
+          });
+          //没有答题次数限制
+        } else if (item.answerNum == 0) {
+          uni.navigateTo({
+            url:
+              "/pages2/class/questionBank?courseId=" +
+              this.courseId +
+              "&gradeId=" +
+              this.gradeId +
+              "&isFromVideo=1&id=" +
+              id +
+              "&goodsid=" +
+              goodsId +
+              "&moduleId=" +
+              moduleId +
+              "&chapterId=" +
+              chapterId +
+              "&orderGoodsId=" + this.orderGoodsId,
+          });
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: "该试卷只能答题" + item.answerNum + "次",
+          });
+
+          return;
+        }
+      }
+    },
+    bankRecordDoNum(examId) {
+      return new Promise((resolve) => {
+        this.$api
+          .bankRecordDoNum({
+            goodsId: this.goodsId,
+            gradeId: this.gradeId,
+            chapterId: this.menuItem.id,
+            courseId: this.courseId,
+            moduleId: 0,
+            examId: examId,
+          })
+          .then((res) => {
+            resolve(res.data.data);
+          });
+      });
+    },
+    openChapter(item) {
+      console.log(this.menuItem);
+      this.down = !this.down;
+      if (!this.down && this.list.length == 0) {
+        console.log(item.id, 69);
+        if (this.isBuy) {
+          let moduleId = item.moduleId ? item.moduleId : 0;
+          if (this.isRebuild) {
+            this.getReSectionList(item.id, item.courseId, moduleId);
+          } else {
+            this.getBuySectionList(item.id, item.courseId, moduleId);
+            //				this.getMenuExamList(item.id,item.courseId,moduleId)
+          }
+        } else {
+          this.getSectionList(item.id);
+        }
+      }
+    },
+    getMenuExamList(chapterId, courseId, moduleId) {
+      let self = this;
+      this.$api
+        .menuExamList({
+          chapterId: chapterId,
+          courseId: courseId,
+          moduleId: moduleId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            self.examList = res.data.rows;
+          }
+        });
+    },
+    getSectionList(chapterId) {
+      let self = this;
+      this.$api.sectionList(chapterId).then((res) => {
+        if (res.data.code == 200) {
+          for (let i = 0; i < res.data.data.length; i++) {
+            let item = res.data.data[i];
+            item.id = item.sectionId;
+            item.menuType = 3;
+            //判断是否试听
+            item.tryListen = false;
+            if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
+              item.tryListen = true;
+            }
+          }
+
+          let newArr = res.data.data.filter((item) => {
+            console.log(item);
+            return item.type != 2;
+          });
+          this.canLearn = newArr.every((item) => {
+            console.log(item);
+            if (item.learning == 1) {
+              return true;
+            } else {
+              return false;
+            }
+          });
+          self.list = res.data.data;
+        }
+      });
+    },
+    getReSectionList(chapterId, courseId, moduleId) {
+      let self = this;
+      this.$api
+        .reSectionList({
+          chapterId: chapterId,
+          gradeId: this.gradeId,
+          courseId: courseId,
+          rebuild: 1,
+          moduleId: moduleId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            for (let i = 0; i < res.data.data.length; i++) {
+              let item = res.data.data[i];
+              item.id = item.sectionId;
+              item.menuType = 3;
+              //判断是否试听
+              item.tryListen = false;
+              if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
+                item.tryListen = true;
+              }
+            }
+            let newArr = res.data.data.filter((item) => {
+              console.log(item);
+              return item.type != 2;
+            });
+            this.canLearn = newArr.every((item) => {
+              console.log(item);
+              if (item.learning == 1) {
+                return true;
+              } else {
+                return false;
+              }
+            });
+            self.list = res.data.data;
+          }
+        });
+    },
+    getBuySectionList(chapterId, courseId, moduleId) {
+      let self = this;
+      this.$api
+        .reSectionList({
+          chapterId: chapterId,
+          gradeId: this.gradeId,
+          courseId: courseId,
+          moduleId: moduleId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            for (let i = 0; i < res.data.data.length; i++) {
+              let item = res.data.data[i];
+              item.id = item.sectionId;
+              item.menuType = 3;
+              //判断是否试听
+              item.tryListen = false;
+              if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
+                item.tryListen = true;
+              }
+            }
+            let newArr = res.data.data.filter((item) => {
+              return item.type != 2;
+            });
+            this.canLearn = newArr.every((item) => {
+              console.log(item);
+              if (item.learning == 1) {
+                return true;
+              } else {
+                return false;
+              }
+            });
+            self.list = res.data.data;
+          }
+        });
+    },
+  },
+  computed: { ...mapGetters(["goodsAuditionConfigIdList", "chapterOpen"]) },
 };
 </script>
 
 <style scoped>
-
-	.tagRe{
-		width: 80rpx;
-		height: 28rpx;
-		background: #FF3B30;
-		border-radius: 8rpx;
-		font-size: 20rpx;
-		color: #FFFFFF;
-		text-align: center;
-	}
-	.tagGreen{
-		width: 80rpx;
-		height: 28rpx;
-		background: #34C759;
-		border-radius: 8rpx;
-		font-size: 20rpx;
-		color: #FFFFFF;
-		text-align: center;
-	}
-	.eTag{
-		width: 56rpx;
-		height: 28rpx;
-		background: #007AFF;
-		border-radius: 8rpx;
-		color: #FFFFFF;
-		font-size: 20rpx;
-		text-align: center;
-		line-height: 28rpx;
-	}
-	.examBox{
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-	}
-	.exam{
-		display: flex;
-		align-items: center;
-		margin: 20rpx 0;
-	}
-	.icon_up{
-		width: 24rpx;
-		height: 24rpx;
-	}
-.title{
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #666666;
-	white-space:nowrap;
-	overflow:hidden;
-	text-overflow:ellipsis; 
+.tagRe {
+  width: 80rpx;
+  height: 28rpx;
+  background: #ff3b30;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  color: #ffffff;
+  text-align: center;
+}
+.tagGreen {
+  width: 80rpx;
+  height: 28rpx;
+  background: #34c759;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  color: #ffffff;
+  text-align: center;
+}
+.eTag {
+  width: 56rpx;
+  height: 28rpx;
+  background: #007aff;
+  border-radius: 8rpx;
+  color: #ffffff;
+  font-size: 20rpx;
+  text-align: center;
+  line-height: 28rpx;
+}
+.examBox {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.exam {
+  font-size: 30rpx;
+  display: flex;
+  align-items: center;
+  margin: 20rpx 0;
+}
+.icon_up {
+  width: 24rpx;
+  height: 24rpx;
+}
+.title {
+  font-size: 30rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #666666;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  margin-bottom: 30rpx;
 }
 </style>

+ 28 - 8
components/course/courseModule.vue

@@ -5,9 +5,9 @@
 		<image src="/static/icon/down1.png" class="icon_up" v-if="!down"></image>
 		<text style="margin-left: 10rpx;">{{menuItem.name}}</text>
 		</view>
-		<view v-if="!down">
+		<view v-show="!down">
 			<view v-for="(itemM,indexM) in list" :key="indexM">
-				<courseChapter @toDo="toDo($event)" :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
+				<courseChapter :orderGoodsId="orderGoodsId" :preItem="list[indexM - 1] || preItem" :sectionMaxNum="sectionMaxNum" :needOpen="needOpen" @playEnd="playEnd($event)" @toDo="toDo($event)" :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
 		</view>
@@ -15,13 +15,24 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex';
 import courseChapter from '@/components/course/courseChapter.vue';
 export default {
 	name: 'courseModule',
 	props: {
-		learningOrder:{ //是否设置学习顺序 0 设置 1不设置
+		orderGoodsId:{
+			default:0
+		},
+		preItem:{
+			default:undefined
+		},
+		learningOrder:{ //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
 			type:Number,
-			defaule:1
+			defaule:0
+		},
+		needOpen:{ //是否默认展开
+			type:Boolean,
+			default:false,
 		},
 		menuItem: {
 			type: Object,
@@ -50,6 +61,9 @@ export default {
 		gradeId: {  //重修需要班级ID
 			type: Number,
 			default: 0
+		},
+		sectionMaxNum:{
+			default:undefined
 		}
 	},
 	components: {
@@ -66,9 +80,14 @@ export default {
 		
 	},
 	mounted() {
-		
+		if(this.needOpen && this.chapterOpen) {
+			this.openModule(this.menuItem)
+		}
 	},
 	methods: {
+		playEnd(isRebuild) {
+			this.$emit('playEnd',{isRebuild:isRebuild.isRebuild})
+		},
 		toDo(item) {
 			this.$emit('toDo',item)
 		},
@@ -94,7 +113,7 @@ export default {
 							for(let i=0;i<res.data.data.length;i++){
 								let item = res.data.data[i]
 								item.id = item.chapterId
-								
+								item.menuType = 2;
 							}
 							self.list = res.data.data
 						}
@@ -120,13 +139,13 @@ export default {
 					for(let i=0;i<res.data.data.length;i++){
 						let item = res.data.data[i]
 						item.id = item.chapterId
-						
+						item.menuType = 2;
 					}
 					self.list = res.data.data
 				}
 			});
 		},
-	}
+	},computed: { ...mapGetters(['chapterOpen']) },
 };
 </script>
 
@@ -143,5 +162,6 @@ export default {
 	white-space:nowrap;
 	overflow:hidden;
 	text-overflow:ellipsis; 
+	margin-bottom:30rpx;
 }
 </style>

+ 201 - 10
components/course/courseSection.vue

@@ -6,9 +6,9 @@
 				<view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
 				<view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
 				<view class="t_content">
-					<view v-if="menuItem.sectionType==1" :class="playSectionId==newId?'color1':''">{{menuItem.name}}</view>
-					<view v-if="menuItem.sectionType==2" :class="playSectionId==newId?'color2':''">{{menuItem.name}}</view>
-					<view v-if="menuItem.sectionType==3" :class="playSectionId==newId?'color3':''">{{menuItem.name}}</view>
+					<view v-if="menuItem.sectionType==1" :class="playSectionId==newId && playNextId==playId?'color1':''">{{menuItem.name || ''}}</view>
+					<view v-if="menuItem.sectionType==2" :class="playSectionId==newId && playNextId==playId?'color2':''">{{menuItem.name || ''}}</view>
+					<view v-if="menuItem.sectionType==3" :class="playSectionId==newId && playNextId==playId?'color3':''">{{menuItem.name || ''}}</view>
 					<view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.sectionType==2 && menuItem.liveStartTime">
 						<view v-if="menuItem.liveStartTime>nowTime">
 							<text>{{$method.timestampToTime(menuItem.liveStartTime, isDay =false)}}</text>-
@@ -22,7 +22,7 @@
 						</view> -->
 					</view>
 				</view>
-				<view v-if="menuItem.sectionType==null">{{menuItem.name}}</view>
+				<view v-if="menuItem.sectionType==null">{{menuItem.name || ''}}</view>
 			</view>
 			<view style="font-size: 20rpx;color: #FF3B30;"  v-if="menuItem.liveStartTime && menuItem.sectionType != 3">
 				<view class="tagWillPlay" v-if="menuItem.liveStartTime>nowTime">
@@ -53,6 +53,16 @@ import eventHub from '@/common/eventHub.js'
 export default {
 	name: 'courseSection',
 	props: {
+		orderGoodsId:{
+			default:0
+		},
+		preItem:{
+			default:undefined,
+		},
+		learningOrder:{ //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
+			type:Number,
+			default:0
+		},
 		courseId: {
 			type: Number,
 			default: 0
@@ -85,6 +95,9 @@ export default {
 			type: Object,
 			default: {}
 		},
+		sectionMaxNum:{
+			default:undefined,
+		},
 	},
 	watch:{
 		menuItem(val) {
@@ -94,10 +107,13 @@ export default {
 	data() {
 		return {
 			nowTime:0,
-			newId:0
+			newId:0,
+			playId:'',
+			clickLock:false, //点击锁,防止连续点击多次
 		};
 	},
-	onLoad() {},
+	onLoad() {
+	},
 	created() {
 		
 	},
@@ -111,6 +127,7 @@ export default {
 		let chapterId = this.menuItem.chapterId || 0;
 		let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
 		let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${this.isRebuild?'isRebuild':''}`;
+		this.playId = playNextId;
 		uni.$off('playNext'+playNextId) //绑定前先移除之前的事件
 		uni.$once('playNext'+playNextId, (data) => {
 			//到时会触发每个节的监听事件,只允许当前节的接收
@@ -156,27 +173,181 @@ export default {
 		});
 	},
 	methods: {
-		getVideo(){
+		studyRecordMenuAllList() {
+			return new Promise(resolve => {
+				
+				this.$api.studyRecordMenuAllList({
+					courseId:this.courseId,
+					gradeId:this.gradeId,
+					goodsId:this.goodsId
+				}).then(res => {
+					if(res.data.code == 200) {
+						resolve(res.data.data)
+					}
+				})
+			})
+		},
+		gradeCheckGoodsStudy() {
+			let moduleId = this.menuItem.moduleId || 0;
+			let chapterId = this.menuItem.chapterId || 0;
+			let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
+			return new Promise(resolve => {
+				this.$api.gradeCheckGoodsStudy({
+					goodsId:this.goodsId,
+					gradeId:this.gradeId,
+					moduleId:this.menuItem.moduleId || 0,
+					chapterId:this.menuItem.chapterId || 0,
+					sectionId:this.menuItem.sectionId || this.menuItem.menuId
+				}).then( res => {
+					resolve(res.data.data)
+				})
+			})
+		},
+		goodsTodayStudySectionNum() {
+			return new Promise(resolve => {
+				this.$api.goodsTodayStudySectionNum({goodsId:this.goodsId,gradeId:this.gradeId}).then(res => {
+					if(res.data.code == 200) {
+						resolve(res.data.data)
+					}
+				})
+			})
+		},
+		async getVideo(){
+			if(this.clickLock) {
+				return;
+			}
+
+			this.clickLock = true;
+			
+			if(this.learningOrder == 2 && !this.menuItem.isRebuild) { //要按从头到尾顺序学习, 且不是重修课程
+				if(this.preItem) {
+					let rows = await this.studyRecordMenuAllList();
+					let newRows = [];
+					for(let i = 0; i < rows.length; i++ ) {
+						let moduleTrue = rows[i].moduleId == this.menuItem.moduleId || rows[i].moduleId == 0
+						let chapterTrue = rows[i].chapterId == this.menuItem.chapterId || rows[i].chapterId == 0;
+						let sectionTrue = (rows[i].sectionId == this.menuItem.sectionId) || (rows[i].sectionId ==  this.menuItem.menuId);
+						if(moduleTrue && chapterTrue && sectionTrue) {
+							break;
+						} else {
+							if(rows[i].sectionType != 2) {
+								newRows.push(rows[i])
+							}
+							
+						}
+					}
+					console.log(newRows)
+					let isAllLearn = newRows.every(item => {
+						return item.studyStatus == 1;
+					})
+					
+					if(isAllLearn) {
+						this.playVideo();
+					} else {
+						uni.showToast({
+							icon:'none',
+							title:'请按顺序学习视频课程'
+						})
+					}
+					
+					// if(this.preItem.menuType == 3) { //上一个是节
+					// 	if(this.preItem.learning == 1) { //上一节学完
+					// 		this.playVideo();
+					// 	} else {
+					// 		uni.showToast({
+					// 			icon:'none',
+					// 			title:'请按顺序学习视频课程'
+					// 		})
+					// 	}
+					// } else if(this.preItem.menuType == 2) { //上一个是章
+					// 	this.$api.reSectionList({chapterId: this.preItem.menuId || this.preItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.preItem.moduleId || 0}).then(res => {
+					// 		if(res.data.code==200){
+					// 			let lastItem = res.data.data[res.data.data.length -1];
+					// 			if(lastItem.learning == 1) {
+					// 				this.playVideo();
+					// 			} else {
+					// 				uni.showToast({
+					// 					icon:'none',
+					// 					title:'请按顺序学习视频课程'
+					// 				})
+					// 			}
+					// 		}
+					// 	});
+					// } else if(this.preItem.menuType == 1) { //上一个是模块
+					// 	this.$api.reChapterList({moduleId:this.preItem.menuId,gradeId:this.gradeId,courseId:this.courseId}).then(res => {
+					// 		if(res.data.code==200){
+					// 			let lastChapterItem = res.data.data[res.data.data.length -1];
+								
+					// 			this.$api.reSectionList({chapterId:lastChapterItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.menuItem.menuId || this.menuItem.moduleId}).then(res => {
+					// 				if(res.data.code==200){
+					// 					let lastSectionItem = res.data.data[res.data.data.length -1];
+					// 					if(lastSectionItem.learning == 1) {
+					// 						this.playVideo();
+					// 					} else {
+					// 						uni.showToast({
+					// 							icon:'none',
+					// 							title:'请按顺序学习视频课程'
+					// 						})
+					// 					}
+					// 				}
+					// 			});
+					// 		}
+					// 	});
+					// } 
+				} else { //第一章第一节
+					this.playVideo();
+				}
+			} else { 
+				this.playVideo();
+			}
+			
+			
+			setTimeout(() => {
+				this.clickLock = false;
+			},3000)
+			
+		},
+		async playVideo() {
 			if(this.menuItem.sectionType==1||this.menuItem.sectionType==3){
 				//录播
 				if(!this.isBuy){
 					//非购买
 					if(!this.menuItem.tryListen){
 						//不允许试听
+						this.clickLock = false;
 						return
 					}
 					
 				}
+				
+				let learnNum = await this.goodsTodayStudySectionNum()
+				let hasLearn = await this.gradeCheckGoodsStudy();
+				
+				console.log(this.sectionMaxNum,'this.sectionMaxNum')
+				console.log(learnNum,'learnNum')
+				if(this.sectionMaxNum > 0) {
+					if(learnNum >= this.sectionMaxNum && !hasLearn) {
+						uni.showToast({
+							icon:'none',
+							title:`每天最多学习${this.sectionMaxNum}节`
+						})
+						this.clickLock = false;
+						return;
+					}
+				}
 				if(!this.menuItem.recordingUrl){
 					uni.showToast({
 						title: '暂无播放地址数据',
 						icon: 'error'
 					});
+					this.clickLock = false;
+					return;
 				}
 				/* if(this.playSectionId==this.newId){
 					//切换为同一节
 					return
 				} */
+				
 				if(this.playSectionId>0){
 					//切换视频
 					let oldSectionId = this.playSectionId
@@ -185,6 +356,7 @@ export default {
 				//设置播放的节ID
 				this.$store.commit('setPlaySectionId', {playSectionId  :this.newId});
 				this.$store.commit('setPlayVID', {playVID  :this.menuItem.recordingUrl});
+				this.$store.commit('updatePlayNextId',this.playId)
 				uni.$emit('levelId', this.levelId)
 				uni.$emit('getSection', this.menuItem)
 				uni.$emit('isRebuild',this.isRebuild)
@@ -200,8 +372,25 @@ export default {
 				//直播
 				if(!this.isBuy){
 					//非购买
+					this.clickLock = false;
 					return
 				}
+				
+				let learnNum = await this.goodsTodayStudySectionNum()
+				let hasLearn = await this.gradeCheckGoodsStudy();
+				
+				console.log(this.sectionMaxNum,'this.sectionMaxNum')
+				console.log(learnNum,'learnNum')
+				if(this.sectionMaxNum > 0) {
+					if(learnNum >= this.sectionMaxNum && !hasLearn) {
+						uni.showToast({
+							icon:'none',
+							title:`每天最多学习${this.sectionMaxNum}节`
+						})
+						this.clickLock = false;
+						return;
+					}
+				}
 				if(!this.menuItem.liveUrl){
 					uni.showToast({
 						title: '暂无直播地址数据',
@@ -210,11 +399,13 @@ export default {
 				}
 				if(this.playSectionId==this.newId){
 					//切换为同一频道
+					this.clickLock = false;
 					return
 				}
 				//设置播放的节ID
 				this.$store.commit('setPlaySectionId', {playSectionId  :this.newId});
 				this.$store.commit('setPlayChannelId', {playChannelId  :this.menuItem.liveUrl});
+				this.$store.commit('updatePlayNextId',this.playId)
 				uni.$emit('levelId', this.levelId)
 				uni.$emit('getChannel', this.menuItem)
 				uni.$emit('isRebuild',this.isRebuild)
@@ -225,12 +416,11 @@ export default {
 				// 	this.$emit('playEnd',{isRebuild:this.isRebuild})
 				// })
 				console.log(888)
-
-			}
 			
+			}
 		}
 	},
-	computed: { ...mapGetters(['playSectionId','playChannelId','playVID']) }
+	computed: { ...mapGetters(['playSectionId','playChannelId','playVID','playNextId']) }
 	
 };
 </script>
@@ -305,6 +495,7 @@ export default {
 		color: #007AFF;
 	}
 	.t_content{
+		font-size: 30rpx;
 		margin-left: 10rpx;
 		color: #666666;
 		flex:1;

+ 84 - 14
pages.json

@@ -98,6 +98,7 @@
 				"path": "wd/menu",
 				"style": {
 					"navigationBarTitleText": "基本资料",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -107,6 +108,7 @@
 				"path": "wd/edu_info",
 				"style": {
 					"navigationBarTitleText": "教育信息",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -153,6 +155,7 @@
 				"path": "wd/class",
 				"style": {
 					"navigationBarTitleText": "我的网课",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -163,6 +166,7 @@
 				"path": "order/confirm_list",
 				"style": {
 					"navigationBarTitleText": "确认订单",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -173,6 +177,7 @@
 				"path": "order/confirm_pay",
 				"style": {
 					"navigationBarTitleText": "订单支付",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -183,6 +188,7 @@
 				"path": "order/confirm_success",
 				"style": {
 					"navigationBarTitleText": "支付成功",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -193,6 +199,7 @@
 				"path": "order/index",
 				"style": {
 					"navigationBarTitleText": "我的订单",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					// "enablePullDownRefresh": true,
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
@@ -204,6 +211,7 @@
 				"path": "invoice/index",
 				"style": {
 					"navigationBarTitleText": "发票申请",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					// "enablePullDownRefresh": true,
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
@@ -215,6 +223,7 @@
 				"path": "exam/index",
 				"style": {
 					"navigationBarTitleText": "我的考试",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -225,6 +234,7 @@
 				"path": "exam/exam_appointment",
 				"style": {
 					"navigationBarTitleText": "考试预约",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -235,6 +245,7 @@
 				"path": "exam/exam_result",
 				"style": {
 					"navigationBarTitleText": "考试成绩和证书",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -245,6 +256,7 @@
 				"path": "wd/question_bank",
 				"style": {
 					"navigationBarTitleText": "我的题库通",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -255,6 +267,7 @@
 				"path": "bank/my_question",
 				"style": {
 					"navigationBarTitleText": "我的题库",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -265,6 +278,7 @@
 				"path": "bank/question_record",
 				"style": {
 					"navigationBarTitleText": "做题记录",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"enablePullDownRefresh":true,
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
@@ -272,10 +286,23 @@
 					}
 				}
 			},
+			{
+				"path": "bank/question_record_list",
+				"style": {
+					"navigationBarTitleText": "做题记录",
+					"navigationStyle": "custom", // 隐藏系统导航栏
+					"enablePullDownRefresh":true, 
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
+			},
 			{
 				"path": "bank/detail",
 				"style": {
 					"navigationBarTitleText": "题库详情",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -286,6 +313,7 @@
 				"path": "bank/question_detail",
 				"style": {
 					"navigationBarTitleText": "进入刷题",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -297,6 +325,7 @@
 				"style": {
 					"enablePullDownRefresh":true,
 					"navigationBarTitleText": "我的消息",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -307,6 +336,7 @@
 				"path": "bank/question_statistics",
 				"style": {
 					"navigationBarTitleText": "做题统计",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -317,6 +347,7 @@
 				"path": "bank/question_report",
 				"style": {
 					"navigationBarTitleText": "试卷报告",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -349,6 +380,7 @@
 				"path": "bank/questionBankExplain",
 				"style": {
 					"navigationBarTitleText": "解析",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -359,6 +391,7 @@
 				"path": "bank/questionBankWrongExplain",
 				"style": {
 					"navigationBarTitleText": "错题解析",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -370,6 +403,7 @@
 				"path": "bank/questionBankAllExplain",
 				"style": {
 					"navigationBarTitleText": "全部解析",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -391,6 +425,7 @@
 				"path": "bank/questionBankExplainDetail",
 				"style": {
 					"navigationBarTitleText": "试卷解析",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -400,7 +435,8 @@
 			{
 				"path": "bank/questionBankTest",
 				"style": {
-					"navigationBarTitleText": "试卷标题",
+					"navigationBarTitleText": "试卷",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -411,6 +447,7 @@
 				"path": "msg/detail",
 				"style": {
 					"navigationBarTitleText": "消息详情",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -421,6 +458,7 @@
 				"path": "plan/index",
 				"style": {
 					"navigationBarTitleText": "学习计划",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -431,6 +469,7 @@
 				"path": "plan/create",
 				"style": {
 					"navigationBarTitleText": "创建计划",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -441,6 +480,7 @@
 				"path": "plan/edit",
 				"style": {
 					"navigationBarTitleText": "修改计划",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -451,6 +491,7 @@
 				"path": "verify/input",
 				"style": {
 					"navigationBarTitleText": "填写审核资料",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -461,6 +502,7 @@
 				"path": "verify/input2",
 				"style": {
 					"navigationBarTitleText": "填写审核资料",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -471,6 +513,7 @@
 				"path": "appointment/index",
 				"style": {
 					"navigationBarTitleText": "预约考试",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -481,6 +524,7 @@
 				"path": "appointment/order",
 				"style": {
 					"navigationBarTitleText": "预约考试",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -491,6 +535,7 @@
 				"path": "appointment/kporder",
 				"style": {
 					"navigationBarTitleText": "考前培训预约考试",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -511,6 +556,7 @@
 				"path": "subject/collectBank",
 				"style": {
 					"navigationBarTitleText": "试卷",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -521,6 +567,7 @@
 				"path": "subject/wrongBank",
 				"style": {
 					"navigationBarTitleText": "错题",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -532,6 +579,7 @@
 				"path": "subject/collectTypeBank",
 				"style": {
 					"navigationBarTitleText": "试卷",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -542,6 +590,7 @@
 				"path": "subject/wrongTypeBank",
 				"style": {
 					"navigationBarTitleText": "试卷",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -552,6 +601,7 @@
 				"path": "class/question_report",
 				"style": {
 					"navigationBarTitleText": "试卷报告",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -562,6 +612,7 @@
 				"path": "subject/wrong",
 				"style": {
 					"navigationBarTitleText": "错题集",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -572,6 +623,7 @@
 				"path": "bank/wrongById",
 				"style": {
 					"navigationBarTitleText": "错题集",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -582,6 +634,7 @@
 				"path": "bank/collectById",
 				"style": {
 					"navigationBarTitleText": "收藏集",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -592,6 +645,7 @@
 				"path": "subject/collect",
 				"style": {
 					"navigationBarTitleText": "收藏集",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -602,6 +656,7 @@
 				"path": "learn/my_learn",
 				"style": {
 					"navigationBarTitleText": "我的学时",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -612,6 +667,7 @@
 				"path": "learn/details",
 				"style": {
 					"navigationBarTitleText": "详情",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -622,6 +678,7 @@
 				"path": "learn/menu",
 				"style": {
 					"navigationBarTitleText": "目录",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -632,6 +689,7 @@
 				"path": "wd/course",
 				"style": {
 					"navigationBarTitleText": "所有课程",
+					"navigationStyle": "custom", // 隐藏系统导航栏
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"
@@ -657,25 +715,27 @@
 				}
 		},
 		{
-				"path": "polyv/detail",
-				"style": {
-					"navigationBarTitleText": "课程详情",
-					"app-plus": {
-						"titleNView": false, //禁用原生导航栏 
-						"bounce": "none"
-					},
-					"mp-weixin": {
-						"usingComponents": {
-						    "player": "/pages3/static/polyv-sdk/components/player/player",
-							"polyv-player": "plugin://polyv-player/player"
-						  }
-					}
+			"path": "polyv/detail",
+			"style": {
+				"navigationBarTitleText": "课程详情",
+				"navigationStyle": "custom", // 隐藏系统导航栏
+				"app-plus": {
+					"titleNView": false, //禁用原生导航栏 
+					"bounce": "none"
+				},
+				"mp-weixin": {
+					"usingComponents": {
+						"player": "/pages3/static/polyv-sdk/components/player/player",
+						"polyv-player": "plugin://polyv-player/player"
+					  }
 				}
+			}
 		},
 		{
 			"path": "course/detail",
 			"style": {
 				"navigationBarTitleText": "课程详情",
+				"navigationStyle": "custom", // 隐藏系统导航栏
 				"app-plus": {
 					"titleNView": false, //禁用原生导航栏 
 					"bounce": "none"
@@ -686,6 +746,16 @@
 					}
 				}
 			}
+		},{
+			"path": "imgCompare/index",
+			"style": {
+				"navigationBarTitleText": "身份证",
+				"navigationStyle": "custom", // 隐藏系统导航栏
+				"app-plus": {
+					"titleNView": false, //禁用原生导航栏 
+					"bounce": "none"
+				}
+			}
 		}],
 		"plugins": {
 			"polyv-player": {

+ 5 - 2
pages/course/index.vue

@@ -10,7 +10,7 @@
 				<u-line color="#D6D6DB" />
 				<view style="display: flex;justify-content: space-between;height: 78rpx;line-height: 78rpx;padding: 0 30rpx;font-size: 28rpx;">
 					<view style="color: #666666;white-space: nowrap;width: 80%;overflow-x: hidden;">{{selObj.eName}}:{{selObj.pName}}-{{selObj.bName}}</view>
-					<view style="color: #007AFF;width: 20%;" @click="openLeft()">重新选择</view>
+					<view style="color: #007AFF;width: 20%;font-size: 32rpx;" @click="openLeft()">重新选择</view>
 				</view>
 				<u-line color="#D6D6DB" />
 				<view style="display: flex;align-items:center;">
@@ -65,7 +65,7 @@
 							<view style="display: flex;margin-top: 13rpx;align-items: center;">
 								<view class="yearTag" v-if="item.year">{{item.year}}</view>
 								<view class="titleTag" style="display: flex;justify-content: space-between;flex:1;">
-									<view>{{item.goodsName}}</view>
+									<view style="flex:1;">{{item.goodsName}}</view>
 									
 									<view class="priceTag">¥ {{item.standPrice.toFixed(2)}}</view>
 								</view>
@@ -224,6 +224,8 @@ export default {
 					self.eList = res.data.rows
 					if(self.selObj.eId){
 						self.businessList({educationId:self.selObj.eId})
+					} else {
+						this.active1(self.eList[0])
 					}
 				}
 			});
@@ -496,5 +498,6 @@ export default {
 		padding: 3rpx 8rpx;
 		margin-top: 11rpx;
 		color:#666666;
+		font-size: 30rpx;
 	}
 </style>

+ 199 - 153
pages/index/index.vue

@@ -7,12 +7,12 @@
 		</u-navbar>
 		<view class="swiper">
 			<swiper :indicator-dots="false" indicator-color="#fff" indicator-active-color="#007AFF" :style="{'height':swiperHeight+'rpx'}" @change="swiperChange" :interval="interval" :duration="duration"  :autoplay="autoplay" :circular="true">
-				<!-- <swiper-item v-for="(swiper,index) in list" :key="index" @click="swiperClick(swiper)">
+				<swiper-item v-for="(swiper,index) in list" :key="index" @click="swiperClick(swiper)">
 					<image @load="imageLoad" :src="$method.splitImgHost(swiper.adverUrl, true)" mode="widthFix"></image>
-				</swiper-item> -->
-				<swiper-item >
-					<image @load="imageLoad" src="http://file.xyyxt.net/oss/images/file/20220111.jpg" mode="widthFix"></image>
 				</swiper-item>
+				<!-- <swiper-item >
+					<image @load="imageLoad" src="http://file.xyyxt.net/oss/images/file/20220111.jpg" mode="widthFix"></image>
+				</swiper-item> -->
 				
 				
 			</swiper>
@@ -35,16 +35,12 @@
 				<view class="calendar_card">
 					<view class="card_box">
 						<u-row gutter="16">
-							<u-col span="11" v-if="false">
-								<view>
-									<text class="t1">距离</text> 
-									<text class="t2">二级建造师</text>
-									<text class="t1">考试</text>
-									<text class="t3">365</text>
-									<text class="t1">天,继续加油哦!</text>
+							<u-col span="10" >
+								<view  style="height:60rpx;">
+									<text class="t1" v-if="nearByDay !== '' && nearByDay !== null">距离最近一次考试还剩{{nearByDay}}天</text> 
 								</view>
 							</u-col>
-							<u-col offset="11" span="1">
+							<u-col offset="1" span="1">
 								<view @click="jumpPlan"><image src="/static/more.png" class="img_more"></image></view>
 							</u-col>
 						</u-row>
@@ -136,7 +132,9 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters, mapActions } from 'vuex';
+// import { websocket } from '@/common/socket.js';
+import { socket_url, version} from '@/common/request.js';
 export default {
 	components: {},
 	data() {
@@ -152,6 +150,7 @@ export default {
 			interval: 2000,
 			duration: 500,
 			swiperHeight:0,
+			nearByDay:'', //距离最近一天考试
 			menu: [{
 					name: '推荐课程',
 				}, {
@@ -185,19 +184,40 @@ export default {
 		};
 	},
 	onPullDownRefresh() {},
-	onLoad(option) {
-		this.init()
+	async onLoad(option) {
 		this.courseList();
 		this.bankList();
-		this.getAdvertising()
+		this.getAdvertising();
+		if(this.$method.isLogin()) {
+			try  {
+				await this.getUserInfo()
+				// websocket.sokcet(socket_url+this.userInfo.userId+'-'+this.$method.getRandomString(6))
+				// websocket.sokcet(socket_url+this.userInfo.userAccount)
+			}catch(err) {
+				
+			}
+			
+		} else {
+			if(uni.getStorageSync('needToLogin')) {
+				uni.removeStorageSync('needToLogin');
+				uni.navigateTo({
+					url:'/pages/login/login'
+				})
+			}
+		}
+		
+		this.init()
 	},
 	onShow() {
-		if (uni.getStorageSync('updateHome')|| !this.isOld){
-			this.isOld = true;
+		if (uni.getStorageSync('updateHome')){
 			this.init()
 			uni.removeStorageSync('updateHome'); //消费首页刷新事件
 		}
 		
+		this.appCommonConfig({
+			version
+		});
+		
 		if(this.$method.isLogin()){
 			this.$store.state.allowLoading = false;
 			this.$api.getinfoAttached().then(res => {
@@ -220,6 +240,7 @@ export default {
 		};
 	},
 	methods: {
+		...mapActions(['getUserInfo','appCommonConfig']),
 		toFixed(number) {
 			if(number > 0) {
 				return number.toFixed(2)
@@ -277,6 +298,35 @@ export default {
 			await this.advertisingList();
 		},
 		
+		getUserSubscribeRecentExam() {
+			return new Promise(resolve => {
+				this.$api.getUserSubscribeRecentExam().then(res => {
+					if(res.data.code == 200) {
+						if(res.data.data) {
+							let day = this.$method.timestampToTime(res.data.data.applySiteExamTime,true).replace(/-/g,'/')
+							let dayTime = day + ' ' + res.data.data.applySiteStartTime
+							let NowTime = new Date(); //考试时间
+							let examTime = new Date(dayTime); //考试时间
+							let t = (examTime.getTime() / 1000) - (NowTime.getTime() / 1000).toFixed(0);
+							if(t > 0) {
+								let day = +this.$method.GetRTime(examTime.getTime() / 1000,true)
+								this.nearByDay = day;
+							} 
+					
+							
+						}
+						
+						resolve()
+					}
+					
+					console.log(res)
+					
+					
+				})
+			})
+			
+		},
+		
 		advertisingHomeLocation() {
 			return new Promise(resolve => {
 				this.$api.advertisingHomeLocation().then(res => {
@@ -325,95 +375,98 @@ export default {
 		 * 跳转课程详情
 		 */
 		async jumpGoodsDetail(item){
-			let currentTime = this.$method.getZeroTime();
+			uni.navigateTo({
+				url:'/pages2/wd/class'
+			})
+			// let currentTime = this.$method.getZeroTime();
 			
-			if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
-				uni.showToast({
-					title:'不在学习有效期,不可以学习了哦',
-					icon:'none'
-				})
-				return;
-			}
+			// if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+			// 	uni.showToast({
+			// 		title:'不在学习有效期,不可以学习了哦',
+			// 		icon:'none'
+			// 	})
+			// 	return;
+			// }
 			
-			if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
-				uni.showToast({
-					title:'不在班级有效期,不能进入学习',
-					icon:'none'
-				})
-				return;
-			}
+			// if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+			// 	uni.showToast({
+			// 		title:'不在班级有效期,不能进入学习',
+			// 		icon:'none'
+			// 	})
+			// 	return;
+			// }
 			
-			if(item.learningStatus == 2) {
-				uni.showToast({
-					title:'开放学习时间待定,不能进入学习',
-					icon:'none'
-				})
-				return;
-			}
+			// if(item.learningStatus == 2) {
+			// 	uni.showToast({
+			// 		title:'开放学习时间待定,不能进入学习',
+			// 		icon:'none'
+			// 	})
+			// 	return;
+			// }
 			
-			if(item.classStatus == 0 ) {
-				uni.showToast({
-					title:'尚未开班,不能进入学习',
-					icon:'none'
-				})
-				return;
-			}
+			// if(item.classStatus == 0 ) {
+			// 	uni.showToast({
+			// 		title:'尚未开班,不能进入学习',
+			// 		icon:'none'
+			// 	})
+			// 	return;
+			// }
 			
-			if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
-				uni.showToast({
-					title:'不在开放学习时间,不能进入学习',
-					icon:'none'
-				})
-				return;
-			}
+			// if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+			// 	uni.showToast({
+			// 		title:'不在开放学习时间,不能进入学习',
+			// 		icon:'none'
+			// 	})
+			// 	return;
+			// }
 			
-			if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+			// if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
 				
-				uni.showModal({
-					title:'提示',
-					content:'班级已过期,需要重新选班',
-					showCancel:false,
-					success:() => {
-						uni.navigateTo({
-							url:"/pages2/wd/class"
-						})
-					}
-				})
-				return;
-			}
+			// 	uni.showModal({
+			// 		title:'提示',
+			// 		content:'班级已过期,需要重新选班',
+			// 		showCancel:false,
+			// 		success:() => {
+			// 			uni.navigateTo({
+			// 				url:"/pages2/wd/class"
+			// 			})
+			// 		}
+			// 	})
+			// 	return;
+			// }
 			
-			let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+			// let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
 			
-			if(rebuildStatus == 0) {
-				this.$navTo.togo('/pages2/learn/details', {
-					gradeId:item.gradeId,
-					goodsId: item.goodsId
-				})
-				return;
-			}
+			// if(rebuildStatus == 0) {
+			// 	this.$navTo.togo('/pages2/learn/details', {
+			// 		gradeId:item.gradeId,
+			// 		goodsId: item.goodsId
+			// 	})
+			// 	return;
+			// }
 			
-			if(item.courseNum == 1 ) {
+			// if(item.courseNum == 1 ) {
 				
-				this.$api.courseCourseList({
-					pageNum:1,
-					pageSize:1,
-					goodsId:item.goodsId,
-					gradeId:item.gradeId
-				}).then(res => {
-					if(res.data.code == 200) {
-						uni.navigateTo({
-							url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
-						})
-					}
-				});
-				return;
-			}
+			// 	this.$api.courseCourseList({
+			// 		pageNum:1,
+			// 		pageSize:1,
+			// 		goodsId:item.goodsId,
+			// 		gradeId:item.gradeId
+			// 	}).then(res => {
+			// 		if(res.data.code == 200) {
+			// 			uni.navigateTo({
+			// 				url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+			// 			})
+			// 		}
+			// 	});
+			// 	return;
+			// }
 			
 			
-			this.$navTo.togo('/pages2/wd/course', {
-				id: item.goodsId,
-				gid:item.gradeId
-			});
+			// this.$navTo.togo('/pages2/wd/course', {
+			// 	id: item.goodsId,
+			// 	gid:item.gradeId
+			// });
 		},
 		/**
 		 * @param {Object} goodsId 商品id
@@ -452,7 +505,7 @@ export default {
 				this.$navTo.togo('/pages2/plan/index', {});
 			}
 		},
-		init() {
+		async init() {
 			if (!this.$method.isLogin()) {
 				//未登录
 				this.date_num = [];
@@ -463,8 +516,10 @@ export default {
 				this.date_num = [];
 				this.workList = [];
 				this.planGoodsList = [];
-				this.userPlanSeven();
+				await this.userPlanSeven();
+				await this.getUserSubscribeRecentExam();
 			}
+			
 		},
 		getMonDate() {
 			var d = new Date(),
@@ -523,48 +578,53 @@ export default {
 			
 		},
 		userPlanSeven() {
-			let self = this;
-			this.$api.userPlanSeven().then(result => {
-				if (result.data.data && result.data.data.length>0) {
-					
-					self.workList = result.data.data
-					self.planGoodsList = self.workList[0].goodsVos;
-					if (self.planGoodsList != null && self.planGoodsList.length > 0) {
-						self.goodsItem = self.planGoodsList[0];
-					}
-					self.dealRL(result.data.data[0].calendarStudyVo)
-					/* let date = new Date();
-					let num = date.getDate();
-					let month = date.getMonth() + 1;
-					let list = [];
-					for (let i = 0; i < result.data.data[0].calendarStudyVo.length; i++) {
-						let item = result.data.data[0].calendarStudyVo[i];
-						if (item.month == month) {
-							list = item.dayStudyList;
-						}
-					}
-					for (let i = 0; i < list.length; i++) {
-						let item = list[i];
-						item.color = 0;
-						if (item.date == num) {
-							item.color = 3;
-						}
-						if (item.perform == 1) {
-							item.color = 1;
-						}
-						if (item.perform == 2) {
-							item.color = 2;
+			return new Promise(resolve => {
+				let self = this;
+				this.$api.userPlanSeven().then(result => {
+					if (result.data.data && result.data.data.length>0) {
+						
+						self.workList = result.data.data
+						self.planGoodsList = self.workList[0].goodsVos;
+						if (self.planGoodsList != null && self.planGoodsList.length > 0) {
+							self.goodsItem = self.planGoodsList[0];
 						}
-						item.note = item.studyCourseKnob;
-						if (item.note > 0) {
-							item.dot = true;
+						self.dealRL(result.data.data[0].calendarStudyVo)
+						/* let date = new Date();
+						let num = date.getDate();
+						let month = date.getMonth() + 1;
+						let list = [];
+						for (let i = 0; i < result.data.data[0].calendarStudyVo.length; i++) {
+							let item = result.data.data[0].calendarStudyVo[i];
+							if (item.month == month) {
+								list = item.dayStudyList;
+							}
 						}
-						self.date_num.push(item);
-					} */
-				} else {
-					self.initDay();
-				}
-			});
+						for (let i = 0; i < list.length; i++) {
+							let item = list[i];
+							item.color = 0;
+							if (item.date == num) {
+								item.color = 3;
+							}
+							if (item.perform == 1) {
+								item.color = 1;
+							}
+							if (item.perform == 2) {
+								item.color = 2;
+							}
+							item.note = item.studyCourseKnob;
+							if (item.note > 0) {
+								item.dot = true;
+							}
+							self.date_num.push(item);
+						} */
+					} else {
+						self.initDay();
+					}
+					
+					resolve()
+				});
+			})
+			
 		},
 		swiperChange(e) {
 			this.current = e.detail.current;
@@ -812,7 +872,7 @@ export default {
 			border-radius: 16rpx ;
 			
 			.item {
-				padding:8rpx 0;
+				padding:24rpx 0;
 				border-bottom:1rpx solid #eeeeee;
 				display: flex;
 				
@@ -971,26 +1031,12 @@ page {
 .calendar_card .card_box {
 	height: 60rpx;
 	line-height: 60rpx;
-	margin-left: 40rpx;
+	margin-left: 20rpx;
 }
 .calendar_card .t1 {
-	color: #7f8caf;
+	color: #007AFF;
 	font-size: 24rpx;
 }
-.calendar_card .t2 {
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #32467b;
-	margin: 0 10rpx;
-}
-.calendar_card .t3 {
-	font-size: 30rpx;
-	font-weight: bold;
-	color: #32467b;
-	text-shadow: 0rpx 3rpx 3rpx rgba(0, 0, 0, 0.2);
-	margin: 0 10rpx;
-}
 .img_more {
 	width: 26rpx;
 	height: 26rpx;

+ 4 - 2
pages/shopping/shoppingCart.vue

@@ -58,7 +58,7 @@
 						</u-checkbox-group>
 					</uni-swipe-action>
 				</view>
-				<view class="bottomBox">
+				<view class="bottomBox" v-if="!hideBuyState">
 					<view>
 						<u-checkbox label="all" name="all" shape="circle" @change="checkboxAllChange" v-model="allChecked"></u-checkbox>
 						<text>全选</text>
@@ -149,6 +149,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
@@ -178,6 +179,7 @@ export default {
 			examIndex: 0
 		};
 	},
+	computed: { ...mapGetters(['userInfo','hideBuyState']) },
 	onLoad(option) {
 		console.log(option,987)
 	},
@@ -438,7 +440,7 @@ export default {
 				}
 			}
 			this.$store.commit('setShoppingCartList', { shoppingCartList: checkGoodsList });
-			this.$navTo.togo('/pages2/order/confirm_pay');
+			this.$navTo.togo('/pages2/order/confirm_pay?fromCart=true');
 		},
 		checkboxChange(n) {
 			console.log('change', n);

+ 24 - 5
pages/wd/index.vue

@@ -33,10 +33,10 @@
 						<image src="/static/icon/my_icon3.png" class="my_icon"></image>
 						<view>我的网课</view>
 					</navigator>
-					<navigator  hover-class="none" url="/pages2/wd/question_bank" class="small_menu">
+					<view @click="goBank()" class="small_menu">
 						<image src="/static/icon/my_icon4.png" class="my_icon"></image>
 						<view>我的题库通</view>
-					</navigator>
+					</view>
 				</view>
 				<navigator  hover-class="none" url="/pages2/learn/my_learn" class="menu_box" >
 					<view class="box_left">
@@ -59,7 +59,7 @@
 						考试预约
 					</view>
 				</navigator>
-				<navigator  hover-class="none" url="/pages2/order/index" class="menu_box">
+				<navigator  hover-class="none" v-if="!hideBuyState" url="/pages2/order/index" class="menu_box">
 					<view class="box_left">
 						<image src="/static/icon/my_icon7.png" class="my_icon"></image>
 						<view>我的订单</view>
@@ -96,6 +96,7 @@
 </template>
 
 <script>
+// import { websocket } from '@/common/socket.js';
 import { mapGetters } from 'vuex';
 export default {
 	components: {},
@@ -121,6 +122,24 @@ export default {
 		// this.$store.dispatch('changeTabsNum')
 	},
 	methods: {
+		goBank() {
+			this.$api.lockLockStatus({
+			  action:'bank'
+			}).then(res => {
+			  if(res.data.code == 200) { //有其他端在操作,不能学习
+				  uni.showToast({
+					  icon:'none',
+					  title:res.data.msg,
+					  duration:3000,
+				  })
+			  } else if(res.data.code == 500) { //可以学习
+				  
+				uni.navigateTo({
+					url:'/pages2/wd/question_bank'
+				})
+			  }
+			})
+		},
 		getNums() {
 			this.$api.getinfoAttached().then(res => {
 				if (res.data.code === 200) {
@@ -131,7 +150,7 @@ export default {
 			});
 		},
 		logout() {
-			console.log(343);
+			// websocket.stop()
 			this.$method.exit();
 			this.isLogin = this.$method.isLogin();
 			
@@ -140,7 +159,7 @@ export default {
 			this.$navTo.togo('/pages/login/login');
 		}
 	},
-	computed: { ...mapGetters(['userInfo']) }
+	computed: { ...mapGetters(['userInfo','hideBuyState']) }
 };
 </script>
 <style>

+ 4 - 3
pages2/appointment/appointment_success.vue

@@ -2,7 +2,7 @@
 	<view class="safeArea">
 		<view style="padding: 8rpx;">
 			<view class="box1">
-				<view>您所报考的【{{ listData.categoryName }}】专业</view>
+				<view>您所报考的<text v-if="listData.categoryName">【{{ listData.categoryName }}】</text>专业</view>
 				<view class="status">
 					<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon>
 					<text style="margin-left: 8rpx;">{{ listData.subscribeStatus === 1 ? '考试预约成功' : '预约异常' }}</text>
@@ -40,7 +40,7 @@
 					</view>
 					<view class="list_item">
 						<view class="txt_left">报考专业</view>
-						<view class="txt_right">{{listData.categoryName}}专业</view>
+						<view class="txt_right" v-if="listData.categoryName">{{listData.categoryName}}专业</view>
 					</view>
 					<view class="list_item">
 						<view class="txt_left">考试地点</view>
@@ -77,7 +77,8 @@ export default {
 	data() {
 		return {
 			subscribeId: null,
-			listData: {}
+			listData: {},
+			orderGoodsId:''
 		};
 	},
 	onLoad(option) {

+ 15 - 7
pages2/appointment/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="预约考试"></nav-bar>
 		<view class="appointment">
 			<view class="appointmentItem appointmentHead">
 				<view class="imgBox"><image :src="$method.splitImgHost(listData.applyUrl)" mode="widthFix"></image></view>
@@ -14,7 +15,7 @@
 				<u-line color="#EEEEEE" />
 				<view class="item">
 					<view class="labelName">温馨提示:</view>
-					<view class="valName">{{ listData.applyIntroduce || ''}}</view>
+					<text class="valName">{{ listData.applyIntroduce || ''}}</text>
 				</view>
 			</view>
 			<view class="appointmentItem appointmentMajor">
@@ -61,7 +62,7 @@
 			<view class="tipBox">
 				<view class="title">温馨提示</view>
 				<view class="main">
-					<view class="item">您所报考的{{ listData.major }}专业,</view>
+					<view class="item">您所报考的{{ listData.major || '' }}专业,</view>
 					<view class="item">考试次数已经用完。</view>
 					<view class="item">需要预约考试的补考学员,</view>
 					<view class="item">请先购买补考机会。</view>
@@ -84,6 +85,7 @@ export default {
 			radiolist: [{ name: '1', label: '非补考学员' }, { name: '2', label: '补考学员' }],
 			goodsId: 0,
 			gradeId: 0,
+			orderGoodsId:"",
 			applyStatus: '',
 			listData: {
 				applyStatus: []
@@ -95,13 +97,15 @@ export default {
 	onLoad(option) {
 		this.goodsId = Number(option.goodsId);
 		this.gradeId = Number(option.gradeId);
+		this.orderGoodsId = Number(option.orderGoodsId) || ''
 		this.getInfo();
 	},
 	methods: {
 		getInfo() {
 			var data = {
 				goodsId: this.goodsId,
-				gradeId: this.gradeId
+				gradeId: this.gradeId,
+				orderGoodsId:this.orderGoodsId
 			};
 			this.$api.getApplysubscribe(data).then(res => {
 				if (res.data.data.applyStatus) {
@@ -122,7 +126,8 @@ export default {
 				applyId: this.listData.applyId,
 				applyStatus: this.radioInfo,
 				goodsId: this.goodsId,
-				gradeId: this.gradeId
+				gradeId: this.gradeId,
+				orderGoodsId:this.orderGoodsId
 			};
 			this.$api.getApplysubscribeNext(data).then(res => {
 				if (res.data.code === 500) {
@@ -136,13 +141,15 @@ export default {
 							applyId: this.listData.applyId,
 							applyStatus: this.radioInfo,
 							goodsId: this.goodsId,
-							dataId: res.data.data
+							dataId: res.data.data,
+							orderGoodsId: this.orderGoodsId
 						});
 					}
 					if (res.data.data === 3) {
-						this.$api.goodsList({ makeGoodsId: this.goodsId }).then(res => {
+						this.$api.goodsList({ makeGoodsId: this.goodsId,goodsType:3,orderGoodsId:this.orderGoodsId }).then(res => {
 							if (res.data.code === 200) {
 								if(res.data.rows.length){
+									console.log(res.data.rows[0].goodsId)
 								this.goodsIdBK = res.data.rows[0].goodsId;
 								}
 							}
@@ -166,7 +173,8 @@ export default {
 			})
 			this.$navTo.togo('/pages2/order/confirm_list', {
 				id: this.goodsIdBK,
-				isBK:'1'
+				isBK:'1',
+				orderGoodsId:this.orderGoodsId
 			});
 			}
 		}

+ 42 - 20
pages2/appointment/kporder.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="考前培训预约考试"></nav-bar>
 		<view class="appointment">
 			<view class="appointmentItem">
 				<view class="title">考前培训地点:</view>
@@ -36,7 +37,15 @@
 				</view>
 			</view>
 			<view v-else class="appointmentItem">
-				<view class="title">当前考培地点无考前培训时间点</view>
+				<view class="title">
+					<text v-if="addressName && addressName != '请选择'">
+						该考试地点暂无考试时间,建议重新选择考试地点
+					</text>
+					<!-- <text v-else>
+						当前考培地点无考前培训时间点
+					</text> -->
+					
+				</view>
 			</view>
 			<view class="btnMain">
 				<view class="return" @click="backPage">上一步</view>
@@ -67,6 +76,7 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
+			orderGoodsId:0,
 			address_show: false,
 			addressName: '请选择',
 			addressId: null, //当前选中考试点ID
@@ -82,10 +92,11 @@ export default {
 		this.applyId = Number(option.applyId);
 		this.goodsId = Number(option.goodsId);
 		this.applyStatus = Number(option.applyStatus);
+		this.orderGoodsId = Number(option.orderGoodsId)
 		this.getInfo();
 		this.getVuexData();
 		uni.showModal({
-			content: '线下考前培训,自由填选如您有需要,建议先进行预约具体安排,后续会有相关工作人员与您沟通',
+			content: '线下考前培训,自由填选如您有需要,建议先进行预约具体安排,后续会有相关工作人员与您沟通',
 			showCancel: false
 		});
 	},
@@ -120,11 +131,11 @@ export default {
 			var self = this;
 			const index = this.listData.findIndex(item => item.checked);
 			if (index === -1) {
-				uni.showToast({
-					title: '请选择考前培训地点',
-					icon: 'none'
-				});
-				return;
+				// uni.showToast({
+				// 	title: '请选择考前培训地点',
+				// 	icon: 'none'
+				// });
+				// return;
 			}
 			if (this.addressId === this.listData[index].id) {
 				this.address_show = false;
@@ -135,20 +146,20 @@ export default {
 			var arrays = [];
 			this.listData[index].examUserApplySiteTime.forEach(item => {
 				if(item.examTime < self.applyDs.applySiteExamTime){
-				item.examApplySiteTimeTwoVo.forEach(items => {
-					arrays.push({
-						examTime: item.examTime,
-						startTimeC: items.startTime,
-						endTimeC: items.endTime,
-						dataTime: self.$method.timestampToTime(item.examTime),
-						startTime: items.startTime,
-						endTime: items.endTime,
-						num: items.num,
-						registration: items.registration,
-						checked: false,
-						status: items.status === 1 ? items.status : items.registration >= items.num ? 2 : items.status
+					item.examApplySiteTimeTwoVo.forEach(items => {
+						arrays.push({
+							examTime: item.examTime,
+							startTimeC: items.startTime,
+							endTimeC: items.endTime,
+							dataTime: self.$method.timestampToTime(item.examTime).replace(/-/g,'/'),
+							startTime: items.startTime,
+							endTime: items.endTime,
+							num: items.num,
+							registration: items.registration,
+							checked: false,
+							status: items.status === 1 ? items.status : items.registration >= items.num ? 2 : items.status
+						});
 					});
-				});
 				}
 			});
 			this.activeList = arrays.filter((item,index) => {
@@ -185,6 +196,7 @@ export default {
 					var copyData = JSON.parse(JSON.stringify(self.activeList));
 					const index = copyData.findIndex(item => item.checked);
 					var data = {
+						orderGoodsId: self.orderGoodsId,
 						applySiteAddressTrain: self.addressName,
 						applySiteExamTrainTime: copyData[index].examTime,
 						applySiteStartTrainTime: copyData[index].startTimeC,
@@ -197,6 +209,11 @@ export default {
 							uni.reLaunch({
 								url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
 							});
+						} else {
+							uni.showToast({
+								icon:'none',
+								title:res.data.msg
+							})
 						}
 					});
 				} else {
@@ -206,6 +223,11 @@ export default {
 							uni.reLaunch({
 								url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
 							});
+						} else {
+							uni.showToast({
+								icon:'none',
+								title:res.data.msg
+							})
 						}
 					});
 				}

+ 26 - 4
pages2/appointment/order.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="预约考试"></nav-bar>
 		<view class="appointment">
 			<view class="appointmentItem">
 				<view class="title">考试地点:</view>
@@ -28,6 +29,17 @@
 					</view>
 				</view>
 			</view>
+			<view v-else class="appointmentItem">
+				<view class="title">
+					<text v-if="addressName && addressName != '请选择'">
+						该考试地点暂无考试时间,建议重新选择考试地点
+					</text>
+					<!-- <text v-else>
+						当前考培地点无考前培训时间点
+					</text> -->
+					
+				</view>
+			</view>
 			<view class="btnMain">
 				<view class="return" @click="backPage">上一步</view>
 				<view class="sure" @click="sureOppoint">{{ dataId === 1 ? '下一步' : dataId === 2 ? '确定预约' : '异常' }}</view>
@@ -57,6 +69,7 @@ import { mapGetters } from 'vuex';
 export default {
 	data() {
 		return {
+			orderGoodsId:0,
 			address_show: false,
 			addressName: '请选择',
 			addressId: null, //当前选中考试点ID
@@ -73,6 +86,7 @@ export default {
 		this.goodsId = Number(option.goodsId);
 		this.applyStatus = Number(option.applyStatus);
 		this.dataId = Number(option.dataId);
+		this.orderGoodsId = Number(option.orderGoodsId)
 		this.getInfo();
 	},
 	methods: {
@@ -121,7 +135,7 @@ export default {
 						examTime: item.examTime,
 						startTimeC: items.startTime,
 						endTimeC: items.endTime,
-						dataTime: self.$method.timestampToTime(item.examTime),
+						dataTime: self.$method.timestampToTime(item.examTime).replace(/-/g,'/'),
 						startTime: items.startTime,
 						endTime: items.endTime,
 						num: items.num,
@@ -132,12 +146,18 @@ export default {
 				});
 			});
 			this.activeList = arrays.filter((item,index) => {
+				console.log(item)
 				const newTime = parseInt(new Date().getTime() / 1000)
-				const liTime = parseInt(new Date(item.dataTime + '' + item.startTime + ':00').getTime() / 1000)
+				console.log(item.dataTime.replace(/-/g,'/') + '' + item.startTime + ':00')
+				const liTime = parseInt(new Date(item.dataTime.replace(/-/g,'/') + '' + item.startTime + ':00').getTime() / 1000)
+				console.log(liTime,'liTime')
+				console.log(newTime,'newTime')
 				if(liTime > newTime){
 					return item
 				}
 			});
+			
+			console.log(this.activeList)
 			this.address_show = false;
 		},
 		choItem(index) {
@@ -168,14 +188,16 @@ export default {
 						applySiteAddress: self.addressName,
 						applySiteExamTime: copyData[index].examTime,
 						applySiteStartTime: copyData[index].startTimeC,
-						applySiteEndTime: copyData[index].endTimeC
+						applySiteEndTime: copyData[index].endTimeC,
+						orderGoodsId: self.orderGoodsId
 					};
 					if (self.dataId === 1) {
 						self.$store.commit('updateApplyData', data);
 						self.$navTo.togo('/pages2/appointment/kporder', {
 							applyId: self.applyId,
 							applyStatus: self.applyStatus,
-							goodsId: self.goodsId
+							goodsId: self.goodsId,
+							orderGoodsId: self.orderGoodsId
 						});
 					}
 					if (self.dataId === 2) {

+ 10 - 8
pages2/bank/collectById.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="收藏集"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===2} ]" @click="sceenType = !sceenType">全部试卷类型<u-icon class="icon" :class="sceenType ? 'animals':''" name="arrow-down"></u-icon></view>
 		</view>
@@ -26,10 +27,10 @@
 					<view class="bt">
 						<view class="left">收藏数<text class="num">{{item.questionNum}}</text></view>
 						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?id='+item.examId">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&id='+item.examId">
 								<view class="btn">重做</view>
 							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?id='+item.examId+'&explain=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&id='+item.examId+'&explain=1'">
 								<view class="btn">解析</view>
 							</navigator>
 							<!-- <view class="btn">解析</view> -->
@@ -50,10 +51,10 @@
 					<view class="bt">
 						<view class="left">收藏数<text class="num">{{item.num}}</text></view>
 						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type">
 								<view class="btn">重做</view>
 							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type+'&explain=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?orderGoodsId='+orderGoodsId+'&type='+item.type+'&explain=1'">
 								<view class="btn">解析</view>
 							</navigator>
 						</view>
@@ -79,12 +80,13 @@ export default {
 			typeList:[],
 			total:0,
 			goodsid:'',
+			orderGoodsId:'',
 			paperid:''
 		};
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
-		
+		this.orderGoodsId = option.orderGoodsId || ''
 		this.goodsid = option.goodsid
 		this.examaperList();
 		this.getData();
@@ -108,7 +110,7 @@ export default {
 		goodsCollectExamList() {
 			this.$api.goodsCollectExamList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.testList = res.data 
 				let total = 0;
@@ -122,12 +124,12 @@ export default {
 		collectQuestionTypeList() {
 			this.$api.collectQuestionTypeList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.typeList = res.data 
 				let total = 0;
 				this.typeList.rows.forEach(item => {
-					total += item.questionNum;
+					total += item.num;
 				})
 				
 				this.total = total

+ 78 - 33
pages2/bank/detail.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="题库详情"></nav-bar>
 		<view style="background-color: #FFFFFF;">
 			<view>
 				<image :src="$method.splitImgHost(goodsData.coverUrl, true)" style="width: 100%;"></image>
@@ -17,7 +18,7 @@
 			</view>
 			<u-line color="#D6D6DB" />
 			<view>
-				<view><u-tabs :list="list" item-width="50%" font-size="24" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
+				<view><u-tabs :list="list" item-width="50%" font-size="30" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
 			</view>
 			<u-line color="#D6D6DB" />
 		</view>
@@ -28,7 +29,7 @@
 			<view class="content">
 				<view class="list" v-for="(item1, index1) in bankList" :key="index1">
 					<template v-if="item1.type == 1">
-						<view class="moduleItem" @click="clickModule" :data-id="item1.majorId" :data-index="index1">
+						<view class="moduleItem" @click="clickModule(index1,item1.majorId)">
 							<view class="courseName">{{ item1.name }}</view>
 							<view>
 								<image src="/static/icon/up.png" class="icon_up" v-if="!item1.showList"></image>
@@ -38,19 +39,17 @@
 
 						<template v-if="item1.showList">
 							<view v-for="(item2, index2) in item1.list" :key="index2">
-								<view class="section" @click="changeItem" :data-index1="index1" :data-index2="index2" :data-id="item2.chapterExamId" :data-type="item1.type">
+								<view class="section" @click="changeItem(index1,index2,item2.chapterExamId,item1.type)">
 									<image src="/static/icon/down1.png" class="icon_up" v-if="item2.showList"></image>
 									<image src="/static/icon/up1.png" class="icon_up" v-if="!item2.showList"></image>
 									<!-- <u-icon  v-if="!item2.showList" name="arrow-up"></u-icon>
 									<u-icon  v-if="item2.showList" name="arrow-down"></u-icon> -->
 									<text style="margin-left:34rpx;">{{ item2.name }}</text>
 								</view>
-								<view v-if="item2.showList">
+								<view class="article-list" v-if="item2.showList">
 									<view class="article" :class="{ active: showTest(article.examId) }" v-for="(article, index3) in item2.list" :key="index3">
 										<view class="flex_auto">{{ article.examName }}</view>
-										<navigator hover-class="none" :url="'/pages2/bank/questionBankTest?id=' + article.examId + '&num=' + showTest(article.examId).num">
-											<view class="btn" v-if="showTest(article.examId)">试做</view>
-										</navigator>
+										<view class="btn" @click="goTest(item1.type,article)" v-if="showTest(article.examId)">试做</view>
 									</view>
 								</view>
 								<u-line></u-line>
@@ -59,19 +58,17 @@
 					</template>
 
 					<template v-if="item1.type == 2">
-						<view class="section" :data-index1="index1" :data-id="item1.majorId" @click="changeItem" :data-type="item1.type">
+						<view class="section" @click="changeItem(index1,'',item1.majorId,item1.type)" >
 							<image src="/static/icon/down1.png" class="icon_up" v-if="item1.showList"></image>
 							<image src="/static/icon/up1.png" class="icon_up" v-if="!item1.showList"></image>
 							<!-- <u-icon  v-if="!item1.showList" name="arrow-up"></u-icon>
 							<u-icon  v-if="item1.showList" name="arrow-down"></u-icon> -->
 							<text style="margin-left:34rpx;">{{ item1.name }}</text>
 						</view>
-						<view v-if="item1.showList" >
+						<view class="article-list" v-if="item1.showList" >
 							<view class="article" :class="{active:showTest(article.examId)}"  :key="index2" v-for="(article,index2) in item1.list">
-								<view class="flex_auto">{{item1.name}}</view>
-								<navigator  hover-class="none" :url="'/pages2/bank/questionBankTest?id='+article.examId+'&num='+showTest(article.examId).num">
-									<view class="btn"  v-if="showTest(article.examId)">试做</view>
-								</navigator>
+								<view class="flex_auto">{{article.examName}}</view>
+								<view class="btn" @click="goTest(item1.type,article)"  v-if="showTest(article.examId)">试做</view>
 							</view>
 						</view>
 					</template>
@@ -79,15 +76,13 @@
 					<template v-if="item1.type == 3">
 						<view class="article" :class="{ active: showTest(item1.majorId) }">
 							<view class="flex_auto">{{ item1.name }}</view>
-							<navigator hover-class="none" :url="'/pages2/bank/questionBankTest?id=' + item1.majorId + '&num=' + showTest(item1.majorId).num">
-								<view class="btn" v-if="showTest(item1.majorId)">试做</view>
-							</navigator>
+							<view class="btn" @click="goTest(item1.type,item1)" v-if="showTest(item1.majorId)">试做</view>
 						</view>
 					</template>
 				</view>
 			</view>
 		</view>
-		<view class="bottomBox">
+		<view class="bottomBox" v-if="!hideBuyState">
 			<view class="priceTag">¥ {{ toFixed(goodsData.standPrice) }}</view>
 			<view style="display: flex;color: #FFFFFF;align-items: center;">
 				<view class="btn1" @click="addCart">加购物车</view>
@@ -98,6 +93,7 @@
 </template>
 
 <script>
+// import { websocket } from '@/common/socket.js';
 import { mapGetters } from 'vuex';
 export default {
 	data() {
@@ -125,7 +121,7 @@ export default {
 		}
 	},
 	onUnload() {},
-	computed: { ...mapGetters(['userInfo']) },
+	computed: { ...mapGetters(['userInfo','hideBuyState']) },
 	onLoad(option) {
 		this.id = option.id;
 		this.getDetail();
@@ -136,6 +132,8 @@ export default {
 		toFixed(number) {
 			if(number) {
 				return number.toFixed(2)
+			} else {
+				return '0.00'
 			}
 		},
 		getDetail() {
@@ -155,8 +153,31 @@ export default {
 				.then(res => {
 					console.log(res);
 					this.bankList = res.data.data;
+					this.showAllCharpter();
 				});
 		},
+		/**
+		 * 展示第一个章下的节内容
+		 */
+		showAllCharpter() {
+			for(let i = 0; i < this.bankList.length; i++) {
+				if(this.bankList[i].type == 1) { //第一个是模块直接展开,再展开章下面的节
+					this.$api
+						.goodsChapterList({
+							moduleExamId: this.bankList[i].majorId
+						})
+						.then(res => {
+							this.$set(this.bankList[i], 'showList', true);
+							this.$set(this.bankList[i], 'list', res.data.data);
+							this.changeItem(i,0,this.bankList[i].list[0].chapterExamId,this.bankList[i].type)
+						});
+					break;
+				} else if(this.bankList[i].type == 2) { //第一个章展开下面的节
+					this.changeItem(i,'',this.bankList[i].majorId,this.bankList[i].type)
+					break;
+				}
+			}
+		},
 		goodsChapterList(bank, id) {
 			this.$api
 				.goodsChapterList({
@@ -166,13 +187,31 @@ export default {
 					this.$set(bank, 'list', res.data.data);
 				});
 		},
+		
+		goTest(type,item) {
+			
+			if(type == 1) {
+				uni.setStorageSync('testname',item.examName)
+				uni.navigateTo({
+					url:'/pages2/bank/questionBankTest?id=' + item.examId + '&num=' + this.showTest(item.examId).num
+				})
+			} else if(type == 2) {
+				uni.setStorageSync('testname',item.examName)
+				uni.navigateTo({
+					url:'/pages2/bank/questionBankTest?id='+item.examId+'&num='+ this.showTest(item.examId).num
+				})
+			} else if(type == 3) {
+				uni.setStorageSync('testname',item.name)
+				uni.navigateTo({
+					url:'/pages2/bank/questionBankTest?id=' + item.majorId + '&num=' + this.showTest(item.majorId).num
+				})
+			}
+		},
 
 		showTest(id) {
 			return this.goodsExamConfig.find(item => item.examId == id);
 		},
-		clickModule(e) {
-			let index = e.currentTarget.dataset.index;
-			let id = e.currentTarget.dataset.id;
+		clickModule(index,id) {
 
 			if (this.bankList[index].list) {
 				this.$set(this.bankList[index], 'showList', !this.bankList[index].showList);
@@ -217,13 +256,9 @@ export default {
 		change(index) {
 			this.current = index;
 		},
-		changeItem(e) {
-			let index1 = e.currentTarget.dataset.index1;
-			let index2 = e.currentTarget.dataset.index2;
-			let id = e.currentTarget.dataset.id;
-			let type = e.currentTarget.dataset.type;
-
+		changeItem(index1,index2,id,type) {
 			if (type == 1) {
+				console.log(1)
 				if (this.bankList[index1].list[index2].list) {
 					this.$set(this.bankList[index1].list[index2], 'showList', !this.bankList[index1].list[index2].showList);
 					return;
@@ -238,6 +273,7 @@ export default {
 						this.$set(this.bankList[index1].list[index2], 'list', res.data.data);
 					});
 			} else if (type == 2) {
+				console.log(2)
 				if (this.bankList[index1].list) {
 					this.$set(this.bankList[index1], 'showList', !this.bankList[index1].showList);
 					return;
@@ -330,28 +366,35 @@ page {
 				display: flex;
 				align-items: center;
 			}
-
+			
+			.article-list {
+				margin-top:20rpx;
+				
+				
+			}
+			
 			.article {
+				padding:10rpx 0;
 				min-height: 80rpx;
 				display: flex;
 				align-items: center;
 				margin-left: 64rpx;
-				font-size: 24rpx;
+				font-size: 30rpx;
 				color: #666666;
 				border-bottom: 1rpx solid #eeeeee;
 				display: flex;
-
+			
 				.flex_auto {
 					flex: 1;
 				}
-
+			
 				&:nth-last-of-type(1) {
 					border: 0;
 				}
-
+			
 				&.active {
 					color: #007aff;
-
+			
 					.btn {
 						width: 96rpx;
 						height: 48rpx;
@@ -366,6 +409,8 @@ page {
 					}
 				}
 			}
+
+			
 		}
 	}
 }

+ 4 - 3
pages2/bank/my_question.vue

@@ -1,14 +1,15 @@
 <template>
 	<view style="padding: 30rpx;">
+		<nav-bar title="我的题库"></nav-bar>
 		<view v-for="(item, index) in list" :key="index"  style="margin-bottom: 30rpx;" @click="studyIn(item,index)">
 			<view class="class_item">
 				<image class="img" :src="$method.splitImgHost(item.coverUrl, true)"></image>
 				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
 					{{item.goodsName}}
 				</view>
-				<view class=".content_box">
+				<view class=".content_box" v-if="item.serviceStartTime && item.serviceEndTime">
 					<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-					学习有效期:<text class="content"> {{$method.timestampToTime(item.studyStartTime)}} - {{$method.timestampToTime(item.studyEndTime)}} </text>
+					学习服务期:<text class="content"> {{$method.timestampToTime(item.serviceStartTime,true,true)}}-{{$method.timestampToTime(item.serviceEndTime,true,true)}} </text>
 				</view>
 				
 			</view>
@@ -72,7 +73,7 @@
 			studyIn(item,index){
 				this.itemIndex = index;
 				uni.navigateTo({
-					url:'/pages2/bank/question_detail?id='+item.goodsId
+					url:'/pages2/bank/question_detail?id='+item.goodsId+'&orderGoodsId='+item.orderGoodsId
 				})
 			},
 			

+ 99 - 12
pages2/bank/questionBank.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="questionBank">
-		<uni-nav-bar @clickLeft="clickLeft" left-icon="back" ref="navbar" :statusBar="true" title="试卷"></uni-nav-bar>
+		<uni-nav-bar @clickLeft="clickLeft" left-icon="back" ref="navbar" :statusBar="true" :title="examData.examName"></uni-nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -18,7 +18,7 @@
 							</view>
 							<view style="color: #666;font-size: 28rpx;">{{ countdown(lastTime) }}</view>
 						</view>
-						<view class="titles"><rich-text :nodes="bank.content"></rich-text></view>
+						<view class="titles" @click="showPhoto(bank.content)"><rich-text :nodes="bank.content"></rich-text></view>
 					</view>
 					
 					<template v-if="bank.type == 1">
@@ -412,7 +412,7 @@
 								v-for="(item, index) in questionList"
 								:key="index"
 								@click="changeIndex(index)"
-								:class="{ isRight: isRight(item, index), isWrong: isWrong(item, index) }"
+								:class="{ isRight: isRight(item, index), isWrong: isWrong(item, index),isOver:isOver(item,index) }"
 								class="liListSty"
 							>
 								{{ index + 1 }}
@@ -534,10 +534,13 @@ export default {
 			showArrow:false, //退出提示
 			isFromVideo:'',
 			gradeId:'',
+			examData:{},
+			orderGoodsId:'',
 			cgType: 0 //对应设计稿弹窗编码
 		};
 	},
 	async onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId || 0
 		this.current = +option.current || 0
 		this.id = option.id;
 		this.goodsId = option.goodsid;
@@ -598,7 +601,7 @@ export default {
 			app.globalData.bankData = this.$data;
 			clearInterval(this.timer);
 			uni.navigateTo({
-				url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
+				url: '/pages2/bank/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true&orderGoodsId='+this.orderGoodsId
 			});
 		} else {
 			//点击返回按钮确认允许退出,记录答题记录
@@ -623,6 +626,7 @@ export default {
 				
 				this.$api.bankExam(this.id).then(res => {
 					this.bankType = res.data.data.doType;
+					this.examData = res.data.data;
 					if (this.bankType == 2) {
 						this.needBack = true;
 					}
@@ -890,6 +894,7 @@ export default {
 				.examRecordEdit({
 					examId: this.id,
 					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 					reportStatus:reportStatus,
 					recordId: this.recordId,
 					rightQuestionNum: number,
@@ -914,6 +919,7 @@ export default {
 				
 				//错题集id提交(客观题)
 				this.$api.examWrongRecord({
+					orderGoodsId:this.orderGoodsId,
 						moduleExamId:this.moduleId || 0,
 						chapterExamId:this.chapterId || 0,
 						examId: this.id,
@@ -1033,6 +1039,7 @@ export default {
 
 				this.$api
 					.examRecordEdit({
+						orderGoodsId:this.orderGoodsId,
 						examId: this.id,
 						goodsId: this.goodsId,
 						recordId: this.recordId,
@@ -1053,23 +1060,25 @@ export default {
 		 */
 		examRecord(hasSpecial) {
 			let questionList = 0;
-			if(!hasSpecial) {
+			// if(!hasSpecial) {
 				this.questionList.forEach((item, index) => {
 					if(item.type == 1 || item.type == 2 || item.type == 3) {
 						questionList++;
 					}
 				})
-			} else {
-				questionList = this.questionList.length;
-			}
+			// } else {
+			// 	questionList = this.questionList.length;
+			// }
 			
 				this.$api
 					.examRecord({
 						chapterExamId: this.chapterId || 0,
+						orderGoodsId:this.orderGoodsId,
 						moduleExamId: this.moduleId || 0,
 						examId: this.id,
 						goodsId: this.goodsId,
-						totalQuestionNum: questionList
+						totalQuestionNum: questionList,
+						allQuestionNum:this.questionList.length
 					})
 					.then(res => {
 						this.recordId = res.data.data;
@@ -1240,6 +1249,7 @@ export default {
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
 				this.$api
 					.examWrongRecord({
+						orderGoodsId:this.orderGoodsId,
 						examId: this.id,
 						goodsId: this.goodsId,
 						moduleExamId:this.moduleId || 0,
@@ -1322,6 +1332,7 @@ export default {
 			if (isWrong) {
 				this.$api
 					.examWrongRecord({
+						orderGoodsId:this.orderGoodsId,
 						examId: this.id,
 						goodsId: this.goodsId,
 						moduleExamId:this.moduleId || 0,
@@ -1380,6 +1391,7 @@ export default {
 			if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
 				this.$api
 					.examWrongRecord({
+						orderGoodsId:this.orderGoodsId,
 						examId: this.id,
 						goodsId: this.goodsId,
 						moduleExamId:this.moduleId || 0,
@@ -1434,7 +1446,8 @@ export default {
 				.getCollectInfo({
 					examId: this.id,
 					questionId: this.questionList[current].questionId,
-					goodsId: this.goodsId
+					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 				})
 				.then(res => {
 					if (res.data.code == 500) {
@@ -1616,6 +1629,7 @@ export default {
 					reportStatus:reportStatus,
 					recordId: this.recordId,
 					rightQuestionNum: number,
+					orderGoodsId:this.orderGoodsId,
 					status: 1,
 					moduleExamId:this.moduleId || 0,
 					chapterExamId:this.chapterId || 0,
@@ -1639,7 +1653,7 @@ export default {
 
 						setTimeout(() => {
 							uni.redirectTo({
-								url: '/pages2/bank/question_report?goodsId='+this.goodsId+'&chapterId='+this.chapterId+'&moduleId='+this.moduleId+'&examId='+this.id+'&id=' + this.recordId
+								url: '/pages2/bank/question_report?goodsId='+this.goodsId+'&chapterId='+this.chapterId+'&moduleId='+this.moduleId+'&examId='+this.id+'&id=' + this.recordId + '&orderGoodsId='+this.orderGoodsId
 							});
 						}, 1000);
 					}
@@ -1649,6 +1663,7 @@ export default {
 				this.$api.examWrongRecord({
 						examId: this.id,
 						goodsId: this.goodsId,
+						orderGoodsId:this.orderGoodsId,
 						questionIds: doWrongQuestionIds,
 						recordId: this.recordId
 					}).then(res => { 
@@ -1667,7 +1682,8 @@ export default {
 					.collectQuestion({
 						examId: this.id,
 						questionId: this.questionList[index].questionId,
-						goodsId: this.goodsId || ''
+						goodsId: this.goodsId || '',
+						orderGoodsId:this.orderGoodsId,
 					})
 					.then(res => {
 						if (res.data.code == 200) {
@@ -1811,6 +1827,7 @@ export default {
 			var self = this;
 			return new Promise((resolve, reject) => {
 				var data = {
+					orderGoodsId:this.orderGoodsId,
 					imageStatus: int
 				};
 				self.$api.aliyunpolicy(data).then(res => {
@@ -1980,9 +1997,73 @@ export default {
 				return false;
 			}
 		},
+		isOver(item,index) {
+			if(this.questionList[index].ques) {
+				if (item.type == 4) { //案例题
+					let isOver = item.jsonStr.every((jsonItem, indexs) => {
+						if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
+							if (item.ques[indexs]) {
+								return true;
+							} else {
+								return false;
+							}
+						} else if (jsonItem.type == 5) {
+							if (item.ques[indexs] && (item.ques[indexs].text || item.ques[indexs].imageList.length)) {
+								console.log('chil')
+								return true;
+							} else {
+								return false;
+							}
+						}
+					});
+					
+					if (isOver) {
+						return true;
+					} else {
+						return false;
+					}
+				} else if (item.type == 5) { //简答题
+					//每一项都相等
+					if(item.ques && (item.ques.imageList.length || item.ques.text)) {
+						return true;
+					}
+					//判断
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
 
 		tabSelect(index, bankindex) {
 			this.$set(this.questionList[bankindex], 'current', index);
+		},
+		
+		showPhoto(contentStr) {
+			if(contentStr && typeof contentStr == 'string') {
+				let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
+				let strArr = contentStr.match(reg);
+				strArr.forEach((str,index) => {
+					strArr[index] = str.replace(reg,'$1')
+				})
+				
+				// 预览图片
+				uni.previewImage({
+					urls: strArr,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+			}
+			
+			
 		}
 	}
 };
@@ -2351,6 +2432,12 @@ export default {
 		color: #fff;
 		background: #FF3B30;
 	}
+	
+	&.isOver {
+		border: 1rpx solid #eeeeee;
+		color: #fff;
+		background: blue;
+	}
 }
 .answerInfos {
 	padding: 25rpx 25rpx 25rpx 23rpx;

+ 1 - 0
pages2/bank/questionBankAllExplain.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="questionBank">
+		<nav-bar title="全部解析"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">

+ 91 - 8
pages2/bank/questionBankContinue.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="questionBank">
-		<uni-nav-bar @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
+		<uni-nav-bar @clickLeft="clickLeft" left-icon="back" :statusBar="true" :title="examData.examName"></uni-nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -19,7 +19,7 @@
 							<view style="color: #666;font-size: 28rpx;"></view>
 							<view class="leftLetters"></view>
 						</view>
-						<view class="titles">
+						<view class="titles" @click="showPhoto(bank.content)">
 							<rich-text :nodes="bank.content"></rich-text>
 						</view>		
 					</view>
@@ -395,7 +395,7 @@
 				<view class="popupContent">
 					<scroll-view scroll-y="true" style="height: 506rpx;">
 						<view class="boxSty">
-							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index)}" class="liListSty">{{ index + 1 }}</view>
+							<view v-for="(item, index) in questionList" :key="index" @click="changeIndex(index)" :class="{isRight:isRight(item,index),isWrong:isWrong(item,index),isOver:isOver(item,index)}" class="liListSty">{{ index + 1 }}</view>
 						</view>
 					</scroll-view>
 				</view>
@@ -465,10 +465,13 @@ export default {
 			chapterId:'',
 			moduleId:'',
 			isSubmit:false,
+			examData:{},
+			orderGoodsId:'',
 			cgType: 0 //对应设计稿弹窗编码
 		};
 	},
 	onLoad(option){
+		this.orderGoodsId = option.orderGoodsId || ''
 		this.id = option.id || '';
 		this.goodsId = option.goodsid || '';
 		this.chapterId = option.chapterId || '';
@@ -510,7 +513,8 @@ export default {
 					.collectQuestion({
 						examId: this.id,
 						questionId: this.questionList[index].questionId,
-						goodsId: this.goodsId || ''
+						goodsId: this.goodsId || '',
+						orderGoodsId:this.orderGoodsId
 					})
 					.then(res => {
 						if (res.data.code == 200) {
@@ -642,7 +646,7 @@ export default {
 			console.log("继续做题")
 			this.$api.examReport(this.recordId).then(res => {
 				let json = JSON.parse(res.data.data.historyExamJson)
-				
+				this.examData = res.data.data;
 				this.questionList = json;
 			})
 		
@@ -658,7 +662,8 @@ export default {
 				.getCollectInfo({
 					examId: this.id,
 					questionId: this.questionList[current].questionId,
-					goodsId: this.goodsId
+					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId
 				})
 				.then(res => {
 					if (res.data.code == 500) {
@@ -735,6 +740,7 @@ export default {
 					examId:this.id,
 					doQuestionIds:doQuestionIds.join(''),
 					goodsId:this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 					recordId: this.recordId,
 					rightQuestionNum:number,
 					status:0,
@@ -900,6 +906,7 @@ export default {
 			this.$api.examRecordEdit({
 				examId:this.id,
 				goodsId:this.goodsId,
+				orderGoodsId:this.orderGoodsId,
 				reportStatus:reportStatus,
 				totalScore:allScore,
 				recordId: this.recordId,
@@ -924,7 +931,7 @@ export default {
 					
 					setTimeout(() => {
 						uni.redirectTo({
-							url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
+							url:'/pages2/bank/question_report?orderGoodsId='+this.orderGoodsId+'&id='+this.recordId+'&examId='+this.id
 						})
 					},2000)
 				}
@@ -935,7 +942,8 @@ export default {
 					examId: this.id,
 					goodsId: this.goodsId,
 					questionIds: doWrongQuestionIds,
-					recordId: this.recordId
+					recordId: this.recordId,
+					orderGoodsId:this.orderGoodsId
 				}).then(res => { 
 					
 				});
@@ -1155,6 +1163,7 @@ export default {
 				.examRecordEdit({
 					examId: this.id,
 					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 					reportStatus:reportStatus,
 					recordId: this.recordId,
 					rightQuestionNum: number,
@@ -1183,6 +1192,7 @@ export default {
 						chapterExamId:this.chapterId || 0,
 						examId: this.id,
 						goodsId: this.goodsId,
+						orderGoodsId:this.orderGoodsId,
 						questionIds: doWrongQuestionIds,
 						recordId: this.recordId
 					}).then(res => { 
@@ -1292,6 +1302,7 @@ export default {
 			var self = this;
 			return new Promise((resolve, reject) => {
 				var data = {
+					orderGoodsId:this.orderGoodsId,
 					imageStatus: int
 				};
 				self.$api.aliyunpolicy(data).then(res => {
@@ -1455,12 +1466,78 @@ export default {
 			}
 			
 		},
+		isOver(item,index) {
+			if(this.questionList[index].ques) {
+				if (item.type == 4) { //案例题
+					let isOver = item.jsonStr.every((jsonItem, indexs) => {
+						if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
+							if (item.ques[indexs]) {
+								return true;
+							} else {
+								return false;
+							}
+						} else if (jsonItem.type == 5) {
+							if (item.ques[indexs] && (item.ques[indexs].text || item.ques[indexs].imageList.length)) {
+								console.log('chil')
+								return true;
+							} else {
+								return false;
+							}
+						}
+					});
+					
+					if (isOver) {
+						return true;
+					} else {
+						return false;
+					}
+				} else if (item.type == 5) { //简答题
+					//每一项都相等
+					if(item.ques && (item.ques.imageList.length || item.ques.text)) {
+						return true;
+					}
+					//判断
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
 		
 		tabSelect(index,bankindex) {
 			
 			this.$set(this.questionList[bankindex],'current',index)
 			
 		},
+		
+		
+		
+		showPhoto(contentStr) {
+			if(contentStr && typeof contentStr == 'string') {
+				let reg = /<img[^>]*src[=\'\"\s]+([^\'\"]*)[\'\"]?[^>]*>/gi;
+				let strArr = contentStr.match(reg);
+				strArr.forEach((str,index) => {
+					strArr[index] = str.replace(reg,'$1')
+				})
+				
+				// 预览图片
+				uni.previewImage({
+					urls: strArr,
+					longPressActions: {
+						itemList: ['发送给朋友', '保存图片', '收藏'],
+						success: function(data) {
+							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+						},
+						fail: function(err) {
+							console.log(err.errMsg);
+						}
+					}
+				});
+			}
+			
+			
+		}
 	}
 };
 </script>
@@ -1835,6 +1912,12 @@ export default {
 		color:#fff;
 		background: #FF3B30;
 	}
+	
+	&.isOver {
+		border: 1rpx solid #eeeeee;
+		color: #fff;
+		background: blue;
+	}
 }
 .answerInfos {
 	padding: 25rpx 25rpx 25rpx 23rpx;

+ 1 - 0
pages2/bank/questionBankExplain.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="questionBank">
+		<nav-bar title="解析"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">

+ 1 - 0
pages2/bank/questionBankExplainDetail.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="questionBank">
+		<nav-bar title="试卷解析"></nav-bar>
 		<view class="tabs-top">
 			<u-tabs :list="list" sticky :current="tabCurrent" @change="tabChange" active-color="#007AFF"></u-tabs>
 		</view>

+ 10 - 5
pages2/bank/questionBankTest.vue

@@ -1,5 +1,6 @@
 <template>
 	<view id="questionBank">
+		<nav-bar :title="title"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -412,6 +413,7 @@
 export default {
 	data() {
 		return {
+			title:'',
 			id:'',
 			current:0,
 			questionList:[],
@@ -431,7 +433,7 @@ export default {
 		this.num = +option.num;
 		
 		let showDialog = uni.getStorageSync('showDialog');
-		
+		this.title =  uni.getStorageSync('testname');
 		if(showDialog) {
 			this.showDialog = false;
 		} else {
@@ -474,6 +476,7 @@ export default {
 							})
 							item.ans = arr;
 							item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
+							item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
 							return;
 						} else if(item.type == 5) { //简答题
 							item.ansText = {
@@ -481,6 +484,7 @@ export default {
 								imageList: []
 							}
 							item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
+							item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
 							
 						} else if(item.type == 4) { //案例题
 							console.log(item.jsonStr)
@@ -522,6 +526,7 @@ export default {
 							
 						}
 						item.analysisContent && (item.analysisContent = item.analysisContent.replace(/<img/gi, '<img style="max-width:100%;"'));
+						item.content && (item.content = item.content.replace(/<img/gi, '<img style="max-width:100%;"'));
 						item.ans = item.answerQuestion
 					}
 					
@@ -656,7 +661,7 @@ export default {
 			} else {
 				uni.showModal({
 					title: '提示',
-					content: '试做题目已结束,够买题卷可作答所有题目',
+					content: '试做题目已经结束~',
 					cancelText:'返回详情',
 					cancelColor:'',
 					confirmText:'继续作答',
@@ -683,7 +688,7 @@ export default {
 				
 				uni.showModal({
 					title: '提示',
-					content: '试做题目已结束,够买题卷可作答所有题目',
+					content: '试做题目已经结束~',
 					cancelText:'返回详情',
 					cancelColor:'',
 					confirmText:'继续作答',
@@ -707,7 +712,7 @@ export default {
 		 */
 		submit() {
 			uni.showToast({
-			    title: '不能试做返回详情购买后即可交卷~',
+			    title: '试做题目不能交卷~',
 			    duration: 2000,
 				icon:'none'
 			});
@@ -721,7 +726,7 @@ export default {
 		 */
 		collect(state,index) {
 			uni.showToast({
-			    title: '返回详情购买后即可收藏~',
+			    title: '试做题目,不支持收藏~',
 			    duration: 2000,
 				icon:'none'
 			});

+ 1 - 0
pages2/bank/questionBankWrongExplain.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="questionBank">
+		<nav-bar title="错题解析"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">

+ 67 - 25
pages2/bank/question_detail.vue

@@ -1,7 +1,8 @@
 <template>
 	<view>
+		<nav-bar title="进入刷题"></nav-bar>
 		<view class="top">
-			<navigator  hover-class="none" :url="'/pages2/bank/question_statistics?id=' + id">
+			<navigator  hover-class="none" :url="'/pages2/bank/question_statistics?orderGoodsId='+orderGoodsId+'&id=' + id">
 				<view class="left">
 					<view class="title">做题统计</view>
 					<view class="progress">
@@ -31,22 +32,22 @@
 					</view>
 				</view>
 			</navigator>
-			<navigator  hover-class="none" :url="'/pages2/bank/wrongById?goodsid=' + id">
+			<navigator  hover-class="none" :url="'/pages2/bank/wrongById?orderGoodsId='+orderGoodsId+'&goodsid=' + id">
 				<view class="right">
 					<view class="title">
 						错题集
 						<u-icon name="arrow-right"></u-icon>
 					</view>
-					<view class="number">{{ goodsCount.wrongNum }}</view>
+					<view class="number">{{ goodsCount.wrongNum || '0' }}</view>
 				</view>
 			</navigator>
-			<navigator  hover-class="none" :url="'/pages2/bank/collectById?goodsid=' + id">
+			<navigator  hover-class="none" :url="'/pages2/bank/collectById?orderGoodsId='+orderGoodsId+'&goodsid=' + id">
 				<view class="right">
 					<view class="title">
 						收藏集
 						<u-icon name="arrow-right"></u-icon>
 					</view>
-					<view class="number">{{ goodsCount.collectNum }}</view>
+					<view class="number">{{ goodsCount.collectNum || '0' }}</view>
 				</view>
 			</navigator>
 		</view>
@@ -64,7 +65,7 @@
 
 						<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, index2)">
+								<view class="section" @click="changeItem(index1, item2.chapterExamId, item1.type, index2,item1.majorId)">
 									<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>
 									<!-- <u-icon name="arrow-up" color="#999" size="24" v-if="item2.showList"></u-icon>
@@ -76,7 +77,7 @@
 										<view class="flex_auto">{{ article.examName }}</view>
 										<view class="btn" @click="toDo(article.examId, goodsData.goodsId, item1.majorId, item2.chapterExamId)" v-if="article.recordStatus == -1">做题</view>
 										<view class="btn" @click="continueDo(article.recordId,article.examId, goodsData.goodsId, item2.chapterExamId, item1.majorId)" v-if="article.recordStatus == 0 && article.doType == 1">继续</view>
-										<view class="btn" @click="doRepeat(article.recordId,article.examId, goodsData.goodsId, item2.chapterExamId, item1.majorId)" v-if="article.recordStatus == 1 || (article.recordStatus == 0 && article.doType == 2)">重做</view>
+										<view class="btn" :class="{disabled:(article.answerNum > 0 && article.doNum >= article.answerNum)}" @click="doRepeat(article.recordId,article.examId, goodsData.goodsId, item2.chapterExamId, item1.majorId)" v-if="article.recordStatus == 1 || (article.recordStatus == 0 && article.doType == 2)">重做</view>
 									</view>
 								</view>
 								<u-line v-if="item1.length > 1"></u-line>
@@ -85,7 +86,7 @@
 					</template>
 
 					<template v-if="item1.type == 2">
-						<view class="section" @click="changeItem(index1, item1.majorId, item1.type)">
+						<view class="section" @click="changeItem(index1, item1.majorId, item1.type,'',0)">
 							<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>
 							<!-- <u-icon name="arrow-up" color="#999" size="24" v-if="item1.showList"></u-icon>
@@ -97,7 +98,7 @@
 								<view class="flex_auto">{{ article.examName }}</view>
 								<view class="btn" @click="toDo(article.examId, goodsData.goodsId, 0, item1.majorId)" v-if="article.recordStatus == -1">做题</view>
 								<view class="btn" @click="continueDo(article.recordId,article.examId, goodsData.goodsId, 0, item1.majorId)" v-if="article.recordStatus == 0 && article.doType == 1">继续</view>
-								<view class="btn" @click="doRepeat(article.recordId,article.examId, goodsData.goodsId, item1.majorId,0)" v-if="article.recordStatus == 1 || (article.recordStatus == 0 && article.doType == 2)">重做</view>
+								<view class="btn" :class="{disabled:(article.answerNum > 0 && article.doNum >= article.answerNum)}" @click="doRepeat(article.recordId,article.examId, goodsData.goodsId, item1.majorId,0)" v-if="article.recordStatus == 1 || (article.recordStatus == 0 && article.doType == 2)">重做</view>
 							</view>
 						</view>
 					</template>
@@ -107,7 +108,7 @@
 							<view class="flex_auto">{{ item1.name }}</view>
 							<view class="btn" @click="toDo(item1.majorId, goodsData.goodsId, 0, 0)" v-if="item1.recordStatus == -1">做题</view>
 							<view class="btn" @click="continueDo(item1.recordId,item1.majorId, goodsData.goodsId, 0, 0)" v-if="item1.recordStatus == 0 && item1.doType == 1">继续</view>
-							<view class="btn" @click="doRepeat(item1.recordId,item1.majorId, goodsData.goodsId, 0, 0)" v-if="item1.recordStatus == 1 || (item1.recordStatus == 0 && item1.doType == 2)">重做</view>
+							<view class="btn" :class="{disabled:(item1.answerNum > 0 && item1.doNum >= item1.answerNum)}" @click="doRepeat(item1.recordId,item1.majorId, goodsData.goodsId, 0, 0)" v-if="item1.recordStatus == 1 || (item1.recordStatus == 0 && item1.doType == 2)">重做</view>
 						</view>
 					</template>
 				</view>
@@ -126,7 +127,9 @@ export default {
 			id: '',
 			goodsCount: {
 				totalNum: 0
-			}
+			},
+			orderGoodsId:'',
+			firstEnter:true,
 		};
 	},
 	onUnload() {
@@ -134,6 +137,7 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId
 		this.id = option.id;
 		this.getDetail();
 		// this.goodsBankList();
@@ -151,7 +155,7 @@ export default {
 		 */
 		continueDo(recordId,examId,goodsId,chapterId = 0,moduleId = 0) {
 			uni.navigateTo({
-				url:'/pages2/bank/questionBankContinue?recordId=' +recordId +'&id=' +examId +'&goodsid=' +goodsId +'&chapterId='+chapterId+'&moduleId='+moduleId
+				url:'/pages2/bank/questionBankContinue?orderGoodsId='+this.orderGoodsId+'&recordId=' +recordId +'&id=' +examId +'&goodsid=' +goodsId +'&chapterId='+chapterId+'&moduleId='+moduleId
 			})
 		},
 		/**
@@ -180,7 +184,7 @@ export default {
 			    success: (res) => {
 			        if (res.confirm) {
 						uni.navigateTo({
-							url:'/pages2/bank/questionBank?id=' +examId +'&goodsid=' +goodsId +'&moduleId='+moduleId+'&chapterId=' +chapterExamId
+							url:'/pages2/bank/questionBank?orderGoodsId='+this.orderGoodsId+'&id=' +examId +'&goodsid=' +goodsId +'&moduleId='+moduleId+'&chapterId=' +chapterExamId
 						})
 			        } else if (res.cancel) {
 						uni.navigateTo({
@@ -188,7 +192,8 @@ export default {
 									'&goodsid=' + goodsId +
 									'&moduleId=' + moduleId +
 									'&chapterId=' + chapterExamId +
-									'&recordId='+ recordId
+									'&recordId='+ recordId+
+									'&orderGoodsId='+this.orderGoodsId
 							
 						})
 			            console.log('查看上次答题');
@@ -201,11 +206,39 @@ export default {
 		 */
 		goodsBank() {
 			this.$api.goodsBank({
+				orderGoodsId:this.orderGoodsId,
 				goodsId: this.id
 			}).then(res => {
 				this.bankList = res.data.data;
+				if(this.firstEnter) {
+					this.showAllCharpter();
+					this.firstEnter = false;
+				}
+				
 			});
 		},
+		/**
+		 * 展示第一个章下的节内容
+		 */
+		showAllCharpter() {
+			for(let i = 0; i < this.bankList.length; i++) {
+				if(this.bankList[i].type == 1) { //第一个是模块直接展开,再展开章下面的节
+					this.$api
+						.goodsChapterList({
+							moduleExamId: this.bankList[i].majorId
+						})
+						.then(res => {
+							this.$set(this.bankList[i], 'showList', true);
+							this.$set(this.bankList[i], 'list', res.data.data);
+							this.changeItem(i,this.bankList[i].list[0].chapterExamId,this.bankList[i].type,0,this.bankList[i].majorId)
+						});
+					break;
+				} else if(this.bankList[i].type == 2) { //第一个章展开下面的节
+					this.changeItem(i,this.bankList[i].majorId,this.bankList[i].type,'',0)
+					break;
+				}
+			}
+		},
 		getDetail() {
 			this.$api.commonGoodsDetail(this.id).then(res => {
 				console.log(res);
@@ -228,7 +261,7 @@ export default {
 			}
 
 			uni.navigateTo({
-				url: '/pages2/bank/questionBank?id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
+				url: '/pages2/bank/questionBank?orderGoodsId='+this.orderGoodsId+'&id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
 			});
 		},
 
@@ -240,7 +273,7 @@ export default {
 				this.$api
 					.examRecordCount({
 						examId: examId,
-						goodsId: this.id
+						orderGoodsId: this.orderGoodsId
 					})
 					.then(res => {
 						resolve(res.data.data);
@@ -262,7 +295,7 @@ export default {
 		 * 获取用户商品统计数据
 		 */
 		goodsBankQuestionNum() {
-			this.$api.goodsBankQuestionNum(this.id).then(res => {
+			this.$api.goodsBankQuestionNum(this.orderGoodsId).then(res => {
 				this.goodsCount = res.data.data;
 			});
 		},
@@ -280,7 +313,7 @@ export default {
 		getCollectNum() {
 			this.$api
 				.goodsCollectExamList({
-					goodsId: this.id
+					orderGoodsId: this.orderGoodsId
 				})
 				.then(res => {
 					let total = 0;
@@ -294,7 +327,7 @@ export default {
 		getWrongNum() {
 			this.$api
 				.wrongRecordList({
-					goodsId: this.id
+					orderGoodsId: this.orderGoodsId
 				})
 				.then(res => {
 					let total = 0;
@@ -314,14 +347,15 @@ export default {
 			this.$api
 				.goodsChapterList({
 					moduleExamId: id,
-					goodsId:this.id
+          orderGoodsId: this.orderGoodsId,
+					goodsId: this.id
 				})
 				.then(res => {
 					this.$set(this.bankList[index], 'showList', true);
 					this.$set(this.bankList[index], 'list', res.data.data);
 				});
 		},
-		changeItem(index1, id, type, index2) {
+		changeItem(index1, id, type, index2,moduleExamId) {
 			if (type == 1) {
 				if (this.bankList[index1].list[index2].list) {
 					this.$set(this.bankList[index1].list[index2], 'showList', !this.bankList[index1].list[index2].showList);
@@ -330,8 +364,10 @@ export default {
 
 				this.$api
 					.bankExamExamList({
+						moduleExamId:moduleExamId,
+          orderGoodsId: this.orderGoodsId,
 						chapterExamId: id,
-						goodsId:this.id
+						goodsId: this.id
 					})
 					.then(res => {
 						this.$set(this.bankList[index1].list[index2], 'showList', true);
@@ -345,6 +381,8 @@ export default {
 
 				this.$api
 					.bankExamExamList({
+						moduleExamId:moduleExamId,
+          orderGoodsId: this.orderGoodsId,
 						chapterExamId: id,
 						goodsId: this.id
 					})
@@ -462,7 +500,7 @@ page {
 }
 
 .courseName {
-	font-size: 24rpx;
+	font-size: 30rpx;
 	color:#666;
 	white-space: nowrap;
 	overflow: hidden;
@@ -505,7 +543,7 @@ page {
 			}
 
 			.section {
-				font-size: 24rpx;
+				font-size: 30rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
 				color: #666;
@@ -522,7 +560,7 @@ page {
 				display: flex;
 				align-items: center;
 
-				font-size: 24rpx;
+				font-size: 30rpx;
 				color: #666666;
 				border-bottom: 1rpx solid #eeeeee;
 				display: flex;
@@ -549,6 +587,10 @@ page {
 						background: #007aff;
 						margin-left: 36rpx;
 						border-radius: 24rpx;
+						
+						&.disabled {
+							opacity: 0.6;
+						}
 					}
 				}
 			}

+ 77 - 43
pages2/bank/question_record.vue

@@ -1,15 +1,17 @@
 <template>
 	<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>
 		</view>
+		
 
 		<view class="record">
 			<view class="item" v-for="(record,index) in recordList" :key="index">
@@ -27,46 +29,37 @@
 				</view>
 				<view class="btns">
 					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId, record.goodsId, record.moduleExamId, record.chapterExamId,index)">重做</view>
-					<navigator
-						:url="
-							'/pages2/bank/questionBankExplain?id=' +
-								record.examId +
-								'&goodsid=' +
-								record.goodsId +
-								'&moduleId=' +
-								record.moduleExamId +
-								'&chapterId=' +
-								record.chapterExamId +
-								''
-						"
-					>
-						<view class="btn" v-if="record.status == 1">解析</view>
-					</navigator>
-					<navigator  hover-class="none" :url="'/pages2/bank/question_report?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId"><view class="btn" v-if="record.status == 1">报告</view></navigator>
-
+					<view class="btn" @click="questionBankExplain(record)" v-if="record.status == 1">解析</view>
+					<view class="btn" @click="questionReport(record)" v-if="record.status == 1">报告</view>
 					<view class="btn continue" @click="doContinue(record,index)" v-if="record.status == 0 && record.historyExamJson">继续答题</view>
+					<view class="btn continue" @click="moreRecord(record,index)" >更多记录</view>
 				</view>
 			</view>
 		</view>
 
-		<view class="modal" v-if="index == 1">
+		<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" v-if="index == 2">
+		
+		<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>
@@ -90,13 +83,29 @@ export default {
 			total: 0,
 			activeIndex: 0,
 			typeIndex:0,
-			itemIndex:''
+			itemIndex:'',
+			modalTop:0,
 		};
 	},
 	onLoad(option) {
 		this.listGoodsUserQuestion();
 		this.examaperList();
 		this.getExamRecordList();
+		
+		uni.getSystemInfo({
+			success:(e) => {
+				let info = uni.createSelectorQuery().select(".nav");
+				info.boundingClientRect((navData) => { //data - 各种参数
+				
+					let info = uni.createSelectorQuery().select(".tabs");
+					info.boundingClientRect((tabData) => { //data - 各种参数
+						this.modalTop = navData.height + tabData.height
+						console.log(navData) // 获取元素宽度
+						console.log(tabData) // 获取元素宽度
+					}).exec()
+				}).exec()
+			}
+		})
 	},
 	onPullDownRefresh() {
 		let that = this;
@@ -126,6 +135,25 @@ export default {
 		
 	},
 	methods: {
+		questionBankExplain(record) {
+			uni.navigateTo({
+				url:'/pages2/bank/questionBankExplain?id='+record.examId +'&goodsid='+record.goodsId+'&moduleId='+record.moduleExamId+'&chapterId='+record.chapterExamId+'&orderGoodsId='+record.orderGoodsId
+				
+			})
+		},
+		questionReport(record) {
+			uni.navigateTo({
+				url:'/pages2/bank/question_report?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId+'&orderGoodsId='+record.orderGoodsId
+			})
+		},
+		/**
+		 * 更多记录
+		 */
+		moreRecord(record) {
+			uni.navigateTo({
+				url:'/pages2/bank/question_record_list?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId
+			})
+		},
 		addRecord() {
 			this.$api.examRecordList({
 				pageNum: 1,
@@ -136,7 +164,7 @@ export default {
 			this.isRepeat = false;
 		},
 		refreshByIndex() {
-			this.$api.examRecordList({
+			this.$api.examRecordGroupList({
 				pageNum: this.itemIndex+1,
 				pageSize: 1
 			}).then(res => {
@@ -148,7 +176,7 @@ export default {
 			if (this.param.pageNum == 1) {
 				this.recordList = [];
 			}
-			this.$api.examRecordList(this.param).then(res => {
+			this.$api.examRecordGroupList(this.param).then(res => {
 				this.recordList.push.apply(this.recordList, res.data.rows);
 				this.total = res.data.total;
 			});
@@ -256,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);
 		},
 
@@ -289,7 +322,6 @@ page {
 	position: fixed;
 	left: 0;
 	width: 100%;
-	top: 0;
 	display: flex;
 	z-index: 10;
 	.tab {
@@ -372,8 +404,10 @@ page {
 			margin-top: 26rpx;
 			display: flex;
 			justify-content: space-around;
+			flex-wrap: wrap;
 			.btn {
-				width: 100rpx;
+				margin:5rpx 0;
+				width:150rpx;
 				height: 48rpx;
 				line-height: 48rpx;
 				text-align: center;
@@ -382,22 +416,21 @@ page {
 				border: 1rpx solid #007aff;
 				border-radius: 16rpx;
 				
-				&.continue {
-					width:317rpx;
-				}
 			}
 		}
 	}
 }
 
 .modal {
+	bottom:0;
+	z-index: 199999999;
 	position: fixed;
 	left: 0;
 	width: 100%;
-	top: 80rpx;
-	bottom: 0;
 
 	.content {
+		height:80%;
+		overflow: hidden;
 		position: relative;
 		z-index: 10;
 		background: #fff;
@@ -418,6 +451,7 @@ page {
 		}
 
 		.list {
+			width:100%;
 			margin-top: 16rpx;
 			display: flex;
 			flex-wrap: wrap;

+ 8 - 3
pages2/bank/question_report.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="试卷报告"></nav-bar>
 		<view :class="reportdata.reportStatus === 0 ? 'redBtn' : reportdata.reportStatus === 1 ? 'greenBtn' : 'disNone'" v-if="examData.doType == 2 && reportdata.reportStatus !== null">
 			{{ reportdata.reportStatus === 0 ? '测试未通过' : reportdata.reportStatus === 1 ? '测试通过' : '' }}
 		</view>
@@ -101,6 +102,7 @@ export default {
 			context2: null,
 			nextExamId:'',
 			wrongRecordWrongNum:'',
+			orderGoodsId:'',
 		};
 	},
 	onUnload() {},
@@ -111,6 +113,8 @@ export default {
 		
 		
 	async onLoad(option) {
+		console.log(option)
+		this.orderGoodsId = option.orderGoodsId
 		this.recordId = option.id;
 		this.examId = option.examId;
 		this.moduleId = option.moduleId || 0;
@@ -218,6 +222,7 @@ export default {
 				chapterExamId:this.chapterId,
 				examId:this.examId,
 				goodsId:this.goodsId,
+				orderGoodsId:this.orderGoodsId,
 				moduleExamId:this.moduleId
 			}).then(res => {
 				if(res.data.code == 500) {
@@ -229,7 +234,7 @@ export default {
 		},
 		backBank() {
 			uni.navigateTo({
-				url: '/pages2/bank/questionBank?id=' +this.nextExamId + '&goodsid=' + this.goodsId + '&moduleId=' + this.moduleId + '&chapterId=' + this.chapterId + ''
+				url: '/pages2/bank/questionBank?orderGoodsId='+orderGoodsId+'&id=' +this.nextExamId + '&goodsid=' + this.goodsId + '&moduleId=' + this.moduleId + '&chapterId=' + this.chapterId + ''
 			});
 			
 			// uni.navigateBack({
@@ -264,7 +269,7 @@ export default {
 			var prepage = pages[pages.length - 2]; //上一个页面
 			prepage.$vm.isRepeat = true;
 			uni.redirectTo({
-				url: '/pages2/bank/questionBank?id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
+				url: '/pages2/bank/questionBank?orderGoodsId='+this.orderGoodsId+'&id=' + id + '&goodsid=' + goodsId + '&moduleId=' + moduleId + '&chapterId=' + chapterId + ''
 			});
 		},
 		/**
@@ -294,7 +299,7 @@ export default {
 				this.$api
 					.examRecordCount({
 						examId: examId,
-						goodsId: goodsId
+						orderGoodsId: this.orderGoodsId,
 					})
 					.then(res => {
 						resolve(res.data.data);

+ 21 - 13
pages2/bank/question_statistics.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="做题统计"></nav-bar>
 		<view class="top">
 			<view class="title">
 				做题统计
@@ -54,7 +55,7 @@
 											<view class="desc">
 												<view class="flex-auto">
 													正确率
-													<text class="green">{{(article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+													<text class="green">{{article.totalQuestionNum != 0 ?((article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0)) : 0 +'%'}}</text>
 												</view>
 												<view class="flex-auto">
 													已完成
@@ -62,7 +63,7 @@
 												</view>
 											</view>
 										</view>
-										<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+article.goodsId+'&examId='+article.examId">
+										<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+id+'&examId='+article.examId">
 											<view class="btn">详情</view>
 										</navigator>
 									</view>
@@ -87,7 +88,7 @@
 									<view class="desc">
 										<view class="flex-auto">
 											正确率
-											<text class="green">{{(article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+											<text class="green">{{article.totalQuestionNum != 0 ?((article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0)) : 0 +'%'}}</text>
 										</view>
 										<view class="flex-auto">
 											已完成
@@ -95,7 +96,7 @@
 										</view>
 									</view>
 								</view>
-								<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+article.goodsId+'&examId='+article.examId">
+								<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+id+'&examId='+article.examId">
 									<view class="btn">详情</view>
 								</navigator>
 							</view>
@@ -109,7 +110,7 @@
 								<view class="desc">
 									<view class="flex-auto">
 										正确率
-										<text class="green">{{(item1.rightQuestionNum / item1.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+										<text class="green">{{item1.totalQuestionNum != 0 ?((item1.rightQuestionNum / item1.totalQuestionNum * 100).toFixed(0)) : 0+'%'}}</text>
 									</view>
 									<view class="flex-auto">
 										已完成
@@ -117,7 +118,7 @@
 									</view>
 								</view>
 							</view>
-							<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+item1.goodsId+'&examId='+item1.majorId">
+							<navigator  hover-class="none" :url="'/pages2/bank/questionBankExplainDetail?goodsId='+id+'&examId='+item1.majorId">
 								<view class="btn">详情</view>
 							</navigator>
 						</view>
@@ -139,12 +140,14 @@ export default {
 			context1: null,
 			context2: null,
 			caculateX: 0,
-			caculateY: 0
+			caculateY: 0,
+			orderGoodsId:'',
 		};
 	},
 	onUnload() {},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId
 		this.id = option.id;
 		
 	},
@@ -190,7 +193,8 @@ export default {
 		goodsBankDolist() {
 			this.$api
 				.goodsBankDolist({
-					goodsId: this.id
+					goodsId:this.id,
+					orderGoodsId: this.orderGoodsId
 				})
 				.then(res => {
 					console.log(res);
@@ -200,7 +204,8 @@ export default {
 		goodsBankList() {
 			this.$api
 				.goodsBankList({
-					goodsId: this.id
+					goodsId:this.id,
+					orderGoodsId: this.orderGoodsId
 				})
 				.then(res => {
 					console.log(res);
@@ -208,7 +213,7 @@ export default {
 				});
 		},
 		goodsBankQuestionNum() {
-			this.$api.goodsBankQuestionNum(this.id).then(res => {
+			this.$api.goodsBankQuestionNum(this.orderGoodsId).then(res => {
 				this.goodsCount = res.data.data;
 
 				this.context1.beginPath();
@@ -253,7 +258,8 @@ export default {
 
 			this.$api
 				.goodsChapterDolist({
-					goodsId: this.id,
+					goodsId:this.id,
+					orderGoodsId: this.orderGoodsId,
 					moduleExamId: id
 				})
 				.then(res => {
@@ -270,7 +276,8 @@ export default {
 
 				this.$api
 					.goodsExamDolist({
-						goodsId: this.id,
+					goodsId:this.id,
+						orderGoodsId: this.orderGoodsId,
 						moduleExamId: moduleExamId,
 						chapterExamId: id
 					})
@@ -286,7 +293,8 @@ export default {
 
 				this.$api
 					.goodsExamDolist({
-						goodsId: this.id,
+					goodsId:this.id,
+						orderGoodsId: this.orderGoodsId,
 						moduleExamId: moduleExamId,
 						chapterExamId: id
 					})

+ 5 - 2
pages2/bank/wrongById.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="错题集"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===2} ]" @click="sceenType = !sceenType">全部试卷类型<u-icon class="icon" name="arrow-down" :class="sceenType ? 'animals':''" ></u-icon></view>
 		</view>
@@ -80,6 +81,7 @@ export default {
 			goodsid:'',
 			paperid:'',
 			total:0,
+			orderGoodsId:'',
 		};
 	},
 	onPullDownRefresh() {},
@@ -87,6 +89,7 @@ export default {
 		this.getData();
 	},
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId || ''
 		this.goodsid = option.goodsid
 		this.examaperList();
 	},
@@ -109,7 +112,7 @@ export default {
 		wrongRecordList() {
 			this.$api.wrongRecordList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.testList = res.data;
 				let total = 0;
@@ -123,7 +126,7 @@ export default {
 		wrongRecordTypeList() {
 			this.$api.wrongRecordTypeList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.typeList = res.data;
 				

+ 164 - 87
pages2/class/questionBank.vue

@@ -148,7 +148,7 @@
 										</view>
 									</view>
 								</view>
-								<view class="ans_submit answerInfos" v-if="bank.ques">
+								<view class="ans_submit answerInfos" v-if="bank.ques.text || bank.ques.imageList.length">
 									<view class="answerTitle">我的答案:</view>
 									{{ bank.ques.text }}
 									<view class="imgs"><image class="img" v-for="(ques,quesIndex) in bank.ques.imageList" :key="quesIndex" :src="$method.splitImgHost(ques, true)"></image></view>
@@ -418,7 +418,7 @@
 								v-for="(item, index) in questionList"
 								:key="index"
 								@click="changeIndex(index)"
-								:class="{ isRight: isRight(item, index), isWrong: isWrong(item, index) }"
+								:class="{ isRight: isRight(item, index), isWrong: isWrong(item, index),isOver:isOver(item,index) }"
 								class="liListSty"
 							>
 								{{ index + 1 }}
@@ -512,12 +512,16 @@
 					<view class="sqzz"></view>
 				</view>
 				<view class="photoCenter">
-					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
+					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup && isTaking">
 						<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
 					</view>
-					<view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
+					<view class="custom" v-if="!isTaking" ><image :src="avatarUrl" mode=""></image></view>
+				</view>
+				<view class="photoBoxbtns">
+					<view class="btnResult" v-if="isTaking" @click="takePhoto">拍照</view>
+					<view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
+					<view class="btnResult" v-if="!isTaking" @click="submitPhoto">确认</view>
 				</view>
-				<view class="btnResult" @click="takePhoto">拍照</view>
 			</view>
 		</view>
 		
@@ -565,6 +569,8 @@ export default {
 			ossAvatarUrl: '',
 			goodsDetail:{},
 			isTakePhoto:false,
+			orderGoodsId:0,
+			isTaking:true, //是否正在拍照
 			needPhoto:false //是否需要拍照
 		};
 	},
@@ -576,6 +582,7 @@ export default {
 		this.moduleId = option.moduleId;
 		this.isFromVideo = option.isFromVideo||'';
 		this.gradeId = option.gradeId || '';
+    this.orderGoodsId = Number(option.orderGoodsId);
 		let isBack = option.isback;
 		
 		let showDialog = uni.getStorageSync('showDialog');
@@ -601,6 +608,8 @@ export default {
 			//需要拍没拍过直接弹出摄像头
 			if(this.needPhoto && !this.isTakePhoto) {
 				this.photoPopup = true;
+				this.isTaking = true;
+				this.avatarUrl = ''
 			} else { //不需要拍照
 				if(this.lastTime) {
 					this.timer = setInterval(() => {
@@ -642,7 +651,7 @@ export default {
 			app.globalData.bankData = this.$data;
 			clearInterval(this.timer);
 			uni.navigateTo({
-				url: '/pages2/class/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true'
+				url: '/pages2/class/questionBank?id=' + this.id + '&goodsid=' + this.goodsId + '&isback=true&orderGoodsId='+this.orderGoodsId
 			});
 		} else {
 			//点击返回按钮确认允许退出,交卷
@@ -668,6 +677,9 @@ export default {
 				});
 			})
 		},
+		reTake() {
+			this.isTaking = true;
+		},
 		postStudyRecord() {
 			let self = this
 			let data = {
@@ -712,7 +724,8 @@ export default {
 			var self = this;
 			return new Promise((resolve, reject) => {
 				var data = {
-					imageStatus: int
+					imageStatus: int,
+					gradeId:this.gradeId
 				};
 				self.$api.aliyunpolicy(data).then(res => {
 					if (res.data.code != 200) {
@@ -743,7 +756,7 @@ export default {
 						success: result => {
 							if (result.statusCode === 200) {
 								self.ossAvatarUrl = ossToken.dir;
-								resolve();
+								resolve(ossToken.dir);
 							} else {
 								uni.showToast({
 									title: '上传失败',
@@ -771,7 +784,18 @@ export default {
 					success: async res => {
 						let canvasWidth = res.width; //图片原始长宽
 						let canvasHeight = res.height;
-						if (canvasWidth > 1000 || canvasHeight > 1000) {
+						if (canvasWidth > 2000 || canvasHeight > 2000) {
+							uni.compressImage({
+								src: self.avatarUrl,
+								quality: 75,
+								width: '35%',
+								height: '35%',
+								success: async rest => {
+									const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+									resolve(waitUpload);
+								}
+							});
+						} else if(canvasWidth > 1000 || canvasHeight > 1000){
 							uni.compressImage({
 								src: self.avatarUrl,
 								quality: 75,
@@ -779,21 +803,70 @@ export default {
 								height: '50%',
 								success: async rest => {
 									const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-									resolve();
+									resolve(waitUpload);
 								}
 							});
-						} else {
+						}  else {
 							console.log('无需压缩');
 							const waitUpload = await self.uploadFile(self.avatarUrl, 0);
-							resolve();
+							resolve(waitUpload);
 						}
 					}
 				});
 			});
 		},
+		/**
+		 * 人脸匹配
+		 */
+		faceRecognition() {
+			return new Promise(resolve => {
+				let fileSystem = uni.getFileSystemManager();
+				fileSystem.readFile({
+				  filePath: `${this.avatarUrl}`,
+				  encoding: 'base64',
+				  position: 0,
+				  success:(res) => {
+					  console.log(res)
+					  let base64 = 'data:image/jpg;base64,' + res.data;
+					  
+					  this.$api.faceCertificationCompareFace({
+						  imageA:base64,
+						  orderGoodsId:this.orderGoodsId,
+						  gradeId:this.gradeId
+					  }).then(res => {
+							console.log(res,'res')
+						  resolve(res.data.data)
+					  })
+				  },
+				  fail(err) {
+					console.error(err,'err')
+				  }
+				})
+			})
+		},
 		async submitPhoto() {
-			const waitYS = await this.imageInfos();
-			this.postStudyRecord(); //提交记录
+			let compareFaceData = await this.faceRecognition();
+			console.log(compareFaceData,'compareFaceData')
+			if(compareFaceData == 0) {
+				uni.showToast({
+				  title:'人脸匹配不通过,请重新拍照上传',
+				  icon:'none',
+				  duration:2000,
+				})
+				
+				setTimeout(() => {
+					this.uploadLock = false;
+					this.openPhoto();
+				},2000)
+				return;
+			}
+			
+			if(compareFaceData >= 80) {
+				
+				const waitYS = await this.imageInfos();
+				this.postStudyRecord(); //提交记录
+				this.photoPopup = false;
+			}
 		},
 		//确认拍照
 		takePhoto() {
@@ -804,9 +877,10 @@ export default {
 				success: res => {
 					console.log(res.tempImagePath);
 					self.avatarUrl = res.tempImagePath;
-					self.submitPhoto();
+					// self.submitPhoto();
+					this.isTaking = false;
 		
-					self.photoPopup = false;
+					// self.photoPopup = false;
 				},
 				fail: err => {
 					console.log(err);
@@ -1078,6 +1152,7 @@ export default {
 					moduleId:this.moduleId || 0,
 					examId: this.id,
 					goodsId: this.goodsId,
+					orderGoodsId: this.orderGoodsId,
 					recordId:this.recordId,
 					courseId:this.courseId,
 					reportStatus:reportStatus,
@@ -1203,6 +1278,7 @@ export default {
 						gradeId:this.gradeId,
 						examId: this.id,
 						courseId:this.courseId,
+					orderGoodsId: this.orderGoodsId,
 						goodsId: this.goodsId,
 						recordId:this.recordId,
 						performance:score,
@@ -1350,15 +1426,15 @@ export default {
 			return new Promise(resolve => {
 				let self = this
 				let questionList = 0;
-				if(!hasSpecial) {
+				// if(!hasSpecial) {
 					this.questionList.forEach((item, index) => {
 						if(item.type == 1 || item.type == 2 || item.type == 3) {
 							questionList++;
 						}
 					})
-				} else {
-					questionList = this.questionList.length;
-				}
+				// } else {
+				// 	questionList = this.questionList.length;
+				// }
 				 
 				this.$api
 					.bankRecord({
@@ -1366,14 +1442,17 @@ export default {
 						moduleExamId: this.moduleId || 0,
 						examId: this.id,
 						goodsId: this.goodsId,
+					orderGoodsId: this.orderGoodsId,
 						gradeId:this.gradeId,
-						totalQuestionNum: questionList
+						totalQuestionNum: questionList,
+						allQuestionNum:this.questionList.length
 					})
 					.then(res => {
 						this.recordId = res.data.data;
 						
 						if(self.needPhoto){
 							self.photoPopup = true; //拍照
+							this.isTaking = true;
 						} else {
 							if(this.lastTime) {
 								this.timer = setInterval(() => {
@@ -1696,6 +1775,7 @@ export default {
 				reportStatus = 0
 			}
 			
+			clearInterval(this.timer)
 			//交卷
 			this.$api
 				.bankRecordEdit({
@@ -1704,6 +1784,7 @@ export default {
 					gradeId:this.gradeId,
 					examId: this.id,
 					goodsId: this.goodsId,
+					orderGoodsId: this.orderGoodsId,
 					reportStatus:reportStatus,
 					recordId: this.recordId,
 					courseId:this.courseId,
@@ -1843,63 +1924,6 @@ export default {
 				}
 			});
 		},
-
-		uploadFile(options, int) {
-			var self = this;
-			return new Promise((resolve, reject) => {
-				var data = {
-					imageStatus: int
-				};
-				self.$api.aliyunpolicy(data).then(res => {
-					console.log(res.data, 6);
-					if (res.data.code != 200) {
-						self.$method.showToast('签名错误' + JSON.stringify(res.data));
-						return;
-					}
-					var ossToken = res.data.data.resultContent;
-					if (ossToken.host == null || ossToken.host == undefined) {
-						self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
-						return;
-					}
-					uni.uploadFile({
-						url: ossToken.host,
-						name: 'file',
-						filePath: options,
-						fileType: 'image',
-						header: {
-							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
-						},
-						formData: {
-							key: ossToken.dir,
-							OSSAccessKeyId: ossToken.accessid,
-							policy: ossToken.policy,
-							Signature: ossToken.signature,
-							callback: ossToken.callback,
-							success_action_status: 200
-						},
-						success: result => {
-							if (result.statusCode === 200) {
-								self.ossAvatarUrl = ossToken.dir;
-								resolve(ossToken.dir);
-							} else {
-								uni.showToast({
-									title: '上传失败',
-									icon: 'none'
-								});
-								return;
-							}
-						},
-						fail: error => {
-							uni.showToast({
-								title: '上传接口报错' + error,
-								icon: 'none'
-							});
-							return;
-						}
-					});
-				});
-			});
-		},
 		/**
 		 * @param {Object} type
 		 * @param {Object} bankindex
@@ -2018,6 +2042,45 @@ export default {
 				return false;
 			}
 		},
+		
+		isOver(item,index) {
+			if(this.questionList[index].ques) {
+				if (item.type == 4) { //案例题
+					let isOver = item.jsonStr.every((jsonItem, indexs) => {
+						if (jsonItem.type == 1 || jsonItem.type == 2 || jsonItem.type == 3) {
+							if (item.ques[indexs]) {
+								return true;
+							} else {
+								return false;
+							}
+						} else if (jsonItem.type == 5) {
+							if (item.ques[indexs] && (item.ques[indexs].text || item.ques[indexs].imageList.length)) {
+								console.log('chil')
+								return true;
+							} else {
+								return false;
+							}
+						}
+					});
+					
+					if (isOver) {
+						return true;
+					} else {
+						return false;
+					}
+				} else if (item.type == 5) { //简答题
+					//每一项都相等
+					if(item.ques && (item.ques.imageList.length || item.ques.text)) {
+						return true;
+					}
+					//判断
+				} else {
+					return false;
+				}
+			} else {
+				return false;
+			}
+		},
 
 		tabSelect(index, bankindex) {
 			this.$set(this.questionList[bankindex], 'current', index);
@@ -2066,16 +2129,23 @@ export default {
 				}
 			}
 		}
-		.btnResult {
-			height: 100rpx;
-			width: 100%;
-			background-color: #07c160;
-			text-align: center;
-			line-height: 100upx;
-			color: #fff;
-			font-size: 32upx;
-			font-weight: bold;
+		
+		.photoBoxbtns {
+			display: flex;
+			
+			
+			.btnResult {
+				height: 100rpx;
+				width: 100%;
+				background-color: #07c160;
+				text-align: center;
+				line-height: 100upx;
+				color: #fff;
+				font-size: 32upx;
+				font-weight: bold;
+			}
 		}
+		
 	}
 	
 .navbar {
@@ -2442,6 +2512,13 @@ export default {
 		color: #fff;
 		background: #FF3B30;
 	}
+	
+	
+	&.isOver {
+		border: 1rpx solid #eeeeee;
+		color: #fff;
+		background: blue;
+	}
 }
 .answerInfos {
 	padding: 25rpx 25rpx 25rpx 23rpx;

+ 1 - 0
pages2/class/question_report.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="试卷报告"></nav-bar>
 		<view :class="reportStatus == 0 ? 'redBtn' : reportStatus == 1 ? 'greenBtn' : 'disNone'" v-if="reportStatus !== null">
 			{{ reportStatus == 0 ? '测试未通过' : reportStatus == 1 ? '测试通过' : '' }}
 		</view>

+ 4 - 3
pages2/exam/exam_appointment.vue

@@ -1,9 +1,10 @@
 <template>
 	<view>
+		<nav-bar title="考试预约"></nav-bar>
 		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" inactive-color="#999"></u-tabs>
 		</view>
-		<view class="safeArea" style="position: absolute;top: 96rpx;width: 100%;">
+		<view class="safeArea" style="position: absolute;top: 288rpx;width: 100%;">
 			<view class="examMain">
 				<view class="noData" v-if="!listData.length">您暂无相关考试预约哦~</view>
 				<view v-for="(item, index) in listData" :key="index" class="examList">
@@ -15,7 +16,7 @@
 						</view>
 						<view class="item">
 							<view class="left">报考专业</view>
-							<view class="right">{{ item.categoryName }}专业</view>
+							<view class="right" v-if="item.categoryName">{{ item.categoryName }}专业</view>
 						</view>
 						<view class="item">
 							<view class="left">考试地点</view>
@@ -309,7 +310,7 @@ page {
 	font-family: PingFang SC;
 	font-weight: 500;
 	color: #999999;
-	margin: 160rpx 0;
+	margin: 200rpx 0;
 }
 .examMain {
 	padding: 8rpx;

+ 2 - 1
pages2/exam/exam_result.vue

@@ -1,9 +1,10 @@
 <template>
 	<view>
+		<nav-bar title="考试成绩和证书"></nav-bar>
 		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" inactive-color="#999"></u-tabs>
 		</view>
-		<view class="safeArea" style="position: absolute;top: 96rpx;width: 100%;">
+		<view class="safeArea" style="position: absolute;top: 280rpx;width: 100%;">
 			<view class="examMain">
 				<view class="noData" v-if="!listData.length">您暂无相关考试成绩和证书哦~~</view>
 				<view v-for="(item, index) in listData" :key="index" class="examList">

+ 1 - 0
pages2/exam/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="我的考试"></nav-bar>
 		<view class="examWrap">
 			<view class="examItem" @click="goAppointment">
 				<view class="item">考试预约</view>

+ 426 - 189
pages2/invoice/index.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="invoice">
+		<nav-bar title="发票申请"></nav-bar>
 		<view class="invoice__tabs">
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF"></u-tabs>
 		</view>
@@ -7,7 +8,7 @@
 			<view class="open" v-if="current == 0">
 				<view class="form">
 					<u-form :model="form" ref="uForm">
-						<u-form-item label="发票类型" label-width="130" required prop="type" >
+						<u-form-item label="发票类型" label-width="150" required prop="type" >
 							<u-radio-group v-model="form.type" @change="formTypeChange">
 								<u-radio v-for="(item, index) in typeList" :key="index" :name="item.value">
 									{{ item.name }}
@@ -18,40 +19,40 @@
 						<!-- 增值税发票 -->
 						<template v-if="form.type == 2">
 							
-							<u-form-item label="申请主体" label-width="130" required  prop="main">
-								<u-radio-group v-model="form.main">
+							<u-form-item label="申请主体" label-width="150" required  prop="subject">
+								<u-radio-group v-model="form.subject">
 									<u-radio :key="index" name="2">
 										企业
 									</u-radio>
 								</u-radio-group>
 							</u-form-item>
 							
-							<u-form-item label="发票抬头" label-width="130" required prop="header" >
-								<u-input placeholder="请输入" v-model="form.header" />
+							<u-form-item label="发票抬头" label-width="150" required prop="invoiceTitle" >
+								<u-input placeholder="请输入发票抬头" v-model="form.invoiceTitle" />
 							</u-form-item>
-							<u-form-item label="单位税号" label-width="130" required prop="tax" >
-								<u-input placeholder="请输入" v-model="form.tax" />
+							<u-form-item label="纳税登记号" label-width="150" required prop="taxRegistryNumber" >
+								<u-input placeholder="请输入纳税登记号" v-model="form.taxRegistryNumber" />
 							</u-form-item>
-							<u-form-item label="单位地址" label-width="130" required prop="address" >
-								<u-input placeholder="请输入" v-model="form.address" />
+							<u-form-item label="单位地址" label-width="150" required prop="companyAddress" >
+								<u-input placeholder="请输入单位地址" v-model="form.companyAddress" />
 							</u-form-item>
-							<u-form-item label="电话号码" label-width="130" required prop="tel" >
-								<u-input placeholder="请输入" v-model="form.tel" />
+							<u-form-item label="电话号码" label-width="150" required prop="phone" >
+								<u-input placeholder="请输入电话号码" type="number" v-model="form.phone" />
 							</u-form-item>
-							<u-form-item label="开户银行" label-width="130" required prop="bank" >
-								<u-input placeholder="请输入" v-model="form.bank" />
+							<u-form-item label="开户银行" label-width="150" required prop="bankName" >
+								<u-input placeholder="请输入开户银行" v-model="form.bankName" />
 							</u-form-item>
-							<u-form-item label="银行账号" label-width="130" required prop="bankNo" >
-								<u-input placeholder="请输入" v-model="form.bankNo" />
+							<u-form-item label="银行账号" label-width="150" required prop="bankAccount" >
+								<u-input placeholder="请输入银行账号" type="number" v-model="form.bankAccount" />
 							</u-form-item>
-							<u-form-item label="收件地址" label-width="130" required prop="recieveAddress" >
-								<u-input placeholder="请输入" v-model="form.recieveAddress" />
+							<u-form-item label="收件地址" label-width="150" required prop="receivingAddress" >
+								<u-input placeholder="请输入收件地址" v-model="form.receivingAddress" />
 							</u-form-item>
-							<u-form-item label="收件人" label-width="130" required prop="name" >
-								<u-input placeholder="请输入" v-model="form.name" />
+							<u-form-item label="收件人" label-width="150" required prop="receivingName" >
+								<u-input placeholder="请输入收件人" v-model="form.receivingName" />
 							</u-form-item>
-							<u-form-item label="收件手机" label-width="130" required prop="phone" >
-								<u-input placeholder="请输入" v-model="form.phone" />
+							<u-form-item label="收件手机" label-width="150" required prop="receivingTel" >
+								<u-input placeholder="请输入收件手机" v-model="form.receivingTel" />
 							</u-form-item>
 							
 						</template>
@@ -59,24 +60,27 @@
 						
 						<!-- 普通发票 -->
 						<template v-else>
-							<u-form-item label="申请主体" label-width="130" required prop="main">
-								<u-radio-group v-model="form.main">
+							<u-form-item label="申请主体" label-width="150" required prop="subject">
+								<u-radio-group v-model="form.subject">
 									<u-radio v-for="(item, index) in mainList" :key="index" :name="item.value">
 										{{ item.name }}
 									</u-radio>
 								</u-radio-group>
 							</u-form-item>
 							
-							<u-form-item label="发票抬头" label-width="130" required prop="header" >
-								<u-input placeholder="请输入" v-model="form.header" />
+							<u-form-item label="发票抬头" label-width="150" required prop="invoiceTitle" >
+								<u-input placeholder="请输入发票抬头" v-model="form.invoiceTitle" />
+							</u-form-item>
+							<u-form-item v-if="form.subject == '2'" label="纳税登记号" label-width="150" required prop="taxRegistryNumber" >
+								<u-input placeholder="请输入纳税登记号" v-model="form.taxRegistryNumber" />
 							</u-form-item>
 						</template>
 						<!-- 普通发票 -->
 						
 						
-						<u-form-item label="选择订单" label-width="130" required prop="orderIds" right-icon="arrow-right" ref="orderIds">
+						<u-form-item label="选择订单" label-width="150" required prop="orderGoodsIds" right-icon="arrow-right" ref="orderGoodsIds">
 							<view class="form-item" @click="selectOrderModal = true">
-								<u-input placeholder="请选择" disabled  @click="selectOrderModal = true" v-model="form.orderIds" />
+								<u-input placeholder="请点击选择订单" disabled  @click="selectOrderModal = true" />
 							</view>
 						</u-form-item>
 						<view>
@@ -84,9 +88,9 @@
 									<view class="close" @click="deleteOrder(index)">
 										<u-icon name="close-circle-fill" color="#FF2D55" size="40"></u-icon>
 									</view>
-									<view class="title">商品名称</view>
-									<view class="number">订单编号</view>
-									<view class="price">¥ 100元</view>
+									<view class="title">商品名称:{{item.goodsName}}</view>
+									<view class="number">订单编号:{{item.orderSn}}</view>
+									<view class="price">价格:¥ {{item.goodsPrice}}</view>
 							</view>
 						</view>
 						
@@ -95,27 +99,27 @@
 				
 				<view class="order-text">
 					<view class="order-text__label">本次申请开票金额:</view>
-					<view class="order-text__price">¥ 999.00</view>
+					<view class="order-text__price">¥ {{toFixed(invoicePirce)}}</view>
 				</view>
 				
 				<view class="submit" @click="formSubmit">
 					提交申请
 				</view>
 			</view>
-			<view class="." v-if="current == 1">
+			<view class="record" v-if="current == 1">
 				<view class="nodata" v-if="!recordList.length">
 					您暂无相关发票记录哦~
 				</view>
 				
 				<view class="record__list">
-					<view class="record-item"  @click="orderDetailModal = true;" v-for="(record,index) in recordList" :key="index">
-						<view class="item__time">2021/10/29 09:30:00</view>
+					<view class="record-item"  @click="showDetailModal(record);" v-for="(record,index) in recordList" :key="index">
+						<view class="item__time">{{$method.timestampToTime(record.applyTime,false,false)}}</view>
 						<view class="item__content">
 							<view class="top">
-								<view class="state" :class="{wait:record.state == 1,refuse:record.state == 2,agree:record.state == 3}">
-									<text v-if="record.state == 1">待审核</text>
-									<text v-if="record.state == 2">驳回</text>
-									<text v-if="record.state == 3">通过</text>
+								<view class="state" :class="{wait:record.periodStatus == 1,refuse:record.periodStatus == 2,agree:record.periodStatus == 3}">
+									<text v-if="record.periodStatus == 1">待审核</text>
+									<text v-if="record.periodStatus == 2">驳回</text>
+									<text v-if="record.periodStatus == 3">通过</text>
 									<u-icon class="arrow" name="arrow-right" color="#ffffff" size="28"></u-icon>
 								</view>
 							</view>
@@ -124,33 +128,36 @@
 								<view class="flex">
 									<view class="text">发票类型</view>
 									<view class="flex__auto">
-										<text>普通发票</text>
+										<text v-if="record.type == 1">普通发票</text>
+										<text v-if="record.type == 2">增值税专用发票</text>
 									</view>
 								</view>
 								<view class="flex">
 									<view class="text">申请主体</view>
 									<view class="flex__auto">
-										<text>个人</text>
+										<text v-if="record.subject == 1">个人</text>
+										<text v-if="record.subject == 2">企业</text>
 									</view>
 								</view>
 								<view class="flex">
 									<view class="text">发票状态</view>
 									<view class="flex__auto">
-										<text class="red" :class="{red:record.state != 2 ,green:record.state == 2}">未开票</text>
+										<text class="red" v-if="record.invoiceStatus == 1">未开票</text>
+										<text class="green" v-if="record.invoiceStatus == 2">已开票</text>
+										<text class="red" v-if="record.invoiceStatus == -1">已退票</text>
 									</view>
 								</view>
 								<view @click.stop="showOrder(record.checked,index)">
 									<view class="flex noborder" >
 										<view class="text">开票订单</view>
 										<view class="flex__auto">
-											<text class="red">3</text>
+											<text style="margin-right:10rpx;">{{record.orderList.length}}</text>
 											<u-icon v-if="!record.checked" name="arrow-down" color="#ccc" size="28"></u-icon>
 											<u-icon v-if="record.checked" name="arrow-up" color="#ccc" size="28"></u-icon>
 										</view>
 									</view>
 									<view class="order-list" v-if="record.checked">
-										<view class="order-item">1.2021七大员新考施工专业人员岗提高班</view>
-										<view class="order-item">2.2021七大员新考施工专业人员岗提高班订单名称过长换行</view>
+										<view class="order-item" :key="orderIndex" v-for="(orderItem,orderIndex) in record.orderList">{{orderIndex+1}}.{{orderItem.goodsName}}</view>
 									</view>
 								</view>
 							</view>
@@ -180,9 +187,9 @@
 											>	
 												<view class="order-item__bg" :class="item.checked?'active':''" >
 													<view>
-														<view class="order-title">商品名称</view>
-														<view class="order-number">订单编号</view>
-														<view class="order-price">¥ 100元</view>
+														<view class="order-title">{{item.goodsName}}</view>
+														<view class="order-number">{{item.orderSn}}</view>
+														<view class="order-price">¥ {{item.goodsPrice}}元</view>
 													</view>
 												</view>
 											</u-checkbox >
@@ -203,84 +210,75 @@
 		<u-popup class="modal" v-model="orderDetailModal" mode="center" border-radius="40">
 			<view class="order-detail">
 				<view class="order-detail__content">
-					<scroll-view scroll-y="true" style="height: 972rpx;">
+					<scroll-view scroll-y="true" style="height: 860rpx;">
 						<view class="content">
-							<view class="header">2021年10月29日 09:30:00</view>
+							<view class="header">{{$method.timestampToTime(invoiceDetail.applyTime,false,false)}}</view>
 							<view class="body">
 								<view class="body__item">
 									<view class="title">发票申请信息</view>
 									<view class="content">
 										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
 											<view slot="title">发票类型:</view>
-											<text>普通发票</text>
+											<text v-if="invoiceDetail.type == 1">普通发票</text>
+											<text v-if="invoiceDetail.type == 2">增值税专用发票</text>
 										</u-cell-item>
 										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
 											<view slot="title">申请主体:</view>
-											<text>个人</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">发票抬头:</view>
-											<text>广东中正科技教育科技有限公司</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">单位税号:</view>
-											<text>SH123456789</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">单位地址:</view>
-											<text>广州市天河区燕岭路123号建设大厦F座 16楼过长换行</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">电话号码:</view>
-											<text>企业 拷贝</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">开户银行:</view>
-											<text>中国工商银行星星支行</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">银行账号:</view>
-											<text>SH123456789 拷贝</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">收件地址:</view>
-											<text>广州市天河区燕岭路123号</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">收件人:</view>
-											<text>李大米</text>
+											<text v-if="invoiceDetail.subject == 1">个人</text>
+											<text v-if="invoiceDetail.subject == 2">企业</text>
 										</u-cell-item>
 										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
 											<view slot="title">发票抬头:</view>
-											<text>广东中正科技教育科技有限公司</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
-											<view slot="title">收件手机:</view>
-											<text>13800138000</text>
-										</u-cell-item>
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
-											<view slot="title">开票订单:</view>
+											<text>{{invoiceDetail.invoiceTitle}}</text>
 										</u-cell-item>
+										<template v-if="invoiceDetail.type == 2">
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">纳税登记号:</view>
+												<text>{{invoiceDetail.taxRegistryNumber || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">单位地址:</view>
+												<text>{{invoiceDetail.companyAddress || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">电话号码:</view>
+												<text>{{invoiceDetail.phone || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">开户银行:</view>
+												<text>{{invoiceDetail.bankName || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">银行账号:</view>
+												<text>{{invoiceDetail.bankAccount || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">收件地址:</view>
+												<text>{{invoiceDetail.receivingAddress || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">收件人:</view>
+												<text>{{invoiceDetail.receivingName || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
+												<view slot="title">收件手机:</view>
+												<text>{{invoiceDetail.receivingTel || ''}}</text>
+											</u-cell-item>
+											<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" >
+												<view slot="title">开票订单:</view>
+											</u-cell-item>
+										</template>
+										
 										<view class="order-list">
-											<view class="order-item">
-												<view class="order-title">2021七大员新考施工专业人员岗提高班</view>
-												<view class="order-number">GDXY1234567890</view>
-												<view class="order-price">¥ 100元</view>
-											</view>
-											<view class="order-item">
-												<view class="order-title">2021七大员新考施工专业人员岗提高班</view>
-												<view class="order-number">GDXY1234567890</view>
-												<view class="order-price">¥ 100元</view>
-											</view>
-											<view class="order-item">
-												<view class="order-title">2021七大员新考施工专业人员岗提高班</view>
-												<view class="order-number">GDXY1234567890</view>
-												<view class="order-price">¥ 100元</view>
+											<view class="order-item" :key="orderIndex" v-for="(orderItem,orderIndex) in invoiceDetail.orderList">
+												<view class="order-title">{{orderItem.goodsName}}</view>
+												<view class="order-number">{{orderItem.orderSn}}</view>
+												<view class="order-price">¥ {{orderItem.goodsRealPrice}}元</view>
 											</view>
 										</view>
 										<view class="order-text">
 											<view class="order-text__label">本次申请开票金额:</view>
-											<view class="order-text__price">¥ 999.00</view>
+											<view class="order-text__price">¥ {{toFixed(invoiceDetail.amount)}}</view>
 										</view>
 									</view>
 								</view>
@@ -289,34 +287,39 @@
 									<view class="content">
 										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
 											<view slot="title">审核结果:</view>
-											<text class="text wait">待审核</text>
-											<text class="text agree">通过</text>
-											<text class="text refuse">驳回</text>
+											<text class="text wait" v-if="invoiceDetail.periodStatus == 1">待审核</text>
+											<text class="text agree" v-if="invoiceDetail.periodStatus == 3">通过</text>
+											<text class="text refuse" v-if="invoiceDetail.periodStatus == 2">驳回</text>
+										</u-cell-item>
+										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" v-if="invoiceDetail.periodReason">
+											<view slot="title">审核反馈:</view>
+											<text class="text">{{invoiceDetail.periodReason||''}}</text>
 										</u-cell-item>
 										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
 											<view slot="title">发票状态:</view>
-											<text class="text refuse">未开票</text>
-											<text class="text agree">已开票</text>
-											<text class="text refuse">已退票</text>
+											<text class="text refuse" v-if="invoiceDetail.invoiceStatus == 1">未开票</text>
+											<text class="text agree" v-if="invoiceDetail.invoiceStatus == 2">已开票</text>
+											<text class="text refuse" v-if="invoiceDetail.invoiceStatus == -1">已退票</text>
 										</u-cell-item>
 										
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" v-if="invoiceDetail.periodStatus == 3 &&  (invoiceDetail.invoiceStatus == 2 || invoiceDetail.invoiceStatus == -1)  && invoiceDetail.invoiceImg">
 											<view slot="title">发票预览:</view>
 											<view>
-												<image class="preview" src="/static/info_3.png"></image>
-												<view class="download-btn" @click="download">下载电子发票</view>
+												<image class="preview" @click="previewImg(invoiceDetail)" :src="$method.splitImgHost(invoiceDetail.invoiceImg)"></image>
+												<view class="download-btn" @click="download(invoiceDetail)">下载电子发票</view>
 											</view>
 										</u-cell-item>
 										
 										
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
+										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" v-if="invoiceDetail.periodStatus == 3 && (invoiceDetail.invoiceStatus == 2 || invoiceDetail.invoiceStatus == -1) && invoiceDetail.type == 2 && invoiceDetail.subject == 2">
 											<view slot="title">机构发票邮寄状态:</view>
-											<text class="text">是</text>
+											<text class="text" v-if="invoiceDetail.sendInvoice == 1">是</text>
+											<text class="text" v-else>否</text>
 										</u-cell-item>
 										
-										<u-cell-item :border-bottom="false" hover-class="none" :arrow="false">
-											<view slot="title">发票邮寄快递单号:</view>
-											<text class="text">153666689456</text>
+										<u-cell-item v-if="invoiceDetail.periodStatus == 3 && (invoiceDetail.invoiceStatus == 2 || invoiceDetail.invoiceStatus == -1)  && invoiceDetail.sendInvoice == 1 && invoiceDetail.type == 2 && invoiceDetail.subject == 2"  @click.stop="copy(invoiceDetail.trackingNum)" :border-bottom="false" hover-class="none" :arrow="false">
+												<view slot="title">发票邮寄快递单号:(点击可复制)</view>
+												<text class="text">{{invoiceDetail.trackingNum || ''}}</text>
 										</u-cell-item>
 									</view>
 								</view>
@@ -325,12 +328,12 @@
 						
 					</scroll-view>
 				</view>
-				<view class="order-detail__btns">
+				<view class="order-detail__btns" v-if="invoiceDetail.periodStatus == 1">
 					<view class="btn" @click="orderDetailModal = false;">知道了</view>
 					<view class="btn warm" @click="orderCancelModal = true;">撤销申请</view>
 				</view>
 				
-				<view class="order-detail__btns">
+				<view class="order-detail__btns" v-else>
 					<view class="btn ok" @click="orderDetailModal = false;">知道了</view>
 				</view>
 			</view>
@@ -363,16 +366,7 @@ export default {
 	data() {
 		return {
 			checkOrderList:[],
-			recordList:[{
-				checked:false,
-				state:'1'
-			},{
-				checked:false,
-				state:'2'
-			},{
-				checked:false,
-				state:'3'
-			}],
+			recordList:[],
 			list: [
 				{
 					name: '发票申请'
@@ -381,14 +375,25 @@ export default {
 					name: '发票记录'
 				}
 			],
+			invoiceDetail:{
+				amount:0
+			},
 			form:{
-				type:'',
-				main:'',
-				header:'',
-				orderIds:'',
+				type:'1',
+				subject:'1',
+				invoiceTitle:'',
+				orderGoodsIds:'',
+				taxRegistryNumber:'',
+				companyAddress:'',
+				phone:'',
+				bankName:'',
+				bankAccount:'',
+				receivingAddress:'',
+				receivingName:'',
+				receivingTel:'',
 			},
 			rules: {
-				phone: [
+				receivingTel: [
 					{ 
 						required: true, 
 						message: '请输入收件手机', 
@@ -399,6 +404,7 @@ export default {
 						validator: (rule, value, callback) => {
 							// 上面有说,返回true表示校验通过,返回false表示不通过
 							// this.$u.test.mobile()就是返回true或者false的
+							console.log(this.$u.test.mobile(value),'this.$u.test.mobile(value)')
 							return this.$u.test.mobile(value);
 						},
 						message: '手机号码格式不正确',
@@ -414,7 +420,7 @@ export default {
 						trigger: ['change'],
 					}
 				],
-				main: [
+				subject: [
 					{ 
 						required: true, 
 						message: '请选择申请主体', 
@@ -422,23 +428,34 @@ export default {
 						trigger: ['change'],
 					}
 				],
-				header: [
+				invoiceTitle: [
 					{ 
 						required: true, 
 						message: '请输入发票抬头', 
 						// 可以单个或者同时写两个触发验证方式 
 						trigger: ['change'],
-					}
+					},
 				],
-				tax: [
+				taxRegistryNumber: [
 					{ 
 						required: true, 
-						message: '请输入单位税号', 
+						message: '请输入纳税登记号', 
 						// 可以单个或者同时写两个触发验证方式 
 						trigger: ['change'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							var reg = /(^[0-9A-Z]{15,20}$)/;
+							console.log( reg.test(value),' reg.test(value)')
+							return reg.test(value);
+						},
+						message: '发票抬头格式不正确',
+						// 触发器可以同时用blur和change
+						trigger: ['change'],
 					}
 				],
-				address: [
+				companyAddress: [
 					{ 
 						required: true, 
 						message: '请输入单位地址', 
@@ -446,31 +463,66 @@ export default {
 						trigger: ['change'],
 					}
 				],
-				tel: [
+				phone: [
 					{ 
 						required: true, 
 						message: '请输入电话号码', 
 						// 可以单个或者同时写两个触发验证方式 
 						trigger: ['change'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
+							var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
+							if (this.$u.test.mobile(value) || vartest.test(value) || vartest1.test(value)) {
+								return true;
+							} else {
+								return false;
+							}
+						},
+						message: '电话号码不正确',
+						trigger: ['change', 'blur']
 					}
 				],
-				bank: [
+				bankName: [
 					{ 
 						required: true, 
 						message: '请输入开户银行', 
 						// 可以单个或者同时写两个触发验证方式 
 						trigger: ['change'],
+					},
+					{
+						validator: (rule, value, callback) => {
+							var reg = /[\u4E00-\u9FA5]+/;
+							return reg.test(value)
+						},
+						message: '开户银行名称不正确',
+						trigger: ['change', 'blur']
 					}
 				],
-				bankNo: [
+				
+				
+				bankAccount: [
 					{ 
 						required: true, 
 						message: '请输入银行账号', 
 						// 可以单个或者同时写两个触发验证方式 
 						trigger: ['change'],
+						
+					},
+					{
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							var reg = /^[1-9]{1}(\d{15}|\d{18})$/;
+							console.log( reg.test(value),' reg.test(value)')
+							return reg.test(value);
+						},
+						message: '银行卡号格式不正确',
+						// 触发器可以同时用blur和change
+						trigger: ['change'],
 					}
 				],
-				recieveAddress: [
+				receivingAddress: [
 					{ 
 						required: true, 
 						message: '请输入收件地址', 
@@ -478,7 +530,7 @@ export default {
 						trigger: ['change'],
 					}
 				],
-				name: [
+				receivingName: [
 					{ 
 						required: true, 
 						message: '请输入收件人', 
@@ -486,7 +538,7 @@ export default {
 						trigger: ['change'],
 					}
 				],
-				orderIds: [
+				orderGoodsIds: [
 					{ 
 						required: true, 
 						message: '请选择订单', 
@@ -496,11 +548,12 @@ export default {
 				],
 			},
 			orderValue:'',
-			orderList:[{checked:false,name:'1'},{checked:false,name:'2'},{checked:false,name:'3'},{checked:false,name:'4'}],
+			orderList:[],
 			selectOrderModal:false,
 			orderDetailModal:false,
 			orderCancelModal:false,
-			current: 1,
+			current: 0,
+			invoicePirce:0,
 			order: [],
 			typeList:[{
 				name:'普通发票',
@@ -520,12 +573,52 @@ export default {
 	},
 	// onPullDownRefresh() {},
 	onLoad(option) {
-		// this.$refs.uForm.setRules(this.rules)
+		this.orderInvoiceCanInvoiceList();
+		this.$refs.uForm.setRules(this.rules)
 	},
 	onShow() {
 		
 	},
 	methods: {
+		orderCancel() {
+			let invoiceDetail = JSON.parse(JSON.stringify(this.invoiceDetail))
+			invoiceDetail.status = -1;
+			this.$api.orderInvoiceCancel(invoiceDetail).then(res => {
+				if(res.data.code == 200) {
+					this.orderInvoiceList();
+					this.orderInvoiceCanInvoiceList();
+					this.orderDetailModal = false;
+					this.orderCancelModal = false;
+					uni.showToast({
+						title:'撤销成功',
+						icon:'none'
+					})
+				} else {
+					
+				}
+			}) 
+		},
+		showDetailModal(item) {
+			this.orderDetailModal = true;
+			this.invoiceDetail = item;
+		},
+		toFixed(number) {
+			console.log(number.toFixed(2))
+			return number.toFixed(2)
+		},
+		/**
+		 * 获取可开发票的订单
+		 */
+		orderInvoiceCanInvoiceList() {
+			this.$api.orderInvoiceCanInvoiceList().then(res => {
+				if(res.data.code == 200) {
+					res.data.rows.forEach(item => {
+						item.checked = false;
+					})
+					this.orderList = res.data.rows;
+				}
+			}) 
+		},
 		/**
 		 * @param {Object} checkedState 显示状态
 		 * @param {Object} index 索引值
@@ -539,9 +632,61 @@ export default {
 		 */
 		formSubmit() {
 			this.$refs.uForm.validate(valid => {
+				console.log(valid,'valid')
+				console.log(this.form,'this.form')
 				if(valid) {
-					uni.showToast({
-						title:'申请成功'
+					
+					if(this.invoicePirce > 10000) {
+						uni.showModal({
+							title:'提示',
+							content:'您所选的订单总开票金额,大于10000元,超出单张发票的开票额度,请修改开票订单',
+							showCancel:false,
+						})
+						return
+					}
+					let data = JSON.parse(JSON.stringify(this.form));
+					data.orderGoodsIds = data.orderGoodsIds.split(',')
+					data.amount = this.invoicePirce;
+					if(data.subject == '1') {
+						data.taxRegistryNumber = '';
+						data.companyAddress = '';
+						data.phone = '';
+						data.bankName = '';
+						data.bankAccount = '';
+						data.receivingAddress = '';
+						data.receivingName = '';
+						data.receivingTel = '';
+					}
+					this.$api.orderInvoice(data).then(res => {
+						if(res.data.code == 200) {
+							this.orderInvoiceCanInvoiceList();
+							this.form = {
+								type:'1',
+								subject:'1',
+								invoiceTitle:'',
+								orderGoodsIds:'',
+								taxRegistryNumber:'',
+								companyAddress:'',
+								phone:'',
+								bankName:'',
+								bankAccount:'',
+								receivingAddress:'',
+								receivingName:'',
+								receivingTel:'',
+							};
+							this.invoicePirce = 0;
+							uni.showModal({
+								title:'操作提示',
+								content:`您本次的发票申请已经提交成功!\n机构将在3-7个工作日内进行处理,处理结果会在【发票记录】显示,请留意进度。`,
+								showCancel:false,
+								confirmText:'知道了'
+							})
+						} else {
+							uni.showToast({
+								icon:'none',
+								title:res.data.msg
+							})
+						}
 					})
 				}
 			})
@@ -553,9 +698,9 @@ export default {
 		formTypeChange(e) {
 			console.log(e)
 			if(e == '2') {
-				this.$set(this.form,'main','2')
+				this.$set(this.form,'subject','2')
 			} else {
-				this.$set(this.form,'main','')
+				
 			}
 		},
 		/**
@@ -565,71 +710,162 @@ export default {
 		change(e) {
 			console.log(e)
 			this.current = e;
+			
+			if(this.current == 1) {
+				this.orderInvoiceList();
+			} else {
+				this.$nextTick(() => {
+					this.$refs.uForm.setRules(this.rules)
+				})
+				
+			}
+		},
+		
+		orderInvoiceList() {
+			this.$api.orderInvoiceList().then(res => {
+				if(res.data.code == 200) {
+					this.recordList = res.data.rows
+				} else {
+					uni.showToast({
+						icon:'none',
+						title:res.data.msg
+					})
+				}
+			})
 		},
 		
 		radioGroupChange(e) {
 			console.log(e)
 		},
+		copy(str) {
+			if(!str) {
+				uni.showToast({
+					icon:'none',
+					title:'暂时没有可以复制的快递号'
+				})
+				return;
+			}
+			let newStr = String(str)
+			uni.setClipboardData({
+			    data: newStr,
+			    success: function () {
+			        console.log('success');
+			    }
+			});
+		},
 		okPopup() {
 			this.selectOrderModal = false;
 			let strArr = [];
+			this.invoicePirce = 0;
 			this.orderList.forEach((item,index) => {
 				if(item.checked) {
 					this.$set(this.orderList[index],'disabled',true)
-					strArr.push(item.name)
+					strArr.push(item.orderGoodsId)
+					this.invoicePirce += item.goodsPrice
 				}
 			})
 			
-			this.form.orderIds = strArr.join(',')
+			this.form.orderGoodsIds = strArr.join(',')
 			this.$nextTick(() => {
-				this.$refs.orderIds.onFieldChange()
+				this.$refs.orderGoodsIds.onFieldChange()
 			})
-			console.log(this.$refs.orderIds)
+			console.log(this.$refs.orderGoodsIds)
 		},
 		
 		deleteOrder(index) { 
 			this.$set(this.orderList[index],'disabled',false)
 			this.$set(this.orderList[index],'checked',false)
 			let strArr = [];
+			this.invoicePirce = 0;
 			this.orderList.forEach((item,index) => {
 				if(item.checked) {
-					strArr.push(item.name)
+					strArr.push(item.orderGoodsId)
+					this.invoicePirce += item.goodsPrice
 				}
 			})
 			
-			this.form.orderIds = strArr.join(',')
+			this.form.orderGoodsIds = strArr.join(',')
 			this.$nextTick(() => {
-				this.$refs.orderIds.onFieldChange()
+				this.$refs.orderGoodsIds.onFieldChange()
 			})
 		},
 		
-		download() {
-			uni.downloadFile({
-			  url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
-			  success: function (res) {
-				  console.log(999)
-			    var filePath = res.tempFilePath;
-			    uni.openDocument({
-			      filePath: filePath,
-			      showMenu: true,
-			      success: function (res) {
-			        console.log(res,'打开文档成功');
-			      },
-				  fail:function(err) {
-					  console.log(err)
-				  }
-			    });
-			  }
+		previewImg(item) {
+			// 预览图片
+			uni.previewImage({
+				urls: [this.$method.splitImgHost(item.invoiceImg,true,1000)],
+				longPressActions: {
+					itemList: ['发送给朋友', '保存图片', '收藏'],
+					success: function(data) {
+						console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+					},
+					fail: function(err) {
+						console.log(err.errMsg);
+					}
+				}
 			});
 		},
 		
-		orderCancel() {
-			this.orderDetailModal = false;
-			this.orderCancelModal = false;
-			uni.showToast({
-				title:'撤销成功',
-				icon:'none'
-			})
+		download(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.invoiceImg,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) {
+						
+					}
+				}
+			});
+			
 		}
 	},
 	computed: { ...mapGetters(['userInfo']) }
@@ -751,6 +987,7 @@ page {
 				position:fixed;
 				left:50%;
 				bottom:40rpx;
+				z-index: 999;
 				transform: translateX(-50%);
 			}
 		}
@@ -799,7 +1036,7 @@ page {
 								&.refuse {
 									background: #FF3B30;
 								}
-								&.wait {
+								&.agree {
 									background: #34C759;
 								}
 								
@@ -939,7 +1176,7 @@ page {
 		
 		.order-detail {
 			width: 640rpx;
-			height: 1112rpx;
+			height: 1000rpx;
 			background: #FFFFFF;
 			display: flex;
 			flex-direction: column;

+ 56 - 10
pages2/learn/details.vue

@@ -1,17 +1,18 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="详情"></nav-bar>
 		<view class="detailsWrap">
 			<view class="topTitle">
 				<u-icon name="info-circle-fill" style="color:#FF3B30;margin-right:8rpx;"></u-icon>
-				<text>如对审核结果有异议,请勿点击确认重学。</text>
-				<view style="margin-left:34rpx;">致电<text @click="call">020-87085982</text>咨询</view>
+				<text>您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。</text>
+				<!-- <view style="margin-left:34rpx;">致电<text @click="call">020-87085982</text>咨询</view> -->
 			</view>
 			<view class="detailsItem" v-for="(item, index) in listData" :key="index">
 				<view class="head">
 					<view class="tap">{{ getTypeName(item.type) }}</view>
 					<view class="title">{{ item.name }}</view>
 				</view>
-				<u-line color="#EEEEEE" />
+				<!-- <u-line color="#EEEEEE" />
 				<view class="info">
 					<view class="item" v-for="(items, indexs) in item.userStudyRecordPhoto" :key="indexs">
 						<view class="imgbox">
@@ -19,15 +20,15 @@
 						</view>
 						<view class="time">{{ $method.timestampToTime(items.createTime, false) }}</view>
 					</view>
-				</view>
+				</view> -->
 				<u-line color="#EEEEEE" />
 				<view class="reason">
 					<view class="label">原因:</view>
-					<view class="val">拍照异常/时间异常</view>
+					<view class="val">{{item.auditReason}}</view>
 				</view>
 			</view>
 		</view>
-		<view class="btn" @click="getBtn">确认重学</view>
+		<view class="btn" @click="getBtn" v-if="rebuildShow">确认已阅读</view>
 	</view>
 </template>
 
@@ -39,16 +40,55 @@ export default {
 		return {
 			goodsId: null,
 			gradeId: null,
-			listData: []
+			listData: [],
+			orderGoodsId:'',
+			rebuildShow:false
 		};
 	},
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId || '';
 		this.goodsId = Number(option.goodsId);
 		this.gradeId = Number(option.gradeId);
 		this.getInfo();
+		this.orderInfo()
 	},
 	onShow() {},
 	methods: {
+		orderInfo() {
+			this.$api.orderInfo({
+				orderGoodsId:this.orderGoodsId
+			}).then(res => {
+				console.log(res)
+				if(res.data.code == 200) {
+					let sysTime = this.$method.timest();
+					console.log(res.data.data.serviceEndTime)
+					console.log(sysTime)
+					
+					if(res.data.data.serviceEndTime && res.data.data.serviceEndTime > +sysTime) { //学习有效期范围内
+						this.rebuildShow = true;
+					} else { //不在学校有效期范围内隐藏
+						this.rebuildShow = false;
+						return;
+					}
+					
+					if(res.data.data.classEndTime) { //配了班级有效期
+						
+						if(res.data.data.classEndTime > +sysTime) { //班级有效期没过期
+							this.rebuildShow = true;
+						} else { //过期
+							this.rebuildShow = false;
+							return;
+						}
+						
+					} else { //没配按学习有效期
+						
+					}
+					
+					
+					
+				}
+			})
+		},
 		seePhoto(option, index) {
 			var arrays = option.map((item, indexs) => {
 				return this.$method.splitImgHost(item.photo) + `?${indexs}`;
@@ -62,7 +102,8 @@ export default {
 			this.$api
 				.getcourseperiodcheat({
 					goodsId: this.goodsId,
-					gradeId: this.gradeId
+					gradeId: this.gradeId,
+					orderGoodsId:this.orderGoodsId
 				})
 				.then(res => {
 					if (res.data.code === 200) {
@@ -81,11 +122,12 @@ export default {
 					if(res.confirm){
 						self.$api.courseperiodrebuild({
 							goodsId: self.goodsId,
-							gradeId: self.gradeId
+							gradeId: self.gradeId,
+							orderGoodsId:self.orderGoodsId
 						}).then(res => {
 							if(res.data.code === 200){
 								uni.redirectTo({
-									url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId
+									url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId+'&orderGoodsId='+ self.orderGoodsId
 								})
 							}
 						})
@@ -192,6 +234,10 @@ page {
 		.label {
 			color: #666666;
 		}
+		
+		.val {
+			flex:1;
+		}
 	}
 }
 .btn {

+ 2 - 1
pages2/learn/menu.vue

@@ -1,8 +1,9 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="目录"></nav-bar>
 		<view class="menuWrap">
 			<view class="videoMain">
-				<video id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>
+				<video id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" @error="videoErrorCallback" :custom-cache="false" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>
 				<view class="videoTitle">
 					<view class="left">承发包模式-施工合同与物资采购合...</view>
 					<view class="right">

+ 185 - 32
pages2/learn/my_learn.vue

@@ -1,18 +1,19 @@
 <template>
 	<view class="safeArea">
+		<nav-bar title="目录"></nav-bar>
 		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
 			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#333" inactive-color="#999"></u-tabs>
 		</view>
 		<view class="learnWrap">
 			<template v-if="current === 0">
-				<!-- <view class="noData">您暂无相关学时审核记录哦~</view> -->
+				<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>
 					<view class="status">
 						<view class="label">审核状态:</view>
 						<view
 							class="val"
-							:class="item.periodStatus === -1 || item.periodStatus === 3 ? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2 ? 'blue' : ''"
+							:class="item.periodStatus === -1? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2  || item.periodStatus === 3 ? 'blue' : ''"
 						>
 							<text>
 								{{
@@ -23,11 +24,13 @@
 										: item.periodStatus === 2
 										? '等待审核'
 										: item.periodStatus === 3
+										? '审核中'
+										: item.periodStatus === 0
 										? '机构审核不通过'
 										: ''
 								}}
 							</text>
-							<view v-if="item.periodStatus === 3" style="font-size: 24rpx;color:#666;">
+							<view v-if="item.periodStatus === 0" style="font-size: 24rpx;color:#666;">
 								<text style="color:#FF3B30;">{{ item.rebuild }}节</text>
 								需要重修
@@ -46,47 +49,64 @@
 						<view class="label">审核提示:</view>
 						<view class="val color666" v-if="item.periodStatus === -1">您的学时还未修完,请尽快完成课程学习</view>
 						<view class="val color666" v-if="item.periodStatus === 2">学习完成后7-15个工作日完成学时审核。</view>
-						<view class="val color666" v-if="item.periodStatus === 3">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view>
+						<view class="val color666" v-if="item.periodStatus === 0">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view>
+						<view class="val color666" v-if="item.periodStatus === 3">会在7-15个工作日左右完成学时审核</view>
 					</view>
 					<view v-if="item.periodStatus !== 2">
 						<u-line color="#EEEEEE" />
 						<view v-if="item.periodStatus === -1">
-							<view class="btnBox"><view class="btn" @click="jumpPage(item, 1,index)">课程学习</view></view>
+							<view class="btnBox"><view class="btn" v-if="!showLearn(item)" @click="jumpPage(item, 1,index)">课程学习</view></view>
 						</view>
 						<view>
 							<view v-if="item.periodStatus === 1 && item.applyStatus === 1">
 								<view class="subTitle">{{ item.applyName }}</view>
+								<!-- <view class="status">
+									<view class="label">审核状态:</view>
+									<view class="val green">
+										<text>
+											机构审核通过
+										</text>
+									</view>
+								</view> -->
 								<view class="btnBox"><view class="btn" @click="jumpPage(item, 2,index)">预约考试</view></view>
 							</view>
 							<u-line color="#EEEEEE" v-if="item.periodStatus === 1 && item.applyStatus === 1" />
 							<view v-if="item.periodStatus === 1 && item.beforeStatus === 1">
 								<view class="subTitle">{{ item.beforeName }}</view>
+								<!-- <view class="status">
+									<view class="label">审核状态:</view>
+									<view class="val green">
+										<text>
+											机构审核通过
+										</text>
+									</view>
+								</view> -->
 								<view class="btnBox"><view class="btn" @click="jumpPage(item, 3,index)">进入刷题</view></view>
 							</view>
 						</view>
 
-						<view v-if="item.periodStatus === 3 && item.rebuildStatus === 0">
+						<view v-if="item.periodStatus === 0 && item.rebuildStatus === 0">
 							<view class="btnBox"><view class="btn" @click="jumpPage(item, 4,index)">查看详情</view></view>
 						</view>
-						<view v-if="item.periodStatus === 3 && item.rebuildStatus === 1">
+						<view v-if="item.periodStatus === 0 && item.rebuildStatus === 1">
 							<view class="btnBox"><view class="btn" @click="jumpPage(item, 5,index)">重修目录</view></view>
 						</view>
 					</view>
 				</view>
 			</template>
 			<template v-if="current === 1">
-				<view class="noData">您暂无相关学习凭证记录哦~</view>
-				<!-- <view class="learnItem card">
-					<view class="title">2020年二建建筑工程管理与实补这是商品名称</view>
+				<view class="noData" v-if="listData.length == 0">您暂无相关学习凭证记录哦~</view>
+				<view class="learnItem card" v-for="(item,index) in listData" :key="index">
+					<view class="title">{{item.title}}</view>
 					<view class="number">
 						<text class="label">编号:</text>
-						GZXY123456789
+						{{item.certificateCode}}
 					</view>
 					<view class="btnBox">
-						<view class="btn" @click="showPhoto">电子照片</view>
-						<view class="btn" @click="downloadCard">下载凭证</view>
+						<view class="btn" @click="showPhoto(item)">电子照片</view>
+						<view class="btn" @click="saveEwm(item)">下载凭证</view>
 					</view>
-				</view> -->
+				</view>
 			</template>
 		</view>
 	</view>
@@ -98,6 +118,7 @@ export default {
 	components: {},
 	data() {
 		return {
+			loading:false,
 			current: 0,
 			list: [
 				{
@@ -109,34 +130,52 @@ export default {
 			],
 			param:{
 				pageNum:1,
-				pageSize:10
+				pageSize:10,
+				orderGoodsId:''
 			},
 			total:0,
 			itemIndex:'',
-			listData: []
+			listData: [],
+			orderGoodsId:0,
+			sysTime:0
 		};
 	},
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId||''
+		console.log(this.orderGoodsId)
+		this.param.orderGoodsId = option.orderGoodsId||''
+		this.sysTime = +this.$method.timest();
 		this.getcourseperiodlistGoods();
 	},
 	onShow() {
 		if(this.itemIndex !== '') {
-			this.refreshByIndex();
+			if(this.current == 0) {
+				this.refreshByIndex();
+			}
+			
 		}
 	},
 	onReachBottom() {
-		console.log(111)
 		if(this.listData.length < this.total) {
 			this.param.pageNum++;
-			this.getcourseperiodlistGoods();
-			
+			if(this.current == 0) {
+				this.getcourseperiodlistGoods();
+			} else if(this.current == 1){
+				this.getUserCertificateList();
+			}
 		}
 	},
 	methods: {
+		showLearn(item) {
+			console.log(item.goodsName)
+			console.log(((item.interfacePushId > 0 && item.officialStatus != 1) || this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime || (item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this.sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && this.sysTime < item.learningTimeStart)))
+			return ((item.interfacePushId > 0 && item.officialStatus != 1) || this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime || (item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this.sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && this.sysTime < item.learningTimeStart))
+		},
 		refreshByIndex() {
 			this.$api.getcourseperiodlistGoods({
 				pageNum:this.itemIndex + 1,
-				pageSize:1
+				pageSize:1,
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				if (res.data.code === 200) {
 					this.$set(this.listData,this.itemIndex,res.data.rows[0])
@@ -159,32 +198,68 @@ export default {
 			this.itemIndex = index;
 			//int 1.课程学习 2.预约考试 3.进入刷题 4.查看详情 5.重修目录
 			if (int === 1) {
-				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
+				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}&orderGoodsId=${v.orderGoodsId}`);
 			}
 			if (int === 2) {
-				this.$navTo.togo(`/pages2/appointment/index?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
+				var data = {
+					goodsId: v.goodsId,
+					gradeId: v.gradeId
+				};
+				this.$api.getApplysubscribe(data).then(res => {
+					if (res.data.code === 500) {
+						uni.showModal({
+							showCancel: false,
+							content: res.data.msg
+						});
+					}
+					if (res.data.code === 200) {
+						this.$navTo.togo('/pages2/appointment/index', {
+							goodsId: v.goodsId,
+							gradeId: v.gradeId,
+							orderGoodsId:v.orderGoodsId
+						});
+					}
+				});
 			}
 			if (int === 3) {
 				this.appBeforeAddress(v.goodsId)
 			}
 			if (int === 4) {
-				this.$navTo.togo(`/pages2/learn/details?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
+
+				this.$navTo.togo(`/pages2/learn/details?goodsId=${v.goodsId}&gradeId=${v.gradeId}&orderGoodsId=${v.orderGoodsId}`);
 			}
 			if (int === 5) {
-				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
+				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}&orderGoodsId=${v.orderGoodsId}`);
 			}
 		},
+		getUserCertificateList() {
+			this.loading = true;
+			this.$api.getUserCertificateList(this.param).then(res => {
+				this.loading = false;
+				if (res.data.code === 200) {
+					this.listData = [...this.listData,...res.data.rows];
+					this.total = res.data.total;
+				}
+			}).catch(err => {
+				this.loading = false;
+			})
+		},
 		getcourseperiodlistGoods() {
+			this.loading = true;
 			this.$api.getcourseperiodlistGoods(this.param).then(res => {
+				this.loading = false;
 				if (res.data.code === 200) {
 					this.listData = [...this.listData,...res.data.rows];
 					this.total = res.data.total;
 				}
-			});
+			}).catch(err => {
+				this.loading = false;
+			})
 		},
 		appBeforeAddress(goodsId) {
 			this.$api.appBeforeAddress({
-				goodsId
+				goodsId,
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				if(res.data.code == 200) {
 					uni.navigateToMiniProgram({
@@ -202,12 +277,28 @@ export default {
 			})
 		},
 		change(index) {
+			if(this.loading) {
+				return;
+			}
 			this.current = index;
+			this.listData = [];
+			this.total = 0;
+			this.param = {
+				pageNum:1,
+				pageSize:10,
+				orderGoodsId:this.orderGoodsId
+			};
+			if(this.current == 0) {
+				this.getcourseperiodlistGoods();
+			} else if(this.current == 1){
+				this.getUserCertificateList();
+			}
 		},
-		showPhoto() {
+		showPhoto(item) {
+			
 			// 预览图片
 			uni.previewImage({
-				urls: ['https://file.xyyxt.net/oss/images/file/20220111.jpg'],
+				urls: [this.$method.splitImgHost(item.certificatePath,true,1000)],
 				longPressActions: {
 					itemList: ['发送给朋友', '保存图片', '收藏'],
 					success: function(data) {
@@ -219,11 +310,73 @@ export default {
 				}
 			});
 		},
-		downloadCard() {
+		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({
-			  url: 'https://gw.alipayobjects.com/os/bmw-prod/c134022a-1088-47e2-bb76-a33ec0519101.pdf?spm=a2c4g.11186623.0.0.cf863d1fUcFiPN&file=c134022a-1088-47e2-bb76-a33ec0519101.pdf',
+			  url: this.$method.splitImgHost(item.certificatePath,true),
 			  success: function (res) {
-				  console.log(999)
+				  console.log(res,'res')
 			    var filePath = res.tempFilePath;
 			    uni.openDocument({
 			      filePath: filePath,

+ 151 - 106
pages2/msg/detail.vue

@@ -1,5 +1,6 @@
 <template>
-	<view style="padding: 20rpx;">
+	<view>
+		<nav-bar title="消息详情"></nav-bar>
 		<view class="item">
 			<view class="title">{{ listData.systemStatus === 2 ? listData.informVo.informName : listData.systemStatus === 1 ? listData.remind : '' }}</view>
 			<view class="time">{{ $method.timestampToTime(listData.sendTime, false) }}</view>
@@ -41,6 +42,7 @@ export default {
 		return {
 			listData: {},
 			goodsData:{},
+			sysTime:0,
 			id: null,
 			img1: '/static/icon/msg_icon1.png',
 			img2: '/static/icon/msg_icon2.png',
@@ -49,6 +51,7 @@ export default {
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
+		this.sysTime = this.$method.timest();
 		this.id = Number(option.id);
 	},
 	onShow() {
@@ -65,6 +68,14 @@ export default {
 		};
 	},
 	methods: {
+		/**
+		 * 获取系统当前时间
+		 */
+		commonSystemTime() {
+			this.$api.commonSystemTime().then(res => {
+				this.sysTime = res.data.data;
+			})
+		},
 		//跳转页面
 		async jumpFuns(item,remindId) {
 			switch (remindId) {
@@ -81,99 +92,109 @@ export default {
 				case 12:
 				case 18:
 					
-					let currentTime = this.$method.getZeroTime();
-					console.log(currentTime)
-					console.log(item)
-					console.log(item.studyStartTime)
-					console.log(item.studyEndTime)
-					console.log(currentTime < item.studyStartTime || currentTime > item.studyEndTime)
-					if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
-						uni.showToast({
-							title:'不在学习有效期,不可以学习了哦',
-							icon:'none'
-						})
-						return;
-					}
-					
-					if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
-						uni.showToast({
-							title:'不在班级有效期,不能进入学习',
-							icon:'none'
-						})
-						return;
-					}
-					
-					if(item.learningStatus == 2) {
-						uni.showToast({
-							title:'开放学习时间待定,不能进入学习',
-							icon:'none'
-						})
-						return;
-					}
-					
-					if(item.classStatus == 0 ) {
-						uni.showToast({
-							title:'尚未开班,不能进入学习',
-							icon:'none'
-						})
-						return;
-					}
-					
-					if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
-						uni.showToast({
-							title:'不在开放学习时间,不能进入学习',
-							icon:'none'
-						})
-						return;
-					}
-					
-					if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+					//课程
+					if(item.goodsType == 1) {
+						let currentTime = this.$method.timest();
+						console.log(currentTime)
+						console.log(item)
+						console.log(item.studyStartTime)
+						console.log(item.studyEndTime)
+						console.log(currentTime < item.studyStartTime || currentTime > item.studyEndTime)
+						if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+							uni.showToast({
+								title:'不在学习有效期,不可以学习了哦',
+								icon:'none'
+							})
+							return;
+						}
 						
-						uni.showModal({
-							title:'提示',
-							content:'班级已过期,需要重新选班',
-							showCancel:false,
-							success:() => {
-								uni.navigateTo({
-									url:"/pages2/wd/class"
-								})
-							}
-						})
-						return;
-					}
-					
-					let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
-					
-					if(rebuildStatus == 0) {
-						this.$navTo.togo('/pages2/learn/details', {
-							gradeId:item.gradeId,
-							goodsId: item.goodsId
-						})
-						return;
-					}
-					
-					if(item.courseNum == 1 ) {
+						if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+							uni.showToast({
+								title:'不在班级有效期,不能进入学习',
+								icon:'none'
+							})
+							return;
+						}
 						
-						this.$api.courseCourseList({
-							pageNum:1,
-							pageSize:1,
-							goodsId:item.goodsId,
-							gradeId:item.gradeId
-						}).then(res => {
-							if(res.data.code == 200) {
-								uni.navigateTo({
-									url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
-								})
-							}
+						if(item.learningStatus == 2) {
+							uni.showToast({
+								title:'开放学习时间待定,不能进入学习',
+								icon:'none'
+							})
+							return;
+						}
+						
+						if(item.classStatus == 0 ) {
+							uni.showToast({
+								title:'尚未开班,不能进入学习',
+								icon:'none'
+							})
+							return;
+						}
+						
+						if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+							uni.showToast({
+								title:'不在开放学习时间,不能进入学习',
+								icon:'none'
+							})
+							return;
+						}
+						
+						if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+							
+							uni.showModal({
+								title:'提示',
+								content:'班级已过期,需要重新选班',
+								showCancel:false,
+								success:() => {
+									uni.navigateTo({
+										url:"/pages2/wd/class"
+									})
+								}
+							})
+							return;
+						}
+						
+						let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+						
+						if(rebuildStatus == 0) {
+							this.$navTo.togo('/pages2/learn/details', {
+								gradeId:item.gradeId,
+								goodsId: item.goodsId
+							})
+							return;
+						}
+						
+						if(item.courseNum == 1 ) {
+							
+							this.$api.courseCourseList({
+								pageNum:1,
+								pageSize:1,
+								goodsId:item.goodsId,
+								gradeId:item.gradeId
+							}).then(res => {
+								if(res.data.code == 200) {
+									uni.navigateTo({
+										url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+									})
+								}
+							});
+							return;
+						}
+						
+						this.$navTo.togo('/pages2/wd/course', {
+							id: item.goodsId,
+							gid: item.gradeId
+						});
+						// arsty = '立刻学习';
+						
+					//题库
+					} else if(item.goodsType ==2) {
+						this.$navTo.togo('/pages2/bank/question_detail', {
+							id: item.goodsId
 						});
-						return;
 					}
 					
-					this.$navTo.togo('/pages2/wd/course', {
-						id: item.goodsId,
-						gid: item.gradeId
-					});
-					// arsty = '立刻学习';
 					break;
 				case 2:
 				case 4:
@@ -238,7 +259,9 @@ export default {
 				goodsId: item.goodsId,
 				noteSecond: item.noteSecond,
 				sectionId: item.sectionId,
-				recordingUrl: item.recordingUrl
+				recordingUrl: item.recordingUrl,
+				moduleId:item.moduleId || 0,
+				chapterId:item.chapterId || 0
 			});
 		},
 		//跳转题库题目
@@ -293,23 +316,45 @@ export default {
 					}
 					this.listData = res.data.data;
 					if(res.data.data.goodsId) {
-						this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
-							this.goodsData = rs.data.data
-							if (
-								rs.data.data.goodsType === 3 &&
-								(res.data.data.remindId === 1 ||
-									res.data.data.remindId === 3 ||
-									res.data.data.remindId === 5 ||
-									res.data.data.remindId === 6 ||
-									res.data.data.remindId === 7 ||
-									res.data.data.remindId === 19 ||
-									res.data.data.remindId === 21 ||
-									res.data.data.remindId === 22)
-							) {
-								this.statusGO = false;
-							}
-						});
+						if(res.data.data.gradeId) {
+							this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
+								this.goodsData = rs.data.data
+								if (
+									rs.data.data.goodsType === 3 &&
+									(res.data.data.remindId === 1 ||
+										res.data.data.remindId === 3 ||
+										res.data.data.remindId === 5 ||
+										res.data.data.remindId === 6 ||
+										res.data.data.remindId === 7 ||
+										res.data.data.remindId === 19 ||
+										res.data.data.remindId === 21 ||
+										res.data.data.remindId === 22)
+								) {
+									this.statusGO = false;
+								}
+							});
+							
+							
+						} else {
+							this.$api.commonGoodsDetail(res.data.data.goodsId).then(rs => {
+								this.goodsData = rs.data.data
+								if (
+									rs.data.data.goodsType === 3 &&
+									(res.data.data.remindId === 1 ||
+										res.data.data.remindId === 3 ||
+										res.data.data.remindId === 5 ||
+										res.data.data.remindId === 6 ||
+										res.data.data.remindId === 7 ||
+										res.data.data.remindId === 19 ||
+										res.data.data.remindId === 21 ||
+										res.data.data.remindId === 22)
+								) {
+									this.statusGO = false;
+								}
+							});
+						}
 					}
+					
 				}
 			});
 		},

+ 3 - 1
pages2/msg/index.vue

@@ -1,5 +1,6 @@
 <template>
-	<view style="padding: 20rpx;">
+	<view>
+		<nav-bar title="我的消息"></nav-bar>
 		<view v-if="!listData.length"><u-empty text="消息列表为空" mode="message"></u-empty></view>
 		<view v-else v-for="(item, index) in listData" :key="index" style="padding-bottom: 20rpx;">
 			<navigator hover-class="none" :url="`/pages2/msg/detail?id=${item.id}`" class="item" :style="item.receiptStatus === 1 ? 'opacity: 0.7' : ''">
@@ -49,6 +50,7 @@ export default {
 			listData: [],
 			totals: 0,
 			formData: {
+				systemStatusList:'1,2',
 				pageNum: 1,
 				pageSize: 8
 			}

+ 11 - 2
pages2/order/confirm_list.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="确认订单"></nav-bar>
 		<view style="padding: 8rpx;padding-bottom: 98rpx;">
 			<view  >
 				<view class="item">
@@ -146,6 +147,7 @@ export default {
 				applyAreasJson:null,
 				examDateJson:null
 			},
+			fromCart:'',
 			isBK:'',//是不是补考商品
 		};
 	},
@@ -154,6 +156,10 @@ export default {
 	onLoad(option) {
 		this.id = option.id;
 		this.isBK = option.isBK
+		if(option.fromCart) {
+			this.fromCart = option.fromCart
+		}
+		
 		this.getDetail()
 	},
 	onShow() {
@@ -331,10 +337,13 @@ export default {
 			this.$store.commit('setShoppingCartList', {shoppingCartList  :checkGoodsList});
 			if(this.isBK == '1'){
 				this.$navTo.togo('/pages2/order/confirm_pay',{
-					isBK : '1'
+					isBK : '1',
+					fromCart:this.fromCart
 				});
 			}else{
-				this.$navTo.togo('/pages2/order/confirm_pay');
+				this.$navTo.togo('/pages2/order/confirm_pay',{
+					fromCart:this.fromCart
+				});
 			}
 		},
 		getDetail() {

+ 107 - 26
pages2/order/confirm_pay.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="订单支付"></nav-bar>
 		<view>
 			<view style="padding: 8rpx;">
 				<view class="box2">
@@ -42,6 +43,8 @@
 			</view>
 		</view>
 		<button class="bottomBtn" @click="pay()" :disabled="btnNo">确认支付</button>
+		
+		<u-modal v-model="showModal" :confirm-text="confirmText" cancel-text="知道了" cancel-color="#666666" confirm-color="rgba(0, 122, 255, 1);" :show-confirm-button="showConfirmButton" :show-cancel-button="true" :content="modalMsg" @cancel="modalCancel()" @confirm="modalConfirm()" ref="uModal" ></u-modal>
 	</view>
 	
 </template>
@@ -55,6 +58,8 @@ export default {
 	},
 	data() {
 		return {
+			showModal:false,
+			modalMsg:'',
 			list:[
 				{
 					name: '网课'
@@ -69,13 +74,18 @@ export default {
 			value:'wepay',
 			btnNo:false,
 			isBK:'',
-			totalPrice:0
+			fromCart:'',
+			hasPaying:false,
+			showConfirmButton:false,
+			totalPrice:0,
+			confirmText:''
 		};
 	},
 	onPullDownRefresh(){
 	},
 	onLoad(option) {
 		let self = this
+		this.fromCart = option.fromCart;
 		 console.log(self.shoppingCartList,6)
 		 let list = self.shoppingCartList
 		 this.isBK = option.isBK
@@ -116,36 +126,107 @@ export default {
 			let data = {goodsList:list}
 			
 			this.$api.placeSmallOrder(data).then(res => {
-				self.btnNo = false
+				console.log(res,'res')
 				if(res.data.code==200){
+					
 					uni.setStorageSync('updateCart',1) //提醒刷新购物车
-					let data = res.data.data
-					uni.requestPayment({
-					    provider: data.provider,
-					    nonceStr: data.nonceStr,
-					    package: data.package,
-					    signType: data.signType,
-					    paySign: data.sign,
-						timeStamp: String(data.timeStamp),
-					    success: function (res) {
-							uni.redirectTo({
-							    url: `/pages2/order/confirm_success?sn=${data.orderSn}&isBk=${self.isBK}`
-							});
-					        console.log('success:' + JSON.stringify(res));
-					    },
-					    fail: function (err) {
-					        console.log('fail:' + JSON.stringify(err));
-					    }
-					});
-				}else{
-					uni.showModal({
-						title: "提示",
-						content: res.data.msg,
-						showCancel: false
-					})
+					if(this.totalPrice == 0) { //免费商品
+						uni.redirectTo({
+						    url: `/pages2/order/confirm_success?sn=${res.data.orderSn}&isBk=${self.isBK}`
+						});
+					} else {
+						let data = res.data.data
+						uni.showLoading({
+							title:'支付中',
+							mask:true,
+						})
+						uni.requestPayment({
+						    provider: data.provider,
+						    nonceStr: data.nonceStr,
+						    package: data.package,
+						    signType: data.signType,
+						    paySign: data.sign,
+							timeStamp: String(data.timeStamp),
+						    success: function (res) {
+								
+									uni.hideLoading()
+								self.btnNo = false
+								uni.redirectTo({
+								    url: `/pages2/order/confirm_success?sn=${data.orderSn}&isBk=${self.isBK}`
+								});
+						        console.log('success:' + JSON.stringify(res));
+						    },
+						    fail: function (err) {
+								uni.hideLoading()
+								self.btnNo = false
+						        console.log('fail:' + JSON.stringify(err));
+						    }
+						});
+					}
+					
+				}else if(res.data.code == 510){ //有未支付订单
+					self.hasPaying = true;
+					self.btnNo = false
+					this.modalMsg = res.data.msg;
+					this.showConfirmButton = true;
+					this.confirmText = "跳转到【我的订单】\n查看未支付订单";
+					this.showModal = true;
+				} else if(res.data.code == 511) { //511 重复购买
+					self.hasPaying = false;
+					self.btnNo = false
+					this.modalMsg = res.data.msg;
+					this.showConfirmButton = true;
+					this.showModal = true;
+					
+					if(this.fromCart) {
+						console.log(this.fromCart)
+						this.confirmText = "返回购物车";
+					} else {
+						let type = '';
+						if(this.shoppingCartList.length == 1) {
+							type = this.shoppingCartList[0].goodsType
+						} else {
+							type = this.shoppingCartList[0].goodsType;
+							
+							if(this.shoppingCartList.find(item => item.goodsType != type)) {
+								type = 3;
+							}
+						}
+						this.confirmText = type == 1 ? "继续选课" : type == 2 ? "继续选题" : type == 3 ? "继续选购" :"";
+					}
+					
+				} else {
+					self.hasPaying = false;
+					self.btnNo = false
+					this.showConfirmButton = false;
+					this.modalMsg = res.data.msg;
+					this.showModal = true;
 				}
 			});
 		},
+		modalCancel() {
+			this.showModal = false;
+		},
+		modalConfirm() {
+			if(this.hasPaying) {
+				uni.navigateTo({
+					url:'/pages2/order/index?current=0'
+				})
+			} else {
+				if(this.fromCart) {
+					
+					uni.switchTab({
+						url:'/pages/shopping/shoppingCart'
+					})
+				} else {
+					
+					uni.switchTab({
+						url:'/pages/course/index'
+					})
+				}
+			}
+			
+		},
 		getOpenid(code){
 			let self = this
 			this.$api.wxOpenid({code:code}).then(res => {

+ 6 - 2
pages2/order/confirm_success.vue

@@ -1,10 +1,14 @@
 <template>
 	<view>
+		<nav-bar title="支付成功"></nav-bar>
 		<view>
 			<view style="padding: 8rpx;">
 				<view class="box1">
 					<view class="box1_t1">
-						<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon><text style="margin-left: 8rpx;">您的订单已支付成功!</text></view>
+						<u-icon name="checkmark-circle" color="#34C759" size="32"></u-icon><text style="margin-left: 8rpx;">您的订单已支付成功!</text>
+					</view>
+					
+					<view class="tip">*您可在“我的>我的订单”中查询</view>
 					<view style="display: flex;align-items: center;justify-content: center;" v-if="isBK === '1'">
 						<view class="btn1" @click="backMyStudent">
 							返回我的网课
@@ -39,7 +43,6 @@
 							<view class="txt_left">订单编号</view>
 							<view class="txt_right_sn">{{sn}}</view>
 						</view>
-						<view class="tip">*您可在“我的>我的订单”中查询</view>
 					</view>
 					<u-line color="#D6D6DB" />
 				</view>
@@ -184,6 +187,7 @@ export default {
 		margin-top: 30rpx;
 	}
 	.tip{
+		text-align: center;
 		font-size: 24rpx;
 		color: #999999;
 		height: 40rpx;

+ 136 - 28
pages2/order/index.vue

@@ -1,7 +1,8 @@
 <template>
 	<view>
-		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;">
-			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF"></u-tabs>
+		<nav-bar title="我的订单"></nav-bar>
+		<view style="width: 100%;text-align: center;position: fixed;height: 96rpx;z-index: 999;" >
+			<u-tabs :list="list" sticky :current="current" @change="change" active-color="#007AFF" :offset="[-1,0]"></u-tabs>
 		</view>
 		<view style="padding: 96rpx 8rpx 96rpx;">
 			<view v-if="!order.length" class="noData">您暂无相关订单哦~</view>
@@ -15,33 +16,55 @@
 							<view>{{ $method.timestampToTime(item.createTime) }}</view>
 						</view>
 						<u-line color="#D6D6DB" />
-						<view class="body"
-							v-for="(items, indexs) in item.orderGoodsList"
-							:key="indexs" @click="goCourse(items,item.orderStatus)"
-						>
-							<view class="body__content">
-								<image class="goods-img" :src="$method.splitImgHost(items.coverUrl)"></image>
-								<view class="goods-text">
-									<view class="goods-name">{{ items.goodsName }}</view>
-									<view class="goods-price">¥ {{ items.goodsRealPrice }}</view>
+						<view v-if="current == 3">
+							<view class="body"
+							>
+								<view class="body__content">
+									<image class="goods-img" :src="$method.splitImgHost(item.coverUrl)"></image>
+									<view class="goods-text">
+										<view class="goods-name">{{ item.goodsName }}</view>
+										<!-- <view class="goods-price">¥ {{ items.goodsRealPrice }}</view> -->
+									</view>
 								</view>
 							</view>
-							<view style="display: flex;flex-direction: row-reverse;padding: 10rpx 0;">
-								<view class="btn2" v-if="items.refundStatus === 0&&item.orderFrom === 2&&(item.orderStatus === 1 || item.orderStatus === 2 || item.orderStatus === 3)&&(items.goodsType == '1' || items.goodsType == '2')" @click.stop="refund(item.orderSn,items.goodsId)">退款</view>
+						</view>
+						<view v-else >
+							<view class="body"
+								v-for="(items, indexs) in item.orderGoodsList"
+								:key="indexs" @click="goCourse(items,item.orderStatus)"
+							>
+								<view class="body__content">
+									<image class="goods-img" :src="$method.splitImgHost(items.coverUrl)"></image>
+									<view class="goods-text">
+										<view class="goods-name">{{ items.goodsName }}</view>
+										<view class="goods-price">¥ {{ items.goodsRealPrice }}</view>
+									</view>
+								</view>
+								<view style="display: flex;flex-direction: row-reverse;padding: 10rpx 0;">
+									<view class="btn2" v-if="items.refundStatus === 0&&(item.orderFrom === 2 || item.orderFrom === 3)&&(item.orderStatus === 1 || item.orderStatus === 2 || item.orderStatus === 3)&&(items.goodsType == '1' || items.goodsType == '2')" @click.stop="refund(item.orderSn,items.goodsId)">退款</view>
+									<view v-if="items.refundStatus == 2"> 已退款</view>
+								</view>
 							</view>
 						</view>
+						
 						<u-line color="#D6D6DB" />
-						<view class="footer">
+						<view class="footer" v-if="current == 3">
+							<view>
+								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">退款金额</text>
+								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥{{ item.refundFee }}</text>
+							</view>
+						</view>
+						<view class="footer" v-else>
 							<view>
 								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">共{{ item.orderGoodsList.length }}项</text>
 								<text style="color: #333;font-size: 30rpx;font-weight: bold;">合计</text>
 								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥{{ item.payPrice }}</text>
 							</view>
 							<view style="display: flex;align-items: center;">
-								<view class="btn2" v-if="item.orderStatus === 0&&item.orderFrom === 2" @click="resumeOrder(item)">继续支付</view>
+								<view class="btn2" v-if="item.orderStatus === 0&&(item.orderFrom === 2 || item.orderFrom === 3)" @click="resumeOrder(item)">继续支付</view>
 								<!-- <view class="btn2" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="againBuy(item)">重新购买</view> --> 
-								<view class="btn1" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="delOrder(item)">删除订单</view>
-								<view class="btn1" @click="closeOrder(item)" v-if="item.orderStatus === 0">取消订单</view>
+								<view class="btn1" v-if="(item.orderStatus === -1 || item.orderStatus === -2)&&(item.orderFrom === 2 || item.orderFrom === 3)" @click="delOrder(item)">删除订单</view>
+								<view class="btn1" @click="closeOrder(item)" v-if="item.orderStatus === 0 &&(item.orderFrom === 2 || item.orderFrom === 3)">取消订单</view>
 							</view>
 						</view>
 					</view>
@@ -49,9 +72,9 @@
 			</template>
 			
 
-			<!-- <template v-if="current == 1 && order.length">
+			<template v-if="current == 1 && order.length">
 				<view class="apply-invoice" @click="goInvoice">发票申请</view>
-			</template> -->
+			</template>
 			
 		</view>
 	</view>
@@ -65,13 +88,20 @@ export default {
 		return {
 			list: [
 				{
-					name: '待支付'
+					name: '待支付',
+					count: 0
 				},
 				{
-					name: '已支付'
+					name: '已支付',
+					count: 0
 				},
 				{
-					name: '已取消'
+					name: '已取消',
+					count: 0
+				},
+				{
+					name: '已退款',
+					count: 0
 				}
 			],
 			current: 0,
@@ -79,17 +109,19 @@ export default {
 			formData: {
 				status: '0,1',
 				pageNum: 1,
-				pageSize: 5
+				pageSize: 10
 			},
 			pageNum1: 0,
 			pageNum2: 0,
-			pageNum3: 0
+			pageNum3: 0,
+			pageNum4: 0
 		};
 	},
 	// onPullDownRefresh() {},
 	onLoad(option) {
 		this.current = +option.current || 0;
 		this.getOrderList();
+		this.getOrderNum();
 		console.log(this.current)
 	},
 	onShow() {
@@ -110,6 +142,44 @@ export default {
 		this.getFY();
 	},
 	methods: {
+		getOrderNum() {
+			
+			this.$api.getorderlists({
+				status: '0,1',
+				pageNum: 1,
+				pageSize: 1,
+				orderStatus:'0'
+			}).then(res => {
+				if (res.data.code === 200) {
+					this.list[0].count = res.data.total;
+				}
+			});
+			
+			
+			this.$api.getorderlists({
+				status: '0,1',
+				pageNum: 1,
+				pageSize: 1,
+				orderStatus:'1,2,3,4'
+			}).then(res => {
+				if (res.data.code === 200) {
+					this.list[1].count = res.data.total;
+					
+				}
+			});
+			
+			this.$api.getorderlists({
+				status: '0,1',
+				pageNum: 1,
+				pageSize: 1,
+				orderStatus:'-1,-2'
+			}).then(res => {
+				if (res.data.code === 200) {
+					this.list[2].count = res.data.total;
+					
+				}
+			});
+		},
 		/**
 		 * 跳转发票申请页面
 		 */
@@ -264,7 +334,7 @@ export default {
 				}
 			}
 			if (this.current === 1) {
-				this.formData.orderStatus = '1,2';
+				this.formData.orderStatus = '1,2,3,4';
 				if (this.order.length >= this.pageNum2) {
 					return;
 				}
@@ -275,6 +345,21 @@ export default {
 					return;
 				}
 			}
+			
+			if(this.current == 3) {
+				if(this.order.length >= this.pageNum4) {
+					return;
+				}
+				
+				
+				this.formData.orderStatus = '';
+				this.$api.orderRefundList(this.formData).then(res => {
+					if(res.data.code == 200) {
+						this.order = this.order.concat(res.data.rows);
+					}
+				})
+				return;
+			}
 			this.$api.getorderlists(this.formData).then(res => {
 				if (res.data.code === 200) {
 					if (res.data.rows.length) {
@@ -290,32 +375,55 @@ export default {
 				this.formData.orderStatus = '0';
 			}
 			if (this.current === 1) {
-				this.formData.orderStatus = '1,2,3';
+				this.formData.orderStatus = '1,2,3,4';
 			}
 			if (this.current === 2) {
-				this.formData.orderStatus = '-1,-2,4';
+				this.formData.orderStatus = '-1,-2';
 			}
+			
+			this.order = [];
 			this.$api.getorderlists(this.formData).then(res => {
 				if (res.data.code === 200) {
 					if (this.current === 0) {
+						this.list[0].count = res.data.total;
 						this.pageNum1 = res.data.total;
 					}
 					if (this.current === 1) {
+						this.list[1].count = res.data.total;
 						this.pageNum2 = res.data.total;
 					}
 					if (this.current === 2) {
+						this.list[2].count = res.data.total;
 						this.pageNum3 = res.data.total;
 					}
 					this.order = res.data.rows;
 				}
 			});
 		},
+		orderRefundList() {
+			this.order = [];
+			this.formData.pageNum = 1;
+			this.formData.orderStatus = ''
+			this.$api.orderRefundList(this.formData).then(res => {
+				if(res.data.code == 200) {
+					this.order = res.data.rows;
+				}
+			})
+		},
 		change(index) {
 			if (this.current === index) {
 				return;
 			}
 			this.current = index;
-			this.getOrderList();
+			if(this.current == 3) { //退款订单
+			this.formData.status = '';
+				this.orderRefundList()
+			} else { //其他订单
+			
+				this.formData.status = '0,1';
+				this.getOrderList();
+			}
+			
 			uni.pageScrollTo({
 				scrollTop: 0
 			});

+ 61 - 38
pages2/plan/create.vue

@@ -1,5 +1,6 @@
 <template>
-	<view style="padding: 16rpx;">
+	<view>
+		<nav-bar title="创建计划"></nav-bar>
 		<view class="list_box">
 			<view class="item" v-for="(item, index) in list" :key="index">
 				<image :src="item.coverUrl"></image>
@@ -20,11 +21,11 @@
 					<view style="line-height: 40rpx;text-align: right;" v-if="form.category">{{ form.category }}</view>
 					<view v-else style="text-align: right;">请添加网课</view>
 				</u-form-item>
-				<u-form-item label="考试日期" prop="birth" :label-width="auto">
+				<!-- <u-form-item label="考试日期" prop="birth" :label-width="auto">
 					<picker mode="date" :start="stateDate" :value="form.date" @change="bindDateChange">
 						<view class="picker">{{ form.date }}</view>
 					</picker>
-				</u-form-item>
+				</u-form-item> -->
 				<u-form-item label="学习提醒" prop="birth" :label-width="auto">
 					<picker mode="time" :value="form.time" @change="bindTimeChange">
 						<view class="picker">{{ form.time }}</view>
@@ -56,13 +57,15 @@
 		</view>
 		<u-calendar v-model="calendar_show" :min-date="minDate" :mode="calendar" @change="change" :max-date="maxDate"></u-calendar>
 		<!-- 弹框-->
-		<u-popup v-model="week_show" mode="bottom">
-			<view style="height: 400rpx;text-align: center">
-				<view style="padding-top: 100rpx;padding-left: 40rpx;text-align: center;">
-					<u-checkbox-group @change="checkboxGroupChange">
-						<u-checkbox v-model="item.checked" v-for="(item, index) in list3" :key="index" :name="item.name">{{ item.name }}</u-checkbox>
+		<u-popup v-model="week_show" mode="bottom" @close="weekPopClose">
+			<view style="height: 450rpx;">
+				<view style="padding-top: 20rpx;padding-left: 40rpx;padding-right:40rpx;">
+					<u-checkbox-group @change="checkboxGroupChange" width="100%">
+						<u-checkbox v-model="item.checked" v-for="(item, index) in list3" :key="index" :name="item.name">
+							<view style="width:660rpx;">{{ item.name }}</view>
+						</u-checkbox>
 					</u-checkbox-group>
-					<view class="title_l" @click="week_submit" style="margin: 50rpx auto;">确认</view>
+					<!-- <view class="title_l" @click="week_submit" style="margin: 50rpx auto;">确认</view> -->
 				</view>
 			</view>
 		</u-popup>
@@ -74,8 +77,8 @@
 					<u-line></u-line>
 				</view>
 				<view class="popup_list" v-if="list2.length !== 0">
-					<scroll-view class="list_in" scroll-y="true">
-						<view class="popup_item" v-for="(item, index) in list2" :key="index">
+					<scroll-view @scrolltolower="scrolltolower" class="list_in" scroll-y="true">
+						<view class="popup_item" v-for="(item, index) in list2" :key="index" @click="selectToast(item)" v-if="index < indexRange">
 							
 								<u-checkbox
 									:disabled="item.disabled"
@@ -119,80 +122,88 @@ export default {
 			week_show: false,
 			form: {
 				category: '',
-				date: this.$method.timestampToTime(new Date().valueOf()/1000, true),
+				// date: this.$method.timestampToTime(new Date().valueOf()/1000, true),
 				time: '20:30',
 				startDate: '2021-05-07',
 				endDate: '2021-05-31',
-				week: '一、三、五'
+				week: '每周一、每周三、每周五'
 			},
 			studyNums: '?',
 			calendar: 'range',
 			list: [],
 			list2: [],
+			param:{
+				pageSize:10,
+				pageNum:0,
+			},
+			indexRange:10,
 			show: false,
-			stateDate:this.$method.timestampToTime(new Date().valueOf()/1000, true),
+			stateDate:this.$method.timestampToTime(new Date().valueOf()/1000, true).replace(/-/g,'/'),
 			calendar_show: false,
 			maxDate: '2023-01-01',
 			minDate: '',
 			businessId:'',
 			list3: [
 				{
-					name: '一',
+					name: '每周日',
+					checked: false,
+					disabled: false,
+					id: 0
+				},
+				{
+					name: '每周一',
 					checked: false,
 					disabled: false,
 					id: 1
 				},
 				{
-					name: '二',
+					name: '每周二',
 					checked: false,
 					disabled: false,
 					id: 2
 				},
 				{
-					name: '三',
+					name: '每周三',
 					checked: false,
 					disabled: false,
 					id: 3
 				},
 				{
-					name: '四',
+					name: '每周四',
 					checked: false,
 					disabled: false,
 					id: 4
 				},
 				{
-					name: '五',
+					name: '每周五',
 					checked: false,
 					disabled: false,
 					id: 5
 				},
 				{
-					name: '六',
+					name: '每周六',
 					checked: false,
 					disabled: false,
 					id: 6
 				},
-				{
-					name: '日',
-					checked: false,
-					disabled: false,
-					id: 0
-				}
 			],
 			selWeek: '',
 			index_review: 4,
-			array_review: [1, 2, 3, 4, 5, 6, 7]
+			array_review: [0,1, 2, 3, 4, 5, 6, 7]
 		};
 	},
 	onLoad(option) {
-		this.minDate = this.$method.timestampToTime(new Date().getTime() / 1000);
+		this.minDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
 		this.form.startDate = this.minDate;
-		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 30);
+		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 30).replace(/-/g,'/');
 		this.getGoods();
 		// this.getMyCourse();
 	},
 	onShow() {},
 	methods: {
+		scrolltolower(e) {
+			this.indexRange += 10;
+		},
 		getGoods() {
 			var self = this;
 			self.$api.courseGoodsList().then(res => {
@@ -204,7 +215,7 @@ export default {
 							res.data.rows[i].coverUrl = self.$method.splitImgHost(res.data.rows[i].coverUrl);
 						}
 					}
-					self.list2 = res.data.rows;
+					this.list2 = res.data.rows;
 				}
 			});
 		},
@@ -232,32 +243,32 @@ export default {
 			let ss = this.form.week.split('、');
 			let weekArray = [];
 			for (let i = 0; i < ss.length; i++) {
-				if (ss[i] == '日') {
+				if (ss[i] == '每周日') {
 					weekArray.push(0);
 				}
-				if (ss[i] == '一') {
+				if (ss[i] == '每周一') {
 					weekArray.push(1);
 				}
-				if (ss[i] == '二') {
+				if (ss[i] == '每周二') {
 					weekArray.push(2);
 				}
-				if (ss[i] == '三') {
+				if (ss[i] == '每周三') {
 					weekArray.push(3);
 				}
-				if (ss[i] == '四') {
+				if (ss[i] == '每周四') {
 					weekArray.push(4);
 				}
-				if (ss[i] == '五') {
+				if (ss[i] == '每周五') {
 					weekArray.push(5);
 				}
-				if (ss[i] == '六') {
+				if (ss[i] == '每周六') {
 					weekArray.push(6);
 				}
 			}
 			let data = {
 				goodsId: goodsId,
 				reminderTime: this.form.time,
-				examDate: this.$method.TimeTotimestamp(this.form.date),
+				// examDate: this.$method.TimeTotimestamp(this.form.date),
 				startTime: this.$method.TimeTotimestamp(this.form.startDate),
 				endTime: this.$method.TimeTotimestamp(this.form.endDate),
 				studyCount: weekArray,
@@ -305,6 +316,15 @@ export default {
 			console.log(34);
 			item.checked = !item.checked;
 		},
+		selectToast(item) {
+			if(item.disabled) {
+				uni.showToast({
+					icon:'none',
+					title:'选择网课(只能选同类课程)',
+					duration:3000
+				})
+			}
+		},
 		getMyCourse() {
 			let data = {
 				typeId: 1
@@ -338,6 +358,9 @@ export default {
 			this.form.week = this.selWeek;
 			this.week_show = false;
 		},
+		weekPopClose() {
+			this.form.week = this.selWeek;
+		},
 		openWeek() {
 			this.week_show = true;
 			this.selWeek = this.form.week;

+ 70 - 47
pages2/plan/edit.vue

@@ -1,5 +1,6 @@
 <template>
-	<view style="padding: 16rpx;">
+	<view>
+		<nav-bar title="修改计划"></nav-bar>
 		<view class="list_box">
 			<view class="item" v-for="(item, index) in list" :key="index">
 				<image :src="item.coverUrl"></image>
@@ -20,11 +21,11 @@
 					<view style="line-height: 40rpx;text-align: right;" v-if="form.category">{{ form.category }}</view>
 					<view v-else style="text-align: right;">请添加网课</view>
 				</u-form-item>
-				<u-form-item label="考试日期" prop="birth" :label-width="auto">
+				<!-- <u-form-item label="考试日期" prop="birth" :label-width="auto">
 					<picker mode="date" :value="form.date" @change="bindDateChange">
 						<view class="picker">{{ form.date }}</view>
 					</picker>
-				</u-form-item>
+				</u-form-item> -->
 				<u-form-item label="学习提醒" prop="birth" :label-width="auto">
 					<picker mode="time" :value="form.time" @change="bindTimeChange">
 						<view class="picker">{{ form.time }}</view>
@@ -56,13 +57,15 @@
 		</view>
 		<u-calendar v-model="calendar_show" :min-date="minDate" :mode="calendar" @change="change" :max-date="maxDate"></u-calendar>
 		<!-- 弹框-->
-		<u-popup v-model="week_show" mode="bottom">
-			<view style="height: 400rpx;text-align: center">
-				<view style="padding-top: 100rpx;padding-left: 40rpx;text-align: center;">
-					<u-checkbox-group @change="checkboxGroupChange">
-						<u-checkbox v-model="item.checked" v-for="(item, index) in list3" :key="index" :name="item.name">{{ item.name }}</u-checkbox>
+		<u-popup v-model="week_show" mode="bottom"  @close="weekPopClose">
+			<view style="height: 450rpx;">
+				<view style="padding-top: 20rpx;padding-left: 40rpx;padding-right:40rpx;">
+					<u-checkbox-group @change="checkboxGroupChange" width="100%">
+						<u-checkbox v-model="item.checked" v-for="(item, index) in list3" :key="index" :name="item.name">
+							<view style="width:660rpx;">{{ item.name }}</view>
+						</u-checkbox>
 					</u-checkbox-group>
-					<view class="title_l" @click="week_submit" style="margin: 50rpx auto;">确认</view>
+					<!-- <view class="title_l" @click="week_submit" style="margin: 50rpx auto;">确认</view> -->
 				</view>
 			</view>
 		</u-popup>
@@ -74,8 +77,8 @@
 					<u-line></u-line>
 				</view>
 				<view class="popup_list" v-if="list2.length !== 0">
-					<scroll-view class="list_in" scroll-y="true">
-						<view class="popup_item" v-for="(item, index) in list2" :key="index">
+					<scroll-view  @scrolltolower="scrolltolower" class="list_in" scroll-y="true">
+						<view class="popup_item" v-for="(item, index) in list2" :key="index" @click="selectToast(item)" v-if="index < indexRange">
 							
 								<u-checkbox
 									:disabled="item.disabled"
@@ -118,81 +121,89 @@ export default {
 			week_show: false,
 			form: {
 				category: '',
-				date: '2021-01-01',
+				// date: '2021-01-01',
 				time: '20:30',
 				startDate: '2021-05-07',
 				endDate: '2021-05-31',
-				week: '一、三、五'
+				week: '每周一、每周三、每周五'
 			},
 			businessId:'',
 			calendar: 'range',
 			list: [],
 			list2: [],
+			param:{
+				pageSize:10,
+				pageNum:0,
+			},
+			indexRange:10,
 			show: false,
 			calendar_show: false,
 			maxDate: '2023-01-01',
 			minDate: '',
 			list3: [
 				{
-					name: '一',
+					name: '每周日',
+					checked: false,
+					disabled: false,
+					id: 0
+				},
+				{
+					name: '每周一',
 					checked: false,
 					disabled: false,
 					id: 1
 				},
 				{
-					name: '二',
+					name: '每周二',
 					checked: false,
 					disabled: false,
 					id: 2
 				},
 				{
-					name: '三',
+					name: '每周三',
 					checked: false,
 					disabled: false,
 					id: 3
 				},
 				{
-					name: '四',
+					name: '每周四',
 					checked: false,
 					disabled: false,
 					id: 4
 				},
 				{
-					name: '五',
+					name: '每周五',
 					checked: false,
 					disabled: false,
 					id: 5
 				},
 				{
-					name: '六',
+					name: '每周六',
 					checked: false,
 					disabled: false,
 					id: 6
-				},
-				{
-					name: '日',
-					checked: false,
-					disabled: false,
-					id: 0
 				}
 			],
 			selWeek: '',
 			index_review: 4,
-			array_review: [1, 2, 3, 4, 5, 6, 7],
+			array_review: [0,1, 2, 3, 4, 5, 6, 7],
 			planId: null,
 			studyNums: '?'
 		};
 	},
 	onLoad(option) {
 		this.planId = Number(option.id);
-		this.minDate = this.$method.timestampToTime(new Date().getTime() / 1000);
+		this.minDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
 		this.form.startDate = this.minDate;
-		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 30);
+		this.form.endDate = this.$method.timestampToTime(new Date().getTime() / 1000 + 24 * 3600 * 30).replace(/-/g,'/');
 		this.getGoods();
 		this.getInfo();
 	},
 	onShow() {},
 	methods: {
+		scrolltolower(e) {
+			this.indexRange += 10;
+		},
 		getGoods() {
 			var self = this;
 			self.$api.courseGoodsList().then(res => {
@@ -232,32 +243,32 @@ export default {
 			let ss = this.form.week.split('、');
 			let weekArray = [];
 			for (let i = 0; i < ss.length; i++) {
-				if (ss[i] == '日') {
+				if (ss[i] == '每周日') {
 					weekArray.push(0);
 				}
-				if (ss[i] == '一') {
+				if (ss[i] == '每周一') {
 					weekArray.push(1);
 				}
-				if (ss[i] == '二') {
+				if (ss[i] == '每周二') {
 					weekArray.push(2);
 				}
-				if (ss[i] == '三') {
+				if (ss[i] == '每周三') {
 					weekArray.push(3);
 				}
-				if (ss[i] == '四') {
+				if (ss[i] == '每周四') {
 					weekArray.push(4);
 				}
-				if (ss[i] == '五') {
+				if (ss[i] == '每周五') {
 					weekArray.push(5);
 				}
-				if (ss[i] == '六') {
+				if (ss[i] == '每周六') {
 					weekArray.push(6);
 				}
 			}
 			let data = {
 				goodsId: goodsId,
 				reminderTime: this.form.time,
-				examDate: this.$method.TimeTotimestamp(this.form.date),
+				// examDate: this.$method.TimeTotimestamp(this.form.date),
 				startTime: this.$method.TimeTotimestamp(this.form.startDate),
 				endTime: this.$method.TimeTotimestamp(this.form.endDate),
 				studyCount: weekArray,
@@ -305,14 +316,23 @@ export default {
 			console.log(34);
 			item.checked = !item.checked;
 		},
+		selectToast(item) {
+			if(item.disabled) {
+				uni.showToast({
+					icon:'none',
+					title:'选择网课(只能选同类课程)',
+					duration:3000
+				})
+			}
+		},
 		getInfo(int) {
 			var self = this;
 			this.$api.systemplanInfo({planId:this.planId}).then(res => {
-				this.form.date = this.$method.timestampToTime(res.data.data.examDate);
+				this.form.date = this.$method.timestampToTime(res.data.data.examDate).replace(/-/g,'/');
 				this.form.time = res.data.data.reminderTime;
-				this.form.startDate = this.$method.timestampToTime(res.data.data.startTime);
-				this.form.endDate = this.$method.timestampToTime(res.data.data.endTime);
-				this.index_review = res.data.data.studyDay - 1;
+				this.form.startDate = this.$method.timestampToTime(res.data.data.startTime).replace(/-/g,'/');
+				this.form.endDate = this.$method.timestampToTime(res.data.data.endTime).replace(/-/g,'/');
+				this.index_review = res.data.data.studyDay;
 				this.form.week = res.data.data.studyCount;
 				res.data.data.goodsVos.forEach(item => {
 					item.coverUrl = this.$method.splitImgHost(item.coverUrl)
@@ -323,31 +343,31 @@ export default {
 				var numWeek = [];
 				this.form.week.forEach((items, indexs) => {
 					if (items === 1) {
-						numWeek.push('一');
+						numWeek.push('每周一');
 						return;
 					}
 					if (items === 2) {
-						numWeek.push('二');
+						numWeek.push('每周二');
 						return;
 					}
 					if (items === 3) {
-						numWeek.push('三');
+						numWeek.push('每周三');
 						return;
 					}
 					if (items === 4) {
-						numWeek.push('四');
+						numWeek.push('每周四');
 						return;
 					}
 					if (items === 5) {
-						numWeek.push('五');
+						numWeek.push('每周五');
 						return;
 					}
 					if (items === 6) {
-						numWeek.push('六');
+						numWeek.push('每周六');
 						return;
 					}
 					if (items === 0) {
-						numWeek.push('日');
+						numWeek.push('每周日');
 						return;
 					}
 				});
@@ -369,6 +389,9 @@ export default {
 			this.form.week = this.selWeek;
 			this.week_show = false;
 		},
+		weekPopClose() {
+			this.form.week = this.selWeek;
+		},
 		openWeek() {
 			this.week_show = true;
 			this.selWeek = this.form.week;

+ 385 - 134
pages2/plan/index.vue

@@ -1,8 +1,53 @@
 <template>
-	<view style="padding: 16rpx;">
+	<view >
+		<nav-bar title="学习计划"></nav-bar>
 		<view v-if="havePlan">
 			<view class="card" v-if="havePlan">
-				<view class="date_t1">
+				<swiper :style="{height:isOpen?'550rpx':'260rpx'}" @change="swiperChange" class="swiper"  :current="swiperIndex" :duration="300">
+					<swiper-item v-for="(swiperItem,swiperIndex) in swiperList" :key="swiperIndex">
+						<view class="date_t1">
+							<u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon>
+							<text style="padding: 0 15rpx;">{{ swiperItem.year }}年 {{ swiperItem.month }}月</text>
+							<u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
+						</view>
+						<view style="width: 100%;margin-top: 20rpx;">
+							<view v-for="(item, index) in date" :key="index" class="card_date">{{ item }}</view>
+						</view>
+						<view style="width: 100%;margin-top: 20rpx;">
+							<view v-for="(item, index) in swiperItem.dayStudyList" :key="index" class="date_num">
+								<view v-if="item.color == 0" @click="itemClick(item,index,swiperItem)" class="date_num_color0" :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}" v-show="item.date > 0">
+									{{ item.date }}
+									<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+									<view v-if="item.dot" class="date_dot"></view>
+								</view>
+								<view v-if="item.color == 1" @click="itemClick(item,index,swiperItem)" class="date_num_color1"  :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
+									{{ item.date }}
+									<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+									<view v-if="item.dot" class="date_dot"></view>
+								</view>
+								<view v-if="item.color == 2" @click="itemClick(item,index,swiperItem)" class="date_num_color2"  :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
+									{{ item.date }}
+									<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+									<view v-if="item.dot" class="date_dot"></view>
+								</view>
+								<view v-if="item.color == 3" @click="itemClick(item,index,swiperItem)" class="date_num_color3"  :class="{active_color:(swiperItem.year+'-'+swiperItem.month+'-'+item.date) == activeDate}">
+									{{ item.date }}
+									<view v-if="item.note > 0" class="date_note">{{ item.note }}</view>
+									<view v-if="item.dot" class="date_dot"></view>
+								</view>
+							</view>
+						</view>
+						<view style="width: 100%;display: flex;justify-content: center;" v-if="isOpen == false">
+							<view @click="oepn_calendar(swiperItem)" style="height: 20rpx;width: 40rpx;padding:20rpx 0;"><view class="date_line"></view></view>
+						</view>
+						<view style="width: 100%;display: flex;justify-content: center;" v-else>
+							<image class="date_line_close" @click="close_calendar(swiperItem)" src="/static/close_card.png"></image>
+						</view>
+					</swiper-item>
+					
+				</swiper>
+				
+				<!-- <view class="date_t1">
 					<u-icon name="arrow-left" size="28" v-if="havePreviousMonth" @click="swipeMonth(-1)"></u-icon>
 					<text style="padding: 0 15rpx;">{{ calendarStudyVo.year }}年 {{ calendarStudyVo.month }}月</text>
 					<u-icon name="arrow-right" size="28" v-if="haveNextMonth" @click="swipeMonth(1)"></u-icon>
@@ -39,9 +84,10 @@
 				</view>
 				<view style="width: 100%;display: flex;justify-content: center;" v-else>
 					<image class="date_line_close" @click="close_calendar" src="/static/close_card.png"></image>
-				</view>
+				</view> -->
+				
 				<view v-for="(item, index) in workList" :key="index">
-					<view style="margin-left: 30rpx;margin-top: 10rpx;display: flex;align-items: center;" @click="jumpDetail(item)">
+					<view style="padding-left: 30rpx;padding-top: 10rpx;display: flex;align-items: center;background:#fff;" @click="jumpDetail(item)">
 						<text class="date_t2">{{ item.goodsName }}</text>
 						<view class="circle_num" style="margin-left: 20rpx;">{{ item.classHours }}</view>
 					</view>
@@ -64,8 +110,8 @@
 							</u-row>
 							<scroll-view style="white-space: nowrap" class="scroll-view_H" scroll-x="true">
 								<view style="margin-top: 30rpx;display: inline-block;width:296rpx;margin-right: 30rpx;" v-for="(items, indexs) in item.goodsVos" :key="indexs">
-									<image :src="$method.splitImgHost(item.goodsVos[0].coverUrl)" class="r_image"></image>
-									<view class="r_t2">{{ item.goodsVos[0].goodsName }}</view>
+									<image :src="$method.splitImgHost(items.coverUrl)" class="r_image"></image>
+									<view class="r_t2">{{ items.goodsName }}</view>
 								</view>
 							</scroll-view>
 
@@ -93,14 +139,17 @@
 			<view class="newPlan" @click="newPlan()">新建计划</view>
 		</view>
 		<view v-else class="tipBox">
-			<view class="dis_ffs" v-if="goodsList.length">
-				<view class="tip">您暂无相关计划哦~</view>
-				<view class="tipBtn" @click="newPlan()">马上制定</view>
-			</view>
-			<view class="dis_ffs" v-else>
-				<view class="tip">您暂无课程可以制定计划哦~</view>
-				<view class="tipBtn" @click="planNow()">马上选课</view>
-			</view>
+			<template v-if="isLoaded">
+				<view class="dis_ffs" v-if="goodsList.length">
+					<view class="tip">您暂无相关计划哦~</view>
+					<view class="tipBtn" @click="newPlan()">马上制定</view>
+				</view>
+				<view class="dis_ffs" v-else>
+					<view class="tip">您暂无课程可以制定计划哦~</view>
+					<view class="tipBtn" @click="planNow()">马上选课</view>
+				</view>
+			</template>
+			
 		</view>
 	</view>
 </template>
@@ -109,11 +158,14 @@
 export default {
 	data() {
 		return {
+			swiperIndex:0,
+			isLoaded:false, //是否请求完毕
 			monthIndex: 0,
 			haveNextMonth: false,
 			havePreviousMonth: false,
 			showDayList: [],
 			workList: [],
+			swiperList:[],
 			calendarStudyVo: {},
 			index: 0,
 			date: ['日', '一', '二', '三', '四', '五', '六'],
@@ -180,7 +232,7 @@ export default {
 			],
 			activeDate:'',
 			dayStudyList: [],
-			listItem: {},
+			listItem: null,
 			currentMonth: 0,
 			havePlan: false,
 			goodsList: [] //用户拥有的商品
@@ -198,18 +250,18 @@ export default {
 		this.getList();
 	},
 	methods: {
-		itemClick(item,index) {
+		itemClick(item,index,swiperItem) {
 			// console.log(item)
-			this.activeDate = item.date;
-			this.workList = this.getStudyCourseByDay();
+			this.activeDate = `${swiperItem.year}-${swiperItem.month}-${item.date}`;
+			this.workList = this.getStudyCourseByDay(swiperItem);
 		},
 		/**
 		 * 根据选中日期获取需要学习的课程
 		 */
-		getStudyCourseByDay() {
+		getStudyCourseByDay(swiperItem) {
 			let courseList = [];
-			this.showDayList.forEach(day => {
-				if(day.date == this.activeDate) {
+			swiperItem.dayStudyList.forEach(day => {
+				if(`${swiperItem.year}-${swiperItem.month}-${day.date}` == this.activeDate) {
 					if(day.daySectionList) {
 						day.daySectionList.forEach(section => {
 							this.listItem.goodsVos.forEach(vos => {
@@ -221,7 +273,7 @@ export default {
 					}
 				}
 			})
-			
+			console.log(courseList)
 			return courseList;
 		},
 		planNow(){
@@ -232,6 +284,7 @@ export default {
 		getUserGoodsList() {
 			this.$api.courseGoodsList().then(res => {
 				if (res.data.code === 200) {
+					this.isLoaded = true;
 					this.goodsList = res.data.rows;
 				}
 			});
@@ -249,142 +302,327 @@ export default {
 			});
 		},
 		swipeMonth(index) {
-			console.log(index,198)
-			this.isOpen = false;
+			this.swiperIndex = this.swiperIndex + index
+			
+			console.log(this.swiperIndex)
+			// console.log(index,198)
+			// this.isOpen = false;
 			this.haveNextMonth = false;
 			this.havePreviousMonth = false;
-			this.monthIndex = this.monthIndex + index;
-			this.currentMonth = this.currentMonth + index;
-			let item = this.listItem.calendarStudyVo[this.monthIndex];
-			this.calendarStudyVo = item;
-			this.activeDate = '';
-			// this.workList = this.calendarStudyVo.goodsVos;
-			this.workList = this.getStudyCourseByDay();
-			if (this.monthIndex > 0) {
+			// this.monthIndex = this.monthIndex + index;
+			// this.currentMonth = this.currentMonth + index;
+			// let item = this.listItem.calendarStudyVo[this.monthIndex];
+			// this.calendarStudyVo = item;
+			// this.activeDate = '';
+			// // this.workList = this.calendarStudyVo.goodsVos;
+			// this.workList = this.getStudyCourseByDay();
+			if (this.swiperIndex > 0) {
 				this.havePreviousMonth = true;
 			}
-			if (this.monthIndex < this.listItem.calendarStudyVo.length - 1) {
+			if (this.swiperIndex < this.swiperList.length - 1) {
 				this.haveNextMonth = true;
 			}
-			this.dealDayList();
+			// this.dealDayList();
 		},
-		dealMonth() {
-			let date = new Date();
-			let currentMonth = date.getMonth() + 1;
+		swiperChange(e) {
+			this.swiperIndex = e.detail.current;
 			this.haveNextMonth = false;
 			this.havePreviousMonth = false;
-			this.workList = this.getStudyCourseByDay();
-			// this.workList = this.listItem.goodsVos;
-			if (this.listItem !== undefined) {
-				for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
-					let item = this.listItem.calendarStudyVo[i];
-					if (item.month == currentMonth) {
-						this.monthIndex = i;
-						this.calendarStudyVo = item;
-						if (i > 0) {
-							this.havePreviousMonth = true;
+			if (this.swiperIndex > 0) {
+				this.havePreviousMonth = true;
+			}
+			if (this.swiperIndex < this.swiperList.length - 1) {
+				this.haveNextMonth = true;
+			}
+		},
+		dealMonth(isFirst) {
+			//初始化
+			if(isFirst) {
+				if (this.listItem != null) {
+					this.swiperList = [];
+					this.swiperIndex = 0;
+					for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
+						let item = this.listItem.calendarStudyVo[i];
+						let firstItem = item.dayStudyList[0]
+						for (let j = 0; j < firstItem.studyDay; j++) {
+							 //补齐1号前的日数凑满一周
+							item.dayStudyList.unshift({ date: 0 });
+						} 
+						
+							
+						for(let k = 0; k < item.dayStudyList.length; k += 7) {
+							this.swiperList.push({
+								dayStudyList:item.dayStudyList.slice(k,k+7),
+								year: item.year,
+								month: item.month
+							})
+						}
+						
+						
+					}
+					
+					let date = new Date();
+					let currentMonth = date.getMonth() + 1;
+					
+					for(let i = 0; i < this.swiperList.length; i++) {
+						if(this.swiperList[i].month == currentMonth) {
+							this.swiperIndex = i;
+							
+							if (i > 0) {
+								this.havePreviousMonth = true;
+							}
+							if (i < this.swiperList.length - 1) {
+								this.haveNextMonth = true;
+							}
+							break;
+						}
+					}
+					
+					
+					this.dealDayList()
+				}
+			} else {  //非初始化
+				if(this.isOpen) {  //点击展开日历
+					
+					this.haveNextMonth = false;
+					this.havePreviousMonth = false;
+					let currentMonth = this.listItem.calendarStudyVo.find(item => item.month == this.swiperList[this.swiperIndex].month).month;
+					this.swiperList = []
+					// this.swiperList = [];
+					if (this.listItem != null) {
+						for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
+							let item = this.listItem.calendarStudyVo[i];
+							let firstItem = item.dayStudyList[0]
+							for (let j = 0; j < firstItem.studyDay; j++) {
+								 //补齐1号前的日数凑满一周
+								item.dayStudyList.unshift({ date: 0 });
+							} 
+							console.log(currentMonth)
+							if (item.month == currentMonth) {
+								this.swiperIndex = i;
+								if (i > 0) {
+									this.havePreviousMonth = true;
+								}
+								if (i < this.listItem.calendarStudyVo.length - 1) {
+									this.haveNextMonth = true;
+								}
+							}
+							
+							this.swiperList.push(this.listItem.calendarStudyVo[i])
+						}
+						
+						this.dealDayList();
+					}
+				} else { //点击收起日历
+					let currentMonth = this.listItem.calendarStudyVo.find(item => item.month == this.swiperList[this.swiperIndex].month).month;
+					this.swiperList = [];
+					for (let i = 0; i < this.listItem.calendarStudyVo.length; i++) {
+						let item = this.listItem.calendarStudyVo[i];
+						let firstItem = item.dayStudyList[0]
+						for (let j = 0; j < firstItem.studyDay; j++) {
+							 //补齐1号前的日数凑满一周
+							item.dayStudyList.unshift({ date: 0 });
+						} 
+						
+						
+						
+						//构建日历表
+						for(let k = 0; k < item.dayStudyList.length; k += 7) {
+							this.swiperList.push({
+								dayStudyList:item.dayStudyList.slice(k,k+7),
+								year: item.year,
+								month: item.month
+							})
 						}
-						if (i < this.listItem.calendarStudyVo.length - 1) {
-							this.haveNextMonth = true;
+						
+					}
+					
+					for(let i = 0; i < this.swiperList.length; i++) {
+						if(this.swiperList[i].month == currentMonth) {
+							this.swiperIndex = i;
+							
+							if (i > 0) {
+								this.havePreviousMonth = true;
+							}
+							if (i < this.swiperList.length - 1) {
+								this.haveNextMonth = true;
+							}
+							break;
 						}
 					}
+					
+					console.log(this.swiperIndex,'this.swiperIndex')
+					
+					
+					this.dealDayList()
 				}
-				this.dealDayList();
 			}
+			
 		},
 		openEdit(item) {
 			this.activeDate = '';
 			this.listItem = item;
+			this.swiperIndex = 0;
 			this.isOpen = false;
-			this.dealMonth();
+			this.dealMonth(true);
 		},
 		dealDayList() {
-			let firstItem = this.calendarStudyVo.dayStudyList[0];
-			this.calendarStudyVo.miniDayStudyList = []; //创建缩放的数组
-			let date = new Date();
-			let num = date.getDate();
-			//如果不是当前月,默认显示第一周
-			if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
-				num = 1;
-			}
-			 for (let i = 0; i < firstItem.studyDay; i++) {
-				 //补齐1号前的日数凑满一周
-				this.calendarStudyVo.dayStudyList.unshift({ date: 0 });
-			} 
-			let todayIndex;
-			let todayItem;
-			for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
-				let item = this.calendarStudyVo.dayStudyList[i];
-				item.color = 0;
-				if (item.date == num) {
-					if (date.getMonth() + 1 == this.calendarStudyVo.month) {
-						item.color = 3;
-					}
-					todayIndex = i;
-					todayItem = item;
-				}
-				if (item.perform == 1) {
-					item.color = 1;
+			
+			this.swiperList.forEach((swiper,index) => {
+				// let firstItem = swiper.dayStudyList[0]
+				// for (let i = 0; i < firstItem.studyDay; i++) {
+				// 	 //补齐1号前的日数凑满一周
+				// 	swiper.dayStudyList.unshift({ date: 0 });
+				// } 
+				
+				let date = new Date();
+				let num = date.getDate();
+				//如果不是当前月,默认显示第一周
+				if ((date.getMonth() + 1) != swiper.month) {
+					num = 1;
 				}
-				if (item.perform == 2) {
-					item.color = 2;
+				
+				let todayIndex;
+				let todayItem;
+				
+				for (let i = 0; i < swiper.dayStudyList.length; i++) {
+					let item = swiper.dayStudyList[i];
+					item.color = 0;
+					
+					if (item.date == num) {
+						if (date.getMonth() + 1 == swiper.month) {
+							item.color = 3;
+						}
+						todayIndex = i;
+						todayItem = item;
+					}
+					
+					if (item.perform == 1) {
+						item.color = 1;
+					}
+					if (item.perform == 2) {
+						item.color = 2;
+					}
+					
+					let today = this.$method.getDate(); //获取当前日期
+					let currentTime = this.$method.TimeTotimestamp(today.replace('-','/'))
+					let dateTime = this.$method.TimeTotimestamp(`${swiper.year}/${swiper.month}/${item.date}`)
+					
+					item.note = item.studyCourseKnob;
+					if ((item.note > 0) && (dateTime >= currentTime)) {
+						item.dot = true;
+					}
 				}
-				item.note = item.studyCourseKnob;
-				if (item.note > 0) {
-					item.dot = true;
+				
+				for (let i = 0; i < swiper.dayStudyList.length; i++) {
+					let item = swiper.dayStudyList[i];
+					
+					if (item.note > 0) {
+						item.note = 0;
+						swiper.dayStudyList.forEach(day => {
+							if(day.date == item.date) {
+								if(day.daySectionList) {
+									day.daySectionList.forEach(section => {
+										this.listItem.goodsVos.forEach(vos => {
+											if(vos.goodsId == section.goodsId) {
+												item.note += vos.classHours
+											}
+										})
+									})
+								}
+							}
+						})
+					}
 				}
-			}
+				
+			})
+			
+			// let firstItem = this.calendarStudyVo.dayStudyList[0];
+			// this.calendarStudyVo.miniDayStudyList = []; //创建缩放的数组
+			// let date = new Date();
+			// let num = date.getDate();
+			// //如果不是当前月,默认显示第一周
+			// if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
+			// 	num = 1;
+			// }
+			//  for (let i = 0; i < firstItem.studyDay; i++) {
+			// 	 //补齐1号前的日数凑满一周
+			// 	this.calendarStudyVo.dayStudyList.unshift({ date: 0 });
+			// } 
+			// let todayIndex;
+			// let todayItem;
+			// for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
+			// 	let item = this.calendarStudyVo.dayStudyList[i];
+			// 	item.color = 0;
+			// 	if (item.date == num) {
+			// 		if (date.getMonth() + 1 == this.calendarStudyVo.month) {
+			// 			item.color = 3;
+			// 		}
+			// 		todayIndex = i;
+			// 		todayItem = item;
+			// 	}
+			// 	if (item.perform == 1) {
+			// 		item.color = 1;
+			// 	}
+			// 	if (item.perform == 2) {
+			// 		item.color = 2;
+			// 	}
+			// 	item.note = item.studyCourseKnob;
+			// 	if (item.note > 0) {
+			// 		item.dot = true;
+			// 	}
+			// }
 			
-			let start 
-			start = todayIndex - todayItem.studyDay;
-			/* if(todayItem){
+			// let start 
+			// start = todayIndex - todayItem.studyDay;
+			// /* if(todayItem){
 				
-			}else{
-				//今天在下个月不存在,例如31号
-				todayIndex = this.calendarStudyVo.dayStudyList.length-1
-				todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
-				start = todayIndex - todayItem.studyDay;
-			} */
-			/* if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
-				todayIndex = 0
-				todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
-				start = 0;
-			} */
-			console.log(start,689)
-			/* this.calendarStudyVo.miniDayStudyList = []
-			for(let i=start;i<start + 7;i++){
-				this.calendarStudyVo.miniDayStudyList.push(this.calendarStudyVo.dayStudyList[i])
-			} */
-			console.log(this.calendarStudyVo.miniDayStudyList,789)
-			this.calendarStudyVo.miniDayStudyList = this.calendarStudyVo.dayStudyList.slice(start, start + 7);
-			this.showDayList = this.calendarStudyVo.miniDayStudyList;
-			console.log(this.showDayList)
+			// }else{
+			// 	//今天在下个月不存在,例如31号
+			// 	todayIndex = this.calendarStudyVo.dayStudyList.length-1
+			// 	todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
+			// 	start = todayIndex - todayItem.studyDay;
+			// } */
+			// /* if ((date.getMonth() + 1) != this.calendarStudyVo.month) {
+			// 	todayIndex = 0
+			// 	todayItem = this.calendarStudyVo.dayStudyList[todayIndex]
+			// 	start = 0;
+			// } */
+			// console.log(start,689)
+			// /* this.calendarStudyVo.miniDayStudyList = []
+			// for(let i=start;i<start + 7;i++){
+			// 	this.calendarStudyVo.miniDayStudyList.push(this.calendarStudyVo.dayStudyList[i])
+			// } */
+			// console.log(this.calendarStudyVo.miniDayStudyList,789)
+			// this.calendarStudyVo.miniDayStudyList = this.calendarStudyVo.dayStudyList.slice(start, start + 7);
+			// this.showDayList = this.calendarStudyVo.miniDayStudyList;
+			// console.log(this.showDayList)
 			
-			for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
-				let item = this.calendarStudyVo.dayStudyList[i];
+			// for (let i = 0; i < this.calendarStudyVo.dayStudyList.length; i++) {
+			// 	let item = this.calendarStudyVo.dayStudyList[i];
 				
-				if (item.note > 0) {
-					item.note = 0;
-					this.showDayList.forEach(day => {
-						if(day.date == item.date) {
-							if(day.daySectionList) {
-								day.daySectionList.forEach(section => {
-									this.listItem.goodsVos.forEach(vos => {
-										if(vos.goodsId == section.goodsId) {
-											item.note += vos.classHours
-										}
-									})
-								})
-							}
-						}
-					})
-				}
-			}
+			// 	if (item.note > 0) {
+			// 		item.note = 0;
+			// 		this.showDayList.forEach(day => {
+			// 			if(day.date == item.date) {
+			// 				if(day.daySectionList) {
+			// 					day.daySectionList.forEach(section => {
+			// 						this.listItem.goodsVos.forEach(vos => {
+			// 							if(vos.goodsId == section.goodsId) {
+			// 								item.note += vos.classHours
+			// 							}
+			// 						})
+			// 					})
+			// 				}
+			// 			}
+			// 		})
+			// 	}
+			// }
 			
 		},
 		async jumpDetail(item) {
 			
-			let currentTime = this.$method.getZeroTime();
+			let currentTime = this.$method.timest();
 			
 			if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
 				uni.showToast({
@@ -516,16 +754,23 @@ export default {
 			this.$api.getsystemplanlist({ status: 1 }).then(result => {
 				result.data.rows.forEach((item, index) => {
 					item.show = 'none';
+					item.studyNum = 0;
+					item.pitchNum = 0;
+					item.goodsVos.forEach(vos => {
+						item.pitchNum += vos.secAllNum
+						item.studyNum += vos.stuAllNum
+					})
 				});
 				self.list = result.data.rows;
 				if (result.data.rows.length > 0) {
 					self.listItem = self.list[0];
-					self.dealMonth();
-					if (self.list.length > 0) {
-						self.listItem = self.list[0];
-						self.dealMonth();
-						self.havePlan = true;
-					}
+					self.dealMonth(true);
+					self.havePlan = true;
+					// if (self.list.length > 0) {
+					// 	self.listItem = self.list[0];
+					// 	self.dealMonth();
+					// 	self.havePlan = true;
+					// }
 				} else {
 					self.havePlan = false;
 				}
@@ -562,10 +807,12 @@ export default {
 		},
 		close_calendar() {
 			this.isOpen = false;
+			this.dealMonth();
 			this.showDayList = this.calendarStudyVo.miniDayStudyList;
 		},
 		oepn_calendar() {
 			this.isOpen = true;
+			this.dealMonth();
 			this.showDayList = this.calendarStudyVo.dayStudyList;
 		},
 		random(min, max) {
@@ -575,7 +822,7 @@ export default {
 };
 </script>
 
-<style scope>
+<style scope lang="scss">
 .dis_ffs {
 	display: flex;
 	flex-direction: column;
@@ -822,7 +1069,11 @@ export default {
 	background: #ffffff;
 	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(47, 67, 121, 0.05);
 	border-radius: 24rpx;
-	padding-bottom: 20rpx;
+	padding-bottom:20rpx;
+	
+	.swiper {
+		height:550rpx;
+	}
 }
 page {
 	background: rgba(234,238,241,1);

+ 6 - 3
pages2/register/register.vue

@@ -16,8 +16,11 @@
 			<view style="margin: 30rpx 0;">
 				<view  style="display: flex;align-items: center;font-size: 24rpx;justify-content:center;">
 					<u-checkbox v-model="read" :label-disabled="false"></u-checkbox>
-					<view style="color: #666666;">我已认真阅读并同意</view>
-					<view style="color: #007AFF;" @click="agreementModal = true;">《祥粤云学堂服务协议》</view>
+					<view>
+						<view style="color: #666666;">我已认真阅读并同意</view>
+						<view style="color: #007AFF;" @click="agreementModal = true;">《用户使用协议》及《个人信息保护政策》</view>
+					</view>
+					
 				</view>
 			</view>
 			<button :disabled="isUse" class="loginBtn" :class="{able:canRegister()}" @click="submit">
@@ -295,7 +298,7 @@
 				<view class="footer">
 					<view v-if="isAgree" class="btn close" @click="agreementModal = false">关闭</view>
 					<view v-if="!isAgree" class="btn cancel" @click="refuseAgreement">取消</view>
-					<view v-if="!isAgree" class="btn ok" @click="agree">确定</view>
+					<view v-if="!isAgree" class="btn ok" @click="agree">同意并继续</view>
 				</view>
 			</view>
 		</u-popup>

+ 68 - 34
pages2/subject/collect.vue

@@ -1,18 +1,25 @@
 <template>
 	<view class="safeArea">
+		<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">
@@ -85,18 +92,35 @@ export default {
 			],
 			type:1,
 			total:0,
+			modalTop:0,
 			testList:[],
 			typeList:[],
 			goodsid:'',
+			orderGoodsId:'',
 			paperid:''
 		};
 	},
 	onPullDownRefresh() {},
 	onLoad(option) {
-		
+		this.orderGoodsId = option.orderGoodsId || '';
 		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() {
@@ -124,7 +148,7 @@ export default {
 		goodsCollectExamList() {
 			this.$api.goodsCollectExamList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.testList = res.data 
 				let total = 0;
@@ -138,7 +162,7 @@ export default {
 		collectQuestionTypeList() {
 			this.$api.collectQuestionTypeList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.typeList = res.data 
 				let total = 0;
@@ -150,6 +174,10 @@ export default {
 			})
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		/**
@@ -226,8 +254,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -241,30 +270,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{

+ 11 - 2
pages2/subject/collectBank.vue

@@ -1,5 +1,6 @@
 <template>
 	<view id="questionBank">
+		<nav-bar title="试卷"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -387,10 +388,12 @@ export default {
 			bankList: [],
 			collectList:[],
 			goodsId:'',
-			explain:''
+			explain:'',
+			orderGoodsId:'',
 		};
 	},
 	onLoad(option){
+		this.orderGoodsId = option.orderGoodsId||''
 		this.id = option.id;
 		this.explain = option.explain;
 		
@@ -895,9 +898,15 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.swiper {
+#questionBank {
 	width:100%;
 	height:100vh;
+	display: flex;
+	flex-direction: column;
+}
+.swiper {
+	width: 100%;
+	flex:1;
 }
 .lisSty {
 	margin-bottom: 16rpx;

+ 11 - 2
pages2/subject/collectTypeBank.vue

@@ -1,5 +1,6 @@
 <template>
 	<view id="questionBank">
+		<nav-bar title="试卷"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -387,10 +388,12 @@ export default {
 			bankList: [],
 			collectList:[],
 			type:'',
-			explain:''
+			explain:'',
+			orderGoodsId:'',
 		};
 	},
 	onLoad(option){
+		this.orderGoodsId = option.orderGoodsId || '';
 		this.type = option.type;
 		this.explain = option.explain;
 		
@@ -896,9 +899,15 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.swiper {
+#questionBank {
 	width:100%;
 	height:100vh;
+	display: flex;
+	flex-direction: column;
+}
+.swiper {
+	width: 100%;
+	flex:1;
 }
 .lisSty {
 	margin-bottom: 16rpx;

+ 66 - 34
pages2/subject/wrong.vue

@@ -1,18 +1,24 @@
 <template>
 	<view class="safeArea">
+		<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">
@@ -89,6 +95,8 @@ export default {
 			goodsid:'',
 			paperid:'',
 			total:0,
+			orderGoodsId:'',
+			modalTop:0,
 		};
 	},
 	onPullDownRefresh() {},
@@ -96,8 +104,24 @@ export default {
 		this.getData();
 	},
 	onLoad(option) {
+		this.orderGoodsId = option.orderGoodsId || ''
 		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() {
@@ -125,7 +149,7 @@ export default {
 		wrongRecordList() {
 			this.$api.wrongRecordList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.testList = res.data;
 				let total = 0;
@@ -139,7 +163,7 @@ export default {
 		wrongRecordTypeList() {
 			this.$api.wrongRecordTypeList({
 				paperId:this.paperid,
-				goodsId:this.goodsid
+				orderGoodsId:this.orderGoodsId
 			}).then(res => {
 				this.typeList = res.data;
 				
@@ -156,6 +180,10 @@ export default {
 			this.getData();
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		hideSceen(){
@@ -225,8 +253,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -240,30 +269,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{

+ 10 - 1
pages2/subject/wrongBank.vue

@@ -1,5 +1,6 @@
 <template>
 	<view id="questionBank">
+		<nav-bar title="错题"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -396,9 +397,11 @@ export default {
 			goodsId:'',
 			examId:'',
 			explain:'',
+			orderGoodsId:'',
 		};
 	},
 	onLoad(option){
+		this.orderGoodsId = option.orderGoodsId;
 		this.id = option.id || '';
 		this.examId = option.examId || '';
 		this.isFromReport = option.isFromReport;
@@ -1066,9 +1069,15 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.swiper {
+#questionBank {
 	width:100%;
 	height:100vh;
+	display: flex;
+	flex-direction: column;
+}
+.swiper {
+	width: 100%;
+	flex:1;
 }
 .lisSty {
 	margin-bottom: 16rpx;

+ 8 - 1
pages2/subject/wrongTypeBank.vue

@@ -1,5 +1,6 @@
 <template>
 	<view id="questionBank">
+		<nav-bar title="试卷"></nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank,bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -950,9 +951,15 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.swiper {
+#questionBank {
 	width:100%;
 	height:100vh;
+	display: flex;
+	flex-direction: column;
+}
+.swiper {
+	width: 100%;
+	flex:1;
 }
 .lisSty {
 	margin-bottom: 16rpx;

+ 268 - 19
pages2/verify/input.vue

@@ -1,6 +1,6 @@
 <template>
 	<view style="padding: 30rpx;">
-		
+		<nav-bar title="填写审核资料"></nav-bar>
 		<view v-show="!agreementModal">
 			<view class="topBox">
 				<view>
@@ -9,7 +9,7 @@
 				</view>
 				<view style="color: #007AFF;" @click="backPage">稍后再填</view>
 			</view>
-			<u-collapse v-if="remarkStatus" :item-style="itemStyle" event-type="close">
+			<u-collapse v-if="remarkStatus" :item-style="itemStyle" event-type="close" ref="collapse">
 				<u-collapse-item title="审核结果反馈">
 					<view style="padding-bottom: 30rpx;">
 						<text class="collapse-item">{{ remark }}</text>
@@ -97,7 +97,7 @@
 							:label-width="auto"
 							:prop="item.required ? item.fieldKey : ''"
 						>
-							<u-input v-model="form.apply_post" :placeholder="`请输入${item.fieldName}`" />
+							<u-input v-model="form.apply_post" :disabled="apply_post_disabled" :placeholder="`请输入${item.fieldName}`" />
 						</u-form-item>
 						<u-form-item
 							:key="index"
@@ -170,6 +170,15 @@
 							<u-upload
 								:show-progress="false"
 								:max-size="2097152"
+								:ref="
+									item.fieldKey === 'recent_photos'
+										? 'recent_photos'
+										: item.fieldKey === 'idcard_face_photo'
+										? 'idcard_face_photo'
+										: item.fieldKey === 'idcard_national_photo'
+										? 'idcard_national_photo'
+										: ''
+								"
 								@on-list-change="
 									item.fieldKey === 'recent_photos'
 										? changePhotoListHeader1($event)
@@ -302,6 +311,7 @@ import Handwriting from '@/common/signature.js';
 export default {
 	data() {
 		return {
+			gradeId:0,
 			errorType: ['message'],
 			agreementModal:true,
 			goodsData:{},
@@ -479,14 +489,14 @@ export default {
 				idcard_face_photo: [
 					{
 						required: true,
-						message: '请上传身份证正面照',
+						message: '请上传身份证人像面',
 						trigger: ['change', 'blur']
 					}
 				],
 				idcard_national_photo: [
 					{
 						required: true,
-						message: '请上传身份证国徽',
+						message: '请上传身份证国徽',
 						trigger: ['change', 'blur']
 					}
 				],
@@ -498,14 +508,20 @@ export default {
 					}
 				]
 			},
-			isRequired: false
+			apply_post_disabled:false,
+			isRequired: false,
+			orderGoodsId:0,
+			veryIdCard:'',
+			veryIdName:'',
 		};
 	},
 	created() {
 		this.$store.getters.dictObj;
 	},
 	async onLoad(option) {
+		this.orderGoodsId = Number(option.orderGoodsId)
 		this.goodsId = Number(option.id);
+		this.gradeId = Number(option.gradeId)
 		await this.getGoodsDetail()
 		this.getInfo();
 	},
@@ -543,12 +559,21 @@ export default {
 				
 				this.$api.goodsDetail(this.goodsId).then(res => {
 					this.goodsData = res.data.data;
+					if(this.goodsData.categoryName) {
+						this.form.apply_post = this.goodsData.categoryName;
+						if(this.goodsData.categoryName) {
+							this.apply_post_disabled = true;
+						}
+					}
 					resolve()
 				})
 			})
 		},
 		agree() {
 			this.agreementModal = false;
+			setTimeout(() => {
+				this.$refs.collapse.init()
+			},1000)
 		},
 		refuseAgreement() {
 			uni.navigateBack({
@@ -570,7 +595,165 @@ export default {
 			this.$set(this.form, 'name', '唐');
 			console.log(this.form.name, 123);
 		},
-		uploadDatas(data) {
+		
+		async uploadDatas(data) {
+			if(this.form.recent_photos && this.form.idcard_face_photo) {
+			uni.downloadFile({
+				url: this.$method.splitImgHost(this.form.idcard_face_photo),
+				success:async (res) => {
+					console.log(res,'res')
+					if (res.statusCode === 200) {
+						let resData = await this.faceCertificationIDCardOCR(1,res.tempFilePath);
+						this.veryIdCard = resData.data.data.IdNum
+						this.veryIdName = resData.data.data.IdName
+						
+						if(this.form.idcard) {
+							if(this.form.idcard != this.veryIdCard) {
+								uni.showModal({
+									title:'提示',
+									content:'输入的身份证号和身份证人像面照片身份证号不匹配',
+									showCancel:false,
+								})
+								this.isUploading = false;
+								return;
+							}
+						}
+						
+						uni.downloadFile({
+							url: this.$method.splitImgHost(this.form.recent_photos),
+							success: (res) => {
+								if (res.statusCode === 200) {
+									console.log('下载成功');
+									let fileSystem = uni.getFileSystemManager();
+										fileSystem.readFile({
+										  filePath: res.tempFilePath,
+										  encoding: 'base64',
+										  position: 0,
+										  success:(res) => {
+											  console.log(res)
+											  let base64 = 'data:image/jpg;base64,' + res.data;
+												let data = {
+													idNum:this.veryIdCard,
+													idName:this.veryIdName,
+													oneInchPhotos:base64
+												}
+												
+												this.$api.facCertificationImageRecognition(data).then(res1 => {
+													if(res1.data.data.sim >= 70) {
+														var self = this;
+														if (self.remarkStatus) {
+															var arsty = {};
+															for (let k in data) {
+																for (let j in self.copyData) {
+																	if (k === j) {
+																		if (self.copyData[j].value === data[k]) {
+																			arsty[k] = {
+																				fieldKey: k,
+																				value: data[k],
+																				fieldName: (function() {
+																					for (let i = 0; i < self.listData.length; i++) {
+																						if (self.listData[i].fieldKey == k) {
+																							return self.listData[i].fieldName;
+																						}
+																					}
+																				})(),
+																				status: 0
+																			};
+																		} else {
+																			arsty[k] = {
+																				fieldKey: k,
+																				value: data[k],
+																				fieldName: (function() {
+																					for (let i = 0; i < self.listData.length; i++) {
+																						if (self.listData[i].fieldKey == k) {
+																							return self.listData[i].fieldName;
+																						}
+																					}
+																				})(),
+																				status: 1
+																			};
+																		}
+																	}
+																}
+															}
+															var datas = {
+																id: this.id,
+																goodsId: this.goodsId,
+																orderGoodsId:this.orderGoodsId,
+																keyValue: JSON.stringify(arsty)
+															};
+															this.$api.editbaseprofiletp(datas).then(res => {
+																this.isUploading = false;
+																if (res.data.code === 200) {
+																	this.$method.showToast('提交成功');
+																	uni.navigateBack();
+																} else {
+																	this.$method.showToast(res.data.msg);
+																	this.isUploading = false;
+																}
+															});
+														} else {
+															var objs = {};
+															for (let k in data) {
+																objs[k] = {
+																	fieldKey: k,
+																	value: data[k],
+																	fieldName: (function() {
+																		for (let i = 0; i < self.listData.length; i++) {
+																			if (self.listData[i].fieldKey == k) {
+																				return self.listData[i].fieldName;
+																			}
+																		}
+																	})(),
+																	status: 0
+																};
+															}
+															var datas = {
+																goodsId: this.goodsId,
+																profileTpId: this.goodsId,
+																orderGoodsId:this.orderGoodsId,
+																keyValue: JSON.stringify(objs)
+															};
+															this.$api.addbaseprofiletp(datas).then(res => {
+																this.isUploading = false;
+																if (res.data.code === 200) {
+																	this.$method.showToast('提交成功');
+																	uni.navigateBack();
+																} else {
+																	this.$method.showToast(res.data.msg);
+																	this.isUploading = false;
+																}
+															});
+														}
+													} else {
+														this.isUploading = false;
+														uni.showModal({
+															title:'提示',
+															content:'个人近照和身份证人像面照片不匹配',
+															showCancel:false,
+														})
+													}
+												})
+										  },
+										  fail(err) {
+												this.isUploading = false;
+											console.error(err,'err')
+										  }
+										})
+										
+									}
+							}
+						});
+					}
+					
+					
+				},
+			})
+			
+			
+				return
+			}
+			
 			var self = this;
 			if (self.remarkStatus) {
 				var arsty = {};
@@ -610,17 +793,17 @@ export default {
 				var datas = {
 					id: this.id,
 					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 					keyValue: JSON.stringify(arsty)
 				};
-				if(this.isUploading) {
-					return;
-				}
-				this.isUploading = true;
 				this.$api.editbaseprofiletp(datas).then(res => {
 					this.isUploading = false;
 					if (res.data.code === 200) {
 						this.$method.showToast('提交成功');
 						uni.navigateBack();
+					} else {
+						this.$method.showToast(res.data.msg);
+						this.isUploading = false;
 					}
 				});
 			} else {
@@ -642,17 +825,17 @@ export default {
 				var datas = {
 					goodsId: this.goodsId,
 					profileTpId: this.goodsId,
+					orderGoodsId:this.orderGoodsId,
 					keyValue: JSON.stringify(objs)
 				};
-				if(this.isUploading) {
-					return;
-				}
-				this.isUploading = true;
 				this.$api.addbaseprofiletp(datas).then(res => {
 					this.isUploading = false;
 					if (res.data.code === 200) {
 						this.$method.showToast('提交成功');
 						uni.navigateBack();
+					} else {
+						this.$method.showToast(res.data.msg);
+						this.isUploading = false;
 					}
 				});
 			}
@@ -704,7 +887,9 @@ export default {
 									this.submitApi();
 								}
 							} else {
+								this.isUploading = false;
 								this.errorType = ['message'];
+								console.log(this.form)
 								console.log('验证失败');
 							}
 						});
@@ -714,6 +899,11 @@ export default {
 			}
 		},
 		async submits() {
+			
+			if(this.isUploading) {
+				return;
+			}
+			this.isUploading = true;
 			var ast = this.listData.some(item => {
 				return item.fieldKey === 'commitment_electr_signature';
 			});
@@ -723,9 +913,37 @@ export default {
 			this.openVerify = true;
 			this.resultForm(1);
 		},
+		faceCertificationIDCardOCR(cardSide,url) {
+			return new Promise(resolve => {
+				let fileSystem = uni.getFileSystemManager();
+				fileSystem.readFile({
+				  filePath: url,
+				  encoding: 'base64',
+				  position: 0,
+				  success:(res) => {
+					  console.log(res)
+					  let base64 = 'data:image/jpg;base64,' + res.data;
+					  console.log(base64)
+					  this.$api.faceCertificationIDCardOCR({
+					  	cardSide:cardSide,  //1人像  2 国徽
+					  	cardImageBase64:base64,
+					  	gradeId:this.gradeId
+					  }).then(res => {
+					  	resolve(res)
+					  })
+				  },
+				  fail(err) {
+					console.error(err,'err')
+				  }
+				})
+				
+			})
+		},
 		async changePhotoListHeader1(lists, name) {
+			console.log(lists)
 			if (lists.length) {
 				this.fileList1 = lists;
+				console.log(lists,'lists1')
 				if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
 					this.$set(this.form, 'recent_photos', await this.$method.imageInfos(lists[0].url));
 				}
@@ -742,9 +960,22 @@ export default {
 		async changePhotoListHeader2(lists, name) {
 			if (lists.length) {
 				this.fileList2 = lists;
-				console.log(lists,'lists')
 				if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
-					this.$set(this.form, 'idcard_face_photo', await this.$method.imageInfos(lists[0].url));
+					let url = lists[0].url
+					this.$refs.idcard_face_photo[0].remove(0)
+					let res = await this.faceCertificationIDCardOCR(1,url);
+					
+					if(res.data.code == 500) {
+						uni.showToast({
+							icon:'none',
+							title:'请上传正确清晰的身份证人像面照片'
+						})
+						return;
+					}
+					this.$refs.idcard_face_photo[0].lists = [{
+						url:this.$method.splitImgHost(res.data.data.IdImgPath)
+					}]; 
+					this.$set(this.form, 'idcard_face_photo', res.data.data.IdImgPath,1000);
 				}
 			} else {
 				this.fileList2 = [];
@@ -758,7 +989,21 @@ export default {
 			if (lists.length) {
 				this.fileList3 = lists;
 				if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
-					this.$set(this.form, 'idcard_national_photo', await this.$method.imageInfos(lists[0].url));
+					console.log('//tem')
+					let url = lists[0].url
+					this.$refs.idcard_national_photo[0].remove(0)
+					let res = await this.faceCertificationIDCardOCR(2,url);
+					if(res.data.code == 500) {
+						uni.showToast({
+							icon:'none',
+							title:'请上传正确清晰的身份证国徽面照片'
+						})
+						return;
+					}
+					this.$refs.idcard_national_photo[0].lists = [{
+						url:this.$method.splitImgHost(res.data.data.IdImgPath)
+					}]; 
+					this.$set(this.form, 'idcard_national_photo', res.data.data.IdImgPath);
 				}
 			} else {
 				this.fileList3 = [];
@@ -777,9 +1022,11 @@ export default {
 		},
 		getarrays(key) {
 			if (key === 'sex') {
+				console.log(this.dictObj)
 				return this.dictObj['sys_user_sex'];
 			}
 			if (key === 'education') {
+				console.log(this.dictObj['edu_level'])
 				return this.dictObj['edu_level'];
 			}
 			if (key === 'working_years') {
@@ -836,7 +1083,7 @@ export default {
 				this.$nextTick(() => {
 					this.agreementModal = true;
 				})
-				self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
+				self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId ,orderGoodsId:self.orderGoodsId}).then(result => {
 					if (result.data.code === 200) {
 						if (!result.data.data) {
 							self.$api.getbaseprofiletplistProfile({ pageNum: 1, pageSize: 1, status: 1 }).then(kit => {
@@ -993,6 +1240,8 @@ export default {
 							title: '签名上传失败',
 							icon: 'error'
 						});
+						
+							this.isUploading = false;
 					});
 			});
 		}

+ 11 - 10
pages2/verify/input2.vue

@@ -1,5 +1,6 @@
 <template>
 	<view style="padding: 30rpx;">
+		<nav-bar title="填写审核资料"></nav-bar>
 		<view class="topBox">
 			<view>
 				<u-icon name="error-circle-fill" color="#FF3B30" size="28"></u-icon>
@@ -86,11 +87,13 @@ export default {
 						trigger: ['change', 'blur']
 					}
 				]
-			}
+			},
+			orderGoodsId:0
 		};
 	},
 	created() {},
 	onLoad(option) {
+		this.orderGoodsId = Number(option.orderGoodsId)
 		this.goodsId = Number(option.id);
 		this.getInfo();
 	},
@@ -227,15 +230,12 @@ export default {
 				};
 			}
 			var datas = {
+				orderGoodsId:this.orderGoodsId,
 				goodsId: self.goodsId,
 				keyValue: JSON.stringify(objs)
 			};
 			if (self.remarkStatus) {
 				datas.id = self.id;
-				if(this.isUploading) {
-					return;
-				}
-				this.isUploading = true;
 				self.$api.editbaseprofileStamp(datas).then(res => {
 					this.isUploading = false;
 					if (res.data.code === 200) {
@@ -244,10 +244,6 @@ export default {
 					}
 				});
 			} else {
-				if(this.isUploading) {
-					return;
-				}
-				this.isUploading = true;
 				self.$api.addbaseprofileStamp(datas).then(res => {
 					this.isUploading = false;
 					if (res.data.code === 200) {
@@ -272,12 +268,17 @@ export default {
 							this.submitApi();
 						}
 					} else {
+						this.isUploading = false;
 						console.log('验证失败');
 					}
 				});
 			}
 		},
 		submits() {
+			if(this.isUploading) {
+				return;
+			}
+			this.isUploading = true;
 			this.openVerify = true;
 			this.resultForm(1);
 		},
@@ -299,7 +300,7 @@ export default {
 			this.$api.getbaseprofiletpId(this.goodsId).then(res => {
 				var ast = JSON.parse(res.data.data.keyValue2);
 				self.listData = ast;
-				self.$api.getbaseprofileStampgetInfo({ goodsId: self.goodsId }).then(result => {
+				self.$api.getbaseprofileStampgetInfo({ goodsId: self.goodsId,orderGoodsId:self.orderGoodsId }).then(result => {
 					if (result.data.code === 200) {
 						if (result.data.data && result.data.data.status === 3) {
 							self.remark = result.data.data.text;

+ 28 - 17
pages2/wd/avatar.vue

@@ -1,21 +1,21 @@
 <template>
 	<view>
 		<u-cell-group>
-				<u-cell-item  title="头像" @click="editAvatar">
-					<image :src="avatarUrl" class="avatar"></image>
-				</u-cell-item>
-				<u-cell-item  title="昵称" :value="nickname" @click="editNickName"></u-cell-item>
-			</u-cell-group>
-			<u-modal v-model="show" :show-cancel-button="true" title="修改昵称">
-				<view class="slot-content">
-					<u-input v-model="nickname"  />
-				</view>
-			</u-modal>
-			<view style="position: fixed;bottom: 50rpx;width: 100%;padding: 20rpx;">
-				<button  @click="submitForm" class="submit_btn">保存</button>
-				
-				<button  @click="exit" class="exit_btn">退出登录</button>
+			<u-cell-item  title="头像" @click="editAvatar">
+				<image :src="avatarUrl" class="avatar"></image>
+			</u-cell-item>
+			<u-cell-item  title="昵称" :value="nickname" @click="editNickName"></u-cell-item>
+		</u-cell-group>
+		<u-modal v-model="show" :show-cancel-button="true" title="修改昵称">
+			<view class="slot-content">
+				<u-input v-model="nickname"  />
 			</view>
+		</u-modal>
+		<view style="position: fixed;bottom: 50rpx;width: 100%;padding: 20rpx;">
+			<button  @click="submitForm" class="submit_btn">保存</button>
+			
+			<button  @click="exit" class="exit_btn">退出登录</button>
+		</view>
 			
 	</view>
 </template>
@@ -44,7 +44,18 @@
 						success: async res => {
 							let canvasWidth = res.width; //图片原始长宽
 							let canvasHeight = res.height;
-							if (canvasWidth > 1000 || canvasHeight > 1000) {
+							if (canvasWidth > 2000 || canvasHeight > 2000) {
+								uni.compressImage({
+									src: self.avatarUrl,
+									quality: 75,
+									width: '35%',
+									height: '35%',
+									success: async rest => {
+										const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+										resolve(waitUpload)
+									} 
+								});
+							} else if (canvasWidth > 1000 || canvasHeight > 1000) {
 								uni.compressImage({
 									src: self.avatarUrl,
 									quality: 75,
@@ -52,13 +63,13 @@
 									height: '50%',
 									success: async rest => {
 										const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-										resolve()
+										resolve(waitUpload)
 									} 
 								});
 							} else {
 								console.log('无需压缩');
 								const waitUpload = await self.uploadFile(self.avatarUrl, 0);
-								resolve()
+								resolve(waitUpload)
 							}
 						}
 					});

+ 694 - 531
pages2/wd/class.vue

@@ -1,189 +1,236 @@
 <template>
-	<view style="padding: 30rpx;">
+	<view style=" padding:0 30rpx 30rpx;">
+		<nav-bar title="我的网课"></nav-bar>
 		<view class="class" v-for="(item, index) in goodsList" :key="index">
-			
-				<view class="class_item" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">
-						<image :src="$method.splitImgHost(item.coverUrl, true)" class="class_img"></image>
-						<view class="class_text">
-							<view class="class_title">{{ item.goodsName }}</view>
-							<view class="content_box">
-								<image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
-								共
-								<text class="content">{{ item.courseNum }}</text>
-								课程
-								<text class="content">{{ item.secAllNum }}</text>
-								节
-								<text class="content">{{ item.classHours }}</text>
-								学时
+
+			<view class="class_item" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">
+				<image :src="$method.splitImgHost(item.coverUrl, true)" class="class_img"></image>
+				<view class="class_text">
+					<view class="class_title">{{ item.goodsName }}</view>
+					<view class="content_box">
+						<image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
+						共
+						<text class="content">{{ item.courseNum }}</text>
+						课程
+						<text class="content">{{ item.secAllNum+item.examNum }}</text>
+						节
+						<text class="content">{{ item.classHours }}</text>
+						学时
+					</view>
+					<view class="content_box" v-if="item.serviceStartTime && item.serviceEndTime">
+						<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
+						学习服务期:
+						<text class="content">{{ $method.timestampToTime(item.serviceStartTime,true,true) }} - {{ $method.timestampToTime(item.serviceEndTime,true,true) }}</text>
+					</view>
+				</view>
+
+				<!-- 不在学习服务期 -->
+				<template v-if="sysTime < item.serviceStartTime || sysTime > item.serviceEndTime">
+					<view class="class-warm" v-if="item.gradeId != 0 && item.gradeStatus == 1">
+						<view class="class-warm__text">
+							<view class="date">
+								不在学习服务期,不可以学习了哦
+							</view>
+						</view>
+					</view>
+				</template>
+
+				<template v-else>
+					<!-- 班级有效期过了 -->
+					<template v-if="item.classEndTime && (item.classEndTime < sysTime) ">
+						<view class="class-warm">
+							<u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill">
+							</u-icon>
+							<view class="class-warm__text">
+								<view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}} - {{$method.timestampToTime(item.classEndTime,true,true)}}</view>
+								<view class="state">班级状态:已过期,有疑问请联系 <text @click="call">020-87085982</text></view>
 							</view>
-							<view class="content_box">
-								<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-								学习有效期:
-								<text class="content">{{ $method.timestampToTime(item.studyStartTime) }} - {{ $method.timestampToTime(item.studyEndTime) }}</text>
+						</view>
+					</template>
+
+					<!-- 班级有效期之前 -->
+					<template v-else-if="item.classStartTime && (item.classStartTime > sysTime) ">
+						<view class="class-warm">
+							<u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill">
+							</u-icon>
+							<view class="class-warm__text">
+								<view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}} -
+									{{$method.timestampToTime(item.classEndTime,true,true)}}</view>
+								<view class="state">班级状态:未到学习时间,有疑问请联系 <text @click="call">020-87085982</text></view>
 							</view>
 						</view>
-						
-						<!-- 不在学习有效期 -->
-						<template v-if="sysTime < item.studyStartTime || sysTime > item.studyEndTime">
-							<view class="class-warm" v-if="item.gradeId != 0 && item.gradeStatus == 1">
+					</template>
+
+					<!-- 在班级有效期之间或者没有班级有效期 -->
+					<template v-else>
+
+						<view class="class-warm"
+							v-if="item.gradeId != 0 && item.gradeStatus == 1 && item.classStatus != null">
+							<view class="class-warm__text">
+								<view class="date">
+									班级状态:
+									<text v-if="item.classStatus == 1">已开班</text>
+									<text v-if="item.classStatus == 0">未开班</text>
+								</view>
+								<view class="state" v-if="item.classStatus == 0">教务处正在为您开通班级,请耐心等待</view>
+								<view class="state"
+									v-if="item.classStatus == 1 && item.classStartTime && item.classEndTime">
+									班级有效期:{{$method.timestampToTime(item.classStartTime,true,true)}}-{{$method.timestampToTime(item.classEndTime,true,true)}}
+								</view>
+							</view>
+						</view>
+						<!-- 学时审核状态不可审核 -->
+						<template v-if="item.periodStatus == -1">
+
+							<view class="class-warm" v-if="item.classStatus == 1 || item.classStatus === null">
 								<view class="class-warm__text">
 									<view class="date">
-										不在学习有效期,不可以学习了哦
+										<template
+											v-if="sysTime >= item.serviceStartTime && sysTime <= item.serviceEndTime">
+											学习状态:
+											<text v-if="item.stuAllNum == 0">未学习</text>
+											<text
+												v-else-if="item.stuAllNum > 0 && item.stuAllNum < item.secAllNum">学习中</text>
+											<text v-else-if="item.stuAllNum >= item.secAllNum">已学完</text>
+										</template>
+										<template v-else>
+											已过学习服务期,不可以学习了哦!
+										</template>
 									</view>
 								</view>
 							</view>
-						</template>
-						
-						<template v-else>
-							<!-- 班级有效期过了 -->
-							<template v-if="item.classEndTime && (item.classEndTime < sysTime) ">
-								<view class="class-warm">
-									<u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill"></u-icon>
-									<view class="class-warm__text">
-										<view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime)}} - {{$method.timestampToTime(item.classEndTime)}}</view>
-										<view class="state">班级状态:已过期,有疑问请联系 <text @click="call">020-87085982</text></view>
+
+							<view class="class-warm" v-if="item.profileTpStatus == 1">
+								<view class="class-warm__text">
+									<view class="date">
+										资料审核状态:
+										<text v-if="item.profileStatus == null">未提交资料</text>
+										<text v-else-if="item.profileStatus == 1">已通过</text>
+										<text v-else-if="item.profileStatus == 2">审核中</text>
+										<text v-else-if="item.profileStatus == 3">待完善</text>
 									</view>
 								</view>
-							</template>
-							
-							<!-- 班级有效期之前 -->
-							<template v-else-if="item.classStartTime && (item.classStartTime > sysTime) ">
-								<view class="class-warm">
-									<u-icon class="class-warm__icon" size="30" color="#FF3B30" name="error-circle-fill"></u-icon>
-									<view class="class-warm__text">
-										<view class="date">班级有效期:{{$method.timestampToTime(item.classStartTime)}} - {{$method.timestampToTime(item.classEndTime)}}</view>
-										<view class="state">班级状态:未到学习时间,有疑问请联系 <text @click="call">020-87085982</text></view>
+							</view>
+						</template>
+
+						<!-- 学时审核状态可以审核 -->
+						<template v-if="item.periodStatus != -1">
+							<view class="class-warm">
+								<view class="class-warm__text">
+									<view class="date">
+										<text v-if="item.periodStatus == 0">机构审核:学时审核不通过</text>
+										<text v-else-if="item.periodStatus == 2">学时待审核</text>
+										<text v-else-if="item.periodStatus == 3">学时审核中</text>
+										<text v-else-if="item.periodStatus == 1">
+											<text v-if="item.periodPlush > 0">学时已上报注册中心</text>
+											<text v-else>机构审核:学时审核通过</text>
+
+										</text>
 									</view>
 								</view>
-							</template>
-							
-							<!-- 在班级有效期之间或者没有班级有效期 -->
-							<template v-else>
-								
-								<!-- 学时审核状态不可审核 -->
-								<template v-if="item.periodStatus == -1">
-									<view class="class-warm" v-if="item.gradeId != 0 && item.gradeStatus == 1 && item.classStatus != null">
-										<view class="class-warm__text">
-											<view class="date">
-												班级状态:
-												<text v-if="item.classStatus == 1">已开班</text>
-												<text v-if="item.classStatus == 0">未开班</text>
-											</view>
-											<view class="state" v-if="item.classStatus == 0">教务处正在为您开通班级,请耐心等待</view>
-										</view>
-									</view>
-									
-									<view class="class-warm">
-										<view class="class-warm__text">
-											<view class="date">
-												<template v-if="sysTime >= item.studyStartTime && sysTime <= item.studyEndTime">
-													学习状态:
-													<text v-if="item.stuAllNum == 0">未学习</text>
-													<text v-else-if="item.stuAllNum > 0 && item.stuAllNum < item.secAllNum">学习中</text>
-													<text v-else-if="item.stuAllNum >= item.secAllNum">已学完</text>
-												</template>
-												<template v-else>
-													已过学习有效期,不可以学习了哦!
-												</template>
-											</view>
-										</view>
-									</view>
-									
-									<view class="class-warm" v-if="item.profileTpStatus == 1">
-										<view class="class-warm__text">
-											<view class="date">
-												资料审核状态:
-												<text v-if="item.profileStatus == null">未提交资料</text>
-												<text v-else-if="item.profileStatus == 1">已通过</text>
-												<text v-else-if="item.profileStatus == 2">审核中</text>
-												<text v-else-if="item.profileStatus == 3">待完善</text>
-											</view>
-										</view>
-									</view>
-								</template>
-								
-								<!-- 学时审核状态可以审核 -->
-								<template v-if="item.periodStatus != -1">
-									<view class="class-warm">
-										<view class="class-warm__text">
-											<view class="date">
-												<text v-if="item.periodStatus == 0">机构审核:学时审核不通过</text>
-												<text v-else-if="item.periodStatus == 1">机构审核:学时审核通过</text>
-												<text v-else-if="item.periodStatus == 2">学时待审核</text>
-											</view>
+							</view>
+
+							<view class="class-warm" v-if="item.subscribeId != null && item.periodStatus == 1">
+								<view class="class-warm__text">
+									<view class="date">
+										<view v-if="item.subExamStatus === null">待预约考试</view>
+										<view
+											v-else-if="item.subExamStatus === 0 &&  sysTime < $method.TimeTotimestamp(
+												$method.timestampToTime(item.subApplySiteExamTime, true) +
+													' ' +
+													item.subApplySiteStartTime
+											)">
+											待考试,考试时间:
+											{{
+												$method.timestampToTime(item.subApplySiteExamTime, true) +
+												" " +
+												item.subApplySiteStartTime
+											}}
+                    -
+                    {{
+											$method.timestampToTime(item.subApplySiteExamTime, true) +
+											" " +
+											item.subApplySiteEndTime
+										}}
 										</view>
-									</view>
-									
-									<view class="class-warm" v-if="item.applyStatus == 1 && item.periodStatus == 1">
-										<view class="class-warm__text">
-											<view class="date">
-												<view v-if="item.subExamStatus === null">待预约考试</view>
-												<view v-else-if="item.subExamStatus === 0 &&  sysTime < item.subApplySiteStartTime">
-													待考试,考试时间:{{$method.timestampToTime(item.subApplySiteStartTime)}} - {{$method.timestampToTime(item.subaApplySiteEndTime)}}
-												</view>
-												<view v-else-if="item.subExamStatus === 0">待出考试结果</view>
-												<view v-else-if="item.subExamStatus === 1">
-													<text v-if="item.subResult === null">待出考试结果</text>
-													<text v-if="item.subResult === 0">考试结果:不通过,需补考</text>
-													<text v-else-if="item.subResult === 1">考试结果:通过,考试成绩为{{item.subPerformance}}</text>
-												</view>
-												<view v-else-if="item.subExamStatus === 2">缺考,无成绩,需补考</view>
-												<view v-else-if="item.subExamStatus === 3">作弊,无成绩,需补考</view>
-												<view v-else-if="item.subExamStatus === 4">替考,无成绩,需补考</view>
-												
-												
-											</view>
+										<view v-else-if="item.subExamStatus === 0">待出考试结果</view>
+										<view v-else-if="item.subExamStatus === 1">
+											<text v-if="item.subResult === null">待出考试结果</text>
+											<text v-if="item.subResult === 0">考试结果:不通过,需补考</text>
+											<text
+												v-else-if="item.subResult === 1">考试结果:通过,考试成绩为{{item.subPerformance}}</text>
 										</view>
+										<view v-else-if="item.subExamStatus === 2">缺考,无成绩,需补考</view>
+										<view v-else-if="item.subExamStatus === 3">作弊,无成绩,需补考</view>
+										<view v-else-if="item.subExamStatus === 4">替考,无成绩,需补考</view>
+
+
 									</view>
-								</template>
-								
-							</template>
-							
-							
+								</view>
+							</view>
 						</template>
-						
-						
-				</view>
-			
-			
+
+					</template>
+
+
+				</template>
+
+
+			</view>
+
+
 			<view class="bottomBox">
-				<template v-if="item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > sysTime) && (item.studyStartTime < sysTime) &&  (item.classEndTime && (item.classEndTime < sysTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0">
+				<template
+					v-if="item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > sysTime) && (item.serviceStartTime < sysTime) &&  (item.classEndTime && (item.classEndTime < sysTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0">
 					<view class="restart" @click.stop="selectClass(item,index)">
 						选班重学
 					</view>
 				</template>
-				
+
 				<template v-else>
 					<view class="content_box">
 						<image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
-						学习进度:{{ item.stuAllNum }}/{{ item.secAllNum }}
+						学习进度:{{ item.stuAllNum+item.recordNum }}/{{ item.secAllNum+item.examNum }}
 					</view>
 					<view class="box_progress">
-						<view style="width: 60%;"><u-line-progress :showText="false" height="22" active-color="#ff9900" :show-percent="false" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
-						
-						<view><u-button :class="{disabled:sysTime <= item.studyStartTime || sysTime >= item.studyEndTime || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart)}" type="warning" size="mini" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">进入学习</u-button></view>
-					</view>
-					<view class="box_progress" v-if="item.applyStatus === 1">
 						<view style="width: 60%;">
-							<text style="color: #333333;white-space: nowrap;text-overflow: ellipsis;">{{ item.applyName }}</text>
+							<u-line-progress :showText="false" height="22" active-color="#ff9900" :show-percent="false"
+								:percent="((item.stuAllNum+item.recordNum) / (item.secAllNum+item.examNum)) * 100"></u-line-progress>
+						</view>
+
+						<view>
+							<u-button
+								:class="{disabled:(item.interfacePushId > 0 && item.officialStatus != 1) || sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart)}"
+								type="warning" size="mini" @click.stop="studyIn(item.goodsId,item.gradeId,item,index)">
+								进入学习</u-button>
 						</view>
-						<view><u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item)">预约考试</u-button></view>
 					</view>
-					<view class="box_progress" v-if="item.beforeStatus === 1">
-						<view style="width: 60%;">
-							<text style="color: #2979ff;white-space: nowrap;text-overflow: ellipsis;">{{ item.beforeName }}</text>
+					<view class="box_progress" v-if="item.applyStatus === 1 && !((item.interfacePushId > 0 && item.officialStatus != 1) || sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart))">
+						<view style="flex:1;margin-right:10rpx;">
+							<text style="color: #333333;">{{ item.applyName }}</text>
+						</view>
+						<view>
+							<u-button :plain="true" type="primary" size="mini" @click.stop="appointment(item)">预约考试
+							</u-button>
+						</view>
+					</view>
+					<view class="box_progress" v-if="item.beforeStatus === 1 && !((item.interfacePushId > 0 && item.officialStatus != 1) || sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime || (item.classStartTime && sysTime <= item.classStartTime) || (item.classEndTime && sysTime >= item.classEndTime) || item.learningStatus == 2 || item.classStatus == 0 || (item.learningStatus == 3 && sysTime < item.learningTimeStart))">
+						<view style="flex:1;margin-right:10rpx;">
+							<text style="color: #2979ff;">{{ item.beforeName }}</text>
+						</view>
+						<view>
+							<u-button type="primary" size="mini" @click="appBeforeAddress(item.goodsId,item)">进入刷题</u-button>
 						</view>
-						<view><u-button type="primary" size="mini" @click="appBeforeAddress(item.goodsId)">进入刷题</u-button></view>
 					</view>
 				</template>
-				
-				
+
+
 			</view>
 		</view>
-			
+
 		<view v-if="goodsList.length==0">
 			<u-empty text="暂无网课" margin-top="500" mode="list"></u-empty>
-			
+
 		</view>
 		<u-popup v-model="selectClassModal" @close="gradeValue = -1" mode="bottom" border-radius="40">
 			<view class="popup_box">
@@ -196,24 +243,24 @@
 					<scroll-view scroll-y="true" style="height: 500rpx;">
 						<view>
 							<u-radio-group v-model="gradeValue" @change="radioGroupChange">
-								<view v-for="(item, index) in gradeList" :key="index" >
+								<view v-for="(item, index) in gradeList" :key="index">
 									<view style="display: flex;align-items: center;padding: 20rpx;">
 										<view>
-											<u-radio
-												shape="circle"
-												:name="index"
-												:disabled="item.studentNum > 0 && item.studentNum == item.studentUpper"
-											>
-												<view :class="item.checked?'white-box blue-box':'white-box'" >
+											<u-radio shape="circle" :name="index"
+												:disabled="item.studentNum > 0 && item.studentNum == item.studentUpper">
+												<view :class="item.checked?'white-box blue-box':'white-box'">
 													<view>
 														<view class="blackTxt">{{item.className}}</view>
-														<view class="redTxt" v-if="item.classEndTime">有效期至:{{$method.timestampToTime(item.classEndTime)}}</view>
-														<view class="redTxt" v-if="item.classEndTime">本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
+														<view class="redTxt" v-if="item.classEndTime">
+															有效期至:{{$method.timestampToTime(item.classEndTime,true,true)}}
+														</view>
+														<view class="redTxt" v-if="item.classEndTime">
+															本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
 													</view>
 												</view>
 											</u-radio>
 										</view>
-										
+
 									</view>
 								</view>
 							</u-radio-group>
@@ -225,430 +272,546 @@
 				</view>
 			</view>
 		</u-popup>
-		
+		<u-modal v-model="showMark" title="提示" @confirm="markConfirm" confirm-text="复制学习网址" :show-cancel-button="true"
+			cancel-text="关闭">
+			<view class="slot-content">
+				<view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
+				<view>1.复制学习地址:{{markContent}}</view>
+				<view>2.在【浏览器中】打开复制的学习网址</view>
+				<view>3.打开学习网址后,选择【个人用户】进行登录</view>
+				<view>(1)账号:您个人的身份证号码</view>
+				<view>(2)密码:身份证号码,再加111111</view>
+			</view>
+
+		</u-modal>
 	</view>
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			list: [1, 2, 3],
-			goodsList: [],
-			selectClassModal:false,
-			gradeList:[],
-			gradeValue:-1,
-			param:{
-				pageNum: 1,
-				pageSize: 10
-			},
-			total: 0,
-			sysTime:0,
-			itemIndex:'',
-			selectItem:{}
-		};
-	},
-	onLoad(option) {
-		this.courseGoodsList();
-	},
-	onShow() {
-		if(this.itemIndex !== '') {
-			this.refreshByIndex();
-		}
-		this.commonSystemTime()
-	},
-	onReachBottom() {
-		if (this.goodsList.length < this.total) {
-			this.param.pageNum++;
-			this.courseGoodsList();
-		}
-	},
-	methods: {
-		/**
-		 * 返回刷新之前进入的课程数据
-		 */
-		refreshByIndex() {
-			let self = this;
-			this.$api.courseGoodsList({
-				pageNum: this.itemIndex+1,
-				pageSize: 1
-			}).then(res => {
-				if (res.data.code == 200) {
-					this.$set(this.goodsList,this.itemIndex,res.data.rows[0])
-				}
-			});
+	export default {
+		data() {
+			return {
+				markContent: 'http://admin.zhujianpeixun.com/',
+				showMark: false,
+				list: [1, 2, 3],
+				goodsList: [],
+				selectClassModal: false,
+				gradeList: [],
+				gradeValue: -1,
+				param: {
+					pageNum: 1,
+					pageSize: 10
+				},
+				total: 0,
+				sysTime: 0,
+				itemIndex: '',
+				selectItem: {}
+			};
 		},
-		commonSystemTime() {
-			this.$api.commonSystemTime().then(res => {
-				this.sysTime = res.data.data;
-			})
+		onLoad(option) {
+			this.sysTime = +this.$method.timest();
+			this.courseGoodsList();
 		},
-		selectClass(item,index) {
-			console.log(item)
-			this.itemIndex = index;
-			this.selectItem = item;
-			this.selectClassModal = true;
-			this.goodsGradeList(item.goodsId);
+		onShow() {
+			if (this.itemIndex !== '') {
+				this.refreshByIndex();
+			}
+			// this.commonSystemTime()
+			this.sysTime = +this.$method.timest();
 		},
-		radioGroupChange(e){
-			console.log(e)
+		onReachBottom() {
+			if (this.goodsList.length < this.total) {
+				this.param.pageNum++;
+				this.courseGoodsList();
+			}
 		},
-		goodsGradeList(id) {
-			let self = this
-			this.$api.goodsGradeList({goodsId:id}).then(res => {
-				if(res.data.code==200){
-					self.gradeList = res.data.rows
-					if(self.gradeList.length==0){
-						let item = {
-							className:'系统分班',
-							gradeId:0
-						}
-						self.gradeList.push(item)
-					} else {
-						let isGradeFull = self.gradeList.every(item => (item.studentNum > 0 && item.studentNum == item.studentUpper))
-						//所有班级都满了
-						if(isGradeFull) {
+		methods: {
+			/**
+			 * 复制网址
+			 */
+			markConfirm() {
+				uni.setClipboardData({
+			 	data: this.markContent,
+			  success: function() {
+						console.log('success');
+					}
+				});
+			},
+			/**
+			 * 返回刷新之前进入的课程数据
+			 */
+			refreshByIndex() {
+				let self = this;
+				this.$api.courseGoodsList({
+					pageNum: this.itemIndex + 1,
+					pageSize: 1
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.$set(this.goodsList, this.itemIndex, res.data.rows[0])
+					}
+				});
+			},
+			commonSystemTime() {
+				this.$api.commonSystemTime().then(res => {
+					this.sysTime = res.data.data;
+				})
+			},
+			selectClass(item, index) {
+				console.log(item)
+				this.itemIndex = index;
+				this.selectItem = item;
+				this.selectClassModal = true;
+				this.goodsGradeList(item.goodsId);
+			},
+			radioGroupChange(e) {
+				console.log(e)
+			},
+			goodsGradeList(id) {
+				let self = this
+				this.$api.goodsGradeList({
+					goodsId: id
+				}).then(res => {
+					if (res.data.code == 200) {
+						self.gradeList = res.data.rows
+						if (self.gradeList.length == 0) {
 							let item = {
-								className:'系统分班',
-								gradeId:0
+								className: '系统分班',
+								gradeId: 0
+							}
+							self.gradeList.push(item)
+						} else {
+							let isGradeFull = self.gradeList.every(item => (item.studentNum > 0 && item
+								.studentNum == item.studentUpper))
+							//所有班级都满了
+							if (isGradeFull) {
+								let item = {
+									className: '系统分班',
+									gradeId: 0
+								}
+								self.gradeList.unshift(item)
 							}
-							self.gradeList.unshift(item)
 						}
 					}
-				}
-			});
-		},
-		appBeforeAddress(goodsId) {
-			this.$api.appBeforeAddress({
-				goodsId
-			}).then(res => {
-				if(res.data.code == 200) {
-					uni.navigateToMiniProgram({
-					  appId: res.data.data.url,
-					  success(res) {
-					    // 打开成功
-					  }
-					})
-				} else {
-					uni.showToast({
-						title: res.data.msg,
-						icon: 'none',
-					})
-				}
-			})
-		},
-		courseGoodsList() {
-			let self = this;
-			this.$api.courseGoodsList(this.param).then(res => {
-				if (res.data.code == 200) {
-					self.goodsList.push.apply(self.goodsList, res.data.rows);
-					self.total = res.data.total;
-				}
-			});
-		},
-		async studyIn(v,i,item,index) {
-			if(this.sysTime <= item.studyStartTime || this.sysTime >= item.studyEndTime ) {
-				uni.showToast({
-					icon:'none',
-					title:'不在学习有效期,不能进入学习'
-				})
-				return;
-			}
-			
-			if( (item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this.sysTime >= item.classEndTime)) {
-				uni.showToast({
-					icon:'none',
-					title:'不在班级有效期,不能进入学习'
-				})
-				return
-			}
-			
-			if(item.learningStatus == 2) {
-				uni.showToast({
-					icon:'none',
-					title:'开放学习时间待定,不能进入学习'
-				})
-				return
-			}
-			
-			if(item.classStatus == 0) {
-				uni.showToast({
-					icon:'none',
-					title:'尚未开班,不能进入学习'
-				})
-				return 
-			}
-			
-			if(item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
-				uni.showToast({
-					icon:'none',
-					title:'不在开放学习时间,不能进入学习'
-				})
-				return ;
-			}
-			
-			
-			this.itemIndex = index;
-			
-			if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > this.sysTime) &&  (item.classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
-				this.selectClass(item,index);
-				return ;
-			}
-			
-			
-			let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId)
-			
-			if(rebuildStatus == 0) {
-				this.$navTo.togo('/pages2/learn/details', {
-					gradeId:item.gradeId,
-					goodsId: item.goodsId
 				});
-				return;
-			}
-			
-			if(item.courseNum == 1 ) {
-				
-				this.$api.courseCourseList({
-					pageNum:1,
-					pageSize:1,
-					goodsId:item.goodsId,
-					gradeId:item.gradeId
+			},
+			appBeforeAddress(goodsId,item) {
+				this.$api.appBeforeAddress({
+					// goodsId,
+					orderGoodsId:item.orderGoodsId
 				}).then(res => {
-					if(res.data.code == 200) {
-						uni.navigateTo({
-							url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+					if (res.data.code == 200) {
+						uni.navigateToMiniProgram({
+							appId: res.data.data.url,
+							success(res) {
+								// 打开成功
+					 	}
+						})
+					} else {
+						uni.showModal({
+							title:'提示',
+							content:res.data.msg,
+							showCancel:false,
 						})
 					}
-				});
-				return;
-			}
-			this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}`);
-		},
-		/**
-		 * @param {Object} goodsId 商品id
-		 * 查询商品重修状态
-		 */
-		courseGoodsRebuildStatus(goodsId,gradeId) {
-			return new Promise(resolve => {
-				this.$api.courseGoodsRebuildStatus({
-					goodsId:goodsId,
-					gradeId:gradeId
-				}).then(res => {
-					resolve(res.data.data)
 				})
-			})
-		},
-		appointment(item) {
-			var data = {
-				goodsId: item.goodsId,
-				gradeId: item.gradeId
-			};
-			this.$api.getApplysubscribe(data).then(res => {
-				if (res.data.code === 500) {
+			},
+			courseGoodsList() {
+				let self = this;
+				this.$api.courseGoodsList(this.param).then(res => {
+					if (res.data.code == 200) {
+						self.goodsList.push.apply(self.goodsList, res.data.rows);
+						self.total = res.data.total;
+					}
+				});
+			},
+			async studyIn(v, i, item, index) {
+
+
+				if (item.interfaceAccountId > 0) { //学习账号已开通
+
+					if (item.learnStatus == 1) { //跳转第三方h5
+						this.showMark = true;
+
+						return;
+						// uni.navigateTo({
+						// 	url:'/pages/webview/index?url='+item.officialLearningUrl
+						// })
+						// return;
+					} else {
+						uni.showModal({
+							showCancel: false,
+							content: '您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!'
+						});
+						return;
+					}
+
+
+					return;
+				}
+
+				//内部系统
+				if (item.interfacePushId > 0 && item.officialStatus != 1) {
 					uni.showModal({
 						showCancel: false,
-						content: res.data.msg
+						content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
 					});
+					return;
+				}
+				if (this.sysTime <= item.serviceStartTime || this.sysTime >= item.serviceEndTime) {
+					uni.showToast({
+						icon: 'none',
+						title: '不在学习服务期,不能进入学习'
+					})
+					return;
+				}
+
+				if ((item.classStartTime && this.sysTime <= item.classStartTime) || (item.classEndTime && this
+						.sysTime >= item.classEndTime)) {
+					uni.showToast({
+						icon: 'none',
+						title: '不在班级有效期,不能进入学习'
+					})
+					return
 				}
-				if (res.data.code === 200) {
-					this.$navTo.togo('/pages2/appointment/index', {
+
+				if (item.learningStatus == 2) {
+					uni.showToast({
+						icon: 'none',
+						title: '开放学习时间待定,不能进入学习'
+					})
+					return
+				}
+
+				if (item.classStatus == 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '尚未开班,不能进入学习'
+					})
+					return
+				}
+				console.log(this.sysTime, item.learningTimeStart)
+				console.log(this.sysTime < item.learningTimeStart)
+				if (item.learningStatus == 3 && (this.sysTime < item.learningTimeStart)) {
+					uni.showToast({
+						icon: 'none',
+						title: '不在开放学习时间,不能进入学习'
+					})
+					return;
+				}
+
+
+				this.itemIndex = index;
+
+				if (item.gradeStatus == 1 && item.status == 1 && (item.serviceEndTime > this.sysTime) && (item
+						.classEndTime && (item.classEndTime < this.sysTime)) && (item.periodStatus == 0 || item
+						.periodStatus == -1) && item.studyCount > 0) {
+					this.selectClass(item, index);
+					return;
+				}
+
+
+				let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId, item.gradeId)
+
+				if (rebuildStatus == 0) {
+					this.$navTo.togo('/pages2/learn/details', {
+						gradeId: item.gradeId,
 						goodsId: item.goodsId,
-						gradeId: item.gradeId
+						orderGoodsId: item.orderGoodsId,
 					});
+					return;
 				}
-			});
-		},
-		okPopup() {
-			if(this.gradeValue == -1) {
-				uni.showToast({
-					icon:'none',
-					title:'请选择班级'
-				})
-				return;
-			}
-			this.$api.changeGrade({
-			  goodsId: this.selectItem.goodsId,
-			  gradeId: this.gradeValue,
-			  oldGradeId: this.selectItem.gradeId,
-			  orderGoodsId: this.selectItem.orderGoodsId,
-			  userId: this.selectItem.userId
-			}).then(res => {
-				if(res.data.code == 200) {
-					if(this.itemIndex !== '') {
-						this.refreshByIndex();
-					}
-					this.selectClassModal = false;
-					uni.showToast({
-						title:'选班成功'
+
+				if (item.educationName == '继续教育') {
+					this.$api.lockLockStatus({
+						action: 'jxjy'
+					}).then(res => {
+						if (res.data.code == 200) { //有其他端在操作,不能学习
+							uni.showToast({
+								icon: 'none',
+						  title: res.data.msg,
+								mask: true,
+								duration: 3000
+							})
+						} else if (res.data.code == 500) { //可以学习
+
+							if (item.courseNum == 1) {
+
+								this.$api.courseCourseList({
+									pageNum: 1,
+									pageSize: 1,
+									goodsId: item.goodsId,
+									gradeId: item.gradeId,
+									orderGoodsId: item.orderGoodsId,
+								}).then(res => {
+									if (res.data.code == 200) {
+					  			uni.navigateTo({
+											url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
+										})
+									}
+								});
+								return;
+							}
+							this.$navTo.togo(
+								`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
+						}
 					})
 				} else {
+					if (item.courseNum == 1) {
+
+						this.$api.courseCourseList({
+							pageNum: 1,
+							pageSize: 1,
+							goodsId: item.goodsId,
+							gradeId: item.gradeId,
+							orderGoodsId: item.orderGoodsId,
+						}).then(res => {
+							if (res.data.code == 200) {
+								uni.navigateTo({
+									url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
+								})
+							}
+						});
+						return;
+					}
+					this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
+				}
+
+
+			},
+			/**
+			 * @param {Object} goodsId 商品id
+			 * 查询商品重修状态
+			 */
+			courseGoodsRebuildStatus(goodsId, gradeId) {
+				return new Promise(resolve => {
+					this.$api.courseGoodsRebuildStatus({
+						goodsId: goodsId,
+						gradeId: gradeId
+					}).then(res => {
+						resolve(res.data.data)
+					})
+				})
+			},
+			appointment(item) {
+				var data = {
+					goodsId: item.goodsId,
+					gradeId: item.gradeId
+				};
+				this.$api.getApplysubscribe(data).then(res => {
+					if (res.data.code === 500) {
+						uni.showModal({
+							showCancel: false,
+							content: res.data.msg
+						});
+					}
+					if (res.data.code === 200) {
+						this.$navTo.togo('/pages2/appointment/index', {
+							goodsId: item.goodsId,
+							gradeId: item.gradeId,
+							orderGoodsId: item.orderGoodsId
+						});
+					}
+				});
+			},
+			okPopup() {
+				if (this.gradeValue == -1) {
 					uni.showToast({
-						icon:'none',
-						title:res.data.msg
+						icon: 'none',
+						title: '请选择班级'
 					})
+					return;
 				}
-			})
-		},
-		call() {
-			uni.makePhoneCall({
-				 phoneNumber: '020-87085982' //仅为示例
-			})
+				this.$api.changeGrade({
+					goodsId: this.selectItem.goodsId,
+					gradeId: this.gradeValue,
+					oldGradeId: this.selectItem.gradeId,
+					orderGoodsId: this.selectItem.orderGoodsId,
+					userId: this.selectItem.userId
+				}).then(res => {
+					if (res.data.code == 200) {
+						if (this.itemIndex !== '') {
+							this.refreshByIndex();
+						}
+						this.selectClassModal = false;
+						uni.showToast({
+							title: '选班成功'
+						})
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.data.msg
+						})
+					}
+				})
+			},
+			call() {
+				uni.makePhoneCall({
+					phoneNumber: '020-87085982' //仅为示例
+				})
+			}
 		}
-	}
-};
+	};
 </script>
 <style>
-page {
-	background: #eaeef1;
-}
+	page {
+		background: #eaeef1;
+	}
 </style>
 <style scope lang="scss">
-.box_progress {
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	margin-top: 20rpx;
-	
-	.disabled {
-		opacity: 0.6;
-	}
-}
-.bottomBox {
-	background: #ffffff;
-	width: 94%;
-	border-bottom-left-radius: 24rpx;
-	border-bottom-right-radius: 24rpx;
-	margin: 0 auto;
-	padding: 20rpx;
-	
-	.restart {
-		margin:0 auto;
-		text-align: center;
-		line-height: 80rpx;
-		color:#fff;
-		font-size: 30rpx;
-		width: 440rpx;
-		height: 80rpx;
-		background: #FF0000;
-		border-radius: 40rpx 40rpx 40rpx 40rpx;
+	.box_progress {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		margin-top: 20rpx;
+
+		.disabled {
+			opacity: 0.6;
+		}
 	}
-}
-.content_box {
-	font-size: 24rpx;
-	display: flex;
-	align-items: center;
-	color: #999999;
-	margin-top: 8rpx;
-}
-.content {
-	color: #000000;
-	margin: 0 8rpx;
-}
-.wk_icon {
-	width: 24rpx;
-	height: 24rpx;
-	margin-right: 8rpx;
-}
-
-.class {
-	margin-bottom: 30rpx;
-	
-	.class_item {
-		width: 100%;
+
+	.bottomBox {
 		background: #ffffff;
-		box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
-		border-radius: 24rpx;
+		width: 94%;
+		border-bottom-left-radius: 24rpx;
+		border-bottom-right-radius: 24rpx;
+		margin: 0 auto;
 		padding: 20rpx;
-		z-index: 999;
-		position: relative;
-		
-		.class_img {
-			height: 316rpx;
+
+		.restart {
+			margin: 0 auto;
+			text-align: center;
+			line-height: 80rpx;
+			color: #fff;
+			font-size: 30rpx;
+			width: 440rpx;
+			height: 80rpx;
+			background: #FF0000;
+			border-radius: 40rpx 40rpx 40rpx 40rpx;
+		}
+	}
+
+	.content_box {
+		font-size: 24rpx;
+		display: flex;
+		align-items: center;
+		color: #999999;
+		margin-top: 8rpx;
+	}
+
+	.content {
+		color: #000000;
+		margin: 0 8rpx;
+	}
+
+	.wk_icon {
+		width: 24rpx;
+		height: 24rpx;
+		margin-right: 8rpx;
+	}
+
+	.class {
+		margin-bottom: 30rpx;
+
+		.class_item {
 			width: 100%;
+			background: #ffffff;
+			box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
 			border-radius: 24rpx;
-		}
-		
-		.class_text {
-			padding:0 20rpx;
-			
-			.class_title {
-				color: #333333;
-				font-weight: bold;
-				font-size: 32rpx;
-			}
-		}
-		
-		.class-warm {
-			padding:10rpx 20rpx;
-			display: flex;
-			align-items: flex-start;
-			
-			&__icon {
-				margin-right:10rpx;
+			padding: 20rpx;
+			z-index: 999;
+			position: relative;
+
+			.class_img {
+				height: 316rpx;
+				width: 100%;
+				border-radius: 24rpx;
 			}
-			
-			&__text {
-				
-				.date {
-					font-size: 24rpx;
+
+			.class_text {
+				padding: 0 20rpx;
+
+				.class_title {
+					color: #333333;
 					font-weight: bold;
-					color: #FF3B30;
+					font-size: 32rpx;
 				}
-				
-				.state {
-					margin-top:15rpx;
-					font-size: 24rpx;
-					font-weight: bold;
-					color: #FF3B30;
+			}
+
+			.class-warm {
+				padding: 10rpx 20rpx;
+				display: flex;
+				align-items: flex-start;
+
+				&__icon {
+					margin-right: 10rpx;
+				}
+
+				&__text {
+
+					.date {
+						font-size: 24rpx;
+						font-weight: bold;
+						color: #FF3B30;
+					}
+
+					.state {
+						margin-top: 15rpx;
+						font-size: 24rpx;
+						font-weight: bold;
+						color: #FF3B30;
+					}
 				}
 			}
 		}
 	}
-}
 
 
 
 
-.popup_box {
-	height: 700rpx;
-	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-	border-radius: 32rpx 32rpx 0rpx 0rpx;
-	
-	.line1{
-		width: 80rpx;
-		height: 8rpx;
-		background: #999999;
-		border-radius: 4rpx;
-		margin: 0 auto;
-		margin-top: 15rpx;
-	}
-	
-	
-	.grade{
-		height: 23rpx;
-		font-size: 24rpx;
-		color: #999999;
-		margin: 0 auto;
-		margin-top: 15rpx;
-		text-align: center;
-	}
-	
-	.confrim-btn{
-		height: 98rpx;
-		width: 100%;
-		display: flex;
-		align-items: center;
-		justify-content:center;
-		
-		.okBtn{
-			width: 200rpx;
-			height: 64rpx;
-			background: linear-gradient(0deg, #015EEA, #00C0FA);
-			border-radius: 32rpx;
-			color: #FFFFFF;
+	.popup_box {
+		height: 700rpx;
+		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+		border-radius: 32rpx 32rpx 0rpx 0rpx;
+
+		.line1 {
+			width: 80rpx;
+			height: 8rpx;
+			background: #999999;
+			border-radius: 4rpx;
+			margin: 0 auto;
+			margin-top: 15rpx;
+		}
+
+
+		.grade {
+			height: 23rpx;
+			font-size: 24rpx;
+			color: #999999;
+			margin: 0 auto;
+			margin-top: 15rpx;
 			text-align: center;
-			line-height: 64rpx;
 		}
+
+		.confrim-btn {
+			height: 98rpx;
+			width: 100%;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+
+			.okBtn {
+				width: 200rpx;
+				height: 64rpx;
+				background: linear-gradient(0deg, #015EEA, #00C0FA);
+				border-radius: 32rpx;
+				color: #FFFFFF;
+				text-align: center;
+				line-height: 64rpx;
+			}
+		}
+	}
+
+	.slot-content {
+		padding: 0 20rpx;
 	}
-}
 </style>

+ 312 - 141
pages2/wd/course.vue

@@ -1,167 +1,338 @@
 <template>
-	<view style="padding: 30rpx;">
-		<view v-if="!courseList.length">
-			<u-empty text="暂无课程" mode="list"></u-empty>
-		</view>
-		<view v-else @click="jump(item,index)" v-for="(item, index) in courseList" :key="index" style="margin-bottom: 30rpx;">
-			<view class="class_item">
-				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
-				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">{{ item.courseName }}</view>
-			</view>
-			<view class="bottomBox">
-				<view class=".content_box">
-					<image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
-					学习进度:{{ item.stuAllNum }}/{{ item.secAllNum }}
-				</view>
-				<view class="box_progress">
-					<view style="width: 60%;"><u-line-progress height="22" :show-percent="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
-					<view><u-button type="warning" size="mini" @click.stop="studyIn(item,index)">进入学习</u-button></view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view style="padding: 30rpx">
+    <nav-bar title="所有课程"></nav-bar>
+    <view v-if="!courseList.length">
+      <u-empty text="暂无课程" mode="list"></u-empty>
+    </view>
+    <view
+      v-else
+      @click="jump(item, index)"
+      v-for="(item, index) in courseList"
+      :key="index"
+      style="margin-bottom: 30rpx"
+    >
+      <view class="class_item">
+        <image
+          :src="$method.splitImgHost(item.coverUrl, true)"
+          style="height: 316rpx; width: 100%; border-radius: 24rpx"
+        ></image>
+        <view style="color: #333333; font-weight: bold; font-size: 32rpx">{{
+          item.courseName
+        }}</view>
+      </view>
+      <view class="bottomBox">
+        <view class=".content_box">
+          <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
+          学习进度:{{ item.stuAllNum + item.recordNum }}/{{
+            item.secAllNum + item.examNum
+          }}
+        </view>
+        <view class="box_progress">
+          <view style="width: 60%"
+            ><u-line-progress
+              height="22"
+              :show-percent="false"
+              active-color="#ff9900"
+              :percent="((item.stuAllNum + item.recordNum) / (item.secAllNum + item.examNum)) * 100"
+            ></u-line-progress
+          ></view>
+          <view
+            ><u-button
+              type="warning"
+              size="mini"
+              @click.stop="jump(item, index)"
+              >进入学习</u-button
+            ></view
+          >
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
 export default {
-	data() {
-		return {
-			goodsId: 0,
-			gradeId:0,
-			courseList: [],
-			param:{
-				pageNum: 1,
-				pageSize: 10,
-				total: 0
-			},
-			itemIndex:''
-		};
-	},
-	onLoad(option) {
-		this.goodsId = Number(option.id);
-		this.gradeId = Number(option.gid)
-		// uni.setStorageSync('courseGoodsId', this.goodsId);
-		this.courseCourseList();
-		this.$store.getters.dictObj
-	},
-	onShow(){
-		if(this.itemIndex !== '') {
-			this.refreshByIndex();
-		}
-	},
-	onReachBottom() {
-		if (this.courseList.length < this.param.total) {
-			this.param.pageNum++;
-			this.courseCourseList();
-		}
-	},
-	methods: {
-		/**
-		 * 返回刷新之前进入的课程数据
-		 */
-		refreshByIndex() {
-			this.$api.courseCourseList({
-				pageNum: this.itemIndex+1,
-				pageSize: 1,
-				goodsId:this.goodsId,
-				gradeId:this.gradeId
-			}).then(res => {
-				if (res.data.code == 200) {
-					this.$set(this.courseList,this.itemIndex,res.data.rows[0])
-				}
-			});
-		},
-		jump(item,index) {
-			this.itemIndex = index;
-			if(item.rebuild === 0) {  //未重修
-				this.$navTo.togo('/pages2/learn/details', {
-					id: item.courseId,
-					gradeId:item.gradeId,
-					goodsId: this.goodsId
-				});
-				return;
-			}
-			 this.$navTo.togo('/pages3/polyv/detail', {
-				id: item.courseId,
-				goodsId: this.goodsId,
-			}); 
-		},
-		studyIn(item,index) {
-			this.itemIndex = index;
-			if(item.rebuild === 0) {  //未重修
-				this.$navTo.togo('/pages2/learn/details', {
-					id: item.courseId,
-					gradeId:item.gradeId,
-					goodsId: this.goodsId
-				});
-				return;
-			}
-			this.$navTo.togo('/pages3/polyv/detail', {
-				id: item.courseId,
-				goodsId: this.goodsId
-			});
-			// this.$navTo.togo('/pages2/verify/input');
-		},
-		courseCourseList() {
-			let self = this;
-			this.param.goodsId =this.goodsId
-			this.param.gradeId = this.gradeId
-			this.$api.courseCourseList(this.param).then(res => {
-				if (res.data.code == 200) {
-					self.courseList.push.apply(self.courseList, res.data.rows);
-					self.param.total = res.data.total;
-				}
-			});
-		},
-		appointment() {
-			this.$navTo.togo('/pages2/appointment/index');
-		}
-	}
+  data() {
+    return {
+      goodsId: 0,
+      gradeId: 0,
+      courseList: [],
+      orderGoodsId: 0,
+      param: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0,
+      },
+      businessData: {},
+      itemIndex: "",
+    };
+  },
+  onLoad(option) {
+    this.goodsId = Number(option.id);
+    this.gradeId = Number(option.gid);
+    this.orderGoodsId = Number(option.orderGoodsId);
+    // uni.setStorageSync('courseGoodsId', this.goodsId);
+    this.courseCourseList();
+    this.$store.getters.dictObj;
+  },
+  onShow() {
+    if (this.itemIndex !== "") {
+      this.refreshByIndex();
+    }
+  },
+  onReachBottom() {
+    if (this.courseList.length < this.param.total) {
+      this.param.pageNum++;
+      this.courseCourseList();
+    }
+  },
+  methods: {
+    /**
+     * 返回刷新之前进入的课程数据
+     */
+    refreshByIndex() {
+      this.$api
+        .courseCourseList({
+          pageNum: this.itemIndex + 1,
+          pageSize: 1,
+          goodsId: this.goodsId,
+          gradeId: this.gradeId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            this.$set(this.courseList, this.itemIndex, res.data.rows[0]);
+          }
+        });
+    },
+    /**
+     * 获取业务层次详情
+     */
+    courseBusiness(businessId) {
+      this.$api.courseBusiness(businessId).then((res) => {
+        this.businessData = res.data.data;
+      });
+    },
+    jump(item, index) {
+      this.itemIndex = index;
+
+      if (index == 0) {
+        if (item.rebuild === 0) {
+          //未重修
+          this.$navTo.togo("/pages2/learn/details", {
+            id: item.courseId,
+            gradeId: item.gradeId,
+            goodsId: this.goodsId,
+						orderGoodsId: this.orderGoodsId,
+          });
+          return;
+        }
+
+        this.$api.courseDetail(item.courseId).then((res) => {
+          if (res.data.code == 200) {
+            if (res.data.data.educationName == "继续教育") {
+              this.$api
+                .lockLockStatus({
+                  action: "jxjy",
+                })
+                .then((res) => {
+                  if (res.data.code == 200) {
+                    //有其他端在操作,不能学习
+                    uni.showToast({
+                      icon: "none",
+                      title: res.data.msg,
+                      mask: true,
+                      duration: 3000,
+                    });
+                  } else if (res.data.code == 500) {
+                    //可以学习
+                    this.$navTo.togo("/pages3/polyv/detail", {
+                      id: item.courseId,
+                      goodsId: this.goodsId,
+                      orderGoodsId: this.orderGoodsId,
+                    });
+                  }
+                });
+
+              // websocket.sendMsg("doCourse");
+            } else {
+              this.$navTo.togo("/pages3/polyv/detail", {
+                id: item.courseId,
+                goodsId: this.goodsId,
+                orderGoodsId: this.orderGoodsId,
+              });
+            }
+          }
+        });
+      } else {
+        if (this.businessData.goodsLearningOrder == 2) {
+          //学习顺序是从头到尾学习,没学完上一课不能学习下一课
+          let prevItem = this.courseList[index - 1]; //上一课
+          if (
+            prevItem.stuAllNum + prevItem.recordNum ==
+            prevItem.secAllNum + prevItem.examNum
+          ) {
+            if (item.rebuild === 0) {
+              //未重修
+              this.$navTo.togo("/pages2/learn/details", {
+                id: item.courseId,
+                gradeId: item.gradeId,
+                goodsId: this.goodsId,
+								orderGoodsId: this.orderGoodsId,
+              });
+              return;
+            }
+
+            this.$api.courseDetail(item.courseId).then((res) => {
+              if (res.data.code == 200) {
+                if (res.data.data.educationName == "继续教育") {
+                  this.$api
+                    .lockLockStatus({
+                      action: "jxjy",
+                    })
+                    .then((res) => {
+                      if (res.data.code == 200) {
+                        //有其他端在操作,不能学习
+                        uni.showToast({
+                          icon: "none",
+                          title: res.data.msg,
+                          duration: 2000,
+                        });
+                      } else if (res.data.code == 500) {
+                        //可以学习
+
+                        this.$navTo.togo("/pages3/polyv/detail", {
+                          id: item.courseId,
+                          goodsId: this.goodsId,
+                          orderGoodsId: this.orderGoodsId,
+                        });
+                      }
+                    });
+
+                  // websocket.sendMsg("doCourse");
+                } else {
+                  this.$navTo.togo("/pages3/polyv/detail", {
+                    id: item.courseId,
+                    goodsId: this.goodsId,
+                    orderGoodsId: this.orderGoodsId,
+                  });
+                }
+              }
+            });
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: "请按顺序学完上一课再学习这一课",
+            });
+          }
+        } else {
+          if (item.rebuild === 0) {
+            //未重修
+            this.$navTo.togo("/pages2/learn/details", {
+              id: item.courseId,
+              gradeId: item.gradeId,
+              goodsId: this.goodsId,
+							orderGoodsId: this.orderGoodsId,
+            });
+            return;
+          }
+
+          this.$api.courseDetail(item.courseId).then((res) => {
+            if (res.data.code == 200) {
+              if (res.data.data.educationName == "继续教育") {
+                this.$api
+                  .lockLockStatus({
+                    action: "jxjy",
+                  })
+                  .then((res) => {
+                    if (res.data.code == 200) {
+                      //有其他端在操作,不能学习
+                      uni.showToast({
+                        icon: "none",
+                        title: res.data.msg,
+                        duration: 2000,
+                      });
+                    } else if (res.data.code == 500) {
+                      //可以学习
+
+                      this.$navTo.togo("/pages3/polyv/detail", {
+                        id: item.courseId,
+                        goodsId: this.goodsId,
+                        orderGoodsId: this.orderGoodsId,
+                      });
+                    }
+                  });
+
+                // websocket.sendMsg("doCourse");
+              }
+            }
+          });
+        }
+      }
+    },
+    courseCourseList() {
+      let self = this;
+      this.param.goodsId = this.goodsId;
+      this.param.gradeId = this.gradeId;
+      this.$api.courseCourseList(this.param).then((res) => {
+        if (res.data.code == 200) {
+          self.courseList.push.apply(self.courseList, res.data.rows);
+          self.param.total = res.data.total;
+					console.log(res.data.rows.length,'res.data.rows.length')
+          if (res.data.rows.length) {
+            this.courseBusiness(res.data.rows[0].businessId);
+          }
+        }
+      });
+    },
+    appointment() {
+      this.$navTo.togo("/pages2/appointment/index?orderGoodsId="+this.orderGoodsId);
+    },
+  },
 };
 </script>
 <style>
 page {
-	background: #eaeef1;
+  background: #eaeef1;
 }
 </style>
 <style scope>
 .box_progress {
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	margin-top: 20rpx;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-top: 20rpx;
 }
 .bottomBox {
-	background: #ffffff;
-	width: 94%;
-	border-bottom-left-radius: 24rpx;
-	border-bottom-right-radius: 24rpx;
-	margin: 0 auto;
-	padding: 20rpx;
+  background: #ffffff;
+  width: 94%;
+  border-bottom-left-radius: 24rpx;
+  border-bottom-right-radius: 24rpx;
+  margin: 0 auto;
+  padding: 20rpx;
 }
 .content_box {
-	display: flex;
-	align-items: center;
-	color: #999999;
-	margin-top: 8rpx;
+  display: flex;
+  align-items: center;
+  color: #999999;
+  margin-top: 8rpx;
 }
 .content {
-	color: #000000;
-	margin: 0 8rpx;
+  color: #000000;
+  margin: 0 8rpx;
 }
 .wk_icon {
-	width: 24rpx;
-	height: 24rpx;
-	margin-right: 8rpx;
+  width: 24rpx;
+  height: 24rpx;
+  margin-right: 8rpx;
 }
 
 .class_item {
-	width: 100%;
-	background: #ffffff;
-	box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
-	border-radius: 24rpx;
-	padding: 20rpx;
-	z-index: 999;
-	position: relative;
+  width: 100%;
+  background: #ffffff;
+  box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
+  border-radius: 24rpx;
+  padding: 20rpx;
+  z-index: 999;
+  position: relative;
 }
 </style>

+ 15 - 3
pages2/wd/edu_info.vue

@@ -1,5 +1,6 @@
 <template>
 	<view style="padding: 30rpx;" >
+		<nav-bar title="所有课程"></nav-bar>
 		<view style="position: relative;">
 			<view class="tip">
 				请填写真实信息,以便我们后续为您提供完善的 <br>
@@ -152,7 +153,18 @@
 						success: async res => {
 							let canvasWidth = res.width; //图片原始长宽
 							let canvasHeight = res.height;
-							if (canvasWidth > 1000 || canvasHeight > 1000) {
+							if (canvasWidth > 2000 || canvasHeight > 2000) {
+								uni.compressImage({
+									src: self.fileList[0].url,
+									quality: 75,
+									width: '35%',
+									height: '35%',
+									success: async rest => {
+										const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+										resolve(waitUpload)
+									} 
+								});
+							} else if (canvasWidth > 1000 || canvasHeight > 1000) {
 								uni.compressImage({
 									src: self.fileList[0].url,
 									quality: 75,
@@ -160,13 +172,13 @@
 									height: '50%',
 									success: async rest => {
 										const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-										resolve()
+										resolve(waitUpload)
 									} 
 								});
 							} else {
 								console.log('无需压缩');
 								const waitUpload = await self.uploadFile(self.fileList[0].url, 0);
-								resolve()
+								resolve(waitUpload)
 							}
 						}
 					});

+ 22 - 9
pages2/wd/info.vue

@@ -1,5 +1,6 @@
 <template>
 	<view >
+		
 	<image mode="widthFix" src="/static/wd_bg_login.jpg" class="login_full_img"></image>
 	
 	
@@ -42,7 +43,8 @@
 								<view>{{ form.realname }}</view>
 								<view>{{ form.idCard }}</view>
 							</view>
-							<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
+							<!-- <u-icon name="arrow-right" color="#999999" size="28"></u-icon> -->
+						</view>
 					</view>
 					<view>
 						<pick-regions :defaultRegion="defaultRegionCode" @getRegion="handleGetRegion2">
@@ -57,12 +59,10 @@
 					</view>
 					<view class="item" @click="showPhone">
 						<view>手机号码</view>
-						<view>{{ form.telphone }}<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
+						<view>{{ form.telphone }}
+							<!-- <u-icon name="arrow-right" color="#999999" size="28"></u-icon> -->
+						</view>
 					</view>
-				<!--	<view class="item">
-						<view>微信绑定</view>
-						<view>{{ form.gzh_open_id }}<u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
-					</view> -->
 				</view>
 			</view>
 		</view>
@@ -252,7 +252,18 @@ export default {
 					success: async res => {
 						let canvasWidth = res.width; //图片原始长宽
 						let canvasHeight = res.height;
-						if (canvasWidth > 1000 || canvasHeight > 1000) {
+						if (canvasWidth > 2000 || canvasHeight > 2000) {
+							uni.compressImage({
+								src: self.avatarUrl,
+								quality: 75,
+								width: '35%',
+								height: '35%',
+								success: async rest => {
+									const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+									resolve(waitUpload)
+								} 
+							});
+						} else if (canvasWidth > 1000 || canvasHeight > 1000) {
 							uni.compressImage({
 								src: self.avatarUrl,
 								quality: 75,
@@ -260,13 +271,13 @@ export default {
 								height: '50%',
 								success: async rest => {
 									const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-									resolve()
+									resolve(waitUpload)
 								} 
 							});
 						} else {
 							console.log('无需压缩');
 							const waitUpload = await self.uploadFile(self.avatarUrl, 0);
-							resolve()
+							resolve(waitUpload)
 						}
 					}
 				});
@@ -298,6 +309,7 @@ export default {
 			this.submitForm(data)
 		},
 		editIdCard(){
+			return;
 			this.id_show = true
 			this.realname = this.form.realname
 			this.idCard = this.form.idCard
@@ -375,6 +387,7 @@ export default {
 			});
 		},
 		showPhone() {
+			return;
 			this.showPhoneModal = true;
 			this.$refs.telForm.setRules(this.rules)
 		},

+ 1 - 0
pages2/wd/menu.vue

@@ -1,5 +1,6 @@
 <template>
 	<view >
+		<nav-bar title="基本资料"></nav-bar>
 		<u-cell-group>
 				<u-cell-item  title="基本信息" @click="jumpInfo"></u-cell-item>
 				<u-cell-item  title="教育信息" @click="jumpEduInfo"></u-cell-item>

+ 27 - 2
pages2/wd/question_bank.vue

@@ -1,9 +1,10 @@
 <template>
 	<view style="padding: 32rpx;">
+		<nav-bar title="我的题库通"></nav-bar>
 		<navigator  hover-class="none" url="/pages2/bank/my_question">
 			<view class="my_question">
 				<view class="flex">
-					<view class="text">我的题库<u-icon name="arrow-right"></u-icon></view>
+					<view class="text">自购题卷<u-icon name="arrow-right"></u-icon></view>
 				</view>
 				<image src="/static/questionBank.png" class="my_bg"></image>
 			</view>
@@ -40,18 +41,42 @@
 </template>
 
 <script>
+// import { websocket } from '@/common/socket.js';
 	export default {
 		data() {
 			return {
 				list:[
 					1,2,3
-				]
+				],
+				timer:null,
 				
 			}
 		},
 		onLoad(option) {
+			this.$api.lockLockAction({
+				action:'bank'
+			}).then(res => {
+				
+			})
+			this.timer = setInterval(() => {
+				this.$api.lockLockAction({
+					action:'bank'
+				}).then(res => {
+					
+				})
+			},10000)
+			// websocket.sendMsg('doQuestion')
 			// this.getDict()
 		},
+		onUnload() {
+			clearInterval(this.timer)
+			this.$api.lockDelLock({
+				action:'bank'
+			}).then(res => {
+				
+			})
+			// websocket.sendMsg('delAction')
+		},
 		onShow(){
 			
 		},

+ 45 - 10
pages3/course/detail.vue

@@ -1,5 +1,6 @@
 <template>
 	<view>
+		<nav-bar title="课程详情"></nav-bar>
 		<view class="videoBox" >
 			<view >
 				<view class="video_box" v-if="!startStatus">
@@ -35,16 +36,16 @@
 			</view>
 			<u-line color="#D6D6DB" />
 			<view style="height: 80rpx;">
-				<view><u-tabs :list="list" item-width="50%" font-size="24" bar-width="24"  :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
+				<view><u-tabs :list="list" item-width="50%" font-size="30" bar-width="24"  :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
 			</view>
 			
 		</view>
-		<view style="padding: 20rpx 20rpx 100rpx;position: relative;top: 730rpx;" v-show="current==0">
+		<view style="padding: 20rpx;padding-bottom: 100rpx;position: relative;" v-show="current==0">
 			<view class="content">
 				<view v-html="detail.mobileDetailHtml" style="width: 100%;overflow: hidden;"></view>
 			</view>
 		</view>
-		<view style="padding: 20rpx 20rpx 100rpx;padding-bottom: 100rpx;position: relative;top: 730rpx;" v-show="current==1">
+		<view style="padding: 20rpx;padding-bottom: 100rpx;position: relative;" v-show="current==1">
 			<view >
 				<view v-for="(item,index) in courseList" :key="index" >
 					<view class="courseItemBox" >
@@ -57,8 +58,8 @@
 						</view>
 						<view v-show="!item.down">
 							<view v-for="(itemM,indexM) in item.menuList"  :key="indexM">
-								<courseModule v-if="itemM.type==1" :menuItem="itemM"></courseModule>
-								<courseChapter v-if="itemM.type==2" :isBuy="false" :menuItem="itemM"></courseChapter>
+								<courseModule :needOpen="(isFirstEnter && menuIndex[0] === index && menuIndex[1] === indexM) ? true : false" v-if="itemM.type==1" :menuItem="itemM"></courseModule>
+								<courseChapter :needOpen="(isFirstEnter && menuIndex[0] === index && menuIndex[1] === indexM) ? true : false" v-if="itemM.type==2" :isBuy="false" :menuItem="itemM"></courseChapter>
 								<courseSection v-if="itemM.type==3" :isBuy="false" :menuItem="itemM"></courseSection>
 								<u-line></u-line>
 								
@@ -69,7 +70,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="bottomBox">
+		<view class="bottomBox" v-if="!hideBuyState">
 			<view class="priceTag">¥ {{toFixed(detail.standPrice)}}</view>
 			<view style="display: flex;color: #FFFFFF;align-items: center;">
 				<view class="btn1" @click="addCart">加购物车</view>
@@ -83,7 +84,7 @@
 import courseModule from '@/components/course/courseModule.vue';
 import courseChapter from '@/components/course/courseChapter.vue';
 import courseSection from '@/components/course/courseSection.vue';
-import { mapGetters } from 'vuex';
+import { mapGetters,mapMutations  } from 'vuex';
 export default {
 	components: {
 		courseModule,
@@ -101,6 +102,7 @@ export default {
 					name: '大纲'
 				}
 			],
+			menuIndex:[],
 			current:0,
 			detail:{},
 			courseList:[],
@@ -112,12 +114,13 @@ export default {
 			autoplay:true,
 			listenConfigList:[],
 			listenSecond:0,
+			isFirstEnter:true, //是否首次进入
 			timer:null,
 			businessData:{},
 			startTime:0
 		};
 	},
-	computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList','playSectionId']) },
+	computed: { ...mapGetters(['userInfo','goodsAuditionConfigIdList','playSectionId','hideBuyState']) },
 	onLoad(option) {
 		this.id = option.id;
 		this.getDetail()
@@ -161,8 +164,10 @@ export default {
 			}
 			
 		})
+		this.updateChapterOpen(true)
 	},
 	methods: {
+		 ...mapMutations(['updateChapterOpen']),
 		courseBusiness(){
 			this.$api.courseBusiness(this.detail.businessId).then(res => {
 				this.businessData = res.data.data;
@@ -240,10 +245,41 @@ export default {
 						item.down = true
 						item.menuList = []
 					}
-					self.courseList = res.data.rows
+					self.courseList = res.data.rows;
+					this.getFirstCourse();
 				}
 			});
 		},
+		/**
+		 * 获取第一个有模块或者章的课程
+		 */
+		async getFirstCourse() {
+			for(let i = 0; i < this.courseList.length; i++) {
+				
+				let menuIndexOrFalse = await this.getCourseMenus(this.courseList[i]);
+				
+				if(menuIndexOrFalse !== false) {
+					this.menuIndex = [i,menuIndexOrFalse]
+					this.openCourse(this.courseList[i])
+					break
+				}
+			}
+		},
+		getCourseMenus(item) {
+			return new Promise(resolve => {
+				this.$api.menuList({courseId:item.courseId}).then(res => {
+					if(res.data.code==200){
+						for(let i=0;i<res.data.rows.length;i++){
+							if(res.data.rows[i].type == 1 || res.data.rows[i].type == 2) {
+								resolve(i)
+								break;
+							}
+						}
+					}
+				});
+			})
+			
+		},
 		getMenuList(item) {
 			let self = this
 			this.$api.menuList({courseId:item.courseId}).then(res => {
@@ -361,7 +397,6 @@ export default {
 		text-overflow:ellipsis; 
 	}
 	.videoBox{
-		position: fixed;
 		background-color: #FFFFFF;
 		width: 100%;
 		/* height: 680rpx; */

+ 2699 - 1941
pages3/polyv/detail.vue

@@ -1,2113 +1,2871 @@
 <template>
-	<view>
-		<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;top: 0;" id="top">
-			<view class="video_box" v-if="!startStatus">
-				<image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
-				<image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
-			</view>
-			<view v-else>
-				<view   class="video_box" style="width: 100%;height: 460rpx;" v-if="playVID">
-					<polyv-player
-						id="playerVideo"
-						playerId="playerVideo"
-						height="460rpx"
-						:vid="vid"
-						:showSettingBtn="true"
-						:enablePlayGesture="true"
-						@statechange="onStateChange"
-						:autoplay="autoplay"
-						:isAllowSeek="isAllowSeek"
-						:playbackRate="playbackRate"
-						:startTime="startTime"
-					></polyv-player>
-				</view>
-				<view class="video_box" style="width: 100%;height: 460rpx;" v-if="playChannelId>0">
-				  <player
-				    class="plv-mp-demo-player"
-				    :videoOption="videoOption"
-					@onLiveStatusChange="playerLiveStatusChange"
-				  />
-				</view> 
-			</view>
-			
-			<view>
-				<u-row>
-					<u-col span="10">
-						<view class="video_t1">{{ detail.courseName }}</view>
-					</u-col>
-					<u-col span="2" v-if="false">
-						<view class="video_t1_t" @click="openJY">
-							<image src="/static/icon/jy_icon.png" style="width: 40rpx;height: 40rpx;"></image>
-							讲义
-						</view>
-					</u-col>
-				</u-row>
-			</view>
-			<u-line color="#D6D6DB" />
-			<view>
-				<view><u-tabs gutter="0" :item-width="itemWidth()" :list="list" font-size="32" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
-			</view>
-			<u-line color="#D6D6DB" />
-		</view>
-		<view class="box">
-			
-			<!--目录 -->
-			<view v-show="current == 0">
-				<view class="menuBox" v-for="(item, index) in menuList" :key="index">
-					<!--模块 -->
-					<view v-if="item.type == 1"><courseModule :courseId="courseId" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
-					<!--章 -->
-					<view v-if="item.type == 2"><courseChapter :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
-					<!--节 -->
-					<view v-if="item.type == 3"><courseSection @playEnd="sectionPlayEnd($event,index)" :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
-				</view>
-			</view>
-			<!--讲义 -->
-			<view v-show="current == 1">
-				<view class="lecture-box" v-if="courseHandoutsData">
-					<view class="title">
-						{{courseHandoutsData.handoutsName}}
-						<!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
-					</view>
-					<view class="btn" @click="openDocument">
-						<u-icon name="download" color="#007AFF" size="40"></u-icon>
-					</view>
-				</view>
-				
-				<view style="text-align: center;" v-else>暂无讲义</view>
-				<!-- <view class="lecture-content">
-					<rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
-				</view> -->
-				
-			<!-- 	<view class="inputBottom">
-					<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
-					<view style="width: 73%;height: 100%;padding: 10rpx 0;">
-						<u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
-					</view>
-					<view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
-				</view> -->
-				
-			</view>
-			<!--笔记 -->
-			<view v-show="current == 2">
-				<view v-if="noteList.length == 0" style="text-align: center;">暂无笔记</view>
-				<view class="inputBottom">
-					<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
-					<view style="width: 73%;height: 100%;padding: 10rpx 0;">
-						<u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
-					</view>
-					<view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
-				</view>
-				<view v-for="(item, index) in noteList" :key="index">
-					<view class="dateBox">{{ $method.timestampToTime(item.dateNote) }}</view>
-					<view class="noteBox">
-						<view v-for="(item1, index1) in item.userNotes" :key="index1" style="margin-top: 30rpx;" @click="jumpNote(item1)">
-							<view style="display: flex;">
-								<view>
-									<view>
-										<image src="/static/icon/note2.png" v-if="noteId != item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
-										<image src="/static/icon/note1.png" v-if="noteId == item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
-									</view>
-									<view class="title" style="width: 39rpx;height: 39rpx;margin:0 29rpx;">{{ $method.secondToDate(item1.noteSecond) }}</view>
-								</view>
-								<view style="margin-left: 10rpx;">
-									<view class="t2Content leftPadding">{{ item1.sectionName }}</view>
-									<view class="tBox2">{{ item1.noteText }}</view>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-			<!--答疑 -->
-			<view v-show="current == 3">
-				<view class="inputBottom">
-					<view class="flex_auto">
-						<u-input height="60" fixed="true" :placeholder="placeholder" type="textarea" :custom-style="inputStyle" v-model="ctxValue" />
-					</view>
-					<view class="btn" @click="postContent">提交</view>
-				</view>
-				<view v-for="(item, index) in answerList" :key="index" style="background-color: #FFFFFF;margin-bottom: 20rpx;">
-					<view class="chat_box" @click.stop="clearCtx">
-						<view style="display: flex;">
-							<view><image :src="$method.splitImgHost(item.avatar)" style="width: 64rpx;height: 64rpx;"></image></view>
-							<view style="margin-left: 15rpx;">
-								<view class="chat1">{{ item.realname }}</view>
-								<view class="chat2">{{ $method.timestampToTime(item.createTime) }}</view>
-								<view class="chat3">
-									<text v-if="item.assignUserId > 0">回复</text>
-									<text v-if="item.assignUserId > 0" style="color: #007AFF;">@{{ item.assignRealname }}</text>
-									{{ item.answerText }}
-								</view>
-							</view>
+  <view class="polyv_detail">
+    <nav-bar
+      :title="detail.courseName || '课程详情'"
+      v-show="navShow"
+    ></nav-bar>
+    <view id="top">
+      <view class="video_box" v-if="!startStatus">
+        <image
+          :src="$method.splitImgHost(detail.coverUrl)"
+          mode="widthFix"
+          style="width: 100%; height: 460rpx"
+        ></image>
+        <image
+          v-if="false"
+          class="video_play"
+          src="/static/play.png"
+          @click="startVideo"
+        ></image>
+      </view>
+      <view v-else>
+        <view
+          class="video_box"
+          style="width: 100%; height: 460rpx"
+          v-if="playVID"
+        >
+          <polyv-player
+            id="playerVideo"
+            playerId="playerVideo"
+            height="460rpx"
+            :vid="vid"
+            :showSettingBtn="true"
+            :enablePlayGesture="true"
+            :custom-cache="false"
+            :object-fit="'contain'"
+            @statechange="onStateChange"
+            @fullscreenchange="fullscreenchange"
+            @error="playError"
+            :autoplay="autoplay"
+            :isAllowSeek="isAllowSeek"
+            :playbackRate="playbackRate"
+            :startTime="startTime"
+            :enableAutoRotation="enableAutoRotation"
+						@loadedmetadata="loadedmetadata"
+          ></polyv-player>
+          <cover-view
+            class="video-toast__close"
+            v-if="videoToastShow"
+            @click="closeToast()"
+            >X</cover-view
+          >
+          <cover-view class="video-toast" v-if="videoToastShow">
+            <cover-view class="video-toast__text"
+              >您上次看到 {{ seekTime }},正在自动续播</cover-view
+            >
+            <cover-view class="video-toast__btn" @click="restart()"
+              >从头播放</cover-view
+            >
+          </cover-view>
+        </view>
+        <view
+          class="video_box"
+          style="width: 100%; height: 460rpx"
+          v-if="playChannelId > 0"
+        >
+          <player
+            class="plv-mp-demo-player"
+            :videoOption="videoOption"
+            @onLiveStatusChange="playerLiveStatusChange"
+          />
+        </view>
+      </view>
+      <view>
+        <u-row>
+          <u-col span="10">
+            <view class="video_t1">{{ detail.courseName }}</view>
+          </u-col>
+          <u-col span="2">
+            <div class="notice_wrap" v-if="goodsData.buyNote">
+              <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
+            </div>
+          </u-col>
+        </u-row>
+      </view>
+      <u-line color="#D6D6DB" />
+      <view>
+        <view
+          ><u-tabs
+            gutter="0"
+            :item-width="itemWidth()"
+            :list="list"
+            font-size="32"
+            bar-width="24"
+            :current="current"
+            @change="change"
+            active-color="#007AFF"
+          ></u-tabs
+        ></view>
+      </view>
+      <u-line color="#D6D6DB" />
+    </view>
+    <view class="box">
+      <scroll-view class="box_in" scroll-y="true">
+        <!--目录 -->
+        <view v-show="current == 0">
+          <view class="menuBox" v-for="(item, index) in menuList" :key="index">
+            <!--模块 -->
+            <view v-if="item.type == 1"
+              ><courseModule
+								:orderGoodsId="orderGoodsId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                :needOpen="menuIndex[0] === index ? true : false"
+                :courseId="courseId"
+                :preItem="menuList[index - 1]"
+                :learningOrder="businessData.goodsLearningOrder"
+                :goodsId="goodsId"
+                :gradeId="gradeId"
+                :isBuy="true"
+                :menuItem="item"
+                :levelId="item.menuId"
+              ></courseModule
+            ></view>
+            <!--章 -->
+            <view v-if="item.type == 2"
+              ><courseChapter
+								:orderGoodsId="orderGoodsId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                :needOpen="menuIndex[0] === index ? true : false"
+                :courseId="courseId"
+                :preItem="menuList[index - 1]"
+                @playEnd="sectionPlayEnd($event, index)"
+                :learningOrder="businessData.goodsLearningOrder"
+                :goodsId="goodsId"
+                :gradeId="gradeId"
+                :isBuy="true"
+                :menuItem="item"
+                :levelId="'0-' + item.menuId"
+              ></courseChapter
+            ></view>
+            <!--节 -->
+            <view v-if="item.type == 3"
+              ><courseSection
+								:orderGoodsId="orderGoodsId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                @playEnd="sectionPlayEnd($event, index)"
+                :courseId="courseId"
+                :preItem="menuList[index - 1]"
+                :learningOrder="businessData.goodsLearningOrder"
+                :goodsId="goodsId"
+                :gradeId="gradeId"
+                :isBuy="true"
+                :menuItem="item"
+                :levelId="'0-0-' + item.menuId"
+              ></courseSection
+            ></view>
+          </view>
+        </view>
+        <!--讲义 -->
+        <view v-show="current == 1">
+          <view class="lecture-box" v-if="courseHandoutsData">
+            <view class="title">
+              {{ courseHandoutsData.handoutsName }}
+              <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
+            </view>
+            <view class="btn" @click="openDocument">
+              <u-icon name="download" color="#007AFF" size="40"></u-icon>
+            </view>
+          </view>
+
+          <view style="text-align: center" v-else>暂无讲义</view>
+          <!-- <view class="lecture-content">
+						<rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
+					</view> -->
+
+          <!-- 	<view class="inputBottom">
+						<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
+						<view style="width: 73%;height: 100%;padding: 10rpx 0;">
+							<u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
 						</view>
-						<view class="btnReply" @click.stop="replyContent(item)" v-if="item.userId != userInfo.userId">回复</view>
-						<view v-else class="btnDel" @click.stop="delContent(item)">删除</view>
-					</view>
-					<u-line color="#D6D6DB" />
-				</view>
-				<view v-if="answerList.length == 0" style="text-align: center;">暂无记录</view>
-			</view>
-			<!--目录 -->
-			<view v-show="current == 4" >
-				<view class="menuBox" v-for="(item, index) in reMenuList" :key="index">
-					<!--模块 -->
-					<view v-if="item.type == 1"><courseModule :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
-					<!--章 -->
-					<view v-if="item.type == 2">
-						<courseChapter :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>			
-					</view>
-					<!--节 -->
-					<view v-if="item.type == 3">
-						<courseSection :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)"  :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!-- 播放前拍照end -->
-		<u-popup v-model="showSet" :mask-close-able="false" mode="center" border-radius="24">
-			<view style="align-items:center;padding: 0 40rpx;display: flex;flex-direction: column;justify-content:center;">
-				<view style="font-weight: bold;color: #333333;font-size: 30rpx;margin-top: 30rpx;">温馨提示</view>
-				<view style="width: 457rpx;color: #666666;font-size: 30rpx;margin-top: 30rpx;">学习过程中需要拍照验证学员身份,
-拍照功能需要使用您的相机。
-是否授权使用?</view>
-				<view style="margin: 40rpx 0;">
-					<button open-type="openSetting" @bindopensetting="openSetting" class="btnSet">去授权</button>
-				</view>
-			</view>
-		</u-popup>
-		
-		<u-mask :show="photoPopup" >
-		<!-- 播放前拍照start -->
-		<view v-if="photoPopup"  :mask-close-able="false" style="bottom: 0;position: fixed;width: 100%;z-index: 999;">
-			<view class="photoBox">
-				<view class="photoTop">
-					<view class="sqzz" v-if="false"><u-icon name="close" color="#333333" size="30" @click="closePhoto"></u-icon></view>
-					<view class="centersq">请正视手机屏幕</view>
-					<view class="sqzz"></view>
-				</view>
-				<view class="photoCenter">
-					<view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
-						<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
-					</view>
-					<view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
-				</view>
-				<view class="btnResult" @click="takePhoto">拍照</view>
-			</view>
-		</view>
+						<view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
+					</view> -->
+        </view>
+        <!--笔记 -->
+        <view v-show="current == 2">
+          <view v-if="noteList.length == 0" style="text-align: center"
+            >暂无笔记</view
+          >
+          <view class="inputBottom" v-if="!(isPlayRebuild > 0)">
+            <view style="width: 10%"
+              ><image
+                src="/static/icon/note3.png"
+                style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+              ></image
+            ></view>
+            <view style="width: 73%; height: 100%; padding: 10rpx 0">
+              <u-input
+                class="input"
+                height="60"
+                fixed="true"
+                placeholder="您可以在这里输入笔记内容"
+                type="input"
+                :custom-style="inputStyle"
+                v-model="noteValue"
+              />
+            </view>
+            <view
+              style="
+                color: #007aff;
+                font-size: 30rpx;
+                font-weight: bold;
+                width: 15%;
+                text-align: center;
+              "
+              @click="postNote"
+              >提交</view
+            >
+          </view>
+          <view v-for="(item, index) in noteList" :key="index">
+            <view class="dateBox">{{
+              $method.timestampToTime(item.dateNote)
+            }}</view>
+            <view class="noteBox">
+              <view
+                v-for="(item1, index1) in item.userNotes"
+                :key="index1"
+                style="margin-top: 30rpx"
+                @click="jumpNote(item1)"
+              >
+                <view style="display: flex">
+                  <view>
+                    <view>
+                      <image
+                        src="/static/icon/note2.png"
+                        v-if="noteId != item1.noteId"
+                        style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                      ></image>
+                      <image
+                        src="/static/icon/note1.png"
+                        v-if="noteId == item1.noteId"
+                        style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                      ></image>
+                    </view>
+                    <view
+                      class="title"
+                      style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
+                      >{{ $method.secondToDate(item1.noteSecond) }}</view
+                    >
+                  </view>
+                  <view style="margin-left: 10rpx">
+                    <view class="t2Content leftPadding">{{
+                      item1.sectionName
+                    }}</view>
+                    <view class="tBox2">{{ item1.noteText }}</view>
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <!--答疑 -->
+        <view v-show="current == 3">
+          <view class="inputBottom">
+            <view class="flex_auto">
+              <u-input
+                height="60"
+                fixed="true"
+                :placeholder="placeholder"
+                type="input"
+                :custom-style="inputStyle"
+                v-model="ctxValue"
+              />
+            </view>
+            <view class="btn" @click="postContent">提交</view>
+          </view>
+          <view
+            v-for="(item, index) in answerList"
+            :key="index"
+            style="background-color: #ffffff; margin-bottom: 20rpx"
+          >
+            <view class="chat_box" @click.stop="clearCtx">
+              <view style="display: flex; flex: 1">
+                <view
+                  ><image
+                    :src="
+                      item.assignUserId > 0 && !item.realname
+                        ? '/static/logo_xcx.png'
+                        : $method.splitImgHost(item.avatar)
+                    "
+                    style="width: 64rpx; height: 64rpx"
+                  ></image
+                ></view>
+                <view style="margin-left: 15rpx">
+                  <view class="chat1">{{
+                    item.assignUserId > 0 && !item.realname
+                      ? "祥粤老师"
+                      : item.realname
+                  }}</view>
+                  <view class="chat2">{{
+                    $method.timestampToTime(item.createTime, false)
+                  }}</view>
+                  <view class="chat3">
+                    <text v-if="item.assignUserId > 0">回复</text>
+                    <text v-if="item.assignUserId > 0" style="color: #007aff"
+                      >@{{ item.assignRealname }}</text
+                    >
+                    <view style="word-break: break-all">{{
+                      item.answerText
+                    }}</view>
+                  </view>
+                </view>
+              </view>
+              <view
+                class="btnReply"
+                @click.stop="replyContent(item)"
+                v-if="item.userId != userInfo.userId"
+                >回复</view
+              >
+              <view v-else class="btnDel" @click.stop="delContent(item)"
+                >删除</view
+              >
+            </view>
+            <u-line color="#D6D6DB" />
+          </view>
+          <view v-if="answerList.length == 0" style="text-align: center"
+            >暂无记录</view
+          >
+        </view>
+        <!--目录 -->
+        <view v-show="current == 4">
+          <view
+            class="menuBox"
+            v-for="(item, index) in reMenuList"
+            :key="index"
+          >
+            <!--模块 -->
+            <view v-if="item.type == 1"
+              ><courseModule
+								:orderGoodsId="orderGoodsId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                :courseId="courseId"
+                :goodsId="goodsId"
+                :gradeId="gradeId"
+                :isRebuild="true"
+                :isBuy="true"
+                :menuItem="item"
+                :levelId="item.menuId"
+              ></courseModule
+            ></view>
+            <!--章 -->
+            <view v-if="item.type == 2">
+              <courseChapter
+								:orderGoodsId="orderGoodsId"
+                :courseId="courseId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                @playEnd="sectionPlayEnd($event, index)"
+                :gradeId="gradeId"
+                :goodsId="goodsId"
+                :isRebuild="true"
+                :isBuy="true"
+                :menuItem="item"
+                :levelId="'0-' + item.menuId"
+              ></courseChapter>
+            </view>
+            <!--节 -->
+            <view v-if="item.type == 3">
+              <courseSection
+								:orderGoodsId="orderGoodsId"
+                :courseId="courseId"
+                :sectionMaxNum="goodsData.sectionMaxNum"
+                @playEnd="sectionPlayEnd($event, index)"
+                :gradeId="gradeId"
+                :goodsId="goodsId"
+                :isRebuild="true"
+                :isBuy="true"
+                :nextMenuItem="findMenuNextSection(index)"
+                :menuItem="item"
+                :levelId="'0-0-' + item.menuId"
+              ></courseSection>
+            </view>
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+    <!-- 播放前拍照end -->
+    <u-popup
+      v-model="showSet"
+      :mask-close-able="false"
+      mode="center"
+      border-radius="24"
+    >
+      <view
+        style="
+          align-items: center;
+          padding: 0 40rpx;
+          display: flex;
+          flex-direction: column;
+          justify-content: center;
+        "
+      >
+        <view
+          style="
+            font-weight: bold;
+            color: #333333;
+            font-size: 30rpx;
+            margin-top: 30rpx;
+          "
+          >温馨提示</view
+        >
+        <view
+          style="
+            width: 457rpx;
+            color: #666666;
+            font-size: 30rpx;
+            margin-top: 30rpx;
+          "
+          >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
+          是否授权使用?</view
+        >
+        <view style="margin: 40rpx 0">
+          <button
+            open-type="openSetting"
+            @bindopensetting="openSetting"
+            class="btnSet"
+          >
+            去授权
+          </button>
+        </view>
+      </view>
+    </u-popup>
+
+    <u-mask :show="photoPopup">
+      <!-- 播放前拍照start -->
+      <view
+        v-if="photoPopup"
+        :mask-close-able="false"
+        style="bottom: 0; position: fixed; width: 100%; z-index: 999"
+      >
+        <view class="photoBox">
+          <view class="photoTop">
+            <view class="sqzz" v-if="false"
+              ><u-icon
+                name="close"
+                color="#333333"
+                size="30"
+                @click="closePhoto"
+              ></u-icon
+            ></view>
+            <view class="centersq">请正视手机屏幕</view>
+            <view class="sqzz"></view>
+          </view>
+          <view class="photoCenter">
+            <view
+              style="width: 100%; height: 979rpx; position: fixed"
+              v-if="photoPopup && isTaking"
+            >
+              <camera
+                device-position="front"
+                flash="off"
+                @error="error"
+                style="width: 100%; height: 100%"
+              ></camera>
+            </view>
+            <view class="custom" v-if="!isTaking"
+              ><image :src="avatarUrl" mode=""></image
+            ></view>
+          </view>
+          <view class="btns">
+            <view class="btnResult" v-if="isTaking" @click="takePhoto"
+              >拍照</view
+            >
+            <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
+            <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
+          </view>
+        </view>
+      </view>
+    </u-mask>
 
-		</u-mask>
-	</view>
-	
+    <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%">
+          <view class="title">学员须知</view>
+          <text class="text">
+            {{ goodsData.buyNote }}
+          </text>
+        </scroll-view>
+      </div>
+    </u-popup>
+  </view>
 </template>
 
 <script>
-import plv from '../static/polyv-sdk/index';
-import courseModule from '@/components/course/courseModule.vue';
-import courseChapter from '@/components/course/courseChapter.vue';
-import courseSection from '@/components/course/courseSection.vue';
-import { mapGetters } from 'vuex';
+import plv from "../static/polyv-sdk/index";
+import courseModule from "@/components/course/courseModule.vue";
+import courseChapter from "@/components/course/courseChapter.vue";
+import courseSection from "@/components/course/courseSection.vue";
+// import { websocket } from "@/common/socket.js";
+import { mapGetters, mapMutations } from "vuex";
 export default {
-	components: {
-		courseModule,
-		courseChapter,
-		courseSection
-	},
-	data() {
-		return {
-			initLiveOk:false,
-			livePlay:false, //是否正在播放直播,不含暂停
-			liveDuration:0, //直播观看时长
-			videoOption:{
-				mode: 'live',
-				uid: '',
-				cid: '',
-				openId: '',
-				isAutoChange: false,
-				forceVideo: false, 
-			},
-			courseHandoutsData:'',
-			liveDetail:{},
-			showSet:false,
-			startStatus: false,
-			detail: {},
-			courseId: 0,
-			placeholder: '您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记',
-			inputStyle: {
-				background: 'rgba(244, 244, 244, 0.98)',
-				borderRadius: '24rpx',
-				padding: '8rpx',
-				marginBottom: '10rpx'
-			},
-			list: [],
-			menuList: [],
-			current: 0,
-			vid: '',
-			goodsId: 0,
-			goodsData: {},
-			photoPopup: false,
-			goodsPlayConfig: null,
-			autoplay: false,
-			isAllowSeek: 'no',
-			playbackRate: [1.0],
-			timer: null,
-			goodsPhotographConfig: null,
-			intervalTimeList: [], // 间隔拍照时长
-			intervalTimeIndex: 0, //当前处于哪个时间段拍照
-			playTime: 0, //页面播放时长,不含暂停
-			currentTime: 0,
-			avatarUrl: '',
-			ossAvatarUrl: '',
-			studyDuration: 0, // 当前视频时长
-			gradeId: 0,
-			chapterId: 0,
-			moduleId: 0,
-			reMenuList: [],
-			answerList: [],
-			assignUserId: 0,
-			placeholder: '您可以在这里输入答疑内容',
-			ctxValue: '',
-			noteList: [],
-			noteValue: '',
-			noteId: 0,
-			recordObj: 0,
-			gradeDetail:{},
-			needSeek: false, //第一次播放是否需要跳转
-			needProfileModal:false, //是否需要资料审核弹框
-			liveObj:{},
-			photoNum:0,
-			photoList:[], //拍照的时间点
-			photoConfig:false, //是否配置好拍照次数
-			photoIndex:0, //当前位于拍照的区间下标 从0开始
-			photoHistoryList:[], //已拍照历史的下标点
-			businessData:{},
-			isRebuild:false, //视频是否从重修目录点击
-		};
-	},
-	computed: { ...mapGetters(['userInfo', 'playSectionId','playChannelId','playVID']) },
-	onLoad(option) {
-		this.courseId = Number(option.id);
-		this.goodsId = Number(option.goodsId);
-		this.courseDetail();
-		this.getGoodsDetail();
-		this.getAnswerList();
-		let noteSecond = Number(option.noteSecond);
-		if(noteSecond>0){
-			//我的消息跳过来,播放节
-			let item = {
-				sectionId:Number(option.sectionId),
-				recordingUrl:option.recordingUrl,
-				noteSecond:noteSecond,
-				studyDuration:noteSecond
-			}
-			this.$store.commit('setPlaySectionId', {playSectionId  :item.sectionId});
-			this.$store.commit('setPlayVID', {playVID  :item.recordingUrl});
-			this.playNoteVideo(item);
-		}
+  components: {
+    courseModule,
+    courseChapter,
+    courseSection,
+  },
+  data() {
+    return {
+      lockTimer: null,
+      orderGoodsId: 0,
+      noticeShow: false,
+      navShow: true,
+      enableAutoRotation: true,
+      seekTime: "",
+      toastTimer: null,
+      videoToastShow: false,
+      initLiveOk: false,
+      livePlay: false, //是否正在播放直播,不含暂停
+      liveDuration: 0, //直播观看时长
+      videoOption: {
+        mode: "live",
+        uid: "",
+        cid: "",
+        openId: "",
+        isAutoChange: false,
+        forceVideo: false,
+      },
+      courseHandoutsData: "",
+      liveDetail: {},
+      showSet: false,
+      startStatus: false,
+      detail: {},
+      courseId: 0,
+      placeholder:
+        "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
+      inputStyle: {
+        background: "rgba(244, 244, 244, 0.98)",
+        borderRadius: "24rpx",
+        padding: "8rpx",
+        marginBottom: "10rpx",
+      },
+      list: [],
+      menuList: [],
+      current: 0,
+      vid: "",
+      goodsId: 0,
+      goodsData: {},
+      photoPopup: false,
+      goodsPlayConfig: null,
+      autoplay: false,
+      isAllowSeek: "no",
+      playbackRate: [1.0],
+      timer: null,
+      answerTimer: null,
+      goodsPhotographConfig: null,
+      intervalTimeList: [], // 间隔拍照时长
+      intervalTimeIndex: 0, //当前处于哪个时间段拍照
+      playTime: 0, //页面播放时长,不含暂停
+      currentTime: 0,
+      avatarUrl: "",
+      ossAvatarUrl: "",
+      studyDuration: 0, // 当前视频时长
+      gradeId: 0,
+      chapterId: 0,
+      moduleId: 0,
+      reMenuList: [],
+      answerList: [],
+      assignUserId: 0,
+      placeholder: "您可以在这里输入答疑内容",
+      ctxValue: "",
+      noteList: [],
+      noteValue: "",
+      noteId: 0,
+      recordObj: 0,
+      gradeDetail: {},
+      isTaking: true, //是否正在拍照
+      needSeek: false, //第一次播放是否需要跳转
+      needProfileModal: false, //是否需要资料审核弹框
+      liveObj: {},
+      photoNum: 0,
+      photoList: [], //拍照的时间点
+      photoConfig: false, //是否配置好拍照次数
+      photoIndex: 0, //当前位于拍照的区间下标 从0开始
+      photoHistoryList: [], //已拍照历史的下标点
+      sectionItem: null,
+      businessData: {},
+      showNotes: true,
+      menuIndex: [],
+      uploadLock: false, //上传图片
+      isPlayRebuild: false, //是否正在播放重修视频
+      isRebuild: false, //视频是否从重修目录点击
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID","playObj"]),
+  },
+  onLoad(option) {
+    this.courseId = Number(option.id);
+    this.goodsId = Number(option.goodsId);
+    this.orderGoodsId = Number(option.orderGoodsId);
+    this.courseDetail();
+    this.getGoodsDetail();
+    this.getAnswerList();
+    this.answerTimer = setInterval(() => {
+      this.getAnswerList();
+    }, 5000);
+    let noteSecond = Number(option.noteSecond);
+    if (noteSecond > 0) {
+      //我的消息跳过来,播放节
+      let item = {
+        sectionId: Number(option.sectionId),
+        recordingUrl: option.recordingUrl,
+        noteSecond: noteSecond,
+        studyDuration: noteSecond,
+      };
+      let playNextId = `moduleId${option.moduleId}chapterId${
+        option.chapterId
+      }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
+      this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId });
+      this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
+      this.$store.commit("updatePlayNextId", playNextId);
+      console.log("this.playNoteVideo");
+    }
+  },
+  onShow() {
+    var self = this;
+    //相机授权
+    this.getCameraSetting();
+    this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
+      console.log(res, "res");
+      if (res.data.code === 200 && res.data.rows.length) {
+        if (res.data.rows[0].keyValue) {
+          self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
+            if (baseRes.data.code === 200) {
+              if (baseRes.data.data) {
+                self.$api
+                  .getbaseprofiletpgetInfo({
+                    goodsId: self.goodsId,
+                    orderGoodsId: self.orderGoodsId,
+                  })
+                  .then((result) => {
+                    console.log(result, "result");
+                    if (result.data.code === 200) {
+                      if (
+                        !result.data.data ||
+                        (result.data.data.status === 3 &&
+                          result.data.data.changeStatus === 1)
+                      ) {
+                        if (!result.data.data) {
+                          self.needProfileModal = true;
+                          uni.showModal({
+                            content: "请前往填写资料",
+                            cancelText: "返回",
+                            success: function (resultst) {
+                              if (resultst.confirm) {
+                                self.$navTo.togo("/pages2/verify/input", {
+                                  id: self.goodsId,
+                                  orderGoodsId: self.orderGoodsId,
+                                });
+                              }
+                              if (resultst.cancel) {
+                                uni.navigateBack();
+                              }
+                            },
+                          });
+                        } else {
+                          self.needProfileModal = true;
+                          uni.showModal({
+                            content: "资料审核不通过,请前往重新填写",
+                            cancelText: "返回",
+                            success: function (resultst) {
+                              if (resultst.confirm) {
+                                self.$navTo.togo("/pages2/verify/input", {
+                                  id: self.goodsId,
+                                  orderGoodsId: self.orderGoodsId,
+                                });
+                              }
+                              if (resultst.cancel) {
+                                uni.navigateBack();
+                              }
+                            },
+                          });
+                        }
+                      } else if (
+                        result.data.data.status === 1 &&
+                        JSON.parse(res.data.rows[0].keyValue2)[0]
+                      ) {
+                        self.$api
+                          .getbaseprofileStampgetInfo({
+                            goodsId: self.goodsId,
+                            orderGoodsId: self.orderGoodsId,
+                          })
+                          .then((k) => {
+                            if (k.data.code === 200) {
+                              if (
+                                !k.data.data ||
+                                (k.data.data.status === 3 &&
+                                  k.data.data.changeStatus === 1)
+                              ) {
+                                if (!k.data.data) {
+                                  self.needProfileModal = true;
+                                  uni.showModal({
+                                    cancelText: "返回",
+                                    content: "请前往填写盖章资料",
+                                    success: function (resultst) {
+                                      if (resultst.confirm) {
+                                        self.$navTo.togo(
+                                          "/pages2/verify/input2",
+                                          {
+                                            id: self.goodsId,
+                                            orderGoodsId: self.orderGoodsId,
+                                          }
+                                        );
+                                      }
+                                      if (resultst.cancel) {
+                                        uni.navigateBack();
+                                      }
+                                    },
+                                  });
+                                } else {
+                                  self.needProfileModal = true;
+                                  uni.showModal({
+                                    cancelText: "返回",
+                                    content:
+                                      "资料盖章审核不通过,请前往重新填写",
+                                    success: function (resultst) {
+                                      if (resultst.confirm) {
+                                        self.$navTo.togo(
+                                          "/pages2/verify/input2",
+                                          {
+                                            id: self.goodsId,
+                                            orderGoodsId: self.orderGoodsId,
+                                          }
+                                        );
+                                      }
+                                      if (resultst.cancel) {
+                                        uni.navigateBack();
+                                      }
+                                    },
+                                  });
+                                }
+                              }
+                            }
+                          });
+                      }
+                    }
+                  });
+              }
+            }
+          });
+        }
+      }
+    });
+    console.log(this.gradeId, 7512);
+    if (this.gradeId > 0) {
+      //提交完资料返回判断是否已开班
+
+      this.getGradeInfo();
+    }
+  },
+	onHide() {
 		
 	},
-	onShow() {
-		var self = this;
-		//相机授权
-		this.getCameraSetting()
-		this.$api.getbaseprofiletplists({ goodsId: self.goodsId }).then(res => {
-			console.log(res,'res')
-			if (res.data.code === 200 && res.data.rows.length) {
-				if (res.data.rows[0].keyValue) {
-					self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
-						console.log(result,'result')
-						if (result.data.code === 200) {
-							if (!result.data.data || (result.data.data.status === 3 && result.data.data.changeStatus === 1)) {								
-								if (!result.data.data) {
-									self.needProfileModal = true
-									uni.showModal({
-										content: '请前往填写资料',
-										cancelText: '返回',
-										success: function(resultst) {
-											if (resultst.confirm) {
-												self.$navTo.togo('/pages2/verify/input', {
-													id: self.goodsId
-												});
-											}
-											if (resultst.cancel) {
-												uni.navigateBack();
-											}
-										}
-									});
-								} else {
-									self.needProfileModal = true
-									uni.showModal({
-										content: '资料审核不通过,请前往重新填写',
-										cancelText: '返回',
-										success: function(resultst) {
-											if (resultst.confirm) {
-												self.$navTo.togo('/pages2/verify/input', {
-													id: self.goodsId
-												});
-											}
-											if (resultst.cancel) {
-												uni.navigateBack();
-											}
-										}
-									});
-								}
-							} else if (result.data.data.status === 1 && JSON.parse(res.data.rows[0].keyValue2)[0]) {
-								self.$api.getbaseprofileStampgetInfo({ goodsId: self.goodsId }).then(k => {
-									
-									if (k.data.code === 200) {
-										if (!k.data.data || (k.data.data.status === 3 && k.data.data.changeStatus === 1)) {
-											if (!k.data.data) {
-												self.needProfileModal = true
-												uni.showModal({
-													cancelText: '返回',
-													content: '请前往填写盖章资料',
-													success: function(resultst) {
-														if (resultst.confirm) {
-															self.$navTo.togo('/pages2/verify/input2', {
-																id: self.goodsId
-															});
-														}
-														if (resultst.cancel) {
-															uni.navigateBack();
-														}
-													}
-												});
-											} else {
-												self.needProfileModal = true
-												uni.showModal({
-													cancelText: '返回',
-													content: '资料盖章审核不通过,请前往重新填写',
-													success: function(resultst) {
-														if (resultst.confirm) {
-															self.$navTo.togo('/pages2/verify/input2', {
-																id: self.goodsId
-															});
-														}
-														if (resultst.cancel) {
-															uni.navigateBack();
-														}
-													}
-												});
-											}
-										}
-									}
-								});
-							}
-						}
-					});
-				}
-			}
-		});
-		console.log(this.gradeId,7512)
-		if(this.gradeId>0){
-			//提交完资料返回判断是否已开班
-			
-			this.getGradeInfo()
-		}
-	},
-	onUnload() {
-		if (this.playSectionId > 0) {
-			//退出提交记录
-			this.postStudyRecord();
-		}
-		//清除正在播放的节ID
-		this.$store.commit('setPlaySectionId', { playSectionId: 0 });
-		this.$store.commit('setPlayChannelId', { playChannelId: 0 });
-		this.$store.commit('setPlayVID', { playVID: null });
-		this.closePlv()
-		console.log('onUnload')
-		//移除所有的事件监听器
-		uni.$off();
-		if (this.timer) {
-			clearInterval(this.timer);
-		}
-	},
-	mounted() {
-		uni.$on('changeSection', oldSectionId => {
-			console.log(this.playVID)
-			this.photoConfig = false
-			this.photoIndex = 0
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			if(polyvPlayerContext){
-				//解决同个节视频切换问题
-				polyvPlayerContext.pause();
-			}
-			//清除直播
-			this.$store.commit('setPlayChannelId', { playChannelId: 0 });
-			this.postStudyRecord(0, oldSectionId);
-		});
-		uni.$on('getSection', item => {
-			//清除直播
-			this.photoConfig = false
-			this.photoIndex = 0
-			this.$store.commit('setPlayChannelId', { playChannelId: 0 });
-			//获取拍照历史
-			this.getPhotoLastRecord()
-			this.playVideo(item);
-		});
-		uni.$on('levelId', item => {
-			let arr = item.split('-');
-			//点击节获取的各层级ID
-			this.moduleId = arr[0];
-			this.chapterId = arr[1];
-		});
-		uni.$on('getChannel', item => {
-			//清除录播
-			this.$store.commit('setPlayVID', {playVID  :null});
-			this.playChannel(item);
-		});
-		uni.$on('isRebuild',item => {
-			console.log(item)
-			this.isRebuild = item;
-		})
-	},
-	methods: {
-		/**
-		 * 模块大节播放完毕,刷新列表 
-		 */
-		sectionPlayEnd(isRebuild,index) {
-			console.log('sectionPlayEnd')
-			console.log('isRebuild',isRebuild)
-			if(this.reMenuList.length>0) {  //有重修目录
-				if(isRebuild.isRebuild) { //从重修点击
-					this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
-						console.log('Rebuild1')
-						if (res.data.code == 200) {
-							if(res.data.rows.length) {
-								// res.data.rows[index].name = res.data.rows[index].menuName;
-								// this.$set(this.reMenuList,index,res.data.rows[index])
-								for (let i = 0; i < res.data.rows.length; i++) {
-									let item = res.data.rows[i];
-									item.down = true;
-									item.id = item.menuId;
-									item.name = item.menuName;
-								}
-								this.reMenuList = []
-								this.$nextTick(() => {
-									this.reMenuList = res.data.rows;
-									console.log(this.reMenuList)
-								})
-								
-							} else {
-								this.reMenuList = []
-							}
-							
-							this.$nextTick(() => {
-								if(this.reMenuList.length>0){
-									this.list = [
-										
-										{
-											name: '目录'
-										},
-										{
-											name: '讲义'
-										},
-										{
-											name: '笔记'
-										},
-										{
-											name: '答疑'
-										},
-										{name:'重修目录'}
-									];
-								} else {
-									this.list = [
-										
-										{
-											name: '目录'
-										},
-										{
-											name: '讲义'
-										},
-										{
-											name: '笔记'
-										},
-										{
-											name: '答疑'
-										}
-									];
-									if(this.current == 4) {
-										this.current = 0;
-									}
-									
-								}
-							})
-							
-							
-						}
-					});
-					
-					this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
-						console.log('noRebuild1')
-						if (res.data.code == 200) {
-							for (let i = 0; i < res.data.rows.length; i++) {
-								let item = res.data.rows[i];
-								item.down = true;
-								item.id = item.menuId;
-								item.name = item.menuName;
-							}
-							this.menuList = []
-							this.$nextTick(() => {
-								this.menuList = res.data.rows;
-							})
-							
-						}
-					});
-				} else {  //从普通目录点击
-					this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
-						console.log('noRebuild2')
-						if (res.data.code == 200) {
-							res.data.rows[index].name = res.data.rows[index].menuName;
-							this.$set(this.menuList,index,res.data.rows[index])
-						}
-					});
-					
-					this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
-						console.log('Rebuild2')
-						if (res.data.code == 200) {
-							for (let i = 0; i < res.data.rows.length; i++) {
-								let item = res.data.rows[i];
-								item.down = true;
-								item.id = item.menuId;
-								item.name = item.menuName;
-							}
-							this.reMenuList = []
-							this.$nextTick(() => {
-								this.reMenuList = res.data.rows;
-								if(this.reMenuList.length>0){
-									this.list = [
-										
-										{
-											name: '目录'
-										},
-										{
-											name: '讲义'
-										},
-										{  
-											name: '笔记'
-										},
-										{
-											name: '答疑'
-										},
-										{name:'重修目录'}
-									];
-								} else {
-									this.list = [
-										
-										{
-											name: '目录'
-										},
-										{
-											name: '讲义'
-										},
-										{
-											name: '笔记'
-										},
-										{
-											name: '答疑'
-										}
-									];
-									if(this.current == 4) {
-										this.current = 0;
-									}
-								}
-							})
-							
-						}
-					});
-				}
-				
-			} else { //没有重修目录
-				this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
-						console.log('noRebuild3')
-					if (res.data.code == 200) {
-						res.data.rows[index].name = res.data.rows[index].menuName;
-						res.data.rows[index].id = res.data.rows[index].menuId;
-						this.$set(this.menuList,index,res.data.rows[index])
-					}
-				});
-				
-				
-			}
-			
-			
+  onUnload() {
+    if (this.playSectionId > 0) {
+      //退出提交记录
+      this.postStudyRecord();
+    }
+    //清除正在播放的节ID
+		this.$store.commit('setPlayObj',null)
+    this.$store.commit("setPlaySectionId", { playSectionId: 0 });
+    this.$store.commit("setPlayChannelId", { playChannelId: 0 });
+    this.$store.commit("setPlayVID", { playVID: null });
+    this.closePlv();
+    console.log("onUnload");
+    //移除所有的事件监听器
+    uni.$off();
+    clearInterval(this.answerTimer);
+    if (this.timer) {
+      clearInterval(this.timer);
+    }
+    console.log(this.lockTimer, "this.lockTimer");
+    if (this.lockTimer) {
+      clearInterval(this.lockTimer);
+      this.$api
+        .lockDelLock({
+          action: "jxjy",
+        })
+        .then((res) => {});
+    }
+    // websocket.sendMsg("delAction");
+  },
+  mounted() {
+    uni.$on("changeSection", (oldSectionId) => {
+      console.log(this.playVID);
+      this.photoConfig = false;
+      this.photoIndex = 0;
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      if (polyvPlayerContext) {
+        //解决同个节视频切换问题
+        polyvPlayerContext.seek(0);
+        polyvPlayerContext.pause();
+      }
+      //清除直播
+      this.$store.commit("setPlayChannelId", { playChannelId: 0 });
+      this.postStudyRecord(0, oldSectionId);
+    });
+    uni.$on("getSection", (item) => {
+      //清除直播
+      this.isPlayRebuild = item.rebuild;
+      this.photoConfig = false;
+      this.photoIndex = 0;
+      this.sectionItem = item;
+      this.$store.commit("setPlayChannelId", { playChannelId: 0 });
+      //获取拍照历史
+      this.getPhotoLastRecord();
+      this.playVideo(item);
+    });
+    uni.$on("levelId", (item) => {
+      let arr = item.split("-");
+      //点击节获取的各层级ID
+      this.moduleId = arr[0];
+      this.chapterId = arr[1];
+    });
+    uni.$on("getChannel", (item) => {
+      //清除录播
+      this.$store.commit("setPlayVID", { playVID: null });
+      this.playChannel(item);
+    });
+    uni.$on("isRebuild", (item) => {
+      console.log(item);
+      this.isRebuild = item;
+    });
+    this.updateChapterOpen(true);
+  },
+  methods: {
+    ...mapMutations(["updateChapterOpen","setPlayObj"]),
+    /**
+     * 模块大节播放完毕,刷新列表
+     */
+    sectionPlayEnd(isRebuild, index) {
+      console.log("sectionPlayEnd");
+      console.log("isRebuild", isRebuild), console.log("index", index);
+      if (this.reMenuList.length > 0) {
+        //有重修目录
+        if (isRebuild.isRebuild) {
+          //从重修点击
+          this.$api
+            .reMenuList({
+							orderGoodsId: this.orderGoodsId,
+              courseId: this.courseId,
+              rebuild: 1,
+              gradeId: this.gradeId,
+            })
+            .then((res) => {
+              console.log("Rebuild1");
+              if (res.data.code == 200) {
+                if (res.data.rows.length) {
+                  // res.data.rows[index].name = res.data.rows[index].menuName;
+                  // this.$set(this.reMenuList,index,res.data.rows[index])
+                  // for (let i = 0; i < res.data.rows.length; i++) {
+                  // 	let item = res.data.rows[i];
+                  // 	item.down = true;
+                  // 	item.id = item.menuId;
+                  // 	item.name = item.menuName;
+                  // }
+                  // this.reMenuList = []
+                  // this.$nextTick(() => {
+                  // 	this.reMenuList = res.data.rows;
+                  // 	console.log(this.reMenuList,'this.reMenuList1')
+                  // })
+                } else {
+                  this.reMenuList = [];
+                }
+
+                this.$nextTick(() => {
+                  if (this.reMenuList.length > 0) {
+                    this.list = [
+                      {
+                        name: "目录",
+                      },
+                      {
+                        name: "讲义",
+                      },
+                      {
+                        name: "笔记",
+                      },
+                      {
+                        name: "答疑",
+                      },
+                      { name: "重修目录" },
+                    ];
+                  } else {
+                    this.list = [
+                      {
+                        name: "目录",
+                      },
+                      {
+                        name: "讲义",
+                      },
+                      {
+                        name: "笔记",
+                      },
+                      {
+                        name: "答疑",
+                      },
+                    ];
+                    if (this.current == 4) {
+                      this.current = 0;
+                    }
+                  }
+                });
+              }
+            });
+
+          this.$api
+            .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
+            .then((res) => {
+              console.log("noRebuild1");
+              if (res.data.code == 200) {
+                for (let i = 0; i < res.data.rows.length; i++) {
+                  let item = res.data.rows[i];
+                  item.down = true;
+                  item.id = item.menuId;
+                  item.name = item.menuName;
+                  item.menuType = item.type;
+                }
+                this.menuList = [];
+                this.$nextTick(() => {
+                  this.menuList = res.data.rows;
+                });
+              }
+            });
+        } else {
+          //从普通目录点击
+          this.$api
+            .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
+            .then((res) => {
+              console.log("noRebuild2");
+              if (res.data.code == 200) {
+                res.data.rows[index].name = res.data.rows[index].menuName;
+                res.data.rows[index].id = res.data.rows[index].menuId;
+                this.$set(this.menuList, index, res.data.rows[index]);
+              }
+            });
+
+          this.$api
+            .reMenuList({
+							orderGoodsId: this.orderGoodsId,
+              courseId: this.courseId,
+              rebuild: 1,
+              gradeId: this.gradeId,
+            })
+            .then((res) => {
+              console.log("Rebuild2");
+              if (res.data.code == 200) {
+                if (res.data.rows.length) {
+                  // for (let i = 0; i < res.data.rows.length; i++) {
+                  // 	let item = res.data.rows[i];
+                  // 	item.down = true;
+                  // 	item.id = item.menuId;
+                  // 	item.name = item.menuName;
+                  // }
+                  // this.reMenuList = res.data.rows;
+                } else {
+                  this.reMenuList = [];
+                }
+
+                this.$nextTick(() => {
+                  if (this.reMenuList.length > 0) {
+                    this.list = [
+                      {
+                        name: "目录",
+                      },
+                      {
+                        name: "讲义",
+                      },
+                      {
+                        name: "笔记",
+                      },
+                      {
+                        name: "答疑",
+                      },
+                      { name: "重修目录" },
+                    ];
+                  } else {
+                    this.list = [
+                      {
+                        name: "目录",
+                      },
+                      {
+                        name: "讲义",
+                      },
+                      {
+                        name: "笔记",
+                      },
+                      {
+                        name: "答疑",
+                      },
+                    ];
+                    if (this.current == 4) {
+                      this.current = 0;
+                    }
+                  }
+                });
+              }
+            });
+        }
+      } else {
+        //没有重修目录
+        this.$api
+          .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
+          .then((res) => {
+            console.log("noRebuild3");
+            console.log("noRebuild3index", index);
+            if (res.data.code == 200) {
+              res.data.rows[index].name = res.data.rows[index].menuName;
+              res.data.rows[index].id = res.data.rows[index].menuId;
+              this.$set(this.menuList, index, res.data.rows[index]);
+            }
+          });
+      }
+    },
+    /**
+     * 获取业务层次详情
+     */
+    courseBusiness() {
+      this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
+        this.businessData = res.data.data;
+      });
+    },
+    /**
+     * 计算tabs宽度
+     */
+    itemWidth() {
+      return 100 / this.list.length + "%";
+    },
+    /**
+     * 获取讲义权限
+     */
+    courseHandouts() {
+      this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
+        this.courseHandoutsData = res.data.data;
+      });
+    },
+    findMenuNextSection(index) {
+      for (let i = index + 1; i < this.reMenuList.length; i++) {
+        let item = this.reMenuList[i];
+        if (item.type == 3) {
+          return item;
+        }
+      }
+      return {};
+    },
+		loadedmetadata(e) {
+			var polyvPlayerContext = this.selectComponent("#playerVideo");
 			
-		},
-		/**
-		 * 获取业务层次详情
-		 */
-		courseBusiness(){
-			this.$api.courseBusiness(this.goodsData.businessId).then(res => {
-				this.businessData = res.data.data;
+			uni.$off('playPause')
+			uni.$on('playPause',() => {
+				polyvPlayerContext.pause()
 			})
-		},
-		/**
-		 * 计算tabs宽度
-		 */
-		itemWidth() {
-			return 100/this.list.length + '%'
-		},
-		/**
-		 * 获取讲义权限
-		 */
-		courseHandouts() {
-			this.$api.courseHandouts(this.goodsData.handoutsId).then(res => {
-				this.courseHandoutsData = res.data.data
-			})
-		},
-		findMenuNextSection(index){
-			for(let i=index+1;i<this.reMenuList.length;i++){
-				let item = this.reMenuList[i]
-				if(item.type==3){
-					return item;
-				}
-			}
-			return {}
-		},
-		getPhotoLastRecord() {
-			let self = this;
-			let data = {
-				sectionId: parseInt(self.playSectionId),
-				goodsId: parseInt(self.goodsId),
-				courseId: parseInt(self.courseId),
-				gradeId: parseInt(self.gradeId),
-				chapterId: parseInt(self.chapterId),
-				moduleId: parseInt(self.moduleId)}
-				this.$api.getPhotoLastRecord(data).then(res => {
-					if(res.data.code==200){
-						//清空历史数据
-						self.photoHistoryList = []
-						this.photoIndex = 0 
-						self.photoList = []
-						for(let i=0;i<res.data.data.length;i++){
-							//-2存储随机拍照数组
-							 if(res.data.data[i].photoIndex==-2){
-								 self.photoList = res.data.data[i].timeInterval.split(',')
-							 }else{
-								 self.photoHistoryList.push(res.data.data[i].photoIndex)
-							 }
-						}
-						
-						
-					}
-					
-				});
-			
-		},
-		//postTime 只提交随机时间
-		postCoursePhotoRecord(postTime=false) {
-			let currentTime = 0;
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			if (polyvPlayerContext) {
-				currentTime = polyvPlayerContext.getCurrentTime();
+			if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
+				this.postStudyRecord(0)
 			}
-			let self = this;
-			let photoIndex = self.photoIndex
-			let data = {
-				photo: self.ossAvatarUrl,
-				sectionId: parseInt(self.playSectionId),
-				goodsId: parseInt(self.goodsId),
-				courseId: parseInt(self.courseId),
-				photoTime: parseInt(currentTime > 0 ? currentTime : 0),
-				gradeId: parseInt(self.gradeId),
-				photoIndex: postTime?-2:parseInt(photoIndex),//从0算起,-2只提交随机时间
-				photoNum:parseInt(self.photoNum),
-				chapterId: parseInt(self.chapterId),
-				moduleId: parseInt(self.moduleId),
-				timeInterval: postTime?self.photoList.join(','):''
-			};
-			console.log('提交接口', data);
-			this.$api.coursePhotoRecord(data).then(res => {
-				console.log(res);
-			});
 		},
-		randomNum(minNum,maxNum){ 
-		    switch(arguments.length){ 
-		        case 1: 
-		            return parseInt(Math.random()*minNum+1,10); 
-		        break; 
-		        case 2: 
-		            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10); 
-		        break; 
-		            default: 
-		                return 0; 
-		            break; 
-		    } 
-		},
-		//配置随机拍照时间
-		configPhoto(){
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			let totalVideoTime = polyvPlayerContext.getDuration()
-			let duration = polyvPlayerContext.getCurrentTime()
-			let photoNum = this.photoNum
-			if(!this.photoConfig){
-				this.photoConfig = true
-				let  spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
-				if(spaceTime<5){//区间小于5秒
-					photoNum = Math.floor(totalVideoTime/5)
-					spaceTime = 5
-				}
-				if(photoNum<1){
-					photoNum = 1 //只要设置,至少拍一次
-					spaceTime = totalVideoTime
-				}
-				let initSpace = 0
-				//没有历史拍照间隔数据
-				if(this.photoList.length==0){
-					for(let i=0;i<photoNum;i++){
-						let s = this.randomNum(initSpace,initSpace+spaceTime)
-						if(s>totalVideoTime){
-							s = totalVideoTime-1
-						}
-						if(s<=5){
-							s =5 //避免出现5秒内拍照时间
-						}
-						this.photoList.push(s)
-						initSpace+=spaceTime
-					}
-					console.log(this.photoList,"随机拍照时间数组11",photoNum,initSpace,spaceTime)
-					this.postCoursePhotoRecord(true)//提交随机拍照时间数组
-				}
-				console.log(this.photoList,"随机拍照时间数组")
-				//兼容已有观看历史
-				for(let i=0;i<this.photoList.length-1;i++){
-					if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
-						this.photoIndex = i+1
-		//				console.log("我的修改了photoIndex")
-						break
-					}
-					if(duration>this.photoList[this.photoList.length-1]){
-						this.photoIndex = this.photoList.length-1 //取最后一个下标
-		//				console.log("我的修改了photoIndex")
-						break
-					}
-				}
-			}
-		},
-		getLiveUid(channelId) {
-			let self = this;
-			return new Promise(resolve => {
-				let data = {
-					channelId: channelId
-				};
-				self.$api.polyvSign(data).then(res => {
-					resolve(res.data.data);
-				});
-			});
-		},
-		timeEventLiving() {
-			if (plv != null) {
-				if(this.livePlay){
-					this.liveDuration = this.liveDuration +1 //每隔1秒
-					if(this.liveDuration==2){ //直播第2秒拍照
-						if(this.goodsPhotographConfig){
-							if(this.goodsPhotographConfig.livephotograph==1){
-								//开启直播拍照
-								this.openPhoto();
-							}
-						}
-					}
-				}
-				
-			}
-		},
-		playerLiveStatusChange(e) {
-		    const status = e.detail.status;
-			console.log('直播状态',status);
-		    if (status === 'live') {
-		      console.log('开始直播');
-			  //开始播放
-			  if (this.timer) {
-			  	clearInterval(this.timer);
-			  }
-			  this.livePlay = true
-			  this.timer = setInterval(this.timeEventLiving, 1000); //定时器
-		    }
-		    if (status === 'end') {
-				if(this.livePlay){
-					//只有播放过的结束才提交,避免未开播触发结束
-					this.postStudyRecord(1);
-				}
-				 console.log('结束直播');
-				this.livePlay = false
-		      // 未开始
-		     
-			  
-		    }
-		},
-		closePlv(){
-			if(plv){
-				plv.destroy();
-			}
-			
-		},
-		playChannel(item){
-			if (this.timer) {
-				clearInterval(this.timer);
-			}
-			this.startStatus = true
-			this.initLive()
-		},
-		setLiveOption(status) {
-			    const { userId, channelId, recordFileSimpleModel, playbackEnabled } = this.detail;
-			    const playRecordFile = playbackEnabled && recordFileSimpleModel && status === 'end';
-			
-			    this.videoOption = { 
-					mode: 'live',
-					uid: this.liveObj.uid, //this.playChannelId  egsxlptzdq
-					cid: this.playChannelId,
-					openId: this.userInfo.userAccount,
-					isAutoChange: false,
-					forceVideo: false, 
-				  }
-	},
-		async initLive(){
-			console.log(this.playChannelId,7111)
-			this.liveObj = await this.getLiveUid(this.playChannelId);
-			this.initLiveOk = true
-			let optionsData = {}
-			optionsData.mode = 'live';
-			optionsData.forceVideo = false;
-		    optionsData.channelId = this.playChannelId; // 频道ID '2553128'
-		    optionsData.openId = this.userInfo.userAccount; // 用户openId  this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
-		    optionsData.userId = this.liveObj.uid  // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq' 
-			let self = this
-			this.closePlv()
-			plv.init(optionsData)
-			  .then(({ detail, chat }) => {
-			    self.liveDetail = detail
-			
-			    // 设置mode为live的videoOption
-					this.setLiveOption();
-			    if (detail.isPPT) {
-			      chat.on(chat.events.SLICESTART, () => {
-			        // 开始直播
-			      });
-			    } else {
-			      plv.api.getOrdinaryLiveStatus(detail.stream);
-			    }
-			  });
-		},
-		openSetting(res){
-			console.log(res,98)
-		},
-		getCameraSetting () {
-		    const self = this
-		    wx.getSetting({
-		      success: res => {
-		        if (res.authSetting['scope.camera']) {
-		          // 用户已经授权
-		           self.showSet = false
-		        } else {
-		          // 用户还没有授权,向用户发起授权请求
-		          wx.authorize({
-		            scope: 'scope.camera',
-		            success() { // 用户同意授权
-		              self.showSet = false
-		            },
-		            fail() { // 用户不同意授权
-		             self.showSet = true
-		             /* wx.showToast({
+    getPhotoLastRecord() {
+      let self = this;
+      let data = {
+        sectionId: parseInt(self.playSectionId),
+        goodsId: parseInt(self.goodsId),
+        courseId: parseInt(self.courseId),
+        gradeId: parseInt(self.gradeId),
+        chapterId: parseInt(self.chapterId),
+        moduleId: parseInt(self.moduleId),
+				orderGoodsId: this.orderGoodsId,
+      };
+      this.$api.getPhotoLastRecord(data).then((res) => {
+        if (res.data.code == 200) {
+          //清空历史数据
+          self.photoHistoryList = [];
+          this.photoIndex = 0;
+          self.photoList = [];
+          for (let i = 0; i < res.data.data.length; i++) {
+            //-2存储随机拍照数组
+            if (res.data.data[i].photoIndex == -2) {
+              self.photoList = res.data.data[i].timeInterval.split(",");
+            } else {
+              self.photoHistoryList.push(res.data.data[i].photoIndex);
+            }
+          }
+        }
+      });
+    },
+    //postTime 只提交随机时间
+    postCoursePhotoRecord(postTime = false) {
+      return new Promise((resolve, reject) => {
+        let currentTime = 0;
+        var polyvPlayerContext = this.selectComponent("#playerVideo");
+        if (polyvPlayerContext) {
+          currentTime = polyvPlayerContext.getCurrentTime();
+        }
+        let self = this;
+        let photoIndex = self.photoIndex;
+        let data = {
+          photo: self.ossAvatarUrl,
+          sectionId: parseInt(self.playSectionId),
+          goodsId: parseInt(self.goodsId),
+          courseId: parseInt(self.courseId),
+          photoTime: parseInt(currentTime > 0 ? currentTime : 0),
+          gradeId: parseInt(self.gradeId),
+          photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
+          photoNum: parseInt(self.photoNum),
+          chapterId: parseInt(self.chapterId),
+          moduleId: parseInt(self.moduleId),
+          timeInterval: postTime ? self.photoList.join(",") : "",
+					orderGoodsId: this.orderGoodsId,
+        };
+        console.log("提交接口", data);
+        this.$api
+          .coursePhotoRecord(data)
+          .then((res) => {
+						console.log(res,'postCoursePhotoRecord')
+            if (res.data.code == 200) {
+              resolve();
+            } else {
+              reject();
+            }
+          })
+          .catch((err) => {
+            reject();
+          });
+      });
+    },
+    randomNum(minNum, maxNum) {
+      switch (arguments.length) {
+        case 1:
+          return parseInt(Math.random() * minNum + 1, 10);
+          break;
+        case 2:
+          return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
+          break;
+        default:
+          return 0;
+          break;
+      }
+    },
+    //配置随机拍照时间
+    configPhoto() {
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      let totalVideoTime = polyvPlayerContext.getDuration();
+      let duration = polyvPlayerContext.getCurrentTime();
+      let photoNum = this.photoNum;
+      if (!this.photoConfig) {
+        this.photoConfig = true;
+        // let  spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
+        // if(spaceTime<5){//区间小于5秒
+        // 	photoNum = Math.floor(totalVideoTime/5)
+        // 	spaceTime = 5
+        // }
+        // if(photoNum<1){
+        // 	photoNum = 1 //只要设置,至少拍一次
+        // 	spaceTime = totalVideoTime
+        // }
+        // let initSpace = 0
+        //没有历史拍照间隔数据
+        if (this.photoList.length == 0) {
+          if (totalVideoTime >= 900) {
+            //大于15分钟
+            if (photoNum == 1) {
+              //开头拍1张
+              this.photoList.push(1);
+            } else if (photoNum == 3) {
+              //拍3张
+              this.photoList.push(1); //开头拍一张
+              let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
+              let centerMinTime = centerTime - 300; //前后5分钟
+              let centerMaxTime = centerTime + 300;
+              let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
+              this.photoList.push(centerTakeTime); //中间拍一张
+              let endMaxTime = totalVideoTime - 60;
+              let endMinTime = totalVideoTime - 300;
+              let endTakeTime = this.randomNum(endMinTime, endMaxTime);
+              this.photoList.push(endTakeTime); //最后拍一张
+            }
+          } else {
+            //小于15分钟,只拍前后各一张
+            if (photoNum == 1) {
+              //开头拍1张
+              this.photoList.push(1);
+            } else if (photoNum == 3) {
+              //拍2张
+              if (totalVideoTime <= 300) {
+                //小于5分钟
+                this.photoList.push(1); //开头拍一张
+                let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
+                this.photoList.push(endTakeTime);
+              } else {
+                this.photoList.push(1); //开头拍一张
+                let endMaxTime = totalVideoTime - 60;
+                let endMinTime = totalVideoTime - 300;
+                let endTakeTime = this.randomNum(endMinTime, endMaxTime);
+                this.photoList.push(endTakeTime); //最后1-5分钟拍一张
+              }
+            }
+          }
+          // for(let i=0;i<photoNum;i++){
+          // 	let s = this.randomNum(initSpace,initSpace+spaceTime)
+          // 	if(s>totalVideoTime){
+          // 		s = totalVideoTime-1
+          // 	}
+          // 	if(s<=5){
+          // 		s =5 //避免出现5秒内拍照时间
+          // 	}
+          // 	this.photoList.push(s)
+          // 	initSpace+=spaceTime
+          // }
+          console.log(this.photoList, "随机拍照时间数组11", photoNum);
+          this.postCoursePhotoRecord(true); //提交随机拍照时间数组
+        }
+        console.log(this.photoList, "随机拍照时间数组");
+        //兼容已有观看历史
+        for (let i = 0; i < this.photoList.length - 1; i++) {
+          if (
+            this.photoList[i] < duration &&
+            this.photoList[i + 1] > duration
+          ) {
+            this.photoIndex = i + 1;
+            //				console.log("我的修改了photoIndex")
+            break;
+          }
+          if (duration > this.photoList[this.photoList.length - 1]) {
+            this.photoIndex = this.photoList.length - 1; //取最后一个下标
+            //				console.log("我的修改了photoIndex")
+            break;
+          }
+        }
+      }
+    },
+    getLiveUid(channelId) {
+      let self = this;
+      return new Promise((resolve) => {
+        let data = {
+          channelId: channelId,
+					orderGoodsId: this.orderGoodsId,
+        };
+        self.$api.polyvSign(data).then((res) => {
+          resolve(res.data.data);
+        });
+      });
+    },
+    timeEventLiving() {
+      if (plv != null) {
+        if (this.livePlay) {
+          this.liveDuration = this.liveDuration + 1; //每隔1秒
+          if (this.liveDuration == 2) {
+            //直播第2秒拍照
+            if (
+              this.goodsPhotographConfig.livephotograph == 1 &&
+              this.channelItem.learning != 1
+            ) {
+              //开启直播拍照
+
+              this.openPhoto();
+            }
+          }
+        }
+      }
+    },
+    playerLiveStatusChange(e) {
+      const status = e.detail.status;
+      console.log("直播状态", status);
+      if (status === "live") {
+        console.log("开始直播");
+        //开始播放
+        if (this.timer) {
+          clearInterval(this.timer);
+        }
+        this.livePlay = true;
+        this.timer = setInterval(this.timeEventLiving, 1000); //定时器
+      }
+      if (status === "end") {
+        if (this.livePlay) {
+          //只有播放过的结束才提交,避免未开播触发结束
+          this.postStudyRecord(1);
+        }
+        console.log("结束直播");
+        this.livePlay = false;
+        // 未开始
+      }
+    },
+    closePlv() {
+      if (plv) {
+        plv.destroy();
+      }
+    },
+    playChannel(item) {
+      if (this.timer) {
+        clearInterval(this.timer);
+      }
+      this.startStatus = true;
+      this.initLive();
+    },
+    setLiveOption(status) {
+      const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
+        this.detail;
+      const playRecordFile =
+        playbackEnabled && recordFileSimpleModel && status === "end";
+
+      this.videoOption = {
+        mode: "live",
+        uid: this.liveObj.uid, //this.playChannelId  egsxlptzdq
+        cid: this.playChannelId,
+        openId: this.userInfo.userAccount,
+        isAutoChange: false,
+        forceVideo: false,
+      };
+    },
+    async initLive() {
+      console.log(this.playChannelId, 7111);
+      this.liveObj = await this.getLiveUid(this.playChannelId);
+      this.initLiveOk = true;
+      let optionsData = {};
+      optionsData.mode = "live";
+      optionsData.forceVideo = false;
+      optionsData.channelId = this.playChannelId; // 频道ID '2553128'
+      optionsData.openId = this.userInfo.userAccount; // 用户openId  this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
+      optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
+      let self = this;
+      this.closePlv();
+      plv.init(optionsData).then(({ detail, chat }) => {
+        self.liveDetail = detail;
+
+        // 设置mode为live的videoOption
+        this.setLiveOption();
+        if (detail.isPPT) {
+          chat.on(chat.events.SLICESTART, () => {
+            // 开始直播
+          });
+        } else {
+          plv.api.getOrdinaryLiveStatus(detail.stream);
+        }
+      });
+    },
+    openSetting(res) {
+      console.log(res, 98);
+    },
+    getCameraSetting() {
+      const self = this;
+      wx.getSetting({
+        success: (res) => {
+          if (res.authSetting["scope.camera"]) {
+            // 用户已经授权
+            self.showSet = false;
+          } else {
+            // 用户还没有授权,向用户发起授权请求
+            wx.authorize({
+              scope: "scope.camera",
+              success() {
+                // 用户同意授权
+                self.showSet = false;
+              },
+              fail() {
+                // 用户不同意授权
+                self.showSet = true;
+                /* wx.showToast({
 		                title: '摄像头授权失败',
 		                icon: 'none',
 		                duration: 3000
 		              }) */
-		            }
-		          })
-		        }
-		      },
-		      fail: res => {
-		       
-		       
-		      }
-		    })
-		  },
-		openJY(){
-			this.$u.toast('此功能正在开发中');
-		},
-		//播放笔记视频
-		async playNoteVideo(item) {
-			console.log(item,'noteItem')
-			if (this.timer) {
-				clearInterval(this.timer);
-			}
-			if (this.vid) {
-				//切换视频
-				var polyvPlayerContext = this.selectComponent('#playerVideo');
-				polyvPlayerContext.changeVid(item.recordingUrl);
-			} else {
-				this.vid = item.recordingUrl;
-			}
-			this.recordObj = {videoCurrentTime:item.noteSecond}
-			if (this.recordObj.videoCurrentTime) {
-				this.needSeek = true; //需要跳转到播放记录
-			}
-			this.startStatus = true;
-			//获取节笔记
-			this.getNoteList();
-		},
-		//正常播放视频
-		async playVideo(item) {
-			console.log(item)
-			if (this.timer) {
-				clearInterval(this.timer);
-			}
-			if (this.vid) {
-				//切换视频
-				var polyvPlayerContext = this.selectComponent('#playerVideo');
-				polyvPlayerContext.changeVid(item.recordingUrl);
-			} else {
-				this.vid = item.recordingUrl;
-			}
-			this.recordObj = null
-			this.recordObj = await this.getRecordLast();
-			this.needSeek = true; //跳转到播放记录
-			this.startStatus = true;
-			
-			//获取节笔记
-			this.getNoteList();
-		},
-		getRecordLast() {
-			let self = this;
-			return new Promise(resolve => {
-				let data = {
-					gradeId: Number(self.gradeId),
-					goodsId: Number(self.goodsId),
-					sectionId: Number(self.playSectionId),
-					courseId: Number(self.courseId),
-					chapterId: parseInt(self.chapterId),
-					moduleId: parseInt(self.moduleId)
-				};
-				self.$api.recordLast(data).then(res => {
-					resolve(res.data.data);
-				});
-			});
-		},
-		
-		jumpNote(item) {
-			this.noteId = item.noteId;
-			//没视频播放
-			if(this.playSectionId==0){
-				console.log('即将跳到笔记位置1')
-				this.$u.toast('即将跳到笔记位置');  
-				this.$store.commit('setPlaySectionId', {playSectionId  :item.sectionId});
-				this.$store.commit('setPlayVID', {playVID  :item.recordingUrl});
-				this.playNoteVideo(item);
-			}else{
-				//正在看当前笔记视频
-				console.log('即将跳到笔记位置2')
-				this.$u.toast('即将跳到笔记位置');
-				//跳到笔记时刻
-				var polyvPlayerContext = this.selectComponent('#playerVideo');
-				polyvPlayerContext.seek(item.noteSecond);
-				polyvPlayerContext.play();
-			}
-			
-		},
-		postNote() {
-			let self = this;
-			if (!(this.playSectionId > 0)) {
-				this.$u.toast('目前无播放视频');
-				return;
-			}
-			if (!this.noteValue) {
-				this.$u.toast('请输入内容');
-				return;
-			}
-			if(!this.gradeId){
-				this.$u.toast('暂无班级数据');
-				return;
-			}
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			let noteDate = this.$method.getZeroTime();
-			let noteSecond = polyvPlayerContext.getCurrentTime();
-			console.log(noteSecond,698)
-			if (!noteSecond) {
-				if(noteSecond==0){
-					//播放结束
-					noteSecond = polyvPlayerContext.getDuration();
-					console.log(noteSecond,63398)
-				}
-				if(!noteSecond){
-					this.$u.toast('视频暂未开始');
-					return;
-				}
+              },
+            });
+          }
+        },
+        fail: (res) => {},
+      });
+    },
+    studyNotice() {
+      this.noticeShow = true;
+    },
+    //播放笔记视频
+    async playNoteVideo(item) {
+      console.log(item, "noteItem");
+      if (this.timer) {
+        clearInterval(this.timer);
+      }
+      if (this.vid) {
+        //切换视频
+        var polyvPlayerContext = this.selectComponent("#playerVideo");
+        polyvPlayerContext.changeVid(item.recordingUrl);
+      } else {
+        this.vid = item.recordingUrl;
+      }
+      this.recordObj = { videoCurrentTime: item.noteSecond };
+      if (this.recordObj.videoCurrentTime) {
+        this.needSeek = true; //需要跳转到播放记录
+      }
+      this.startStatus = true;
+      //获取节笔记
+      this.getNoteList();
+    },
+    //正常播放视频
+    async playVideo(item) {
+      console.log(item);
+      if (this.timer) {
+        clearInterval(this.timer);
+      }
+      if (this.vid) {
+        //切换视频
+        var polyvPlayerContext = this.selectComponent("#playerVideo");
+        polyvPlayerContext.changeVid(item.recordingUrl);
+      } else {
+        this.vid = item.recordingUrl;
 				
-			}
-			let data = {
-				gradeId: this.gradeId,
-				goodsId: this.goodsId,
-				sectionId: this.playSectionId,
-				courseId: this.courseId,
-				noteText: this.noteValue,
-				noteDate: noteDate,
-				noteSecond: noteSecond
-			};
-			this.$api.postNote(data).then(res => {
-				if (res.data.code == 200) {
-					this.$u.toast('发布成功');
-					self.getNoteList();
-					this.noteValue = '';
-				}
-			});
-		},
-		getGradeInfo() {
-			let self = this;
-			this.$store.state.allowLoading = false;
-			this.$api.goodsGradeInfo(this.gradeId).then(res => {
-				if (res.data.code == 200) {
-					self.gradeDetail = res.data.data;
-					if(self.needProfileModal){
-						return
-					}
-					if(self.gradeDetail.learningStatus==2){
-						uni.showModal({
-							showCancel:false,
-							cancelText: '返回',
-							content: '当前课程正在申请中,请耐心等待',
-							success: function(resultst) {
-								uni.navigateBack();
-							}
-						});
-					}
-					if(self.gradeDetail.learningStatus==3&&(Number(self.gradeDetail.learningTimeStart)>Number((new Date())/1000))){
-						uni.showModal({
-							showCancel:false,
-							cancelText: '返回',
-							content: '当前课程正在申请中,请耐心等待',
-							success: function(resultst) {
-								uni.navigateBack();
-							}
-						});
-					}
-				}
-			});
-			this.$store.state.allowLoading = true;
-		},
-		getNoteList() {
-			let self = this;
-			self.noteList = [];
-			let data = { courseId: this.courseId, gradeId: this.gradeId, goodsId: this.goodsId }
-			if(this.playSectionId>0){
-				data.sectionId = this.playSectionId
-			}
-			this.$api.noteList(data).then(res => {
-				if (res.data.code == 200) {
-					self.noteList = res.data.rows;
-				}
-			});
-		},
-		delAnswer(answerId) {
-			let self = this;
-			let data = { answerId: answerId, status: -1 };
-			this.$api.delAnswer(data).then(res => {
-				if (res.data.code == 200) {
-					self.getAnswerList();
-				}
-			});
-		},
-		clearCtx() {
-			console.log(4234);
-			this.placeholder = '您可以在这里输入答疑内容';
-			this.ctxValue = '';
-			this.assignUserId = 0;
-		},
-		replyContent(item) {
-			this.assignUserId = item.userId;
-			this.placeholder = '@' + item.realname;
-		},
-		delContent(item) {
-			this.delAnswer(item.answerId);
-		},
-		postAnswer() {
-			let self = this;
-			let data = { courseId: this.courseId, answerText: this.ctxValue, goodsId: this.goodsId };
-			if (this.assignUserId > 0) {
-				data.assignUserId = this.assignUserId;
-			}
-			this.$api.postAnswer(data).then(res => {
-				if (res.data.code == 200) {
-					this.$u.toast('发布成功');
-					self.getAnswerList();
-					this.placeholder = '您可以在这里输入答疑内容';
-					this.ctxValue = '';
-					this.assignUserId = 0;
-				}
-			});
-		},
-		postContent() {
-			if (!this.ctxValue||this.ctxValue=='') {
-				this.$u.toast('请输入内容');
-				return
-			}
-			this.postAnswer();
-		},
-		postStudyRecord(status = 0, sectionId = this.playSectionId) {
-			console.log('status',status)
-			let currentTime = 0;
-			let PlayDuration = 0
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			if (polyvPlayerContext) {
-				currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
-				PlayDuration = polyvPlayerContext.getVideoPlayDuration();//本次看的时长
-			}
-			if(this.playChannelId>0){
-				currentTime = 2;//直播无法获取,无论开始结束都传2秒
-			}
-			let self = this;
-			let data = {
-				photo: self.ossAvatarUrl,
-				sectionId: parseInt(sectionId),
-				goodsId: parseInt(self.goodsId),
-				courseId: parseInt(self.courseId),
-				studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : self.studyDuration),
-				gradeId: parseInt(self.gradeId),
-				chapterId: parseInt(self.chapterId),
-				moduleId: parseInt(self.moduleId),
-				videoCurrentTime: parseInt(currentTime > 0 ? currentTime : self.studyDuration)
-			};
-			if (status > 0) {
-				console.log(sectionId,'sectionId')
-				data.status = status;
-				
-					
-			}
-			console.log('提交接口', data);
-			this.$api.studyRecord(data).then(res => {
-				if (status > 0) {
-					let moduleId = this.moduleId || 0;
-					let chapterId = this.chapterId || 0;
-					let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
-					let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`;  //拼接对应章节唯一id
-					console.log(playNextId,'playNextId')
-					console.log(playNextIdisRebuild,'playNextIdisRebuild')
-					
-					uni.$emit('playNext'+playNextIdisRebuild,{fromRebuild:this.isRebuild}); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
-					uni.$emit('playNext'+playNextId); //通知播放结束
-				}
-				
-				self.ossAvatarUrl = ''
-				console.log(res,'res');
-			});
-		},
-		uploadFile(options, int) {
-			var self = this;
-			return new Promise((resolve, reject) => {
-				var data = {
-					imageStatus: int
-				};
-				self.$api.aliyunpolicy(data).then(res => {
-					if (res.data.code != 200) {
-						self.$method.showToast('签名错误' + JSON.stringify(res.data));
-						return;
-					}
-					var ossToken = res.data.data.resultContent;
-					if (ossToken.host == null || ossToken.host == undefined) {
-						self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
-						return;
-					}
-					uni.uploadFile({
-						url: ossToken.host,
-						name: 'file',
-						filePath: options,
-						fileType: 'image',
-						header: {
-							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
-						},
-						formData: {
-							key: ossToken.dir,
-							OSSAccessKeyId: ossToken.accessid,
-							policy: ossToken.policy,
-							Signature: ossToken.signature,
-							callback: ossToken.callback,
-							success_action_status: 200
-						},
-						success: result => {
-							if (result.statusCode === 200) {
-								self.ossAvatarUrl = ossToken.dir;
-								resolve();
-							} else {
-								uni.showToast({
-									title: '上传失败',
-									icon: 'none'
-								});
-								return;
-							}
-						},
-						fail: error => {
-							uni.showToast({
-								title: '上传接口报错' + error,
-								icon: 'none'
-							});
-							return;
-						}
-					});
-				});
-			});
-		},
-		imageInfos() {
-			var self = this;
-			return new Promise((resolve, reject) => {
-				uni.getImageInfo({
-					src: self.avatarUrl,
-					success: async res => {
-						let canvasWidth = res.width; //图片原始长宽
-						let canvasHeight = res.height;
-						if (canvasWidth > 1000 || canvasHeight > 1000) {
-							uni.compressImage({
-								src: self.avatarUrl,
-								quality: 75,
-								width: '50%',
-								height: '50%',
-								success: async rest => {
-									const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-									resolve();
-								}
-							});
-						} else {
-							console.log('无需压缩');
-							const waitUpload = await self.uploadFile(self.avatarUrl, 0);
-							resolve();
-						}
-					}
+      }
+      this.recordObj = null;
+      this.recordObj = await this.getRecordLast();
+      this.needSeek = true; //跳转到播放记录
+      this.startStatus = true;
+
+      //获取节笔记
+      this.getNoteList();
+    },
+    getRecordLast() {
+      let self = this;
+      return new Promise((resolve) => {
+        let data = {
+          gradeId: Number(self.gradeId),
+          goodsId: Number(self.goodsId),
+          sectionId: Number(self.playSectionId),
+          courseId: Number(self.courseId),
+          chapterId: parseInt(self.chapterId),
+          moduleId: parseInt(self.moduleId),
+					orderGoodsId: this.orderGoodsId,
+        };
+        self.$api.recordLast(data).then((res) => {
+          resolve(res.data.data);
+        });
+      });
+    },
+
+    jumpNote(item) {
+      this.noteId = item.noteId;
+      //没视频播放
+      if (this.playSectionId == 0) {
+        console.log("即将跳到笔记位置1");
+        this.$u.toast("即将跳到笔记位置");
+        this.$store.commit("setPlaySectionId", {
+          playSectionId: item.sectionId,
+        });
+        this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
+        this.playNoteVideo(item);
+      } else {
+        //正在看当前笔记视频
+        console.log("即将跳到笔记位置2");
+        this.$u.toast("即将跳到笔记位置");
+        //跳到笔记时刻
+        var polyvPlayerContext = this.selectComponent("#playerVideo");
+        polyvPlayerContext.seek(item.noteSecond);
+        polyvPlayerContext.play();
+      }
+    },
+    postNote() {
+      let self = this;
+      if (!(this.playSectionId > 0)) {
+        this.$u.toast("目前无播放视频");
+        return;
+      }
+      if (!this.noteValue) {
+        this.$u.toast("请输入内容");
+        return;
+      }
+      if (!this.gradeId) {
+        this.$u.toast("暂无班级数据");
+        return;
+      }
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      let noteDate = this.$method.getZeroTime();
+      let noteSecond = polyvPlayerContext.getCurrentTime();
+      console.log(noteSecond, 698);
+      if (!noteSecond) {
+        if (noteSecond == 0) {
+          //播放结束
+          noteSecond = polyvPlayerContext.getDuration();
+          console.log(noteSecond, 63398);
+        }
+        if (!noteSecond) {
+          this.$u.toast("视频暂未开始");
+          return;
+        }
+      }
+      let data = {
+        gradeId: this.gradeId,
+        goodsId: this.goodsId,
+        sectionId: this.playSectionId,
+        courseId: this.courseId,
+        noteText: this.noteValue,
+        noteDate: noteDate,
+        noteSecond: noteSecond,
+				orderGoodsId: this.orderGoodsId,
+      };
+      this.$api.postNote(data).then((res) => {
+        if (res.data.code == 200) {
+          this.$u.toast("发布成功");
+          self.getNoteList();
+          this.noteValue = "";
+        }
+      });
+    },
+    getGradeInfo() {
+      let self = this;
+      this.$store.state.allowLoading = false;
+      this.$api.goodsGradeInfo(this.gradeId).then((res) => {
+        if (res.data.code == 200) {
+          self.gradeDetail = res.data.data;
+          if (self.needProfileModal) {
+            return;
+          }
+          if (self.gradeDetail.learningStatus == 2) {
+            uni.showModal({
+              showCancel: false,
+              confirmText: "确定",
+              content:
+                "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
+              success: function (resultst) {
+                uni.navigateBack();
+              },
+            });
+          }
+          if (
+            self.gradeDetail.learningStatus == 3 &&
+            Number(self.gradeDetail.learningTimeStart) >
+              Number(new Date() / 1000)
+          ) {
+            uni.showModal({
+              showCancel: false,
+              cancelText: "返回",
+              content:
+                "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
+              success: function (resultst) {
+                uni.navigateBack();
+              },
+            });
+          }
+        }
+      });
+      this.$store.state.allowLoading = true;
+    },
+    getNoteList() {
+      let self = this;
+      self.noteList = [];
+      let data = {
+        courseId: this.courseId,
+        gradeId: this.gradeId,
+        goodsId: this.goodsId,
+				orderGoodsId: this.orderGoodsId,
+      };
+      if (this.playSectionId > 0) {
+        data.sectionId = this.playSectionId;
+      }
+      this.$api.noteList(data).then((res) => {
+        if (res.data.code == 200) {
+          self.noteList = res.data.rows;
+        }
+      });
+    },
+    delAnswer(answerId) {
+      let self = this;
+      let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
+      this.$api.delAnswer(data).then((res) => {
+        if (res.data.code == 200) {
+          self.getAnswerList();
+        }
+      });
+    },
+    clearCtx() {
+      console.log(4234);
+      this.placeholder = "您可以在这里输入答疑内容";
+      this.ctxValue = "";
+      this.assignUserId = 0;
+    },
+    replyContent(item) {
+      this.assignUserId = item.userId;
+      this.placeholder = "@" + item.realname;
+    },
+    delContent(item) {
+      this.delAnswer(item.answerId);
+    },
+    postAnswer() {
+      let self = this;
+      let data = {
+        courseId: this.courseId,
+        answerText: this.ctxValue,
+        goodsId: this.goodsId,
+				orderGoodsId: this.orderGoodsId,
+      };
+      if (this.assignUserId > 0) {
+        data.assignUserId = this.assignUserId;
+      }
+      this.$api.postAnswer(data).then((res) => {
+        if (res.data.code == 200) {
+          this.$u.toast("发布成功");
+          self.getAnswerList();
+          this.placeholder = "您可以在这里输入答疑内容";
+          this.ctxValue = "";
+          this.assignUserId = 0;
+        }
+      });
+    },
+    postContent() {
+      if (!this.ctxValue || this.ctxValue == "") {
+        this.$u.toast("请输入内容");
+        return;
+      }
+      this.postAnswer();
+    },
+    postStudyRecord(status = 0, sectionId = this.playSectionId) {
+      console.log("status", status);
+      let currentTime = 0;
+      let PlayDuration = 0;
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      if (polyvPlayerContext) {
+        currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
+        PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
+      }
+      if (this.playChannelId > 0) {
+        currentTime = 2; //直播无法获取,无论开始结束都传2秒
+      }
+      let self = this;
+      let data = {
+        photo: self.ossAvatarUrl,
+        sectionId: parseInt(sectionId),
+        goodsId: parseInt(self.goodsId),
+        courseId: parseInt(self.courseId),
+				orderGoodsId: this.orderGoodsId,
+        studyDuration: parseInt(
+          PlayDuration > 0 ? PlayDuration : self.studyDuration
+        ),
+        gradeId: parseInt(self.gradeId),
+        chapterId: parseInt(self.chapterId),
+        moduleId: parseInt(self.moduleId),
+        videoCurrentTime: parseInt(
+          currentTime > 0 ? currentTime : self.studyDuration
+        ),
+      };
+      if (status > 0) {
+        console.log(sectionId, "sectionId");
+        data.status = status;
+      }
+      console.log("提交接口", data);
+      this.$api.studyRecord(data).then((res) => {
+        if (res.data.code == 200) {
+          if (status > 0) {
+            let moduleId = this.moduleId || 0;
+            let chapterId = this.chapterId || 0;
+            let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
+            let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
+            console.log(playNextId, "playNextId");
+            console.log(playNextIdisRebuild, "playNextIdisRebuild");
+
+            uni.$emit("playNext" + playNextIdisRebuild, {
+              fromRebuild: this.isRebuild,
+            }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
+            uni.$emit("playNext" + playNextId); //通知播放结束
+          }
+
+          self.ossAvatarUrl = "";
+        } else {
+          this.uploadLock = false;
+          uni.showToast({
+            icon: "none",
+            title: res.data.msg,
+          });
+        }
+        console.log(res, "res");
+      });
+    },
+    uploadFile(options, int) {
+			console.log(options)
+      var self = this;
+      return new Promise((resolve, reject) => {
+        var data = {
+          imageStatus: int,
+          gradeId: this.gradeId,
+					orderGoodsId: this.orderGoodsId,
+        };
+        self.$api.aliyunpolicy(data).then((res) => {
+          if (res.data.code != 200) {
+            self.$method.showToast("签名错误" + JSON.stringify(res.data));
+            return;
+          }
+          var ossToken = res.data.data.resultContent;
+          if (ossToken.host == null || ossToken.host == undefined) {
+            self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
+            return;
+          }
+          uni.uploadFile({
+            url: ossToken.host,
+            name: "file",
+            filePath: options,
+            fileType: "image",
+            header: {
+              AuthorizationToken: "WX " + uni.getStorageSync("token"),
+            },
+            formData: {
+              key: ossToken.dir,
+              OSSAccessKeyId: ossToken.accessid,
+              policy: ossToken.policy,
+              Signature: ossToken.signature,
+              callback: ossToken.callback,
+              success_action_status: 200,
+            },
+            success: (result) => {
+              if (result.statusCode === 200) {
+                self.ossAvatarUrl = ossToken.dir;
+                resolve();
+              } else {
+                uni.showToast({
+                  title: "上传失败",
+                  icon: "none",
+                });
+                this.openPhoto();
+                return;
+              }
+            },
+            fail: (error) => {
+              uni.showToast({
+                title: "上传接口报错,请重新拍照上传" + error,
+                icon: "none",
+              });
+              this.openPhoto();
+              return;
+            },
+          });
+        });
+      });
+    },
+    imageInfos() {
+      var self = this;
+      return new Promise((resolve, reject) => {
+        uni.getImageInfo({
+          src: self.avatarUrl,
+          success: async (res) => {
+            let canvasWidth = res.width; //图片原始长宽
+            let canvasHeight = res.height;
+            if (canvasWidth > 2000 || canvasHeight > 2000) {
+              uni.compressImage({
+                src: self.avatarUrl,
+                quality: 75,
+                width: "35%",
+                height: "35%",
+                success: async (rest) => {
+                  const waitUpload = await self.uploadFile(
+                    rest.tempFilePath,
+                    0
+                  );
+                  resolve(waitUpload);
+                },
+              });
+            } else if (canvasWidth > 1000 || canvasHeight > 1000) {
+              uni.compressImage({
+                src: self.avatarUrl,
+                quality: 75,
+                width: "50%",
+                height: "50%",
+                success: async (rest) => {
+                  const waitUpload = await self.uploadFile(
+                    rest.tempFilePath,
+                    0
+                  );
+                  resolve(waitUpload);
+                },
+              });
+            } else {
+              console.log("无需压缩");
+              const waitUpload = await self.uploadFile(self.avatarUrl, 0);
+              resolve(waitUpload);
+            }
+          },
+        });
+      });
+    },
+    timeEvent() {
+      let self = this;
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      if (polyvPlayerContext != null) {
+        this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
+        //	console.log(this.playTime,789,this.photoHistoryList)
+        //判断是否需要拍照
+        if (this.photoNum > 0) {
+          this.configPhoto();
+          let photoTime = 0; //获取拍照秒数
+          for (let i = 0; i < this.photoList.length; i++) {
+            photoTime = Number(this.photoList[i]); //获取拍照秒数
+            if (photoTime < this.playTime && photoTime > this.playTime - 8) {
+              //3秒区间内才触发拍照,避免拉动滚动条
+              if (
+                this.photoHistoryList.indexOf(i) < 0 &&
+                this.sectionItem.learning != 1
+              ) {
+                //不存在拍照历史,没有重修过,没有学过,则拍照
+                //启动拍照
+                //暂停
+                polyvPlayerContext.exitFullScreen();
+                polyvPlayerContext.pause();
+                this.photoIndex = i;
+                this.openPhoto();
+              }
+            }
+          }
+        }
+      }
+    },
+    closeToast() {
+      clearTimeout(this.toastTimer);
+      this.videoToastShow = false;
+    },
+    restart() {
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      polyvPlayerContext.seek(0);
+      console.log("seek1");
+      clearTimeout(this.toastTimer);
+      this.videoToastShow = false;
+    },
+    onStateChange(newstate, oldstate) {
+      if (newstate.detail.newstate == "playing") {
+        if (this.needSeek) {
+          var polyvPlayerContext = this.selectComponent("#playerVideo");
+          if (this.recordObj.videoCurrentTime) {
+            console.log("seek2");
+            polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
+            this.seekTime = this.$method.secondToDate(
+              this.recordObj.videoCurrentTime
+            );
+            this.videoToastShow = true;
+            this.toastTimer = setTimeout(() => {
+              this.videoToastShow = false;
+            }, 3000);
+          } else {
+            polyvPlayerContext.seek(1); //避免相同节继续播放
+            console.log("seek3");
+          }
+
+          polyvPlayerContext.play();
+          this.needSeek = false;
+        }
+        //开始播放
+        if (this.timer) {
+          clearInterval(this.timer);
+        }
+        this.timer = setInterval(this.timeEvent, 1000); //定时器
+      }
+      if (newstate.detail.newstate == "pause") {
+        clearInterval(this.timer);
+        //暂停提交记录
+        /* this.ossAvatarUrl = ""
+				this.postStudyRecord() */
+      }
+      if (newstate.detail.newstate == "ended") {
+        clearInterval(this.timer);
+        uni.showToast({
+          icon: "none",
+          title: "播放完毕",
+        });
+        this.postStudyRecord(1);
+        // uni.$emit('playNext') //播放重修下一节
+      }
+    },
+    //拍照
+    openPhoto() {
+      var polyvPlayerContext = this.selectComponent("#playerVideo");
+      if (polyvPlayerContext) {
+        polyvPlayerContext.exitFullScreen();
+      }
+
+      this.enableAutoRotation = false;
+      this.photoPopup = true;
+      this.isTaking = true;
+      uni.setKeepScreenOn({
+        keepScreenOn: true,
+      });
+      uni.authorize({
+        scope: "scope.camera",
+        success() {},
+      });
+    },
+    /**
+     * 人脸匹配
+     */
+    faceRecognition() {
+      return new Promise((resolve) => {
+        let fileSystem = uni.getFileSystemManager();
+        fileSystem.readFile({
+          filePath: `${this.avatarUrl}`,
+          encoding: "base64",
+          position: 0,
+          success: (res) => {
+            console.log(res);
+            let base64 = "data:image/jpg;base64," + res.data;
+						console.log({
+                imageA: base64,
+                orderGoodsId: this.orderGoodsId,
+                gradeId: this.gradeId,
+              },'base64Data')
+            this.$api
+              .faceCertificationCompareFace({
+                imageA: base64,
+                orderGoodsId: this.orderGoodsId,
+                gradeId: this.gradeId,
+              })
+              .then((res) => {
+                console.log(res, "res");
+                resolve(res.data.data);
+              });
+          },
+          fail(err) {
+            console.error(err, "err");
+          },
+        });
+      });
+    },
+
+    async submit() {
+      if (this.uploadLock) {
+        return;
+      }
+      this.uploadLock = true;
+
+      let compareFaceData = await this.faceRecognition();
+
+      if (compareFaceData >= 80) {
+        const waitYS = await this.imageInfos();
+        this.postCoursePhotoRecord()
+          .then((res) => {
+            this.photoHistoryList.push(this.photoIndex);
+            this.postStudyRecord(); //提交记录
+            //恢复播放
+
+            uni.setKeepScreenOn({
+              keepScreenOn: false,
+            });
+            this.photoPopup = false;
+            this.uploadLock = false;
+            this.enableAutoRotation = true;
+            var polyvPlayerContext = this.selectComponent("#playerVideo");
+            if (polyvPlayerContext != null) {
+              polyvPlayerContext.play();
+            }
+          })
+          .catch((err) => {
+            uni.showToast({
+              title: "上传接口报错,请重新拍照上传" + err,
+              icon: "none",
+            });
+            this.uploadLock = false;
+            this.openPhoto();
+          });
+      } else {
+				uni.showToast({
+				  title: "人脸匹配不通过,请重新拍照上传",
+				  icon: "none",
+				  duration: 2000,
 				});
-			});
-		},
-		timeEvent() {
-			let self = this;
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			if (polyvPlayerContext != null) {
 				
-				this.playTime = polyvPlayerContext.getCurrentTime() //播放时刻
-			//	console.log(this.playTime,789,this.photoHistoryList)
-				//判断是否需要拍照
-				if (this.photoNum > 0) {
-					this.configPhoto()
-					let photoTime =0; //获取拍照秒数
-					for(let i=0;i<this.photoList.length;i++){
-						photoTime = Number(this.photoList[i]); //获取拍照秒数
-						if (photoTime < this.playTime&&photoTime>this.playTime-8) { //3秒区间内才触发拍照,避免拉动滚动条
-							if(this.photoHistoryList.indexOf(i)<0){ //不存在拍照历史则拍照
-								//启动拍照
-								//暂停
-								polyvPlayerContext.exitFullScreen();
-								polyvPlayerContext.pause();
-								this.photoHistoryList.push(i)
-								this.photoIndex = i
-								this.openPhoto();
-								
-								
-							}
-							
-						}
-					}
-					
-				}
-			}
-		},
-		onStateChange(newstate, oldstate) {
-			if (newstate.detail.newstate == 'playing') {
-				if (this.needSeek) {  
-					var polyvPlayerContext = this.selectComponent('#playerVideo');
-					if(this.recordObj.videoCurrentTime){
-						console.log('seek')
-						polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
-					}else{
-						polyvPlayerContext.seek(1);//避免相同节继续播放
-					}
-					
-					polyvPlayerContext.play();
-					this.needSeek = false;
-				}
-				//开始播放
-				if (this.timer) {
-					clearInterval(this.timer);
-				}
-				this.timer = setInterval(this.timeEvent, 1000); //定时器
-			}
-			if (newstate.detail.newstate == 'pause') {
-				//暂停提交记录
-				/* this.ossAvatarUrl = ""
-				this.postStudyRecord() */
-			}
-			if (newstate.detail.newstate == 'ended') {
-				this.postStudyRecord(1);
-				// uni.$emit('playNext') //播放重修下一节
-			}
-		},
-		//拍照
-		openPhoto() {
-			this.photoPopup = true;
-			uni.authorize({
-			     scope: 'scope.camera',
-			     success() {
-			        
-			     }
-			 })
-		},
-		async submit() {
-			const waitYS = await this.imageInfos();
-			this.postCoursePhotoRecord()
-			this.postStudyRecord(); //提交记录
-			//恢复播放
-			var polyvPlayerContext = this.selectComponent('#playerVideo');
-			if (polyvPlayerContext != null) {
-				polyvPlayerContext.play();
+				setTimeout(() => {
+				  this.uploadLock = false;
+				  this.openPhoto();
+				}, 2000);
+				return;
 			}
-			
-		},
-		//确认拍照
-		takePhoto() {
-			var self = this;
-			const ctx = uni.createCameraContext();
-			ctx.takePhoto({
-				quality: 'high',
-				success: res => {
-					console.log(res.tempImagePath);
-					self.avatarUrl = res.tempImagePath;
-					self.submit();
+    },
+    reTake() {
+      this.isTaking = true;
+    },
+    //确认拍照
+    takePhoto() {
+      var self = this;
+      const ctx = uni.createCameraContext();
+      ctx.takePhoto({
+        quality: "high",
+        success: (res) => {
+          console.log(res.tempImagePath);
+          self.avatarUrl = res.tempImagePath;
+          this.isTaking = false;
+          // self.submit();
 
-					self.photoPopup = false;
-				},
-				fail: err => {
-					console.log(err);
-				}
-			});
-		},
-		//拍照报错
-		error(e) {
-			console.log(e.detail);
-		},
-		//关闭相机
-		closePhoto() {
-			this.photoPopup = false;
-		},
-		getGoodsDetail() {
-			let self = this;
-			this.$api.goodsDetail(this.goodsId).then(res => {
-				self.goodsData = res.data.data;
-				self.gradeId = self.goodsData.gradeId;
-				console.log(self.gradeId, "班级ID");
-				this.courseBusiness()
-				this.courseHandouts();
-				self.getMenuList();
-				self.getReMenuList(); //获取重修目录
-				setTimeout(function(){
-					if(!self.needProfileModal){
-						self.getGradeInfo()
-					}
-				},500)
-				
-				//获取节笔记
-				this.getNoteList();
-				if (self.goodsData.goodsPlayConfig) {
-					self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
-					if (self.goodsPlayConfig.autoPlay > 0) {
-						self.autoplay = true;
-					}
-					if (self.goodsPlayConfig.drag > 0) {
-						self.isAllowSeek = 'yes';
-					}
-					if (self.goodsPlayConfig.speed > 0) {
-						self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
-					}
-				}
-				if (self.goodsData.goodsPhotographConfig) {
-					self.goodsPhotographConfig = JSON.parse(self.goodsData.goodsPhotographConfig);
-					if (self.goodsPhotographConfig.photoNum>0) {
-						self.photoNum = self.goodsPhotographConfig.photoNum
-						console.log(self.photoNum,777777)
-					}
-				}
-			});
-		},
-		startVideo() {
-			this.startStatus = true;
-		},
-		getAnswerList() {
-			let self = this;
-			this.$api.answerList({ courseId: this.courseId,goodsId: this.goodsId }).then(res => {
-				if (res.data.code == 200) {
-					self.answerList = res.data.rows;
-				}
-			});
-		},
-		getReMenuList() {
-			let self = this;
-			this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
-				if (res.data.code == 200) {
-					for (let i = 0; i < res.data.rows.length; i++) {
-						let item = res.data.rows[i];
-						item.down = true;
-						item.id = item.menuId;
-						item.name = item.menuName;
-					}
-					self.reMenuList = res.data.rows;
-					if(self.reMenuList.length>0){
-						self.list = [
-							
-							{
-								name: '目录'
-							},
-							{
-								name: '讲义'
-							},
-							{
-								name: '笔记'
-							},
-							{
-								name: '答疑'
-							},
-							{name:'重修目录'}
-						];
-						this.current = 0;
-					} else {
-						self.list = [
-							
-							{
-								name: '目录'
-							},
-							{
-								name: '讲义'
-							},
-							{
-								name: '笔记'
-							},
-							{
-								name: '答疑'
-							}
-						];
-						this.current = 0;
-					}
-				}
-			});
-		},
-		getMenuList() {
-			let self = this;
-			this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
-				if (res.data.code == 200) {
-					for (let i = 0; i < res.data.rows.length; i++) {
-						let item = res.data.rows[i];
-						item.down = true;
-						item.id = item.menuId;
-						item.name = item.menuName;
-					}
-					self.menuList = res.data.rows;
-				}
-			});
-		},
-		courseDetail() {
-			let self = this;
-			this.$api.courseDetail(this.courseId).then(res => {
-				if (res.data.code == 200) {
-					self.detail = res.data.data;
-					uni.setNavigationBarTitle({
-						title:self.detail.courseName
-					})
-				}
-			});
-		},
-		open(item) {
-			item.showChildren = !item.showChildren;
-		},
-		change(index) {
-			this.current = index;
-		},
-		openDocument() {
-			let self = this;
-			let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl)
-			console.log(url)
-			uni.downloadFile({
-			  url: url,
-			  success: function (res) {
-				  console.log(999)
-			    var filePath = res.tempFilePath;
-			    uni.openDocument({
-			      filePath: filePath,
-			      showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
-			      success: function (res) {
-			        console.log(res,'打开文档成功');
-			      },
-				  fail:function(err) {
-					  console.log(err)
-					uni.showToast({
-						icon:'none',
-						title:'文档地址错误'
-					})
-				  }
-			    });
-			  },
-			  fail:(err) => {
-				  uni.showModal({
-				  	title:'提示',
-					content:'文档错误,'+err.errMsg,
-					showCancel:false
-				  })
-			  }
-			});
-		}
-	}
+          // self.photoPopup = false;
+          // self.enableAutoRotation = true;
+        },
+        fail: (err) => {
+          console.log(err);
+        },
+      });
+    },
+    playError(e) {
+      console.log(e);
+    },
+    //拍照报错
+    error(e) {
+      console.log(e.detail);
+    },
+    //关闭相机
+    closePhoto() {
+      this.photoPopup = false;
+      self.enableAutoRotation = true;
+    },
+    /**
+     * 进入全屏
+     */
+    fullscreenchange(event) {
+      console.log(event);
+      if (event.detail.direction == "vertical") {
+        this.navShow = true;
+      } else if (event.detail.direction == "horizontal") {
+        this.navShow = false;
+      }
+    },
+    getGoodsDetail() {
+      let self = this;
+      this.$api.goodsDetail(this.goodsId).then((res) => {
+        self.goodsData = res.data.data;
+        self.gradeId = self.goodsData.gradeId;
+        console.log(self.gradeId, "班级ID");
+        this.courseBusiness();
+        this.courseHandouts();
+        self.getMenuList();
+        self.getReMenuList(); //获取重修目录
+        setTimeout(function () {
+          if (!self.needProfileModal) {
+            self.getGradeInfo();
+          }
+        }, 500);
+
+        //获取节笔记
+        this.getNoteList();
+        if (self.goodsData.goodsPlayConfig) {
+          self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
+          if (self.goodsPlayConfig.autoPlay > 0) {
+            self.autoplay = true;
+          }
+          if (self.goodsPlayConfig.drag > 0) {
+            self.isAllowSeek = "yes";
+          }
+          if (self.goodsPlayConfig.speed > 0) {
+            self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
+          }
+        }
+        if (self.goodsData.goodsPhotographConfig) {
+          self.goodsPhotographConfig = JSON.parse(
+            self.goodsData.goodsPhotographConfig
+          );
+          if (self.goodsPhotographConfig.photoNum > 0) {
+            self.photoNum = self.goodsPhotographConfig.photoNum;
+            console.log(self.photoNum, 777777);
+          }
+        }
+      });
+    },
+    startVideo() {
+      this.startStatus = true;
+    },
+    getAnswerList() {
+      let self = this;
+      this.$api
+        .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
+        .then((res) => {
+          if (res.data.code == 200) {
+            self.answerList = res.data.rows;
+          }
+        });
+    },
+    getReMenuList() {
+      let self = this;
+      this.$api
+        .reMenuList({
+					orderGoodsId: this.orderGoodsId,
+          courseId: this.courseId,
+          rebuild: 1,
+          gradeId: this.gradeId,
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            for (let i = 0; i < res.data.rows.length; i++) {
+              let item = res.data.rows[i];
+              item.down = true;
+              item.id = item.menuId;
+              item.name = item.menuName;
+            }
+            self.reMenuList = res.data.rows;
+            if (self.reMenuList.length > 0) {
+              this.showNotes = false;
+              self.list = [
+                {
+                  name: "目录",
+                },
+                {
+                  name: "讲义",
+                },
+                {
+                  name: "笔记",
+                },
+                {
+                  name: "答疑",
+                },
+                { name: "重修目录" },
+              ];
+              this.current = 0;
+            } else {
+              self.list = [
+                {
+                  name: "目录",
+                },
+                {
+                  name: "讲义",
+                },
+                {
+                  name: "笔记",
+                },
+                {
+                  name: "答疑",
+                },
+              ];
+              this.current = 0;
+            }
+          }
+        });
+    },
+    getMenuList() {
+      let self = this;
+      this.$api
+        .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
+        .then((res) => {
+          if (res.data.code == 200) {
+            for (let i = 0; i < res.data.rows.length; i++) {
+              let item = res.data.rows[i];
+              item.down = true;
+              item.id = item.menuId;
+              item.name = item.menuName;
+              item.menuType = item.type;
+            }
+            self.menuList = res.data.rows;
+
+            for (let i = 0; i < res.data.rows.length; i++) {
+              if (res.data.rows[i].type == 1) {
+                this.menuIndex = [i];
+                break;
+              } else if (res.data.rows[i].type == 2) {
+                this.menuIndex = [i];
+                break;
+              }
+            }
+          }
+        });
+    },
+    courseDetail() {
+      let self = this;
+      this.$api.courseDetail(this.courseId).then((res) => {
+        if (res.data.code == 200) {
+          if (res.data.data.educationName == "继续教育") {
+            this.$api
+              .lockLockAction({
+                action: "jxjy",
+              })
+              .then((res) => {});
+            this.lockTimer = setInterval(() => {
+              this.$api
+                .lockLockAction({
+                  action: "jxjy",
+                })
+                .then((res) => {});
+            }, 10000);
+
+            // websocket.sendMsg("doCourse");
+          }
+          self.detail = res.data.data;
+        }
+      });
+    },
+    open(item) {
+      item.showChildren = !item.showChildren;
+    },
+    change(index) {
+      this.current = index;
+    },
+    openDocument() {
+      let self = this;
+      let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
+      console.log(url);
+      uni.downloadFile({
+        url: url,
+        success: function (res) {
+          console.log(999);
+          var filePath = res.tempFilePath;
+          uni.openDocument({
+            filePath: filePath,
+            showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
+            success: function (res) {
+              console.log(res, "打开文档成功");
+            },
+            fail: function (err) {
+              console.log(err);
+              uni.showToast({
+                icon: "none",
+                title: "文档地址错误",
+              });
+            },
+          });
+        },
+        fail: (err) => {
+          uni.showModal({
+            title: "提示",
+            content: "文档错误," + err.errMsg,
+            showCancel: false,
+          });
+        },
+      });
+    },
+  },
 };
 </script>
 
 <style lang="scss" scope>
-	.btnSet{
-		width: 440rpx;
-		height: 80rpx;
-		background: #007AFF;
-		border-radius: 40rpx;
-		color: #FFFFFF;
-		font-size: 28rpx;
-		line-height: 80rpx;
-	}
+.polyv_detail {
+  display: flex;
+  flex-direction: column;
+  height: 100vh;
+
+  .box {
+    flex: 1;
+    overflow: hidden;
+    margin: 20rpx;
+
+    .box_in {
+      height: 100%;
+    }
+  }
+}
+.btnSet {
+  width: 440rpx;
+  height: 80rpx;
+  background: #007aff;
+  border-radius: 40rpx;
+  color: #ffffff;
+  font-size: 28rpx;
+  line-height: 80rpx;
+}
 .btnReply {
-	width: 80rpx;
-	height: 40rpx;
-	background: #e3f0ff;
-	border-radius: 16rpx;
-	text-align: center;
-	color: #007aff;
+  width: 80rpx;
+  height: 40rpx;
+  background: #e3f0ff;
+  border-radius: 16rpx;
+  text-align: center;
+  color: #007aff;
 }
 .btnDel {
-	width: 80rpx;
-	height: 40rpx;
-	background: #ffedf0;
-	border-radius: 16rpx;
-	text-align: center;
-	color: #ff2d55;
+  width: 80rpx;
+  height: 40rpx;
+  background: #ffedf0;
+  border-radius: 16rpx;
+  text-align: center;
+  color: #ff2d55;
 }
 .btnReply {
-	width: 80rpx;
-	height: 40rpx;
-	background: #e3f0ff;
-	border-radius: 16rpx;
-	font-size: 24rpx;
+  width: 80rpx;
+  height: 40rpx;
+  background: #e3f0ff;
+  border-radius: 16rpx;
+  font-size: 24rpx;
 }
 .lecture-box {
-	display: flex;
-	align-items: center;
-	height: 80rpx;
-	background: #FFFFFF;
-	border-radius: 16rpx 16rpx 16rpx 16rpx;
-	
-	.title {
-		padding:10rpx;
-		flex:1;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		white-space: nowrap;
-		color:#333;
-		font-weight: bold;
-		font-size: 32rpx;
-	}
-	
-	.btn {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		width:80rpx;
-		height:80rpx;
-		background: #FFFFFF;
-		box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0,0,0,0.1);
-		border-radius: 16rpx 16rpx 16rpx 16rpx;
-	}
+  display: flex;
+  align-items: center;
+  height: 80rpx;
+  background: #ffffff;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+
+  .title {
+    padding: 10rpx;
+    flex: 1;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    color: #333;
+    font-weight: bold;
+    font-size: 32rpx;
+  }
+
+  .btn {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 80rpx;
+    height: 80rpx;
+    background: #ffffff;
+    box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
+    border-radius: 16rpx 16rpx 16rpx 16rpx;
+  }
 }
 
 .lecture-content {
-	background:#fff;
-	margin-top:10rpx;
-	padding:10rpx;
-	border-radius:16rpx;
+  background: #fff;
+  margin-top: 10rpx;
+  padding: 10rpx;
+  border-radius: 16rpx;
 }
 .photoBox {
-	background-color: #FFFFFF;
-	border-radius: 32px 32px 0px 0px;
-	.photoTop {
-		height: 74upx;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		padding: 0upx 38upx;
-		.sqzz {
-			width: 28upx;
-			height: 28upx;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-		}
-		.centersq {
-			color: #333;
-			font-size: 30upx;
-			font-weight: 500;
-		}
-	}
-	.photoCenter {
-		width: 750upx;
-		height: 979upx;
-		position: relative;
-		.custom {
-			width: 750upx;
-			height: 979upx;
-			position: absolute;
-			z-index: 1000;
-			top: 0;
-			left: 0;
-			image {
-				width: 100%;
-				height: 100%;
-			}
-		}
-	}
-	.btnResult {
-		height: 100rpx;
-		width: 100%;
-		background-color: #07c160;
-		text-align: center;
-		line-height: 100upx;
-		color: #fff;
-		font-size: 32upx;
-		font-weight: bold;
-	}
+  background-color: #ffffff;
+  border-radius: 32px 32px 0px 0px;
+  .photoTop {
+    height: 74rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0rpx 38rpx;
+    .sqzz {
+      width: 28rpx;
+      height: 28rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .centersq {
+      color: #333;
+      font-size: 30rpx;
+      font-weight: 500;
+    }
+  }
+  .photoCenter {
+    width: 750rpx;
+    height: 979rpx;
+    position: relative;
+    .custom {
+      width: 750rpx;
+      height: 979rpx;
+      position: absolute;
+      z-index: 1000;
+      top: 0;
+      left: 0;
+      image {
+        width: 100%;
+        height: 100%;
+      }
+    }
+  }
+
+  .btns {
+    display: flex;
+
+    .btnResult {
+      height: 100rpx;
+      flex: 1;
+      background-color: #07c160;
+      text-align: center;
+      line-height: 100rpx;
+      color: #fff;
+      font-size: 32rpx;
+      font-weight: bold;
+    }
+  }
 }
 .chat_box {
-	display: flex;
-	padding: 20rpx;
-	justify-content: space-between;
+  display: flex;
+  padding: 20rpx;
+  justify-content: space-between;
 }
 .chat3 {
-	font-size: 30rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #666666;
-	margin-top: 10rpx;
+  font-size: 30rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #666666;
+  margin-top: 10rpx;
 }
 .chat2 {
-	font-size: 20rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #999999;
-	margin-top: 10rpx;
+  font-size: 20rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #999999;
+  margin-top: 10rpx;
 }
 .chat1 {
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #333333;
+  font-size: 24rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #333333;
 }
 .leftPadding {
-	margin-left: 8rpx;
+  margin-left: 8rpx;
 }
 .t2Content {
-	font-size: 28rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #999999;
-	line-height: 48rpx;
+  font-size: 28rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #999999;
+  line-height: 48rpx;
 }
 .tBox2 {
-	display: flex;
-	padding-top: 10rpx;
-	color: #333333;
-	font-size: 30rpx;
+  display: flex;
+  padding-top: 10rpx;
+  color: #333333;
+  font-size: 30rpx;
 }
 .tBox {
-	display: flex;
-	align-items: center;
-	padding-top: 10rpx;
+  display: flex;
+  align-items: center;
+  padding-top: 10rpx;
 }
 .title {
-	font-size: 24rpx;
-	color: #999999;
+  font-size: 24rpx;
+  color: #999999;
 }
 
 page {
-	padding-top: 10px;
-	padding-top: constant(safe-area-inset-top);
-	padding-top: env(safe-area-inset-top);
+  // padding-top: 10px;
+  // padding-top: constant(safe-area-inset-top);
+  // padding-top: env(safe-area-inset-top);
 }
 .inputBottom {
-	position: fixed;
-	left: 0;
-	bottom: 0;
-	background: #ffffff;
-	height: 98rpx;
-	display: flex;
-	align-items: center;
-	width: 100%;
-	
-	.flex_auto {
-		flex:1;
-		margin-left: 10% ;
-		
-		.input {
-			height:60rpx;
-		}
-	}
-	
-	.btn {
-		color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;
-	}
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  background: #ffffff;
+  height: 98rpx;
+  display: flex;
+  align-items: center;
+  width: 100%;
+
+  .flex_auto {
+    flex: 1;
+    margin-left: 10%;
+
+    .input {
+      height: 60rpx;
+    }
+  }
+
+  .btn {
+    color: #007aff;
+    font-size: 30rpx;
+    font-weight: bold;
+    width: 15%;
+    text-align: center;
+  }
 }
 .noteBox {
-	width: 100%;
-	background: #ffffff;
-	padding: 10rpx;
-	border-radius: 16rpx;
+  width: 100%;
+  background: #ffffff;
+  padding: 10rpx;
+  border-radius: 16rpx;
 }
 .dateBox {
-	width: 216rpx;
-	height: 48rpx;
-	background: #ffffff;
-	border-radius: 24rpx;
-	font-size: 24rpx;
-	color: #666666;
-	text-align: center;
-	line-height: 48rpx;
-	margin: 20rpx 0;
+  width: 216rpx;
+  height: 48rpx;
+  background: #ffffff;
+  border-radius: 24rpx;
+  font-size: 24rpx;
+  color: #666666;
+  text-align: center;
+  line-height: 48rpx;
+  margin: 20rpx 0;
 }
 .t_content1 {
-	color: #007aff;
-	margin-left: 10rpx;
+  color: #007aff;
+  margin-left: 10rpx;
 }
 .tag1 {
-	border: 2rpx solid #007aff;
-	border-radius: 8rpx;
-	font-size: 20rpx;
-	color: #007aff;
-	padding: 5rpx;
+  border: 2rpx solid #007aff;
+  border-radius: 8rpx;
+  font-size: 20rpx;
+  color: #007aff;
+  padding: 5rpx;
 }
 .b_title {
-	color: #333333;
-	font-size: 30rpx;
-	font-weight: bold;
+  color: #333333;
+  font-size: 30rpx;
+  font-weight: bold;
 }
 page {
-	background: #eaeef1;
+  background: #eaeef1;
 }
 .menuBox {
-	width: 100%;
-	background: #ffffff;
-	border-radius: 16rpx;
-	padding: 20rpx;
-	margin-bottom: 20rpx;
+  width: 100%;
+  background: #ffffff;
+  border-radius: 16rpx;
+  padding: 20rpx;
+  margin-bottom: 20rpx;
 }
 .btnspric {
-	border-top: 1rpx solid #eee;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	height: 108rpx;
-	padding-left: 43rpx;
-	padding-right: 32rpx;
+  border-top: 1rpx solid #eee;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  height: 108rpx;
+  padding-left: 43rpx;
+  padding-right: 32rpx;
 }
 .btnspric > .lefprL {
-	font-size: 36rpx;
-	color: #0c141f;
-	font-weight: bold;
+  font-size: 36rpx;
+  color: #0c141f;
+  font-weight: bold;
 }
 .btnspric > .lefprR {
-	padding: 0rpx 24rpx;
-	height: 60rpx;
-	line-height: 60rpx;
-	text-align: center;
-	color: #fff;
-	background: #32467b;
-	border-radius: 24rpx;
-	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+  padding: 0rpx 24rpx;
+  height: 60rpx;
+  line-height: 60rpx;
+  text-align: center;
+  color: #fff;
+  background: #32467b;
+  border-radius: 24rpx;
+  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
 }
 .yhj,
 .hdyhj {
-	padding: 24rpx 29rpx 24rpx 34rpx;
+  padding: 24rpx 29rpx 24rpx 34rpx;
 }
 .yhj {
-	border-bottom: 16rpx solid #f9f9f9;
+  border-bottom: 16rpx solid #f9f9f9;
 }
 .yhjtit {
-	font-size: 30rpx;
-	color: #0c141f;
-	font-weight: 500;
-	margin-bottom: 14rpx;
+  font-size: 30rpx;
+  color: #0c141f;
+  font-weight: 500;
+  margin-bottom: 14rpx;
 }
 .yhjList {
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	margin-bottom: 14rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 14rpx;
 }
 .yhjList > .yhjLefts {
-	display: flex;
-	align-items: center;
+  display: flex;
+  align-items: center;
 }
 .yhjLefts > .yhl {
-	color: #32467b;
-	font-size: 30rpx;
-	margin-right: 31rpx;
+  color: #32467b;
+  font-size: 30rpx;
+  margin-right: 31rpx;
 }
 .yhjLefts > .yhbq {
-	font-size: 24rpx;
-	color: #ff9500;
-	border-radius: 18rpx;
-	background-color: rgba(255, 149, 0, 0.2);
-	border: 2rpx solid #ff9500;
-	height: 38rpx;
-	line-height: 38rpx;
-	padding: 0rpx 16rpx;
+  font-size: 24rpx;
+  color: #ff9500;
+  border-radius: 18rpx;
+  background-color: rgba(255, 149, 0, 0.2);
+  border: 2rpx solid #ff9500;
+  height: 38rpx;
+  line-height: 38rpx;
+  padding: 0rpx 16rpx;
 }
 .ts {
-	font-size: 24rpx;
-	color: #999;
-	margin: 14rpx 0rpx;
-	padding-right: 29rpx;
-	padding-left: 34rpx;
+  font-size: 24rpx;
+  color: #999;
+  margin: 14rpx 0rpx;
+  padding-right: 29rpx;
+  padding-left: 34rpx;
 }
 .yh {
-	padding-top: 20rpx;
+  padding-top: 20rpx;
 }
 .yh > .yhtitle {
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	padding-right: 29rpx;
-	padding-left: 34rpx;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding-right: 29rpx;
+  padding-left: 34rpx;
 }
 .priceBxs {
-	display: flex;
-	align-items: center;
+  display: flex;
+  align-items: center;
 }
 .priceBxs > .pricleft {
-	border-radius: 24rpx;
-	border: 1rpx solid #e91313;
-	background-color: rgba(233, 19, 19, 0.1);
-	padding: 0rpx 18rpx;
-	height: 49rpx;
-	line-height: 49rpx;
-	text-align: center;
-	font-size: 30rpx;
-	font-weight: 500;
-	color: #e91313;
-	margin-right: 13rpx;
+  border-radius: 24rpx;
+  border: 1rpx solid #e91313;
+  background-color: rgba(233, 19, 19, 0.1);
+  padding: 0rpx 18rpx;
+  height: 49rpx;
+  line-height: 49rpx;
+  text-align: center;
+  font-size: 30rpx;
+  font-weight: 500;
+  color: #e91313;
+  margin-right: 13rpx;
 }
 .topBox {
-	padding: 32rpx 32rpx 24rpx;
-	border-bottom: 1rpx solid #eeeeee;
+  padding: 32rpx 32rpx 24rpx;
+  border-bottom: 1rpx solid #eeeeee;
 }
 .topBox > .boldFonstType {
-	font-weight: 500;
-	font-size: 30rpx;
-	margin: 16rpx 0rpx 23rpx;
+  font-weight: 500;
+  font-size: 30rpx;
+  margin: 16rpx 0rpx 23rpx;
 }
 .topBox > .firstTopL {
-	display: flex;
-	align-items: center;
+  display: flex;
+  align-items: center;
 }
 .topBox > .firstTopL > .imageBs {
-	width: 331rpx;
-	height: 160rpx;
-	border-radius: 6rpx;
-	overflow: hidden;
-	margin-right: 8rpx;
-	box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
+  width: 331rpx;
+  height: 160rpx;
+  border-radius: 6rpx;
+  overflow: hidden;
+  margin-right: 8rpx;
+  box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
 }
 .topBox > .firstTopL > .imageBs > image {
-	width: 100%;
-	height: 100%;
+  width: 100%;
+  height: 100%;
 }
 .topBox > .firstTopL > .textBs {
-	font-size: 30rpx;
-	font-weight: bold;
-	color: #0c141f;
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #0c141f;
 }
 .content {
-	padding: 24rpx;
-	text-align: left;
+  padding: 24rpx;
+  text-align: left;
 }
 .catalogBox {
-	display: flex;
-	align-items: center;
-	flex-wrap: nowrap;
-	overflow-x: auto;
-	padding-left: 38rpx;
-	max-height: 305rpx;
-	overflow-y: auto;
-	transition: all 0.4s;
+  display: flex;
+  align-items: center;
+  flex-wrap: nowrap;
+  overflow-x: auto;
+  padding-left: 38rpx;
+  max-height: 305rpx;
+  overflow-y: auto;
+  transition: all 0.4s;
 }
 .catalogBox > .catalogA {
-	min-width: 200rpx;
-	height: 48rpx;
-	line-height: 48rpx;
-	// text-align: center;
-	border: 2rpx solid transparent;
-	white-space: nowrap;
-	text-overflow: ellipsis;
-	overflow: hidden;
-	word-break: break-all;
-	border-radius: 10rpx;
-	background: rgba(22, 119, 255, 0.05);
-	padding-left: 19rpx;
-	box-sizing: border-box;
-	padding-right: 15rpx;
-	margin-right: 16rpx;
-	margin-bottom: 20rpx;
-	margin-top: 15rpx;
-	font-size: 24rpx;
-	color: #666;
+  min-width: 200rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  // text-align: center;
+  border: 2rpx solid transparent;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  word-break: break-all;
+  border-radius: 10rpx;
+  background: rgba(22, 119, 255, 0.05);
+  padding-left: 19rpx;
+  box-sizing: border-box;
+  padding-right: 15rpx;
+  margin-right: 16rpx;
+  margin-bottom: 20rpx;
+  margin-top: 15rpx;
+  font-size: 24rpx;
+  color: #666;
 }
 .catalogBox > .activesq {
-	border-color: #1677ff;
+  border-color: #1677ff;
 }
 .changeCatalogBox {
-	display: block;
+  display: block;
 }
 .catalogBox::-webkit-scrollbar {
-	display: none; /* Chrome Safari */
-}
-.box {
-	position: relative;
-	top: 650rpx;
-	padding-bottom: 88rpx;
-	margin: 20rpx;
+  display: none; /* Chrome Safari */
 }
 .price_t2 {
-	font-size: 18rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	text-decoration: line-through;
-	color: #999999;
+  font-size: 18rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  text-decoration: line-through;
+  color: #999999;
 }
 .price_t1 {
-	font-size: 33rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #e91313;
+  font-size: 33rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #e91313;
 }
 .sc_t {
-	font-size: 22rpx;
-	color: #000000;
+  font-size: 22rpx;
+  color: #000000;
 }
 .sc {
-	width: 29rpx;
-	height: 29rpx;
+  width: 29rpx;
+  height: 29rpx;
 }
 .buy {
-	width: 138rpx;
-	height: 48rpx;
-	line-height: 48rpx;
-	background: #32467b;
-	border-radius: 10rpx;
-	color: #ffffff;
-	font-size: 28rpx;
-	text-align: center;
-	vertical-align: middle;
-	position: absolute;
-	right: 30rpx;
+  width: 138rpx;
+  height: 48rpx;
+  line-height: 48rpx;
+  background: #32467b;
+  border-radius: 10rpx;
+  color: #ffffff;
+  font-size: 28rpx;
+  text-align: center;
+  vertical-align: middle;
+  position: absolute;
+  right: 30rpx;
 }
 .video_body {
-	padding-bottom: 96rpx;
+  padding-bottom: 96rpx;
 }
 .footer_tab {
-	position: fixed;
-	bottom: 0;
-	height: 96rpx;
-	width: 100%;
-	background-color: #ffffff;
+  position: fixed;
+  bottom: 0;
+  height: 96rpx;
+  width: 100%;
+  background-color: #ffffff;
 }
 .tj_box {
-	width: 50%;
-	display: inline-block;
-	text-align: center;
-	margin: 10rpx 0;
+  width: 50%;
+  display: inline-block;
+  text-align: center;
+  margin: 10rpx 0;
 }
 .teacher_t {
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: 400;
-	color: #666666;
-	line-height: 36rpx;
-	margin-left: 15rpx;
+  font-size: 24rpx;
+  font-family: PingFang SC;
+  font-weight: 400;
+  color: #666666;
+  line-height: 36rpx;
+  margin-left: 15rpx;
 }
 .teacher_img {
-	width: 87rpx;
-	height: 129rpx;
+  width: 87rpx;
+  height: 129rpx;
 }
 .t2 {
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	color: #666666;
-	line-height: 36rpx;
-	margin: 15rpx;
+  font-size: 24rpx;
+  font-family: PingFang SC;
+  color: #666666;
+  line-height: 36rpx;
+  margin: 15rpx;
 }
 .r_t2 {
-	width: 201rpx;
-	height: 49rpx;
-	background: rgba(22, 119, 255, 0.05);
-	border: 1rpx solid #32467b;
-	border-radius: 16rpx;
-	color: #666666;
-	font-size: 23rpx;
-	text-align: center;
-	display: flex;
-	align-items: center;
-	padding: 5rpx;
+  width: 201rpx;
+  height: 49rpx;
+  background: rgba(22, 119, 255, 0.05);
+  border: 1rpx solid #32467b;
+  border-radius: 16rpx;
+  color: #666666;
+  font-size: 23rpx;
+  text-align: center;
+  display: flex;
+  align-items: center;
+  padding: 5rpx;
 }
 .scroll_box {
-	width: 100%;
-	height: 60rpx;
-	background: #ffffff;
-	box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
-	white-space: nowrap;
-	overflow: hidden;
-	margin: 15rpx 0;
+  width: 100%;
+  height: 60rpx;
+  background: #ffffff;
+  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
+  white-space: nowrap;
+  overflow: hidden;
+  margin: 15rpx 0;
 }
 .r_sliper {
-	padding: 0 20rpx;
+  padding: 0 20rpx;
 }
 .top_line {
-	width: 6rpx;
-	height: 22rpx;
-	background: #32467b;
-	margin-right: 10rpx;
+  width: 6rpx;
+  height: 22rpx;
+  background: #32467b;
+  margin-right: 10rpx;
 }
 .video_t2 {
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: 500;
-	color: #666666;
+  font-size: 24rpx;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #666666;
 }
 .video_t1 {
-	height: 80rpx;
-	color: #333333;
-	line-height: 80rpx;
-	font-size: 30rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #333333;
-	overflow: hidden;
-	text-overflow: ellipsis;
-	white-space: nowrap;
-}
-.video_t1_t {
-	display: flex;
-	flex-direction: column;
-	height: 80rpx;
-	color: #333333;
-	text-align: center;
-	align-items: center;
-	border-left: solid 1px #d6d6db;
+  height: 80rpx;
+  color: #333333;
+  line-height: 80rpx;
+  font-size: 30rpx;
+  font-family: PingFang SC;
+  font-weight: bold;
+  color: #333333;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.notice_wrap {
+  height: 80rpx;
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+
+  .video_t1_t {
+    width: 100%;
+    height: 40rpx;
+    line-height: 40rpx;
+    text-align: center;
+    background: rgba(245, 154, 35, 1);
+    color: #333;
+    border-radius: 10rpx;
+    font-size: 24rpx;
+  }
 }
 .video_play {
-	position: absolute;
-	width: 95rpx;
-	height: 95rpx;
-	top: 0;
-	left: 0;
-	right: 0;
-	bottom: 0;
-	margin: auto;
+  position: absolute;
+  width: 95rpx;
+  height: 95rpx;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  margin: auto;
 }
 .video_box {
-	position: relative;
+  position: relative;
+
+  .video-toast {
+    position: absolute;
+    width: 686rpx;
+    height: 80rpx;
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: 24rpx;
+    bottom: 100rpx;
+    left: 50%;
+    transform: translateX(-50%);
+    color: #fff;
+    display: flex;
+    font-size: 26rpx;
+    align-items: center;
+    overflow: visible;
+
+    &__text {
+      flex: 1;
+      margin-left: 40rpx;
+    }
+
+    &__btn {
+      width: 180rpx;
+      text-align: center;
+      border-left: 1rpx solid #fff;
+    }
+  }
+
+  .video-toast__close {
+    position: absolute;
+    right: 32rpx;
+    bottom: 184rpx;
+    width: 40rpx;
+    height: 40rpx;
+    line-height: 40rpx;
+    text-align: center;
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: 50%;
+    color: rgba(255, 255, 255, 0.3);
+  }
 }
 .rotoct {
-	transform: rotate(90deg);
+  transform: rotate(90deg);
+}
+
+.notice_modal {
+  .content {
+    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>

+ 1 - 1
pages3/static/polyv-sdk/common/wxParse/wxParse.wxml

@@ -13,7 +13,7 @@
 <template name="wxParseVideo">
   <!--增加video标签支持,并循环添加-->
   <view class="wxParse-view {{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
-    <video class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video>
+    <video custom-cache="{{false}}" class="{{item.classStr}} wxParse-{{item.tag}}-video" src="{{item.attr.src}}"></video>
   </view>
 </template>
 

+ 1 - 0
pages3/static/polyv-sdk/components/live-player/live-player.wxml

@@ -80,6 +80,7 @@
     controls="{{ liveMode === 2 }}"
     enable-danmu="{{ true }}"
     autoplay="{{ true }}"
+	custom-cache="{{false}}"
     object-fit="{{ objectFit }}"
     picture-in-picture-mode="{{ pipMode }}"
     bindtap="showPlayControl"

+ 2 - 1
pages3/static/polyv-sdk/components/player/player.wxml

@@ -27,9 +27,10 @@
       src="{{ vodSrc }}"
       muted="{{ muted }}"
       autoplay
+	  custom-cache="{{false}}"
       picture-in-picture-mode="{{ pipMode }}"
       enable-danmu="{{ true }}"
-      object-fit="{{ objectFit }}"
+      object-fit="contain"
       bindtap="showSetControl"
       bindtimeupdate="onVodTimeUpdate"
       bindplay="onVodPlay"

+ 42 - 5
store/index.js

@@ -4,12 +4,15 @@ import api from '@/common/api.js'
 Vue.use(Vuex);
 const store = new Vuex.Store({
 	state: {
+		hideBuyState:false, //是否隐藏购买流程和订单列表
 		login: true,
 		token: '',
 		avatarUrl: '',
 		userName: '',
+		playNextId:'', //正在播放的节id
 		userInfo: null,
 		dictObj: null,
+		chapterOpen:true,
 		allowLoading: true,
 		goodsAuditionConfigIdList: [], //当前访问页面的试听节ID
 		shoppingCartList: [], //购物车支付商品
@@ -22,11 +25,11 @@ const store = new Vuex.Store({
 	},
 	getters: {
 		userInfo: state => {
-			if (state.userInfo == null) {
-				if (uni.getStorageSync('user_account')) {
-					getUserInfo(state)
-				}
-			}
+			// if (state.userInfo == null) {
+			// 	if (uni.getStorageSync('user_account')) {
+			// 		getUserInfo(state)
+			// 	}
+			// }
 			return state.userInfo
 		},
 		dictObj: state => {
@@ -52,9 +55,18 @@ const store = new Vuex.Store({
 		allowLoading: state => {
 			return state.allowLoading
 		},
+		playNextId: state => {
+			return state.playNextId
+		},
+		chapterOpen: state => {
+			return state.chapterOpen
+		},
 		goodsAuditionConfigIdList: state => {
 			return state.goodsAuditionConfigIdList
 		},
+		hideBuyState: state => {
+			return state.hideBuyState
+		},
 		shoppingCartList: state => {
 			return state.shoppingCartList
 		},
@@ -85,6 +97,16 @@ const store = new Vuex.Store({
 			}
 
 		},
+		updateAllowLoading(state,isShowloading) {
+			state.allowLoading = isShowloading
+		},
+		updatePlayNextId(state,str) {
+			console.log(str,'str')
+			state.playNextId = str
+		},
+		updateChapterOpen(state,boolean) {
+			state.chapterOpen = boolean
+		},
 		updataCopyData(state, objs) {
 			state.copyData = objs
 		},
@@ -124,6 +146,21 @@ const store = new Vuex.Store({
 					commit('tabNum', nums)
 				}
 			})
+		},
+		getUserInfo(context) {
+			return new Promise(async resolve => {
+				const resdata = await api.getInfo()
+				if (resdata.data.code == 200) {
+					context.state.userInfo = resdata.data.data;
+					resolve()
+				}
+			})
+		},
+		async appCommonConfig(context,data) {
+			const resdata = await api.appCommonConfig(data)
+			if (resdata.data.code == 200) {
+				context.state.hideBuyState = resdata.data.data.hide;
+			}
 		}
 	}
 })