xsc 1 vuosi sitten
vanhempi
commit
49a7538ec4
2 muutettua tiedostoa jossa 32 lisäystä ja 20 poistoa
  1. 1 12
      pages/xuexi/detail.vue
  2. 31 8
      pages/xuexi/index.vue

+ 1 - 12
pages/xuexi/detail.vue

@@ -27,17 +27,13 @@
 				<view class="tab-item" :class="currentTab==0 ? 'active-item' :''" @click="changeTab(0)">
 					介绍
 					<view class="line" v-if="currentTab==0">
-
 					</view>
 				</view>
-
 				<view class="tab-item" :class="currentTab==1 ? 'active-item' :''" @click="changeTab(1)">
 					目录
 					<view class="line" v-if="currentTab==1">
-
 					</view>
 				</view>
-
 			</view>
 			<view class="desc" v-if="currentTab==0">
 				<div v-html="msg.description"></div>
@@ -141,15 +137,8 @@
 					if (this.videoList[this.currentVideo].progress !== 100) {
 						this.initialTime = this.videoDuration * this.videoList[this.currentVideo].progress
 					}
-
 				}
 			})
-			// app.request('/course/video?id=' + options.id, 'get').then(res => {
-			// 	console.log(res)
-			// })
-			// app.request('/course/chapter?id=' + options.id, 'get').then(res => {
-			// 	console.log(res)
-			// })
 		},
 		methods: {
 			getSettings() {
@@ -422,4 +411,4 @@
 
 		}
 	}
-</style>
+</style>

+ 31 - 8
pages/xuexi/index.vue

@@ -3,8 +3,8 @@
 		<view class="shenbaoList">
 			<view class="list_li" v-for="(item,index) in list" :key="index" @click="detail(item)">
 				<image :src="item.thumb_resource.url" mode="aspectFit" class="img"></image>
-				<view class="title"><text style="margin-right: 5px;">{{item.title}}</text> <text class="tag" v-for="item1 in item.labels" :key="item1"
-						>{{item1}}</text></view>
+				<view class="title"><text style="margin-right: 5px;">{{item.title}}</text> <text class="tag"
+						v-for="item1 in item.labels" :key="item1">{{item1}}</text></view>
 				<!-- <view class="tag">类型:英语</view> -->
 				<view class="li_bottom">
 					<view class="">
@@ -28,18 +28,41 @@
 		},
 		data() {
 			return {
-				list: []
+				list: [],
+				page: 1,
+				total_pages:''
 			};
 		},
 		onLoad() {
 			app.request('/courses/list', 'get').then(res => {
 				console.log(res)
 				this.list = res.data.data.data
+				this.total_pages = res.data.data.meta.pagination.total_pages
 			})
 		},
 		onShow() {
 
 		},
+		onReachBottom() {
+			console.log('触底时间')
+			uni.showLoading()
+			if(this.total_pages>this.page){
+				this.page++;
+				let params = {
+					page: this.page
+				}
+				app.request('/courses/list',params, 'get').then(res => {
+					console.log(res)
+					this.list = this.list.concat(res.data.data.data)
+				})
+			}else{
+				uni.showToast({
+					title: '到底了~',
+					icon: 'none'
+				})
+			}
+			uni.hideLoading()
+		},
 		methods: {
 			backLast: function() {
 				uni.reLaunch({
@@ -79,12 +102,12 @@
 			border-radius: 3px;
 			border: solid 1px #1c85f1;
 			color: #1c85f1;
-			font-size: 12px;
+			font-size: 12px;
 			padding: 0px 3px;
-			margin-right: 5px;
+			margin-right: 5px;
 			font-weight: normal;
-		}
-	
+		}
+
 
 		.list_li {
 			display: flex;
@@ -136,4 +159,4 @@
 			}
 		}
 	}
-</style>
+</style>