Browse Source

每日一练和随机练习结果页返回

xuqiaoying 2 years ago
parent
commit
a7fc2e483c
2 changed files with 13 additions and 4 deletions
  1. 9 1
      pages2/bank/question_report.vue
  2. 4 3
      pages2/dailyPractice/index.vue

+ 9 - 1
pages2/bank/question_report.vue

@@ -79,7 +79,7 @@
 					<view class="btnACs">全部解析</view>
 				</navigator>
 				<view class="btnACs" v-if="entryType != 'daily'" @click="doRepeat(reportdata.examId, reportdata.goodsId, reportdata.moduleExamId, reportdata.chapterExamId)">重新做题</view>
-				<view class="btnACs" v-if="(entryType != 'daily' && entryType != 'random') && nextExamId" @click="backBank">继续做题</view>
+				<view class="btnACs" v-if="entryType != 'random' || nextExamId" @click="backBank">继续做题</view>
 			</view>
 		</view>
 		<view class="bottom">
@@ -349,6 +349,10 @@ export default {
 			})
 		},
 		backBank() {
+			if (this.entryType == 'daily') {
+				uni.navigateBack()
+				return
+			}
 			uni.navigateTo({
 				url: '/pages2/bank/questionBank?orderGoodsId='+this.orderGoodsId+'&id=' +this.nextExamId + '&goodsid=' + this.goodsId + '&moduleId=' + this.moduleId + '&chapterId=' + this.chapterId + ''
 			});
@@ -372,6 +376,10 @@ export default {
 		 * 去做题
 		 */
 		async doRepeat(id, goodsId, moduleId = 0, chapterId = 0) {
+			if (this.entryType == 'random') {
+				uni.navigateBack()
+				return
+			}
 			// await this.getDetail(goodsId);
 			let count = await this.examRecordCount(id, goodsId);
 			let answerNum = await this.getExamDetail(id);

+ 4 - 3
pages2/dailyPractice/index.vue

@@ -43,7 +43,7 @@
             <view class="c_title">打卡记录</view>
             <view class="punch_calendar">
                 <view class="card_box">
-                    {{ curMonth + '月'}}
+                    {{ curYear + '年' + curMonth + '月'}}
                 </view>
                 <!-- <u-line color="#EEEEEE" /> -->
                 <view class="weeks">
@@ -68,6 +68,7 @@ export default {
         return {
             weekLists: ['日','一','二','三','四','五','六'],
 			date_num: [],
+            curYear: 0, // 当前年份
             curMonth: 0, // 当前月份
             goodsId: '',
             orderGoodsId: '',
@@ -87,9 +88,9 @@ export default {
         // 初始化当月日历
         initCalendar() {
             let date = new Date()
-			let year = date.getFullYear() //获取当前年份
+			this.curYear = date.getFullYear() //获取当前年份
 			this.curMonth = date.getMonth() + 1 //获取当前月份
-			let dd = new Date(year, this.curMonth, 0) //获取当月总天数
+			let dd = new Date(this.curYear, this.curMonth, 0) //获取当月总天数
 			let current_month = []
 			// let weekList = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
 			for (let i = 1; i <= dd.getDate(); i++) {