Browse Source

优化视频跳转

c4az6 4 years ago
parent
commit
1bac11d335

+ 1 - 1
pages/myLike/myLike.vue

@@ -39,7 +39,7 @@
 				// 通过getApp()传参
 				getApp().globalData.videoListJumpParams = {currentPageIndex,currentVideoIndex,videoList, source:'myLike', videoTotal: this.videoTotal}
 				console.log("getApp全局数据: ", getApp().globalData)
-				uni.redirectTo({
+				uni.navigateTo({
 					url: '/pages/videoPlayer/videoPlayer'
 				})
 			},

+ 9 - 5
pages/search/search.vue

@@ -50,6 +50,7 @@
 		},
 		data() {
 			return {
+				hasMore: true,		// 是否有更多视频数据
 				videoList: [],		// 视频列表
 				videoTotal: 0,
 				payload: {
@@ -70,7 +71,7 @@
 				// 通过getApp()传参
 				getApp().globalData.videoListJumpParams = {currentPageIndex,currentVideoIndex,videoList, source:'search', videoTotal: this.videoTotal}
 				console.log("getApp全局数据: ", getApp().globalData)
-				uni.redirectTo({
+				uni.navigateTo({
 					url: '/pages/videoPlayer/videoPlayer'
 				})
 			},
@@ -114,6 +115,7 @@
 							title: '没有更多数据了...',
 							icon: 'none'
 						})
+						this.hasMore = false
 					}
 				}else {
 					uni.showToast({
@@ -141,10 +143,12 @@
 
 		// 页面触底的生命周期
 		onReachBottom() {
-			uni.showLoading({
-				title: '加载中...'
-			})
-			this.getList()
+			if(this.hasMore) {
+				uni.showLoading({
+					title: '加载中...'
+				})
+				this.getList()
+			}
 		},
 		onShow() {
 			this.getList()

+ 2 - 2
pages/videoPlayer/videoPlayer.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="shortVideo">
 		<!-- 导航部分 -->
-		<cu-custom class="lj-navbar" bgColor="" :isBack="true" :isSearch="true" @searchEmit="handleSearch">
-			<block slot="content">优医视频</block>
+		<cu-custom class="lj-navbar" bgColor="" :isBack="true">
+			<block slot="content"></block>
 		</cu-custom>
 
 		<swiper class="swiper" :vertical="true" :current="currentIndex" @change="handleSwiperChange">

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/myLike/myLike.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/search/search.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/videoPlayer/videoPlayer.js.map


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/myLike/myLike.js

@@ -171,7 +171,7 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
       // 通过getApp()传参
       getApp().globalData.videoListJumpParams = { currentPageIndex: currentPageIndex, currentVideoIndex: currentVideoIndex, videoList: videoList, source: 'myLike', videoTotal: this.videoTotal };
       console.log("getApp全局数据: ", getApp().globalData);
-      uni.redirectTo({
+      uni.navigateTo({
         url: '/pages/videoPlayer/videoPlayer' });
 
     },

+ 8 - 4
unpackage/dist/dev/mp-weixin/pages/search/search.js

@@ -182,6 +182,7 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
 
   data: function data() {
     return {
+      hasMore: true, // 是否有更多视频数据
       videoList: [], // 视频列表
       videoTotal: 0,
       payload: {
@@ -202,7 +203,7 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
       // 通过getApp()传参
       getApp().globalData.videoListJumpParams = { currentPageIndex: currentPageIndex, currentVideoIndex: currentVideoIndex, videoList: videoList, source: 'search', videoTotal: this.videoTotal };
       console.log("getApp全局数据: ", getApp().globalData);
-      uni.redirectTo({
+      uni.navigateTo({
         url: '/pages/videoPlayer/videoPlayer' });
 
     },
@@ -246,6 +247,7 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
                       title: '没有更多数据了...',
                       icon: 'none' });
 
+                    _this2.hasMore = false;
                   }
                 } else {
                   uni.showToast({
@@ -273,10 +275,12 @@ var _home = __webpack_require__(/*! ../../api/home.js */ 21);function _interopRe
 
   // 页面触底的生命周期
   onReachBottom: function onReachBottom() {
-    uni.showLoading({
-      title: '加载中...' });
+    if (this.hasMore) {
+      uni.showLoading({
+        title: '加载中...' });
 
-    this.getList();
+      this.getList();
+    }
   },
   onShow: function onShow() {
     this.getList();

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/videoPlayer/videoPlayer.wxml