From c3f223e9260937a6546e4002d8e8f8802c6e98fc Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 11 Oct 2024 10:31:45 +0800 Subject: [PATCH] fix --- src/components/goToStoreModal/index.tsx | 14 +++--- src/pages/DisplayVideo/index.tsx | 52 +++++++++++++--------- src/pages/ListenDetail/index.tsx | 42 ++++++++--------- src/pages/ListenDisplay/index.tsx | 2 +- src/pages/ListenType/MainType/index.less | 16 +++---- src/pages/ListenType/SingleType/index.less | 21 +++++---- 6 files changed, 78 insertions(+), 69 deletions(-) diff --git a/src/components/goToStoreModal/index.tsx b/src/components/goToStoreModal/index.tsx index 44be8c4..cdab4fa 100644 --- a/src/components/goToStoreModal/index.tsx +++ b/src/components/goToStoreModal/index.tsx @@ -34,7 +34,7 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag } }) setmallLink('') - + handleOverlayClick(null) } @@ -48,8 +48,8 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag : { opacity: 0 } } /> - {type === 0 ? '您还没有订阅,请前往商城购买' : '更多绘本请前往商城选购'} - - 去选购 @@ -71,6 +71,6 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag - + ) } diff --git a/src/pages/DisplayVideo/index.tsx b/src/pages/DisplayVideo/index.tsx index 76f735b..487e078 100644 --- a/src/pages/DisplayVideo/index.tsx +++ b/src/pages/DisplayVideo/index.tsx @@ -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 continuePlay()} @@ -375,10 +385,10 @@ export default function Index() { } - - { diff --git a/src/pages/ListenDetail/index.tsx b/src/pages/ListenDetail/index.tsx index 8a16a06..b8e52a9 100644 --- a/src/pages/ListenDetail/index.tsx +++ b/src/pages/ListenDetail/index.tsx @@ -105,23 +105,23 @@ export default function ListenDetail() { setisLoginOpen(true) }else{ console.log('IsSubscribed=>', IsSubscribed) - if(IsSubscribed === -1){ + if (IsSubscribed === -1) { //未订阅,跳转商城 - setprdtMallLink(detailData.MallLink) + detailData.MallLink && setprdtMallLink(detailData.MallLink) setisToStoreOpen(true) }else{ Taro.navigateTo({ url: '/pages/ListenDisplay/index?prdtId=' + prdtId + '&resId=' + resId }) } - + } - + } useEffect(()=> { console.log('isGetUsePhone=>', isGetUsePhone) - + if(isGetUsePhone && queryId){ Taro.request({ method: 'POST', @@ -167,13 +167,13 @@ export default function ListenDetail() { - {setchooseIndex(0)}} + onClick={() => {setchooseIndex(0)}} > - 目录 @@ -181,13 +181,13 @@ export default function ListenDetail() { chooseIndex === 0 && } - {setchooseIndex(1)}} + onClick={() => {setchooseIndex(1)}} > - 介绍 @@ -198,14 +198,14 @@ export default function ListenDetail() { { - chooseIndex === 0 && + chooseIndex === 0 && { detailData.Resources.map((item, index) => ( - {handleDisplay( detailData.Product.PrdtId ,item.ResId, detailData.IsSubscribed)}} + onClick={() => {handleDisplay( detailData.Product.PrdtId ,item.ResId, detailData.IsSubscribed)}} > {item.ResTitle} @@ -218,7 +218,7 @@ export default function ListenDetail() { } } - + { chooseIndex === 1 && @@ -234,9 +234,9 @@ export default function ListenDetail() { onModalClose={() => setisLoginOpen(false)} > - setisToStoreOpen(false)} + setisToStoreOpen(false)} type={0} mallLink={prdtMallLink} setmallLink={setprdtMallLink} diff --git a/src/pages/ListenDisplay/index.tsx b/src/pages/ListenDisplay/index.tsx index f944346..8f43f5c 100644 --- a/src/pages/ListenDisplay/index.tsx +++ b/src/pages/ListenDisplay/index.tsx @@ -16,7 +16,7 @@ export default function ListenDisplay() { return ( ) } diff --git a/src/pages/ListenType/MainType/index.less b/src/pages/ListenType/MainType/index.less index 8c9a8d7..368b070 100644 --- a/src/pages/ListenType/MainType/index.less +++ b/src/pages/ListenType/MainType/index.less @@ -51,13 +51,13 @@ // background: #000; .type_container { - width: 4.3rem; + width: 4.5rem; height: 100%; - padding-left: .2rem; + margin-right: .3rem; .typelist { - width: 4.5rem; height: calc(100vh - 2.5rem); + padding: 0 .7rem; .item { width: 100%; @@ -83,7 +83,7 @@ } .product_container { - width: calc(100vw - 4.5rem); + width: calc(100vw - 4.8rem); height: 100%; .product { @@ -98,12 +98,12 @@ padding: 0 .5rem; .item { - width: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); - height: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3 + 3rem); + width: calc((100vw - 4.8rem - 1rem - 1.625rem) / 3); + height: calc((100vw - 4.8rem - 1rem - 1.625rem) / 3 + 3rem); .icon { - width: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); - height: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); + width: calc((100vw - 4.8rem - 1rem - 1.625rem) / 3); + height: calc((100vw - 4.8rem - 1rem - 1.625rem) / 3); border-radius: .5rem; margin-bottom: .25rem; } diff --git a/src/pages/ListenType/SingleType/index.less b/src/pages/ListenType/SingleType/index.less index 97684e0..71656a5 100644 --- a/src/pages/ListenType/SingleType/index.less +++ b/src/pages/ListenType/SingleType/index.less @@ -32,28 +32,27 @@ width: 100vw; height: calc(100% - 6.5rem - 1rem); display: flex; - margin-top: 1rem; - // background: #000; .type_container { width: 4.5rem; height: 100%; + margin-right: .3rem; .typelist { - width: 4.5rem; - height: calc(100vh - 6.5rem - 1rem); - + height: calc(100vh - 6.5rem - 1rem); + padding: 0 .7rem; + .item { width: 100%; height: 2.5rem; display: flex; - + .line { width: .1875rem; height: .625rem; border-radius: 1.0625rem; background-color: #3ba366; - margin: auto .3125rem auto 0; + margin: auto .3125rem auto 0; } .title { @@ -72,7 +71,7 @@ .product { width: 100%; - height: calc(100vh - 6.5rem - 1rem); + height: calc(100vh - 6.5rem - 1rem); .container { width: calc(100% - 1rem); @@ -85,7 +84,7 @@ .item { width: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); height: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3 + 3rem); - + .icon { width: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); height: calc((100vw - 4.5rem - 1rem - 1.625rem) / 3); @@ -101,8 +100,8 @@ } } - + } } } -} \ No newline at end of file +}