Jelajahi Sumber

学习中心列表接口全部请求完成才隐藏掉loading提示框

xuqiaoying 2 tahun lalu
induk
melakukan
1108334cbe
4 mengubah file dengan 10 tambahan dan 21 penghapusan
  1. 4 2
      common/httpList/course.js
  2. 2 1
      common/httpList/goods.js
  3. 3 9
      pages/learn/index.vue
  4. 1 9
      pages3/polyv/detail.vue

+ 4 - 2
common/httpList/course.js

@@ -197,7 +197,8 @@ export default {
 		return myRequest({
 			url: '/goods/getLiveList',
 			method: 'get',
-			data:data
+			data: data,
+			compleLoading: true
 		})
 	},
 	// 查询用户拥有视频+直播商品
@@ -205,7 +206,8 @@ export default {
 		return myRequest({
 			url: '/goods/listUserVideoLive',
 			method: 'get',
-			data:data
+			data: data,
+			compleLoading: true
 		})
 	},
 	reSectionExamList(data) {

+ 2 - 1
common/httpList/goods.js

@@ -461,7 +461,8 @@ export default {
 		return myRequest({
 			url: '/bank/question/listUserFreeUnionBuyGoodsList',
 			method: 'get',
-			data:data
+			data: data,
+			compleLoading: true
 		})
 	},
 	

+ 3 - 9
pages/learn/index.vue

@@ -518,12 +518,6 @@ export default {
 	async onShow() {
 		this.getCourseLiveQues()
 		await this.commonSystemTime()
-	},
-	onUnload() {
-		console.log('index:--onUnload')
-	},
-	onHide() {
-		console.log('index:--onHide')
 	},
 	 onPullDownRefresh() {
 		this.getCourseLiveQues()
@@ -581,6 +575,7 @@ export default {
 					pageSize: 3 // 默认3条
 				})
 			]
+			wx.stopPullDownRefresh()
 			Promise.all(arrs).then((res) => {
 				// if (res.data.code == 200) {
 					const [{ data: res1}, { data: res2}, {data: res3}] = res
@@ -597,11 +592,10 @@ export default {
 					}
 					this.allLoading = false
 				// }
-				wx.stopPullDownRefresh()
+				uni.hideLoading()
 			}).catch(err => {
+				uni.hideLoading()
 				this.allLoading = false
-				wx.stopPullDownRefresh()
-				// this.$u.toast('请重新刷新请求')
 			})
 		},
 		commonSystemTime() {

+ 1 - 9
pages3/polyv/detail.vue

@@ -730,9 +730,8 @@ export default {
       toggleCourseShow: false, // 切换课程弹窗
       informId: '', //消息id,从公众号消息模板进来的才有
       courseList: [], // 课程列表
-      courseTotal: 0,
+      // courseTotal: 0,
       reStart: false, // 是否显示模块/章/节
-      s_courseList: [], // 筛选后的
       subList: [],
       subIndex: 0,
       goodsTeacher: [],
@@ -824,11 +823,6 @@ export default {
     cMenu(item, index) {
       this.subIndex = index
       this.newActiveSubjectId = item.subjectId
-      // if (item.subjectId != 0) {
-      //   this.s_courseList = this.courseList.filter((e) => e.subjectId == item.subjectId)
-      // } else {
-      //   this.s_courseList = this.courseList
-      // }
     },
     courseCourseList() {
       // /course/courseList查询商品下的课程列表
@@ -843,8 +837,6 @@ export default {
       }).then((res) => {
         if (res.data.code == 200) {
           this.courseList.push.apply(this.courseList, res.data.rows)
-          this.s_courseList = this.courseList
-          this.courseTotal = res.data.total || 0
           // 科目
           let allItem = [{ subjectId: 0, subjectName: '所有'}]
           let ids = []