| | |
| | | pageNumber: 1, |
| | | pageSize: 10, |
| | | authorId: '', |
| | | videoFrom: '' |
| | | videoFrom: '', |
| | | keyword: '' |
| | | }, |
| | | marginBottom: 0, // 底部安全区域 |
| | | windowHeight: 0 // 可使用屏幕高度 |
| | |
| | | }, |
| | | onUnload() { |
| | | uni.removeStorageSync("playInfo"); |
| | | uni.removeStorageSync("searchPlayInfo"); |
| | | }, |
| | | onReady() { |
| | | |
| | |
| | | onLoad(option) { |
| | | this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom |
| | | this.windowHeight = uni.getSystemInfoSync().windowHeight |
| | | const playInfo = uni.getStorageSync("playInfo", playInfo); |
| | | const playInfo = uni.getStorageSync("playInfo"); |
| | | const searchPlayInfo = uni.getStorageSync("searchPlayInfo"); |
| | | if(playInfo) { |
| | | this.currentIndex = playInfo.playIndex; |
| | | this.videoList = playInfo.videoList; |
| | | console.log("拿到数据了",playInfo); |
| | | this.videoQuery.pageNumber = playInfo.pageNumber; |
| | | this.videoNoMore = playInfo.nomore; |
| | | this.videoQuery.authorId = option.authorId; |
| | |
| | | const videoContext = uni.createVideoContext(`video${this.currentIndex}`, this); |
| | | videoContext.play() |
| | | }) |
| | | } else if (searchPlayInfo) { // 搜索页跳转过来的数据略有不同 |
| | | this.currentIndex = searchPlayInfo.playIndex; |
| | | this.videoList = searchPlayInfo.videoList; |
| | | this.videoQuery.pageNumber = searchPlayInfo.pageNumber; |
| | | this.videoNoMore = searchPlayInfo.nomore; |
| | | this.videoQuery.keyword = searchPlayInfo.keyword; |
| | | this.videoQuery.videoFrom = option.videoFrom; |
| | | this.currentVideoIsPlaying = true; |
| | | this.$nextTick(() => { |
| | | const videoContext = uni.createVideoContext(`video${this.currentIndex}`, this); |
| | | videoContext.play() |
| | | }) |
| | | } else { |
| | | this.videoQuery.videoFrom = 'recommend'; |
| | | this.loadVideos(); |