yujialong 2 months ago
parent 5a5c1f443e
commit c3f223e926
  1. 14
      src/components/goToStoreModal/index.tsx
  2. 52
      src/pages/DisplayVideo/index.tsx
  3. 42
      src/pages/ListenDetail/index.tsx
  4. 2
      src/pages/ListenDisplay/index.tsx
  5. 16
      src/pages/ListenType/MainType/index.less
  6. 21
      src/pages/ListenType/SingleType/index.less

@ -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 }
}
/>
<View
className='store_modal'
<View
className='store_modal'
style={
!isAnimationOpen ? { opacity: 1, transition: 'opacity 1s ease-in-out' }
: { opacity: 0 }
@ -59,11 +59,11 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag
<Text className='store_modal_context'>
{type === 0 ? '您还没有订阅,请前往商城购买' : '更多绘本请前往商城选购'}
</Text>
<View
<View
className='store_modal_container'
onClick={handleNavigateToMiniProgram}
onClick={handleNavigateToMiniProgram}
>
<View
<View
className='store_modal_title'
>
@ -71,6 +71,6 @@ export default function GoToStoreModal({ visible, onClose, type, mallLink = 'pag
</View>
</View>
</>
)
}

@ -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
>
{

@ -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() {
</View>
<View className='chooseBar'>
<View
<View
className='item'
onClick={() => {setchooseIndex(0)}}
onClick={() => {setchooseIndex(0)}}
>
<View
<View
className='title'
style={chooseIndex === 0 ? {color: '#3ba366', fontWeight: '600', fontSize: '1rem'} : {}}
style={chooseIndex === 0 ? {color: '#3ba366', fontWeight: '600', fontSize: '1rem'} : {}}
>
</View>
@ -181,13 +181,13 @@ export default function ListenDetail() {
chooseIndex === 0 && <View className='line'></View>
}
</View>
<View
<View
className='item'
onClick={() => {setchooseIndex(1)}}
onClick={() => {setchooseIndex(1)}}
>
<View
<View
className='title'
style={chooseIndex === 1 ? {color: '#3ba366', fontWeight: '600', fontSize: '1rem'} : {}}
style={chooseIndex === 1 ? {color: '#3ba366', fontWeight: '600', fontSize: '1rem'} : {}}
>
</View>
@ -198,14 +198,14 @@ export default function ListenDetail() {
</View>
{
chooseIndex === 0 &&
chooseIndex === 0 &&
<View className='MusicList'>
{
detailData.Resources.map((item, index) => (
<View
key={index}
<View
key={index}
className='item'
onClick={() => {handleDisplay( detailData.Product.PrdtId ,item.ResId, detailData.IsSubscribed)}}
onClick={() => {handleDisplay( detailData.Product.PrdtId ,item.ResId, detailData.IsSubscribed)}}
>
<View className='content'>
<View className='title'>{item.ResTitle}</View>
@ -218,7 +218,7 @@ export default function ListenDetail() {
}
</View>
}
{
chooseIndex === 1 &&
<View className='introduction'>
@ -234,9 +234,9 @@ export default function ListenDetail() {
onModalClose={() => setisLoginOpen(false)}
></GetPhoneNumber>
<GoToStoreModal
visible={isToStoreOpen}
onClose={() => setisToStoreOpen(false)}
<GoToStoreModal
visible={isToStoreOpen}
onClose={() => setisToStoreOpen(false)}
type={0}
mallLink={prdtMallLink}
setmallLink={setprdtMallLink}

@ -16,7 +16,7 @@ export default function ListenDisplay() {
return (
<WebView
src={`https://audioplay.jm-kid.com?prdtId=${prdtId}&resId=${resId}`}
src={`https://audioplay.jm-kid.com?prdtId=${prdtId}&resId=${resId}&_=${Date.now()}`}
></WebView>
)
}

@ -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;
}

@ -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 @@
}
}
}
}
}
}
}

Loading…
Cancel
Save