Переглянути джерело

收藏接口加doMode参数和 题库中心按钮

xuqiaoying 2 роки тому
батько
коміт
79726be528

+ 7 - 11
pages/questionBank/index.scss

@@ -94,16 +94,10 @@
 			margin-top: 40rpx;
 			display: flex;
 			align-items: center;
-			justify-content: flex-end;
-			.exam_btns {
-				// width: 64%;
-				display: flex;
-				justify-content: flex-end;
-				align-items: center;
-			}
+			// justify-content: flex-end;
+			flex-wrap: wrap;
 		}
 		.box_appoint {
-			// width: 35%;
 			display: flex;
 			align-items: center;
 			justify-content: flex-end;
@@ -117,13 +111,15 @@
 		.exam_word {
 			font-size: 24rpx;
 			font-weight: 500;
-			width: 144rpx;
+			// width: 144rpx;
+			padding: 0rpx 20rpx;
 			height: 56rpx;
-			line-height: 56rpx;
+			line-height: 51rpx;
 			text-align: center;
 			background: #FFFFFF;
 			border-radius: 66rpx;
-			margin-left: 32rpx;
+			margin-right: 18rpx;
+			margin-bottom: 24rpx;
 		}
 		.ones {
 			color: #484848;

+ 17 - 13
pages/questionBank/index.vue

@@ -71,9 +71,10 @@
 						</view>
 						<!-- 按钮 -->
 						<view class="study_btns">
-							<view class="exam_word intos" @click.stop="toDailyPractice(item)">每日一练</view>
-							<view class="exam_word intos" @click.stop="toRandomPractice(item)">随机联系</view>
-							<view class="exam_word intos" @click="studyques(item,index)">章节练习</view>
+							<view v-for="(child, c_index) in item.paperVos" :key="c_index" class="exam_word intos"
+							 @click.stop="toDailyPractice(item, child)">{{ child.paperName }}</view>
+							<!-- <view class="exam_word intos" @click.stop="toRandomPractice(item)">随机联系</view> -->
+							<view class="exam_word intos" @click="studyques(item)">章节练习</view>
 						</view>
 					</view>
 				</template>
@@ -143,19 +144,22 @@ export default {
 				url:'/pages/course/index'
 			})
 		},
-		toDailyPractice(item) {
+		toDailyPractice(item, child) {
 			console.log('item', item);
-			uni.navigateTo({
-				url: '/pages2/dailyPractice/index?goodsId=' + item.goodsId + '&orderGoodsId=' + item.orderGoodsId
-			})
-		},
-		toRandomPractice(item) {
-			uni.navigateTo({
-				url: '/pages2/randomPractice/index?goodsId=' + item.goodsId + '&orderGoodsId=' + item.orderGoodsId
-			})
+			if (child.paperName == '每日一练') {
+				uni.navigateTo({
+					url: '/pages2/dailyPractice/index?goodsId=' + item.goodsId + '&orderGoodsId=' + item.orderGoodsId
+				})
+			} else if (child.paperName == '随机练习') {
+				uni.navigateTo({
+					url: '/pages2/randomPractice/index?goodsId=' + item.goodsId + '&orderGoodsId=' + item.orderGoodsId
+				})
+			} else {
+				this.studyques(item)
+			}
 		},
 		// 进入练习
-		studyques(item,index){
+		studyques(item){
 			let sysTime = this.$method.timest()
 			if (item.serviceStartTime && item.serviceEndTime && (sysTime <= item.serviceStartTime || sysTime >= item.serviceEndTime)) {
 				uni.showToast({

+ 2 - 2
pages2/bank/collectById.vue

@@ -27,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?orderGoodsId='+orderGoodsId+'&examId='+item.examId + '&distinction=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&examId='+item.examId + '&distinction=1'+ '&doMode=' + item.doMode">
 								<view class="btn">重做</view>
 							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&examId='+item.examId+'&explain=1' + '&distinction=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?orderGoodsId='+orderGoodsId+'&examId='+item.examId+'&explain=1' + '&distinction=1'+ '&doMode=' + item.doMode">
 								<view class="btn">解析</view>
 							</navigator>
 							<!-- <view class="btn">解析</view> -->

+ 1 - 1
pages2/bank/questionBank.vue

@@ -2293,7 +2293,7 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
-            doMode: this.entryType == 'random' ? 2 : 1, //做题模式 1章卷 2随机练习
+            doMode: this.entryType == 'random' ? 2 : 1, //做题模式 1章卷 2随机练习,只限题库,视频课程里面的不用传这个参数
           })
           .then((res) => {
             if (res.data.code == 200) {

+ 3 - 0
pages2/bank/question_report.vue

@@ -502,6 +502,9 @@ page {
 		font-size: 32rpx;
 		font-weight: bold;
 		color: #333333;
+		white-space: nowrap;
+		overflow: hidden;
+		text-overflow: ellipsis;
 	}
 
 	.desc {

+ 7 - 4
pages2/subject/collect.vue

@@ -39,10 +39,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?examId='+item.examId + '&distinction=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId + '&distinction=1' + '&doMode=' + item.doMode">
 								<view class="btn">重做</view>
 							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId+'&explain=1' + '&distinction=1'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?examId='+item.examId+'&explain=1' + '&distinction=1'+ '&doMode=' + item.doMode">
 								<view class="btn">解析</view>
 							</navigator>
 							<!-- <view class="btn">解析</view> -->
@@ -63,10 +63,10 @@
 					<view class="bt">
 						<view class="left">收藏数<text class="num">{{item.num}}</text></view>
 						<view class="right">
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type + '&distinction=2'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type + '&distinction=2'+ '&doMode=' + item.doMode">
 								<view class="btn">重做</view>
 							</navigator>
-							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type+'&explain=1' + '&distinction=2'">
+							<navigator  hover-class="none" :url="'/pages2/subject/collectBank?type='+item.type+'&explain=1' + '&distinction=2'+ '&doMode=' + item.doMode">
 								<view class="btn">解析</view>
 							</navigator>
 							<!-- <navigator  hover-class="none" :url="'/pages2/subject/collectTypeBank?type='+item.type + '&distinction=2'">
@@ -170,6 +170,9 @@ export default {
 			})
 		},
 		collectQuestionTypeList() {
+			// let params = {}
+			// this.paperid && (params['paperId'] = this.paperid)
+			// this.orderGoodsId && (params['orderGoodsId'])
 			this.$api.collectQuestionTypeList({
 				paperId:this.paperid,
 				orderGoodsId:this.orderGoodsId

+ 5 - 1
pages2/subject/collectBank.vue

@@ -736,15 +736,18 @@ export default {
       orderGoodsId: "",
       distinction: 1, // 1试卷归类,2题型归类
       subjectType: 0, // 题目类型
+      doMode: 1, 
     };
   },
   onLoad(option) {
     this.orderGoodsId = option.orderGoodsId || "";
-    const { examId, explain, type, distinction} = option
+    const { examId, explain, type, distinction, doMode} = option
     this.examId = examId
     this.explain = explain
     this.distinction = distinction
     this.subjectType = type
+    this.doMode = doMode || 1
+    // console.log('--doMode-', this.doMode);
     let showDialog = uni.getStorageSync("showDialog");
 
     if (showDialog) {
@@ -942,6 +945,7 @@ export default {
             questionId: bank.questionId,
             goodsId: bank.goodsId || "",
             orderGoodsId: bank.orderGoodsId,
+            doMode: this.doMode, //做题模式 1章卷 2随机练习
           })
           .then((res) => {
             if (res.data.code == 200) {