|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
import { useEffect, useState } from 'react' |
|
|
|
|
import Taro, { useLoad, useShareAppMessage, useShareTimeline } from '@tarojs/taro' |
|
|
|
|
import { View, Text, Video, Image, ScrollView } from '@tarojs/components' |
|
|
|
|
import { View, Text, Video, Image, ScrollView, CoverView, CoverImage } from '@tarojs/components' |
|
|
|
|
|
|
|
|
|
import './index.less' |
|
|
|
|
|
|
|
|
@ -108,6 +108,10 @@ export default function Index() { |
|
|
|
|
|
|
|
|
|
const [isFree, setisFree] = useState(false) |
|
|
|
|
|
|
|
|
|
const [isFullscreen, setIsFullscreen] = useState(false) |
|
|
|
|
|
|
|
|
|
const [playListOpen, setPlayListOpen] = useState(false) |
|
|
|
|
|
|
|
|
|
useShareAppMessage((res) => { |
|
|
|
|
if (res.from === 'button') { |
|
|
|
|
console.log(res.target); |
|
|
|
@ -346,6 +350,22 @@ export default function Index() { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 视频全屏回调
|
|
|
|
|
const fullScreenChange = (e: any) => { |
|
|
|
|
const { fullScreen } = e.detail |
|
|
|
|
fullScreen || setPlayListOpen(false) |
|
|
|
|
setIsFullscreen(fullScreen) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 展示选集列表
|
|
|
|
|
const showPlayList = () => { |
|
|
|
|
setPlayListOpen(!playListOpen) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const videoClick = () => { |
|
|
|
|
setPlayListOpen(false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View className='bgview' style={{ width: '100%', overflow: 'hidden' }}> |
|
|
|
|
{/* pad小程序 */} |
|
|
|
@ -353,21 +373,31 @@ export default function Index() { |
|
|
|
|
<View className='content'> |
|
|
|
|
{ |
|
|
|
|
!isFree ? |
|
|
|
|
<Video |
|
|
|
|
className='jimeiVideo' |
|
|
|
|
src={displayindex['src']} |
|
|
|
|
poster={displayindex['poster']} |
|
|
|
|
initialTime={0} |
|
|
|
|
controls |
|
|
|
|
autoplay |
|
|
|
|
loop={false} |
|
|
|
|
muted={false} |
|
|
|
|
onEnded={() => continuePlay()} |
|
|
|
|
onPlay={() => provingCdKey()} |
|
|
|
|
direction={90} |
|
|
|
|
id='topvideo' |
|
|
|
|
objectFit='contain' |
|
|
|
|
></Video> : |
|
|
|
|
<> |
|
|
|
|
<Video |
|
|
|
|
className='jimeiVideo' |
|
|
|
|
title={displayindex.title} |
|
|
|
|
src={displayindex['src']} |
|
|
|
|
poster={displayindex['poster']} |
|
|
|
|
initialTime={0} |
|
|
|
|
controls |
|
|
|
|
autoplay |
|
|
|
|
enablePlayGesture |
|
|
|
|
vslideGesture |
|
|
|
|
showScreenLockButton |
|
|
|
|
showBackgroundPlaybackButton |
|
|
|
|
loop={false} |
|
|
|
|
muted={false} |
|
|
|
|
onClick={() => videoClick()} |
|
|
|
|
onEnded={() => continuePlay()} |
|
|
|
|
onPlay={() => provingCdKey()} |
|
|
|
|
onFullScreenChange={(e) => fullScreenChange(e)} |
|
|
|
|
direction={90} |
|
|
|
|
id='topvideo' |
|
|
|
|
objectFit='contain' |
|
|
|
|
></Video> |
|
|
|
|
{isFullscreen && <CoverView className='select-epi' onClick={showPlayList}>选集</CoverView>} |
|
|
|
|
</> : |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
{ |
|
|
|
@ -411,6 +441,32 @@ export default function Index() { |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</ScrollView> |
|
|
|
|
|
|
|
|
|
{/* 全屏播放状态下的视频列表 */} |
|
|
|
|
{ |
|
|
|
|
playListOpen && |
|
|
|
|
<CoverView |
|
|
|
|
className='fullDisplayList' |
|
|
|
|
scrollX |
|
|
|
|
scrollWithAnimation |
|
|
|
|
// enableFlex
|
|
|
|
|
> |
|
|
|
|
<CoverView className='card-epi'>选集</CoverView> |
|
|
|
|
<CoverView className='card-inner'> |
|
|
|
|
{ |
|
|
|
|
alldata.map((item : any, index: number) => |
|
|
|
|
<CoverView className='card' key={item['ResId']} onClick={() => changedisplay(item, index)} > |
|
|
|
|
<CoverView className='card-image-wrap'> |
|
|
|
|
<CoverImage className='card-image' src={item['ResCover']} mode='aspectFill'></CoverImage> |
|
|
|
|
{displayindex['index'] == index && <CoverView className='card-playing-mask'>正在播放</CoverView>} |
|
|
|
|
</CoverView> |
|
|
|
|
<CoverView className='card-title'>{item['ResTitle']}</CoverView> |
|
|
|
|
</CoverView> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
</CoverView> |
|
|
|
|
</CoverView> |
|
|
|
|
} |
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|