he2802 3 gadi atpakaļ
vecāks
revīzija
79d9231f12
3 mainītis faili ar 41 papildinājumiem un 14 dzēšanām
  1. 1 0
      pages.json
  2. 39 14
      pages2/bank/question_record.vue
  3. 1 0
      pages2/class/detail.vue

+ 1 - 0
pages.json

@@ -272,6 +272,7 @@
 				"path": "bank/question_record",
 				"style": {
 					"navigationBarTitleText": "做题记录",
+					"enablePullDownRefresh":true,
 					"app-plus": {
 						"titleNView": false, //禁用原生导航栏 
 						"bounce": "none"

+ 39 - 14
pages2/bank/question_record.vue

@@ -73,21 +73,50 @@
 				list:[],
 				list1:[],
 				recordList:[],
-				goodsData:{}
+				goodsData:{},
+				param:{
+					pageNum:1,
+					pageSize:10
+				},
+				total:0
 			}
 		},
 		onLoad(option) {
 			this.listGoodsUserQuestion();
 			this.examaperList();
+			this.getExamRecordList()
 			
-			this.$api.examRecordList({}).then(res => {
-				this.recordList = res.data.rows
-			})
+		},
+		onPullDownRefresh(){
+			let that = this
+			this.param = {
+					pageNum:1,
+					pageSize:10
+				}
+				this.getExamRecordList()
+			setTimeout(function(){
+				uni.stopPullDownRefresh()
+			},500)
+		},
+		onReachBottom() {
+			if (this.recordList.length < this.total) {
+				this.param.pageNum++
+				this.getExamRecordList()
+			}
 		},
 		onShow(){
 			
 		},
 		methods: {
+			getExamRecordList(){
+				if(this.param.pageNum==1){
+					this.recordList = []
+				}
+				this.$api.examRecordList(this.param).then(res => {
+					this.recordList.push.apply(this.recordList,res.data.rows)
+					this.total = res.data.total
+				})
+			},
 			/**
 			 * 去做题
 			 */
@@ -136,19 +165,15 @@
 			},
 			testClick(item) {
 				this.index = 0
-				this.$api.examRecordList({
-					goodsId:item.goodsId
-				}).then(res => {
-					this.recordList = res.data.rows
-				})
+				this.param.goodsId = item.goodsId
+				this.param.pageNum = 1
+				this.getExamRecordList()
 			},
 			paperClick(item) {
 				this.index = 0
-				this.$api.examRecordList({
-					paperId:item.paperId
-				}).then(res => {
-					this.recordList = res.data.rows
-				})
+				this.param.paperId = item.paperId
+				this.param.pageNum = 1
+				this.getExamRecordList()
 			},
 			tab(e) {
 				this.index = e.currentTarget.dataset.index;

+ 1 - 0
pages2/class/detail.vue

@@ -65,6 +65,7 @@
 			</view>
 			<!--笔记 -->
 			<view v-show="current == 2">
+				<view v-if="noteList.length==0" style="text-align: center;">暂无笔记</view>
 				<view class="inputBottom">
 					<view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
 					<view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;">