Prechádzať zdrojové kódy

Merge branch 'master' of https://gitee.com/he2802/saas_applet

Tang 3 rokov pred
rodič
commit
60906e9918

+ 8 - 6
pages2/bank/questionBankExplain.vue

@@ -292,7 +292,7 @@
 					</view>
 					
 				
-					<view class="footer_btn" v-if="isContinue">
+					<view class="footer_btn" v-if="isContinue || !isHistory">
 						<view class="collect"></view>
 						<view class="flex_center" @click="openFooterTab">
 							<view class="up-icon">
@@ -348,10 +348,11 @@ export default {
 			bankList: [],
 			collectList:[],
 			goodsId:'',
-			explain:'',
-			isContinue:'',
+			explain:'',  	//是否显示答案
+			isContinue:'',  //是否继续做题
 			chapterId:'',
 			moduleId:'',
+			isHistory:'',  //是否显示历史答题记录
 			isSubmit:false,
 		};
 	},
@@ -363,10 +364,11 @@ export default {
 		this.chapterId = option.chapterId;
 		this.moduleId = option.moduleId;
 		this.recordId = option.recordId;
+		this.isHistory = option.isHistory;
 		this.goodsQuestionList();
 	},
 	onUnload() {
-		if(this.isSubmit) {
+		if(this.isSubmit || this.isHistory) {
 			return
 		}
 		this.examRecordEdit();
@@ -375,7 +377,7 @@ export default {
 		
 		goodsQuestionList() {
 			//继续答题
-			if(this.isContinue) {
+			if(this.isContinue || this.isHistory) {
 				
 				console.log(this.isContinue,"历史做题")
 				this.$api.examReport(this.recordId).then(res => {
@@ -617,7 +619,7 @@ export default {
 					
 					setTimeout(() => {
 						uni.redirectTo({
-							url:'/pages2/bank/question_report?id='+this.recordId
+							url:'/pages2/bank/question_report?id='+this.recordId+'&examId='+this.id
 						})
 					},2000)
 				}

+ 6 - 6
pages2/bank/questionBankTest.vue

@@ -293,7 +293,12 @@
 					
 				
 					<view class="footer_btn">
-						<view @click="collect">收藏</view>
+						<view class="collect" @click="collect">
+							<view>
+								<image src="/static/icon/collect.png" mode="widthFix"></image>
+								<view>收藏</view>
+							</view>
+						</view>
 						<view class="flex_center" @click="openFooterTab">
 							<view class="up-icon">
 								<image src="/static/up.png"></image>
@@ -1139,11 +1144,6 @@ export default {
 	}
 	
 	.collect {
-		visibility: hidden;
-	
-		&.show {
-			visibility: visible;
-		}
 		
 		>view {
 			display: flex;

+ 7 - 4
pages2/bank/question_report.vue

@@ -92,10 +92,7 @@ export default {
 	},
 	onUnload() {},
 	computed: { ...mapGetters(['userInfo']) },
-	async onLoad(option) {
-		this.id = option.id;
-		this.examId = option.examId;
-		this.hideBtns = Boolean(option.hideBtns);
+	async onShow() {
 		await this.bankExam();
 		await this.examReport();
 		
@@ -165,6 +162,12 @@ export default {
 			}
 		});
 	},
+	async onLoad(option) {
+		this.id = option.id;
+		this.examId = option.examId;
+		this.hideBtns = Boolean(option.hideBtns);
+		
+	},
 	methods: {
 		backBank() {
 			uni.redirectTo({

+ 40 - 11
pages2/bank/question_statistics.vue

@@ -82,6 +82,7 @@
 										>
 											<view class="btn" v-if="article.recordStatus == 0">继续</view>
 										</navigator>
+										<view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,article.moduleExamId,article.chapterExamId)">重做</view>
 									</view>
 								</view>
 								<u-line></u-line>
@@ -127,6 +128,8 @@
 								>
 									<view class="btn" v-if="article.recordStatus == 0">继续</view>
 								</navigator>
+								
+								<view class="btn" v-if="article.recordStatus == 1" @click="doRepeat(article.recordId,article.examId,article.goodsId,0,article.chapterExamId)">重做</view>
 							</view>
 						</view>
 					</template>
@@ -159,6 +162,7 @@
 							>
 								<view class="btn" v-if="item1.recordStatus == 0">继续</view>
 							</navigator>
+								<view class="btn" v-if="item1.recordStatus == 1" @click="doRepeat(item1.recordId,item1.majorId,item1.goodsId,0,0)">重做</view>
 						</view>
 					</template>
 				</view>
@@ -185,6 +189,9 @@ export default {
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
 		this.id = option.id;
+		
+	},
+	onShow() {
 		uni.getSystemInfo({
 			success: res => {
 				var winW = res.screenWidth;
@@ -194,10 +201,8 @@ export default {
 					.select('.canvas')
 					.boundingClientRect()
 					.exec(newRes => {
-						this.goodsBankQuestionNum();
-						this.goodsBankDolist();
 						// this.goodsBankList();
-
+		
 						var width = newRes[0].width;
 						var height = newRes[0].height;
 						this.caculateX = winW / 750;
@@ -209,7 +214,7 @@ export default {
 						context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, true);
 						context1.stroke();
 						context1.draw();
-
+		
 						var context2 = uni.createCanvasContext('Canvas2');
 						this.context2 = context2;
 						context2.setStrokeStyle('#EEEEEE');
@@ -217,12 +222,36 @@ export default {
 						context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, 2 * Math.PI, false);
 						context2.stroke();
 						context2.draw();
+						
+						this.goodsBankQuestionNum();
+						this.goodsBankDolist();
 					});
 			}
 		});
 	},
-	onShow() {},
 	methods: {
+		doRepeat(recordId,examId,goodsId,chapterExamId) {
+			uni.showModal({
+			    title: '提示',
+			    content: '是否清空答案重做?',
+				cancelText:'查看上次',
+				cancelColor:'',
+				confirmText:'重做',
+				confirmColor:'',
+			    success: (res) => {
+			        if (res.confirm) {
+						uni.navigateTo({
+							url:'/pages2/bank/questionBank?id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
+						})
+			        } else if (res.cancel) {
+						uni.navigateTo({
+							url:'/pages2/bank/questionBankExplain?isHistory=1&recordId='+recordId +'&id=' +examId +'&goodsid=' +goodsId +'&moduleId=0&chapterId=' +chapterExamId
+						})
+			            console.log('查看上次答题');
+			        }
+			    }
+			});
+		},
 		goodsBankDolist() {
 			this.$api
 				.goodsBankDolist({
@@ -259,13 +288,13 @@ export default {
 					this.caculateX * 90,
 					this.caculateX * 180
 				);
-				this.context2.save();
-				this.context2.translate(this.caculateX * 90, this.caculateX * 90);
-				this.context2.rotate((-90 * Math.PI) / 180);
+				this.context1.save();
+				this.context1.translate(this.caculateX * 90, this.caculateX * 90);
+				this.context1.rotate((-90 * Math.PI) / 180);
 				this.context1.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.rightNum / this.goodsCount.totalNum) * 2 * Math.PI, false);
-				this.context2.restore();
+				this.context1.restore();
 				this.context1.stroke();
-				this.context1.draw();
+				this.context1.draw(true);
 
 				this.context2.beginPath();
 				this.context2.setStrokeStyle('#007AFF');
@@ -280,7 +309,7 @@ export default {
 				this.context2.arc(this.caculateX * 90, this.caculateX * 90, this.caculateX * 80, 0, (this.goodsCount.doNum / this.goodsCount.totalNum) * 2 * Math.PI, false);
 				this.context2.restore();
 				this.context2.stroke();
-				this.context2.draw();
+				this.context2.draw(true);
 			});
 		},
 		clickModule(id, index) {

+ 1 - 1
pages2/order/confirm_success.vue

@@ -82,7 +82,7 @@ export default {
 		},
 		goOrder(){
 			uni.redirectTo({
-			    url: '/pages2/order/index'
+			    url: '/pages2/order/index?current=1'
 			});
 		},
 		radioChange(e) {

+ 3 - 1
pages2/order/index.vue

@@ -73,7 +73,9 @@ export default {
 		};
 	},
 	// onPullDownRefresh() {},
-	onLoad(option) {},
+	onLoad(option) {
+		this.current = option.current || 0;
+	},
 	onShow() {
 		this.getOrderList();
 		/* if(this.current === 2 && this.$method.isLogin()){