|
|
|
@ -102,6 +102,7 @@ export default function Index() { |
|
|
|
|
index: -1, |
|
|
|
|
src: '', |
|
|
|
|
poster: '', |
|
|
|
|
title: '', |
|
|
|
|
}) |
|
|
|
|
const [isplay, setisplay] = useState(false) |
|
|
|
|
|
|
|
|
@ -138,15 +139,18 @@ export default function Index() { |
|
|
|
|
prdt_id: query.id, |
|
|
|
|
}, |
|
|
|
|
success: (res: any) => { |
|
|
|
|
const { data } = res.data |
|
|
|
|
const sources = data.Resource |
|
|
|
|
console.log('播放资源请求成功=>', res.data) |
|
|
|
|
setalldata(res.data.data.Resource) |
|
|
|
|
setisFree(res.data.data.IsFree) |
|
|
|
|
setalldata(sources) |
|
|
|
|
setisFree(data.IsFree) |
|
|
|
|
|
|
|
|
|
if(res.data.data.IsFree){ |
|
|
|
|
if(data.IsFree){ |
|
|
|
|
setdisplayindex({ |
|
|
|
|
index: 0, |
|
|
|
|
src: res.data.data.Resource[0].Tvpid, |
|
|
|
|
poster: res.data.data.Resource[0].ResCover, |
|
|
|
|
src: sources[0].Tvpid, |
|
|
|
|
poster: sources[0].ResCover, |
|
|
|
|
title: sources[0].ResTitle, |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
Taro.request({ |
|
|
|
@ -157,8 +161,7 @@ export default function Index() { |
|
|
|
|
"userName": "VqwgIY4g7s9DanyyqsKP4g==", |
|
|
|
|
}, |
|
|
|
|
success: (token_res) => { |
|
|
|
|
if(res.data.data.Resource.length){ |
|
|
|
|
|
|
|
|
|
if(sources.length){ |
|
|
|
|
Taro.request({ |
|
|
|
|
method: 'GET', |
|
|
|
|
url: 'https://api.jimeikid.com/jiyoumei/product/app/message/send/history/getPlayInfo', |
|
|
|
@ -166,8 +169,8 @@ export default function Index() { |
|
|
|
|
authorization: token_res.data.data.token |
|
|
|
|
}, |
|
|
|
|
data: { |
|
|
|
|
token: res.data.data.Resource[0].ResPwd, |
|
|
|
|
videoId: res.data.data.Resource[0].ResVcode, |
|
|
|
|
token: sources[0].ResPwd, |
|
|
|
|
videoId: sources[0].ResVcode, |
|
|
|
|
}, |
|
|
|
|
success: function (rres) { |
|
|
|
|
console.log('视频资源请求成功=>', rres) |
|
|
|
@ -176,6 +179,7 @@ export default function Index() { |
|
|
|
|
index: 0, |
|
|
|
|
src: rres.data.data.body.playInfoList.playInfo[0].playURL, |
|
|
|
|
poster: rres.data.data.body.videoBase.coverURL, |
|
|
|
|
title: rres.data.data.body.playInfoList.playInfo[0].ResTitle || '', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -183,8 +187,8 @@ export default function Index() { |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.log('播放资源请求失败=>', err) |
|
|
|
@ -207,6 +211,7 @@ export default function Index() { |
|
|
|
|
index: 0, |
|
|
|
|
src: res.data.data.Resource[0].Tvpid, |
|
|
|
|
poster: res.data.data.Resource[0].ResCover, |
|
|
|
|
title: res.data.data.Resource[0].ResTitle, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
@ -214,12 +219,12 @@ export default function Index() { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const changedisplay = (item: any, index: any) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!isFree){ |
|
|
|
|
//根据点击行为设置播放状态
|
|
|
|
|
console.log(index) |
|
|
|
@ -250,6 +255,7 @@ export default function Index() { |
|
|
|
|
index: index, |
|
|
|
|
src: rres.data.data.body.playInfoList.playInfo[0].playURL, |
|
|
|
|
poster: rres.data.data.body.videoBase.coverURL, |
|
|
|
|
title: rres.data.data.body.playInfoList.playInfo[0].ResTitle || '', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
@ -264,6 +270,7 @@ export default function Index() { |
|
|
|
|
index: index, |
|
|
|
|
src: item.Tvpid, |
|
|
|
|
poster: item.ResCover, |
|
|
|
|
title: item.ResTitle, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -277,7 +284,7 @@ export default function Index() { |
|
|
|
|
if (nowindex === alldata.length - 1) { |
|
|
|
|
console.log('播放结束') |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!isFree){ |
|
|
|
|
//连播时更新视频
|
|
|
|
|
Taro.request({ |
|
|
|
@ -305,6 +312,7 @@ export default function Index() { |
|
|
|
|
index: nowindex + 1, |
|
|
|
|
src: rres.data.data.body.playInfoList.playInfo[0].playURL, |
|
|
|
|
poster: rres.data.data.body.videoBase.coverURL, |
|
|
|
|
title: rres.data.data.body.playInfoList.playInfo[0].ResTitle || '', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -316,9 +324,10 @@ export default function Index() { |
|
|
|
|
index: nowindex + 1, |
|
|
|
|
src: alldata[nowindex + 1].Tvpid, |
|
|
|
|
poster: alldata[nowindex + 1].ResCover, |
|
|
|
|
title: alldata[nowindex + 1].ResTitle, |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -364,8 +373,9 @@ export default function Index() { |
|
|
|
|
isFree && |
|
|
|
|
//@ts-ignore
|
|
|
|
|
<player-component |
|
|
|
|
className='jimeiVideo'
|
|
|
|
|
id='tvp-id'
|
|
|
|
|
className='jimeiVideo' |
|
|
|
|
title={displayindex.title} |
|
|
|
|
id='tvp-id' |
|
|
|
|
playerid='tvp' |
|
|
|
|
vid={displayindex.src} |
|
|
|
|
onEnded={() => continuePlay()} |
|
|
|
@ -375,10 +385,10 @@ export default function Index() { |
|
|
|
|
} |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<ScrollView
|
|
|
|
|
className='displayList'
|
|
|
|
|
scrollY
|
|
|
|
|
|
|
|
|
|
<ScrollView |
|
|
|
|
className='displayList' |
|
|
|
|
scrollY |
|
|
|
|
scrollWithAnimation |
|
|
|
|
> |
|
|
|
|
{ |
|
|
|
|