Bladeren bron

Merge branch 'xqy_recom' into dev

xuqiaoying 3 jaren geleden
bovenliggende
commit
3d1f6ffc72

+ 3 - 3
common/request.js

@@ -5,8 +5,8 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
+// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
@@ -33,7 +33,7 @@ RVQplIVs5z3MxcUa9ptKPHUTgh8xMCBvl8sUJKwkmn4vYWeDfHT22EL7Hr1pTMwU
 hF6WiNlWfQTVoF1rhwIDAQAB
 -----END PUBLIC KEY-----`;
 
-export const version = '1.3.12' 
+export const version = '1.3.16' 
 export const tenantId = '867735392558919680' 
 export const myRequest = (options) => {
 	if (store.state.allowLoading && !options.noLoading) {

+ 203 - 59
pages/index/index.vue

@@ -99,9 +99,24 @@
 			<view class="tabs">
 				<view v-for="(item, index) in menu" :key="index" class="tab_item" :class="{nactive: tabNum == index}" @click="tab(index)">{{ item.name }}</view>
 			</view>
+			<view class="filters">
+				<scroll-view class="scroll_view_H" scroll-x="true" >
+					<template v-if="tabNum == 0 && courseName.length > 1">
+						<view v-for="(item, index) in courseName" :key="index" class="filter_item"  @click="changeCou(item.recommendId, index)">
+							<view class="name" :class="{nactive: couIndex == index}">{{ item.name }}</view>
+						</view>
+					</template>
+					<template v-if="tabNum == 1 && bankName.length > 1">
+						<view v-for="(item, index) in bankName" :key="index" class="filter_item" @click="changebank(item.recommendId, index)">
+							<view class="name" :class="{nactive: couIndex == index}">{{ item.name }}</view>
+						</view>
+					</template>
+				</scroll-view>
+			</view>
 			<view class="course-list" v-show="tabCurrent==0">
 				<template v-if="list1.length">
-					<navigator  hover-class="none" class="list_item" v-for="(item,index) in list1" :key="index" :url="'/pages3/course/detail?id='+item.goodsId">
+					<!-- hover-class="none" -->
+					<view  class="list_item" v-for="(item,index) in list1" :key="index" @click="tobuy(item)">
 						<view class="course_content">
 							<view class="c_title">{{item.goodsName}}</view>
 							<view class="c_downs">
@@ -130,7 +145,7 @@
 								</view>
 							</view>
 						</view>					
-					</navigator>
+					</view>
 				</template>
 				<template v-else>
 					<u-empty text="暂无推荐课程" mode="list" margin-top="100"></u-empty>
@@ -240,7 +255,7 @@ export default {
 				{
 					pageNum: 1,
 					pageSize: 10,
-					// total: 0,
+					total: 0,
 					// showStatus: 0,
 					getUserNum: 1, //是否返回商品购买用户数量 1带 0不带	,会返回个buyUserNum
 					goodsType:1
@@ -249,16 +264,14 @@ export default {
 				{
 					pageNum: 1,
 					pageSize: 10,
-					// total: 0,
+					total: 0,
 					// showStatus: 0,
 					getUserNum: 1,
 					goodsType:2
 				}
 			],
 			total1: 0,
-			showStatus1: 0,
 			total2: 0,
-			showStatus2: 0,
 			list1: [],
 			list2: [],
 			isLogin:false,
@@ -269,9 +282,14 @@ export default {
 			// opacity: 1,
 			isFollow: null, //是否关注过,不是1就是没关注
 			curClose: true, // 当天时是否关闭过
+			courseName: [],
+			bankName: [],
+			couIndex: 0,
+			bankIndex: 0,
+			courseId: '',
+			bankId: '',
 		};
 	},
-	onPullDownRefresh() {},
 	async onLoad(option) {
 		this.isLogin = this.$method.isLogin()
 		this.dictObj
@@ -303,13 +321,28 @@ export default {
 			}
 		})
 	},
-	onShow() {
+	async onShow() {
+		// console.log('-----couIndex', this.couIndex, this.courseId)
 		this.getInfo() // 判断有没有关注公众号		
 		this.isClickOff() //关注公众号,每天最多显示1次;当天学员关闭弹窗后,无需再显示
-		console.log('this.$store.state.scene', this.$store.state.scene)
 		uni.removeStorageSync('goPath')
-		this.courseList();
-		this.bankList();
+		
+		if (this.courseId || this.bankId) {
+			if (this.tabNum == 0) {
+				this.list1 = []
+				this.paramList[0].pageNum = 1
+				this.list1 = await this.getGoodsList(this.courseId, 0)
+			} else {
+				this.list2 = []
+				this.paramList[1].pageNum = 1
+				this.list2 = await this.getGoodsList(this.bankId, 1)
+			}
+		} else {
+			this.list1 = []
+			this.list2 = []
+			this.courseLists()
+		}
+		// this.bankList();
 		if (uni.getStorageSync('updateHome')){
 			this.init()
 			uni.removeStorageSync('updateHome'); //消费首页刷新事件
@@ -338,23 +371,68 @@ export default {
 			path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
 		};
 	},
+	async onPullDownRefresh() {
+		if (this.tabNum == 0) {
+			this.list1 = []
+			this.paramList[0].pageNum = 1
+			this.list1 = await this.getGoodsList(this.courseId, 0)
+		} else {
+			this.list2 = []
+			this.paramList[1].pageNum = 1
+			this.list2 = await this.getGoodsList(this.bankId, 1)
+		}
+	},
+	async onReachBottom() {
+		// console.log('加载加载--', this.tabNum)
+		// console.log(this.paramList[0].total,'total', this.paramList[1].total)
+		// console.log(this.list1.length,'length', this.list2.length)
+		if (this.tabNum == 0) {
+			if (this.list1.length < this.paramList[0].total) {
+				this.paramList[0].pageNum++
+				let list1 = await this.getGoodsList(this.courseId, 0)
+				this.list1.push(...list1)
+			}
+		} else {
+
+			if (this.list2.length < this.paramList[1].total) {
+				this.paramList[1].pageNum++
+				let list2 = await this.getGoodsList(this.bankId, 1)
+				this.list1.push(...list2)
+			}
+		}
+		
+	},
 	computed: { 
 		...mapGetters(['dictObj','userInfo', 'hideBuyState']),
 		opacitys() {
 			const value = [1011,1017,1025,1047,1124].includes(this.$store.state.scene) && this.isLogin && (this.isFollow != 1) && this.curClose ? 1 : 0
-			console.log('this.opacity::', value)
 			return value
 		},
 	},
 	methods: {
 		...mapActions(['getUserInfo','appCommonConfig']),
+		tobuy(item) {
+			console.log(item)
+			if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+		},
 		getInfo() {
 			// /app/user/getInfo 登录用户信息 // fromPlat来源平台 1小程序 2PC网站
 			this.$api.getInfo({ fromPlat: 1 }).then(res => {
 				if(res.data.code == 200){
 					this.$store.state.userInfo = res.data.data
 					this.isFollow = res.data.data.userFollowWx // 不是1就是没关注
-					console.log('有没有关注', this.isFollow, this.isFollow != 1)
 				}
 			})
 		},
@@ -511,55 +589,95 @@ export default {
 			}
 			
 		},
+		async changeCou(recommendId, index) {
+			this.couIndex = index
+			this.courseId = recommendId
+			this.paramList[0].pageNum = 1
+			this.list1 = []
+			let list1 = await this.getGoodsList(recommendId, 0)
+			this.list1.push(...list1)
+		},
+		async changebank(recommendId, index) {
+			this.bankIndex = index
+			this.bankId = recommendId
+			this.paramList[1].pageNum = 1
+			this.list2 = []
+			let list2 = await this.getGoodsList(recommendId, 1)
+			this.list2.push(...list2)
+		},
 		//课程
-		courseList() {
-			var param = this.paramList[0];
+		 courseLists() {			
+			// var param = this.paramList[0];
 			// /app/common/goods/list
-			// this.$http({
-			// 	url: '/app/common/activity/recommend/list',
-			// 	method: 'get',
-			// 	data: {
-			// 		platform: 1,
-			// 		status: 1,
-			// 	},
-			// 	noToken: true
-			// }).then((res) => {
-			// 	console.log('s---->', res)
-			// 	if (res.data.code == 200) {
-			// 		this.list1 = res.data.rows && (res.data.rows[0].goodsList || [])
-			// 		this.list1 = this.list1.sort((a, b) => a.sort - b.sort)
-          	// 		// this.goodsList2 = goodsList2.sort((a, b) => a.sort - b.sort);
-			// 		this.total1 = res.data.rows[0].goodsList.length
-			// 		if (this.list1.length === this.total1) {
-			// 			this.showStatus1 = true
-			// 		}
-			// 	}
-			// })
-			this.$api.goodsList(param).then(res => {
+			this.$http({
+				url: '/app/common/activity/recommend/list',
+				method: 'get',
+				data: {
+					platform: 1,
+					status: 1
+				},
+				noToken: true
+			}).then(async (res) => {
 				if (res.data.code == 200) {
-					this.list1 = res.data.rows || []
-					this.total1 = res.data.total
-					if (this.list1.length === res.data.total) {
-						this.showStatus1 = true
+					let list = res.data.rows || []
+					//课程
+					this.courseName = list.filter(x => x.type == 1).sort((a,b) => a.sort - b.sort).map(x => {
+						return {
+							name: x.name,
+							recommendId: x.recommendId
+						}
+					});
+					console.log('couIndex', this.couIndex, this.courseName)
+					//题库
+					this.bankName = list.filter(x => x.type == 2).sort((a,b) => a.sort - b.sort).map(x => {
+						return {
+							name: x.name,
+							recommendId: x.recommendId
+						}
+					});
+					if (this.courseName.length) {
+						this.courseId = this.courseName[0].recommendId
+						let list1 = await this.getGoodsList(this.courseName[0].recommendId, 0)
+						this.list1.push(...list1)
 					}
-				}
-				
-			});
-		},
-		//题库
-		bankList() {
-			var param = this.paramList[1];
-			this.$api.goodsList(param).then(res => {
-				// this.paramList[1].total = res.data.total;
-				if (res.data.code == 200) {
-					this.list2 = res.data.rows || []
-					this.total2 = res.data.total
-					if (this.list2.length === res.data.total) {
-						// this.paramList[1].showStatus = true;
-						this.showStatus2 = true
+					
+					if (this.bankName.length) {
+						this.bankId = this.bankName[0].recommendId
+						let list2 = await this.getGoodsList(this.bankName[0].recommendId, 1)
+						this.list2.push(...list2)
 					}
+
 				}
 			});
+			// this.$api.goodsList(param).then(res => {
+			// 	if (res.data.code == 200) {
+			// 		this.list1 = res.data.rows || []
+			// 		this.total1 = res.data.total
+			// 		if (this.list1.length === res.data.total) {
+			// 			this.showStatus1 = true
+			// 		}
+			// 	}
+			// });
+		},
+		getGoodsList(recommendId, num) {	
+			return new Promise((resolve, reject) => {
+				 this.$http({
+					url: `/app/common/activity/recommend/goodsList`,
+					method: 'get',
+					data: {
+						pageNum: this.paramList[num].pageNum,
+						pageSize: this.paramList[num].pageSize,
+						recommendId: recommendId
+					},
+					noToken: true
+				}).then((res) => {
+					if (res.data.code == 200) {
+						this.paramList[num].total = res.data.total
+						resolve(res.data.rows)
+					}	
+				})
+			})
+			 
 		},
 		/**
 		 * @param {Object} item 
@@ -733,7 +851,6 @@ export default {
 			}
 		}
 	},
-	onReachBottom() {},
 	
 };
 </script>
@@ -1088,10 +1205,37 @@ page {
 				}
 			}
 		}
+
+		.filters {
+			width: 100%;
+			padding: 0rpx 16rpx;
+			margin-bottom: 32rpx;
+			display: flex;
+			align-items: center;
+			.scroll_view_H {
+				width: 100%;
+				overflow: hidden;
+				white-space: nowrap;
+			}
+			.filter_item {
+				display: inline-block;
+				margin-right: 16rpx;
+				.name {
+					font-size: 24rpx;
+					color: #666666;
+					padding: 12rpx 16rpx;
+					height: 56rpx;
+					text-align: center;
+					background: #FFFFFF;
+					border-radius: 8rpx;
+					&.nactive {
+						color: #3F8DFD;
+					}
+				}
+			}
+		}
 	}
-	// .botms {
-	// 	padding-bottom: 100rpx;
-	// }
+
 	
 	.my-list {
 		margin:32rpx 0;

+ 145 - 106
pages2/bank/questionBank.vue

@@ -63,6 +63,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="radioSelect(item.optionsId, bankIndex)"
                 >
                   <text
                     :class="{
@@ -133,6 +134,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="checkboxSelect(item.optionsId, bankIndex, index)"
                 >
                   <text
                     :class="{
@@ -142,7 +144,7 @@
                       wrong:
                         bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 &&
                         bank.ans.indexOf(item.optionsId) == -1),
-                      user_choose: bankType == 2 && (bank.ques.indexOf(item.optionsId) != -1),
+                      user_choose: bankType == 2 && item.checked,
                     }"
                     class="activeTI"
                   >
@@ -161,7 +163,7 @@
                 </view>
               </view>
               <view
-                v-if="!bank.ques"
+                v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
                 class="submit_checkbox"
                 :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
                 @click="checkboxSubmit(bankIndex)"
@@ -223,6 +225,7 @@
                   v-for="(item, index) in judge"
                   :key="index"
                   class="lisSty"
+                  @click="judgeSelect(index, bankIndex)"
                 >
                   <text
                     :class="{
@@ -268,8 +271,8 @@
                 <view
                   class="ans_input"
                   v-if="
-                    !bank.ques ||
-                    (!bank.ques.imageList.length && !bank.ques.text)
+                    bankType == 2 || (bankType == 1 && (!bank.ques ||
+                    (!bank.ques.imageList.length && !bank.ques.text)))
                   "
                 >
                   <view class="top flex">
@@ -398,6 +401,9 @@
                       v-for="(option, childIndex) in ansItem.optionsList"
                       :key="childIndex"
                       class="lisSty"
+                      @click="
+                        radioSelectChild(option.optionsId, ansIndex, bankIndex)
+                      "
                     >
                       <text
                         :class="{
@@ -478,7 +484,7 @@
                     </view>
                   </view>
                   <view
-                    v-if="!bank.ques[ansIndex]"
+                    v-if="bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])"
                     class="submit_checkbox"
                     :class="{
                       disabled: !isCheckboxChecked(ansItem.optionsList),
@@ -491,12 +497,15 @@
                       v-for="(option, childindex) in ansItem.optionsList"
                       :key="childindex"
                       class="lisSty"
+                      @click="
+                        checkboxSelectChild(bankIndex, ansIndex, childindex)
+                      "
                     >
                       <text
                         :class="{
                           right: bankType == 1 && right(bankIndex, ansIndex, option),
                           wrong: bankType == 1 && wrong(bankIndex, ansIndex, option),
-                          user_choose: bankType == 2 && (questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1),
+                          user_choose: bankType == 2 &&  option.checked,
                         }"
                         class="activeTI"
                       >
@@ -578,6 +587,7 @@
                       v-for="(option, childindex) in judge"
                       :key="childindex"
                       class="lisSty"
+                      @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
                     >
                       <text
                         :class="{
@@ -635,9 +645,10 @@
                     <view
                       class="ans_input"
                       v-if="
-                        !bank.ques[ansIndex] ||
+                        bankType == 2 || (bankType == 1 &&
+                        (!bank.ques[ansIndex] ||
                         (!bank.ques[ansIndex].text &&
-                          !bank.ques[ansIndex].imageList.length)
+                          !bank.ques[ansIndex].imageList.length)))
                       "
                     >
                       <view class="top flex">
@@ -766,10 +777,11 @@
                 :key="index"
                 @click="changeIndex(index)"
                 :class="{
-                  isRight: isRight(item, index),
-                  isWrong: isWrong(item, index),
-                  isPart: isPart(item, index),
-                  isOver: isOver(item, index),
+                  isRight: bankType == 1 && isRight(item, index),
+                  isWrong: bankType == 1 && isWrong(item, index),
+                  isPart: bankType == 1 && isPart(item, index),
+                  isOver: bankType == 1 && isOver(item, index),
+                  check_ans: bankType == 2 && isCheck(item, index),
                 }"
                 class="liListSty"
               >
@@ -1681,45 +1693,51 @@ export default {
      * @param {Object} e单选点击
      */
     radioSelect(optionsId, bindex) {
-      if (this.questionList[bindex].ques) return;
-      this.$set(this.questionList[bindex], "ques", optionsId);
-      if ((bindex + 1) < this.questionList.length) {
-        this.current = bindex + 1
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
       }
+      this.$set(this.questionList[bindex], "ques", optionsId);
+      // if ((bindex + 1) < this.questionList.length) {
+      //   this.current = bindex + 1
+      // }
       this.isDoOver();
 
       // 回答错误
-      if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
-        // /exam/wwrong/record 
-        this.$api
-          .examWrongRecord({
-            orderGoodsId: this.orderGoodsId,
-            examId: this.id,
-            goodsId: this.goodsId,
-            moduleExamId: this.moduleId || 0,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[bindex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      } else {
-        // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
-        // if(question) {
-        // 	this.$api.wrongRecordDelete({
-        // 		"examId": +this.id,
-        // 		"goodsId": +this.goodsId,
-        // 		"questionId": this.questionList[bindex].questionId,
-        // 	}).then(res => {
-        // 	})
-        // }
-      }
+      // if (this.questionList[bindex].ques != this.questionList[bindex].ans) {
+      //   // /exam/wwrong/record 
+      //   this.$api
+      //     .examWrongRecord({
+      //       orderGoodsId: this.orderGoodsId,
+      //       examId: this.id,
+      //       goodsId: this.goodsId,
+      //       moduleExamId: this.moduleId || 0,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[bindex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // } else {
+      //   // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
+      //   // if(question) {
+      //   // 	this.$api.wrongRecordDelete({
+      //   // 		"examId": +this.id,
+      //   // 		"goodsId": +this.goodsId,
+      //   // 		"questionId": this.questionList[bindex].questionId,
+      //   // 	}).then(res => {
+      //   // 	})
+      //   // }
+      // }
     },
 
     /**
      * @param {Object} e案例单选点击
      */
     radioSelectChild(optionsId, ansIndex, bindex) {
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
       this.isDoOver();
     },
@@ -1728,6 +1746,9 @@ export default {
      * @param {Object} 多选点击
      */
     checkboxSelect(optionsId, bindex, index) {
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[index],
         "checked",
@@ -1739,6 +1760,9 @@ export default {
      * @param {Object} 案例多选点击
      */
     checkboxSelectChild(bindex, ansIndex, childIndex) {
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
         "checked",
@@ -1760,7 +1784,10 @@ export default {
      */
     checkboxSubmit(bindex) {
       // console.log('')
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1769,6 +1796,7 @@ export default {
       });
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1779,48 +1807,43 @@ export default {
       this.$set(this.questionList[bindex], "ques", arr);
       this.isDoOver();
 
-      // let isWrong = this.questionList[bindex].ques.some(
-      //   (quesItem, quesIndex) => {
-      //     return (
-      //       this.questionList[bindex].ques[quesIndex] !=
-      //       this.questionList[bindex].ans[quesIndex]
-      //     );
-      //   }
-      // );
-      let isWrong = this.questionList[bindex].ques.some((item, i) => {
-        return this.questionList[bindex].ans.indexOf(item) == -1;
-      })
-      // 回答错误
-      if (isWrong) {
-        this.$api
-          .examWrongRecord({
-            orderGoodsId: this.orderGoodsId,
-            examId: this.id,
-            goodsId: this.goodsId,
-            moduleExamId: this.moduleId || 0,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[bindex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      } else {
-        // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
-        // if(question) {
-        // 	this.$api.wrongRecordDelete({
-        // 		"examId": +this.id,
-        // 		"goodsId": +this.goodsId,
-        // 		"questionId": this.questionList[bindex].questionId,
-        // 	}).then(res => {
-        // 	})
-        // }
-      }
+      // let isWrong = this.questionList[bindex].ques.some((item, i) => {
+      //   return this.questionList[bindex].ans.indexOf(item) == -1;
+      // })
+      // // 回答错误
+      // if (isWrong) {
+      //   this.$api
+      //     .examWrongRecord({
+      //       orderGoodsId: this.orderGoodsId,
+      //       examId: this.id,
+      //       goodsId: this.goodsId,
+      //       moduleExamId: this.moduleId || 0,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[bindex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // } else {
+      //   // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
+      //   // if(question) {
+      //   // 	this.$api.wrongRecordDelete({
+      //   // 		"examId": +this.id,
+      //   // 		"goodsId": +this.goodsId,
+      //   // 		"questionId": this.questionList[bindex].questionId,
+      //   // 	}).then(res => {
+      //   // 	})
+      //   // }
+      // }
     },
 
     /**
      * @param {Object} 案例多选确认
      */
     checkboxSubmitChild(bindex, ansIndex) {
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1831,6 +1854,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques[ansIndex]
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1848,33 +1872,36 @@ export default {
      * 判断题
      */
     judgeSelect(index, bindex) {
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex], "ques", index + "");
       this.isDoOver();
       // 回答错误
-      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,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[bindex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      } else {
-        // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
-        // if(question) {
-        // 	this.$api.wrongRecordDelete({
-        // 		"examId": +this.id,
-        // 		"goodsId": +this.goodsId,
-        // 		"questionId": this.questionList[bindex].questionId,
-        // 	}).then(res => {
-        // 	})
-        // }
-      }
+      // 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,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[bindex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // } else {
+      //   // let question = this.wrongList.find(item => item.questionId == this.questionList[bindex].questionId);
+      //   // if(question) {
+      //   // 	this.$api.wrongRecordDelete({
+      //   // 		"examId": +this.id,
+      //   // 		"goodsId": +this.goodsId,
+      //   // 		"questionId": this.questionList[bindex].questionId,
+      //   // 	}).then(res => {
+      //   // 	})
+      //   // }
+      // }
     },
 
     /**
@@ -1884,7 +1911,10 @@ export default {
      * 案例判断题
      */
     judgeSelectChild(ansindex, childindex, bindex) {
-      if (this.questionList[bindex].ques[ansindex]) return;
+      // if (this.questionList[bindex].ques[ansindex]) return;
+      if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
       this.isDoOver();
     },
@@ -2439,7 +2469,11 @@ export default {
       });
       this.isDoOver();
     },
-
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2670,7 +2704,7 @@ export default {
   color: #666;
   font-size: 30rpx;
 
-  &.right, &.user_choose {
+  &.right {
     color: #fff;
     background: #36c75a;
   }
@@ -2680,7 +2714,7 @@ export default {
     background: #ff3b30;
   }
 
-  &.checked {
+  &.checked, &.user_choose {
     color: #fff;
     background: #007aff;
   }
@@ -3010,6 +3044,11 @@ export default {
     color: #fff;
     background: blue;
   }
+  &.check_ans {
+    border: 1rpx solid #eeeeee;
+    color: #fff;
+    background: #007aff;
+  }
 }
 .answerInfos {
   padding: 25rpx 25rpx 25rpx 23rpx;

+ 93 - 3
pages2/bank/question_report.vue

@@ -106,6 +106,42 @@
 				</view>
 			</view>
 		</view>
+
+		<view v-if="courseList.length" class="course_list">
+            <view class="titles">
+                <image class="code" src="@/static/learn/act_icon.png" ></image>
+                <text class="title">推荐课程</text>
+            </view>
+            <view class="list_item" v-for="(item,index) in courseList" :key="index" @click="toBuy(item)">
+                <view class="course_content">
+                    <view class="c_title">{{item.goodsName}}</view>
+                    <view class="c_downs">
+                        <view class="img">
+                            <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
+                            <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
+                        </view>
+                        <view class="text">
+                            <view class="desc">
+                                <view class="left">
+                                    <text class="mon_t">¥ {{item.standPrice}}</text>
+                                    <!-- <text class="sale">/限时优惠</text> -->
+                                    <text v-if="item.linePrice" class="sale"> ¥ </text>
+                                    <text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
+                                </view>
+                                <view class="right">
+                                    <view class="regiser_row" v-if="!hideBuyState">立即购买</view>
+                                </view>
+                            </view>
+                            <view v-if="item.buyUserNum" class="joins">
+                                <!-- <image class="people" src="/static/index/people.png"></image> -->
+                                <!-- 为0时,不显示 -->
+                                <view class="people">{{ item.buyUserNum }}人参与</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>					
+            </view>
+        </view>
 	</view>
 </template>
 
@@ -128,12 +164,17 @@ export default {
 			nextExamId:'',
 			wrongRecordWrongNum:'',
 			orderGoodsId:'',
+			courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
 		};
 	},
 	onUnload() {},
-	computed: { ...mapGetters(['userInfo']) },
-	async onShow() {
-		
+	computed: { ...mapGetters(['userInfo', 'hideBuyState']) },
+	onShow() {
+		this.courseList = []
+		this.getcourList()
 	},
 		
 		
@@ -241,7 +282,55 @@ export default {
 		});
 		
 	},
+	onPullDownRefresh() {
+		this.pageNum = 1
+		this.getcourList()
+		// this.timer = setTimeout(function() {
+		// 	uni.stopPullDownRefresh()
+		// }, 500)
+	},
+	onReachBottom() {
+		console.log(this.total,'total')
+		console.log(this.courseList.length,'length')
+		if (this.courseList.length < this.total) {
+			this.pageNum++
+			this.getcourList()
+		}
+	},
 	methods: {
+		getcourList() {
+            this.$http({
+                url: '/apply/recommend/goodsList',
+                method: 'post',
+                data: {
+					examId: this.examId,
+                    pageNum: this.pageNum,
+					pageSize: this.pageSize,
+                }
+            }).then((res) => {
+                if (res.data.code == 200) {
+					
+					this.courseList.push(...(res.data.rows || [] ))
+					console.log('this.courseList', this.courseList)
+					this.total = res.data.total
+                }
+            })
+        },
+		toBuy(item) {
+            if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+        },
 		bankExamNextExam() {
 			this.$api.bankExamNextExam({
 				chapterExamId:this.chapterId,
@@ -357,6 +446,7 @@ page {
 }
 </style>
 <style lang="scss" scope>
+@import '../../pages5/examReport/indexCourseList.scss';
 .disNone {
 	display: none;
 }

+ 76 - 32
pages2/class/questionBank.vue

@@ -55,6 +55,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="radioSelect(item.optionsId, bankIndex)"
                 >
                   <text
                     :class="{
@@ -103,7 +104,7 @@
                 </view>
               </view>
               <view
-                v-if="!bank.ques"
+                v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
                 class="submit_checkbox"
                 :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
                 @click="checkboxSubmit(bankIndex)"
@@ -114,6 +115,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="checkboxSelect(item.optionsId, bankIndex, index)"
                 >
                   <text
                     :class="{
@@ -123,7 +125,7 @@
                       wrong:
                         bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 &&
                         bank.ans.indexOf(item.optionsId) == -1),
-                      user_choose: bankType == 2 && (bank.ques.indexOf(item.optionsId) != -1),
+                      user_choose: bankType == 2 && item.checked,
                     }"
                     class="activeTI"
                   >
@@ -181,6 +183,7 @@
                   v-for="(item, index) in judge"
                   :key="index"
                   class="lisSty"
+                  @click="judgeSelect(index, bankIndex)"
                 >
                   <text
                     :class="{
@@ -219,8 +222,8 @@
                 <view
                   class="ans_input"
                   v-if="
-                    !bank.ques ||
-                    (!bank.ques.text && !bank.ques.imageList.length)
+                    bankType == 2 || (bankType == 1 && (!bank.ques ||
+                    (!bank.ques.imageList.length && !bank.ques.text)))
                   "
                 >
                   <view class="top flex">
@@ -338,6 +341,9 @@
                       v-for="(option, childIndex) in ansItem.optionsList"
                       :key="childIndex"
                       class="lisSty"
+                      @click="
+                        radioSelectChild(option.optionsId, ansIndex, bankIndex)
+                      "
                     >
                       <text
                         :class="{
@@ -403,7 +409,7 @@
                     </view>
                   </view>
                   <view
-                    v-if="!bank.ques[ansIndex]"
+                    v-if="bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])"
                     class="submit_checkbox"
                     :class="{
                       disabled: !isCheckboxChecked(ansItem.optionsList),
@@ -416,12 +422,15 @@
                       v-for="(option, childindex) in ansItem.optionsList"
                       :key="childindex"
                       class="lisSty"
+                      @click="
+                        checkboxSelectChild(bankIndex, ansIndex, childindex)
+                      "
                     >
                       <text
                         :class="{
                           right: bankType == 1 && right(bankIndex, ansIndex, option),
                           wrong: bankType == 1 && wrong(bankIndex, ansIndex, option),
-                          user_choose: bankType == 2 && (questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1),
+                          user_choose: bankType == 2 && option.checked,
                         }"
                         class="activeTI"
                       >
@@ -489,6 +498,7 @@
                       v-for="(option, childindex) in judge"
                       :key="childindex"
                       class="lisSty"
+                      @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
                     >
                       <text
                         :class="{
@@ -541,9 +551,10 @@
                     <view
                       class="ans_input"
                       v-if="
-                        !bank.ques[ansIndex] ||
+                        bankType == 2 || (bankType == 1 &&
+                        (!bank.ques[ansIndex] ||
                         (!bank.ques[ansIndex].text &&
-                          !bank.ques[ansIndex].imageList.length)
+                          !bank.ques[ansIndex].imageList.length)))
                       "
                     >
                       <view class="top flex">
@@ -652,10 +663,11 @@
                 :key="index"
                 @click="changeIndex(index)"
                 :class="{
-                  isRight: isRight(item, index),
-                  isWrong: isWrong(item, index),
-                  isPart: isPart(item, index),
-                  isOver: isOver(item, index),
+                  isRight: bankType == 1 && isRight(item, index),
+                  isWrong: bankType == 1 && isWrong(item, index),
+                  isPart: bankType == 1 && isPart(item, index),
+                  isOver: bankType == 1 && isOver(item, index),
+                  check_ans: bankType == 2 && isCheck(item, index),
                 }"
                 class="liListSty"
               >
@@ -1823,12 +1835,14 @@ export default {
      * @param {Object} e单选点击
      */
     radioSelect(optionsId, bindex) {
-      console.log('单选', bindex, this.questionList[bindex])
-      if (this.questionList[bindex].ques) return;
-      this.$set(this.questionList[bindex], "ques", optionsId);
-      if ((bindex + 1) < this.questionList.length) {
-        this.current = bindex + 1
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
       }
+      this.$set(this.questionList[bindex], "ques", optionsId);
+      // if ((bindex + 1) < this.questionList.length) {
+      //   this.current = bindex + 1
+      // }
       this.isDoOver();
     },
 
@@ -1836,7 +1850,10 @@ export default {
      * @param {Object} e案例单选点击
      */
     radioSelectChild(optionsId, ansIndex, bindex) {
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
       this.isDoOver();
     },
@@ -1845,7 +1862,9 @@ export default {
      * @param {Object} 多选点击
      */
     checkboxSelect(optionsId, bindex, index) {
-      console.log('多选', bindex, index )
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[index],
         "checked",
@@ -1858,6 +1877,9 @@ export default {
      * @param {Object} 案例多选点击
      */
     checkboxSelectChild(bindex, ansIndex, childIndex) {
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
         "checked",
@@ -1878,8 +1900,10 @@ export default {
      * @param {Object} 多选确认
      */
     checkboxSubmit(bindex) {
-      console.log('this.questionList[bindex].jsonStr:', this.questionList[bindex].jsonStr)
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1888,6 +1912,7 @@ export default {
       });
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1906,16 +1931,19 @@ export default {
       //     );
       //   }
       // );
-      let isWrong = this.questionList[bindex].ques.some((item, i) => {
-        return this.questionList[bindex].ans.indexOf(item) == -1;
-      })
+      // let isWrong = this.questionList[bindex].ques.some((item, i) => {
+      //   return this.questionList[bindex].ans.indexOf(item) == -1;
+      // })
     },
 
     /**
      * @param {Object} 案例多选确认
      */
     checkboxSubmitChild(bindex, ansIndex) {
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1926,6 +1954,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques[ansIndex]
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1943,8 +1972,10 @@ export default {
      * 判断题
      */
     judgeSelect(index, bindex) {
-      console.log('判断题',index, bindex )
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex], "ques", index + "");
       this.isDoOver();
     },
@@ -1956,7 +1987,10 @@ export default {
      * 案例判断题
      */
     judgeSelectChild(ansindex, childindex, bindex) {
-      if (this.questionList[bindex].ques[ansindex]) return;
+      // if (this.questionList[bindex].ques[ansindex]) return;
+      if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
       this.isDoOver();
     },
@@ -2202,7 +2236,8 @@ export default {
                   "&reportStatus=" +
                   reportStatus +
 									"&lessQuestionNum=" +
-									lessQuestionNum
+									lessQuestionNum +
+                  "&examId=" + this.id
               });
             }, 1000);
           }
@@ -2375,7 +2410,11 @@ export default {
       });
       this.isDoOver();
     },
-
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2636,7 +2675,7 @@ export default {
   color: #666;
   font-size: 30rpx;
 
-  &.right, &.user_choose {
+  &.right {
     color: #fff;
     background: #36c75a;
   }
@@ -2646,7 +2685,7 @@ export default {
     background: #ff3b30;
   }
 
-  &.checked {
+  &.checked, &.user_choose {
     color: #fff;
     background: #007aff;
   }
@@ -2976,6 +3015,11 @@ export default {
     color: #fff;
     background: blue;
   }
+  &.check_ans {
+    border: 1rpx solid #eeeeee;
+    color: #fff;
+    background: #007aff;
+  }
 }
 .answerInfos {
   padding: 25rpx 25rpx 25rpx 23rpx;

+ 91 - 3
pages2/class/question_report.vue

@@ -51,6 +51,42 @@
 				</view>
 			</view>
 		</view>
+
+		<view v-if="courseList.length" class="course_list">
+            <view class="titles">
+                <image class="code" src="@/static/learn/act_icon.png" ></image>
+                <text class="title">推荐课程</text>
+            </view>
+            <view class="list_item" v-for="(item,index) in courseList" :key="index" @click="toBuy(item)">
+                <view class="course_content">
+                    <view class="c_title">{{item.goodsName}}</view>
+                    <view class="c_downs">
+                        <view class="img">
+                            <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
+                            <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
+                        </view>
+                        <view class="text">
+                            <view class="desc">
+                                <view class="left">
+                                    <text class="mon_t">¥ {{item.standPrice}}</text>
+                                    <!-- <text class="sale">/限时优惠</text> -->
+                                    <text v-if="item.linePrice" class="sale"> ¥ </text>
+                                    <text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
+                                </view>
+                                <view class="right">
+                                    <view class="regiser_row" v-if="!hideBuyState">立即购买</view>
+                                </view>
+                            </view>
+                            <view v-if="item.buyUserNum" class="joins">
+                                <!-- <image class="people" src="/static/index/people.png"></image> -->
+                                <!-- 为0时,不显示 -->
+                                <view class="people">{{ item.buyUserNum }}人参与</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>					
+            </view>
+        </view>
 	</view>
 </template>
 
@@ -73,12 +109,32 @@ export default {
 			examTime:'',
 			reportStatus:null,
 			lessQuestionNum:0,
+			courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
 		};
 	},
+	onPullDownRefresh() {
+		this.pageNum = 1
+		this.getcourList()
+		// this.timer = setTimeout(function() {
+		// 	uni.stopPullDownRefresh()
+		// }, 500)
+	},
+	onReachBottom() {
+		console.log(this.total,'total')
+		console.log(this.courseList.length,'length')
+		if (this.courseList.length < this.total) {
+			this.pageNum++
+			this.getcourList()
+		}
+	},
 	onUnload() {},
-	computed: { ...mapGetters(['userInfo']) },
+	computed: { ...mapGetters(['userInfo', 'hideBuyState']) },
 	async onShow() {
-		
+		this.courseList = []
+		this.getcourList()
 		uni.getSystemInfo({
 			success: res => {
 				var winW = res.screenWidth;
@@ -146,6 +202,7 @@ export default {
 		});
 	},
 	async onLoad(option) {
+		this.examId = option.examId
 		this.examTime = option.examTime;
 		this.doTime = option.doTime;
 		this.reportStatus = option.reportStatus;
@@ -158,7 +215,37 @@ export default {
 		
 	},
 	methods: {
-		
+		getcourList() {
+            this.$http({
+                url: '/apply/recommend/goodsList',
+                method: 'post',
+                data: {
+					examId: this.examId,
+                    pageNum: this.pageNum,
+					pageSize: this.pageSize,
+                }
+            }).then((res) => {
+                if (res.data.code == 200) {
+					this.courseList.push(...(res.data.rows || [] ))
+					this.total = res.data.total
+                }
+            })
+        },
+		toBuy(item) {
+            if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+        },
 	}
 };
 </script>
@@ -168,6 +255,7 @@ page {
 }
 </style>
 <style lang="scss" scope>
+@import '../../pages5/examReport/indexCourseList.scss';
 .disNone {
 	display: none;
 }

+ 83 - 37
pages5/examBank/index.vue

@@ -63,6 +63,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="radioSelect(item.optionsId, bankIndex)"
                 >
                   <text
                     :class="{
@@ -133,6 +134,7 @@
                   v-for="(item, index) in bank.jsonStr"
                   :key="index"
                   class="lisSty"
+                  @click="checkboxSelect(item.optionsId, bankIndex, index)"
                 >
                   <text
                     :class="{
@@ -142,7 +144,7 @@
                       wrong:
                         bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 &&
                         bank.ans.indexOf(item.optionsId) == -1),
-                      user_choose: bankType == 2 && (bank.ques.indexOf(item.optionsId) != -1),
+                      user_choose: bankType == 2 && item.checked,
                     }"
                     class="activeTI"
                   >
@@ -161,7 +163,7 @@
                 </view>
               </view>
               <view
-                v-if="!bank.ques"
+                v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
                 class="submit_checkbox"
                 :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
                 @click="checkboxSubmit(bankIndex)"
@@ -223,6 +225,7 @@
                   v-for="(item, index) in judge"
                   :key="index"
                   class="lisSty"
+                  @click="judgeSelect(index, bankIndex)"
                 >
                   <text
                     :class="{
@@ -268,8 +271,8 @@
                 <view
                   class="ans_input"
                   v-if="
-                    !bank.ques ||
-                    (!bank.ques.imageList.length && !bank.ques.text)
+                    bankType == 2 || (bankType == 1 && (!bank.ques ||
+                    (!bank.ques.imageList.length && !bank.ques.text)))
                   "
                 >
                   <view class="top flex">
@@ -398,6 +401,9 @@
                       v-for="(option, childIndex) in ansItem.optionsList"
                       :key="childIndex"
                       class="lisSty"
+                      @click="
+                        radioSelectChild(option.optionsId, ansIndex, bankIndex)
+                      "
                     >
                       <text
                         :class="{
@@ -478,7 +484,7 @@
                     </view>
                   </view>
                   <view
-                    v-if="!bank.ques[ansIndex]"
+                    v-if="bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])"
                     class="submit_checkbox"
                     :class="{
                       disabled: !isCheckboxChecked(ansItem.optionsList),
@@ -491,12 +497,15 @@
                       v-for="(option, childindex) in ansItem.optionsList"
                       :key="childindex"
                       class="lisSty"
+                      @click="
+                        checkboxSelectChild(bankIndex, ansIndex, childindex)
+                      "
                     >
                       <text
                         :class="{
                           right: bankType == 1 && right(bankIndex, ansIndex, option),
                           wrong: bankType == 1 && wrong(bankIndex, ansIndex, option),
-                          user_choose: bankType == 2 && (questionList[bankIndex].ques[ansIndex].indexOf(option.optionsId) != -1),
+                          user_choose: bankType == 2 && option.checked,
                         }"
                         class="activeTI"
                       >
@@ -578,6 +587,7 @@
                       v-for="(option, childindex) in judge"
                       :key="childindex"
                       class="lisSty"
+                      @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
                     >
                       <text
                         :class="{
@@ -635,9 +645,10 @@
                     <view
                       class="ans_input"
                       v-if="
-                        !bank.ques[ansIndex] ||
+                        bankType == 2 || (bankType == 1 &&
+                        (!bank.ques[ansIndex] ||
                         (!bank.ques[ansIndex].text &&
-                          !bank.ques[ansIndex].imageList.length)
+                          !bank.ques[ansIndex].imageList.length)))
                       "
                     >
                       <view class="top flex">
@@ -756,10 +767,11 @@
                 :key="index"
                 @click="changeIndex(index)"
                 :class="{
-                  isRight: isRight(item, index),
-                  isWrong: isWrong(item, index),
-                  isPart: isPart(item, index),
-                  isOver: isOver(item, index),
+                  isRight: bankType == 1 && isRight(item, index),
+                  isWrong: bankType == 1 && isWrong(item, index),
+                  isPart: bankType == 1 && isPart(item, index),
+                  isOver: bankType == 1 && isOver(item, index),
+                  check_ans: bankType == 2 && isCheck(item, index),
                 }"
                 class="liListSty"
               >
@@ -950,7 +962,7 @@ export default {
       }, 1000);
     } else {
       //进入页面
-      // await this.bankExam();
+      await this.bankExam();
 			await this.setSystemTime()
       this.goodsQuestionList();
     }
@@ -1695,12 +1707,16 @@ export default {
      * @param {Object} e单选点击
      */
     radioSelect(optionsId, bindex) {
-      console.log('222', this.questionList)
-      if (this.questionList[bindex].ques) return;
-      this.$set(this.questionList[bindex], "ques", optionsId);
-      if ((bindex + 1) < this.questionList.length) {
-        this.current = bindex + 1
+      // if (this.questionList[bindex].ques) return;
+      // 类型为考试的可以重新在选择答案
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
       }
+      this.$set(this.questionList[bindex], "ques", optionsId);
+      // if ((bindex + 1) < this.questionList.length) {
+      //   this.current = bindex + 1
+      // }
+      console.log('改变后:', this.questionList[bindex].ques)
       this.isDoOver();
     },
 
@@ -1708,8 +1724,10 @@ export default {
      * @param {Object} e案例单选点击
      */
     radioSelectChild(optionsId, ansIndex, bindex) {
-      console.log('3333', this.questionList)
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
       this.isDoOver();
     },
@@ -1718,6 +1736,9 @@ export default {
      * @param {Object} 多选点击
      */
     checkboxSelect(optionsId, bindex, index) {
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[index],
         "checked",
@@ -1729,6 +1750,9 @@ export default {
      * @param {Object} 案例多选点击
      */
     checkboxSelectChild(bindex, ansIndex, childIndex) {
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(
         this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
         "checked",
@@ -1749,7 +1773,10 @@ export default {
      * @param {Object} 多选确认
      */
     checkboxSubmit(bindex) {
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1758,6 +1785,7 @@ export default {
       });
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1767,22 +1795,25 @@ export default {
 
       this.$set(this.questionList[bindex], "ques", arr);
       this.isDoOver();
-
-      let isWrong = this.questionList[bindex].ques.some(
-        (quesItem, quesIndex) => {
-          return (
-            this.questionList[bindex].ques[quesIndex] !=
-            this.questionList[bindex].ans[quesIndex]
-          );
-        }
-      );
+      console.log('this.questionList[bindex]', this.questionList[bindex].ques)
+      // let isWrong = this.questionList[bindex].ques.some(
+      //   (quesItem, quesIndex) => {
+      //     return (
+      //       this.questionList[bindex].ques[quesIndex] !=
+      //       this.questionList[bindex].ans[quesIndex]
+      //     );
+      //   }
+      // );
     },
 
     /**
      * @param {Object} 案例多选确认
      */
     checkboxSubmitChild(bindex, ansIndex) {
-      if (this.questionList[bindex].ques[ansIndex]) return;
+      // if (this.questionList[bindex].ques[ansIndex]) return;
+      if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1793,6 +1824,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[bindex].ques[ansIndex]
         uni.showToast({
           title: "请选择答案",
           icon: "none",
@@ -1810,7 +1842,10 @@ export default {
      * 判断题
      */
     judgeSelect(index, bindex) {
-      if (this.questionList[bindex].ques) return;
+      // if (this.questionList[bindex].ques) return;
+      if (this.questionList[bindex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex], "ques", index + "");
       this.isDoOver();
     },
@@ -1822,7 +1857,10 @@ export default {
      * 案例判断题
      */
     judgeSelectChild(ansindex, childindex, bindex) {
-      if (this.questionList[bindex].ques[ansindex]) return;
+      // if (this.questionList[bindex].ques[ansindex]) return;
+      if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[bindex].ques, ansindex, childindex + "");
       this.isDoOver();
     },
@@ -2316,6 +2354,11 @@ export default {
       this.isDoOver();
     },
 
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2546,7 +2589,7 @@ export default {
   color: #666;
   font-size: 30rpx;
 
-  &.right, &.user_choose {
+  &.right {
     color: #fff;
     background: #36c75a;
   }
@@ -2556,7 +2599,7 @@ export default {
     background: #ff3b30;
   }
 
-  &.checked {
+  &.checked, &.user_choose {
     color: #fff;
     background: #007aff;
   }
@@ -2756,8 +2799,6 @@ export default {
       border-radius: 4rpx;
     }
   }
-  .popupContent {
-  }
 }
 .pageContent {
   position: relative;
@@ -2886,6 +2927,11 @@ export default {
     color: #fff;
     background: blue;
   }
+  &.check_ans {
+    border: 1rpx solid #eeeeee;
+    color: #fff;
+    background: #007aff;
+  }
 }
 .answerInfos {
   padding: 25rpx 25rpx 25rpx 23rpx;

+ 26 - 15
pages5/examList/index.vue

@@ -225,7 +225,6 @@ export default {
 	onShow() {
 		
 		this.nowTime = +this.$method.timest();
-		console.log('sfhdsofhsoh-----onshow', this.itemIndex, this.nowTime)
 		// if(this.itemIndex !== '') {
 		// 	this.refreshByIndex();
 		// }
@@ -310,7 +309,6 @@ export default {
 			}
 			// mock/subscribe/listSubscribe
 			this.$api.mockSubscribeListSubscribe(param).then(res => {
-				console.log('请求请求')
 				
 				this.recordList.push(...res.data.rows)
 				this.total = res.data.total
@@ -344,7 +342,6 @@ export default {
 			})
 		},
 		async goExamCount(item,index) {
-			console.log('item', item)
 			if (item.mockActivity && item.mockActivity == 1) {
 				if (!(item.activityStartTime < this.nowTime)) {
 					return
@@ -356,23 +353,37 @@ export default {
 						applyId: item.applyId,
 						duration: item.duration,
 						majorId: item.majorId,
-						subjectId: item.subjectId
+						subjectId: item.subjectId,
+						mockMajorSubjectId: item.mockMajorSubjectId
 					},
 				}).then((res) => {
-					const { examTime, startTime, endTime, eachExamId} = res.data.data
-					item.applySiteExamTime = examTime // 当前时间的时间戳
-					item.applySiteStartTime = startTime
-					item.applySiteEndTime = endTime
-					item.eachExamId = eachExamId
-					// item.applySiteExamTime = parseInt(new Date().getTime()/1000) // 当前时间的时间戳
-					// item.applySiteStartTime = this.$method.timestampToTime(new Date().getTime()/1000, false, false, true)
-					// let min = item.duration * 60 *1000 + new Date().getTime()
-					// item.applySiteEndTime = this.$method.timestampToTime(min/1000, false, false, true)
-					console.log('item', item)
+					if (res.data.code == 200) {
+						const { examTime, startTime, endTime, eachExamId} = res.data.data
+						let o_item = {
+							...item,
+							applySiteExamTime: examTime,
+							applySiteStartTime: startTime,
+							applySiteEndTime: endTime,
+							eachExamId: eachExamId,
+						}
+						// item.applySiteExamTime = examTime // 当前时间的时间戳
+						// item.applySiteStartTime = startTime
+						// item.applySiteEndTime = endTime
+						// item.eachExamId = eachExamId
+						this.toJump(o_item, index)
+					} else {
+						this.$u.toast(res.data.msg)
+						return
+					}
+					
 				})
 				
-			}
+			} else {
+				this.toJump(item, index)
 			
+			}
+		},
+		toJump(item, index) {
 			if(this.goTest(item)) {
 				uni.showToast({
 					icon:'none',

+ 101 - 11
pages5/examReport/index.vue

@@ -82,18 +82,18 @@
 							试卷得分
 							<text>(不含简答和案例题)</text>
 						</view>
-						<canvas class="canvas" canvas-id="Canvas1"></canvas>
+						<canvas v-show="!noticeModal" class="canvas" canvas-id="Canvas1"></canvas>
 					</view>
 					<view class="item" v-show="reportdata.examTime">
 						<view class="title">答题时长</view>
-						<canvas canvas-id="Canvas2"></canvas>
+						<canvas v-show="!noticeModal" canvas-id="Canvas2"></canvas>
 					</view>
 					
 					<view class="item" v-show="reportdata.score != -1">
 						<view class="title">试卷得分
 							<text>(含简答和案例题)</text>
 						</view>
-						<canvas canvas-id="Canvas3"></canvas>
+						<canvas v-show="!noticeModal" canvas-id="Canvas3"></canvas>
 					</view>
 				</view>
 			</view>
@@ -128,6 +128,41 @@
 			</template>
 		</template>
 		
+		<view v-if="courseList.length" class="course_list">
+            <view class="titles">
+                <image class="code" src="@/static/learn/act_icon.png" ></image>
+                <text class="title">推荐课程</text>
+            </view>
+            <view class="list_item" v-for="(item,index) in courseList" :key="index" @click="toBuy(item)">
+                <view class="course_content">
+                    <view class="c_title">{{item.goodsName}}</view>
+                    <view class="c_downs">
+                        <view class="img">
+                            <image :src="$method.splitImgHost(item.coverUrl, true)"></image>
+                            <view class="time" v-if="item.year">{{item.year?item.year:''}}</view>
+                        </view>
+                        <view class="text">
+                            <view class="desc">
+                                <view class="left">
+                                    <text class="mon_t">¥ {{item.standPrice}}</text>
+                                    <!-- <text class="sale">/限时优惠</text> -->
+                                    <text v-if="item.linePrice" class="sale"> ¥ </text>
+                                    <text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
+                                </view>
+                                <view class="right">
+                                    <view class="regiser_row" v-if="!hideBuyState">立即购买</view>
+                                </view>
+                            </view>
+                            <view v-if="item.buyUserNum" class="joins">
+                                <!-- <image class="people" src="/static/index/people.png"></image> -->
+                                <!-- 为0时,不显示 -->
+                                <view class="people">{{ item.buyUserNum }}人参与</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>					
+            </view>
+        </view>
 		
 		
 		
@@ -170,22 +205,39 @@ export default {
 			context2: null,
 			eachExamId:'',
 			wrongRecordWrongNum:0,
-			subscribeInfo:{}
+			subscribeInfo:{},
+			courseList: [],
+			pageNum: 1,
+			pageSize: 10,
+			total: 0,
+			timer: null,
 		};
 	},
-	onUnload() {},
-	computed: { ...mapGetters(['userInfo','sysTime']) },
-	async onShow() {
-		
+	
+	computed: { ...mapGetters(['userInfo','sysTime', 'hideBuyState']) },
+	
+	onPullDownRefresh() {
+		this.pageNum = 1
+		this.getcourList()
+		// this.timer = setTimeout(function() {
+		// 	uni.stopPullDownRefresh()
+		// }, 500)
+	},
+	onReachBottom() {
+		console.log(this.total,'total')
+		console.log(this.courseList.length,'length')
+		if (this.courseList.length < this.total) {
+			this.pageNum++
+			this.getcourList()
+		}
 	},
-		
 		
 	async onLoad(option) {
 		console.log(option)
 		this.recordId = option.id;
 		this.examId = option.examId;
 		this.eachExamId = option.eachExamId
-    this.subscribeId = option.subscribeId;
+    	this.subscribeId = option.subscribeId;
 		await this.setSystemTime();
 		this.mockSubscribeInfo();
 		this.mockWrongRecordWrongNum();
@@ -282,8 +334,46 @@ export default {
 		});
 		
 	},
+	onShow() {
+		this.courseList = []
+		this.getcourList()
+	},
+	onUnload() {
+		clearTimeout(this.timer)
+	},
 	methods: {
 		...mapActions(['setSystemTime']),
+		getcourList() {
+            this.$http({
+                url: '/apply/recommend/goodsList',
+                method: 'post',
+                data: {
+					examId: this.examId,
+                    pageNum: this.pageNum,
+					pageSize: this.pageSize,
+                }
+            }).then((res) => {
+                if (res.data.code == 200) {
+					this.courseList.push(...res.data.rows)
+					this.total = res.data.total
+                }
+            })
+        },
+		toBuy(item) {
+            if (item.goodsType == 1) {
+                uni.navigateTo({
+                    url: '/pages3/course/detail?id='+item.goodsId
+                })
+            } else if (item.goodsType == 2) {
+                uni.navigateTo({
+                    url: '/pages2/bank/detail?id='+item.goodsId
+                })
+            } else {
+                uni.navigateTo({
+                    url: '/pages5/liveDetail/index?id='+item.goodsId
+                })
+            }
+        },
 		goLive() {
 			let uuid = new Date().valueOf() + ""
       		// buyCourse 是否购买课程:1是 0否
@@ -404,6 +494,7 @@ page {
 }
 </style>
 <style lang="scss" scope>
+@import './indexCourseList.scss';
 .disNone {
 	display: none;
 }
@@ -615,7 +706,6 @@ page {
 		background: #FFFFFF;
 		display: flex;
 		flex-direction: column;
-		
 		.body {
 			flex:1;
 			

+ 136 - 0
pages5/examReport/indexCourseList.scss

@@ -0,0 +1,136 @@
+.course_list {
+    // width: 100%;
+    padding: 0rpx 32rpx 32rpx 32rpx;
+    box-shadow: 0px 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);			
+    .titles {
+        margin: 72rpx 0rpx 32rpx 10rpx;
+        .code {
+            width: 38rpx;
+            height: 24rpx;
+        }
+        .title {
+            font-size: 40rpx;
+            font-family: OPPOSans-Bold, OPPOSans;
+            font-weight: bold;
+            color: #222222;
+            margin-left: 14rpx;
+        }
+    }
+    .list_item {
+        padding: 24rpx;
+        // height: 278rpx;
+        background: #FFFFFF;
+        box-shadow: 0rpx 0rpx 20rpx 1rpx rgba(1,99,235,0.1000);
+        border-radius: 24rpx;
+        background:#fff;
+        margin-bottom: 32rpx;
+        display: flex;
+        align-items: center;
+        .c_title {
+            font-size: 32rpx;
+            font-weight: bold;
+            margin-bottom: 24rpx;
+            font-weight: bold;
+            color: #222222;
+        }
+        .c_downs {
+            display: flex;
+        }
+        .img {
+            position:relative;
+            margin-right: 24rpx;
+            border-radius: 16rpx ;
+            overflow: hidden;
+            width: 204rpx;
+            height: 120rpx;
+            image {
+                width:100%;
+                height:100%;
+            }
+            
+            .time {
+                position:absolute;
+                bottom:0;
+                right:0;
+                width: 80rpx;
+                height: 32rpx;
+                background: rgba(1, 25, 45, 0.4);
+                color:#fff;
+                text-align: center;
+                line-height: 32rpx;
+                font-size: 24rpx;
+                border-radius: 10rpx 0px 10rpx 0px;
+            }
+        }
+        
+        .text {
+            width: 440rpx;
+            position: relative;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-between;
+            height: 120rpx;
+            .joins {
+                .people {
+                    width: 160rpx;
+                    font-size: 20rpx;
+                    color: #999999;
+                    padding: 0rpx 8rpx;
+                    text-align: center;
+                    height: 36rpx;
+                    line-height: 36rpx;
+                    background: #F6F7FB;
+                    border-radius: 4px;
+                }
+                
+            }
+            .desc {
+                margin-top: 10rpx;
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                width: 100%;
+                .left {
+                    flex:1;
+                    color:#333;
+                    font-size: 26rpx;
+                    .mon_t {
+                        font-weight: bold;
+                        color: #FC3F3F;
+                        font-size: 36rpx;
+                    }
+                    .sale {
+                        color: #999999;
+                        font-size: 24rpx;
+                        margin-left: 8rpx;
+                    }
+                    .price_line {
+                        color: #999999;
+                        font-size: 24rpx;
+                        text-decoration:line-through;
+                        font-weight: 400;
+                    }
+                }
+                
+                .right {
+                    font-size: 24rpx;
+                    font-weight: bold;
+                    .regiser_row {
+                        width: 144rpx;
+                        height: 52rpx;
+                        line-height: 52rpx;
+                        text-align: center;
+                        border-radius: 16rpx;
+                        background-color: #FC3F3F;
+                        color: #fff;
+                        font-weight: 500;
+                        font-size: 26rpx;
+                    }
+                }
+            }
+        }
+    }
+    .course_content {
+        width: 100%;
+    }
+}

+ 27 - 10
pages5/mockExam/registrationSuccess.vue

@@ -103,7 +103,6 @@
                             <view class="desc">
                                 <view class="left">
                                     <text class="mon_t">¥ {{item.standPrice}}</text>
-                                    <!-- <text class="sale">/限时优惠</text> -->
                                     <text v-if="item.linePrice" class="sale"> ¥ </text>
                                     <text v-if="item.linePrice" class="price_line">&nbsp;{{ item.linePrice }}</text>
                                 </view>
@@ -140,11 +139,13 @@ export default {
             eDay: '',
             activityId: '',
             courseList: [],
+            pageNum: 1,
+			pageSize: 10,
+			total: 0,
         }
     },
     filters: {
         getLastDay(time) {
-            console.log('time:', time)
             var padDate = function (va) {
                 va = va < 10 ? '0' + va : va
                 return va
@@ -155,16 +156,11 @@ export default {
                 var month = padDate(value.getMonth() + 1)
                 var day = padDate(value.getDate())
                 let t_value = year + '/' + month + '/' + day
-                console.log('t:', t_value)
                 let curTimeLast = new Date(new Date(t_value).toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1
                 
                 let lastStartDay = parseInt(curTimeLast/1000) - parseInt(curTime/1000)                
                 let days = parseInt(lastStartDay/24/60/60) 
                 return days >= 1 ? days : 0
-                // this.lastEndDay = parseInt(curTimeLast/1000)  - parseInt(curTime/1000)
-                // this.sDay = this.lastStartDay/24/60/60
-                // this.eDay = this.lastEndDay/24/60/60
-                // console.log('lastStartDay', this.lastStartDay, this.lastEndDay, this.sDay, this.eDay)
             }
         },
         
@@ -175,20 +171,41 @@ export default {
         this.startTime = option.startTime
         this.endTime = option.endTime
         this.activityId = option.activityId
-        this.getAct()
+        // this.getAct()
         // this.startTime = "1663041599"
         // this.endTime = "1663127999"
     },
+    onShow() {
+		this.courseList = []
+		this.getAct()
+	},
+    onPullDownRefresh() {
+		this.pageNum = 1
+		this.getAct()
+	},
+	onReachBottom() {
+		console.log(this.total,'total')
+		console.log(this.courseList.length,'length')
+		if (this.courseList.length < this.total) {
+			this.pageNum++
+			this.getAct()
+		}
+	},
     methods: {
         getAct() {
             this.$http({
                 url: `/app/common/activity/goodsList/${this.activityId}`,
                 method: 'get',
                 noToken: true,
+                data: {
+                    pageNum: this.pageNum,
+					pageSize: this.pageSize,
+                }
             }).then((res) => {
                 if (res.data.code == 200) {
-                    console.log('res', res)
-                    this.courseList = res.data.data || []
+                    // this.courseList = res.data.data || []
+                    this.courseList.push(...res.data.rows)
+					this.total = res.data.total
                 }
             })
         },