1*ccac153aS猫头猫import React, { useState } from 'react'; 2*ccac153aS猫头猫import {Pressable, StyleSheet, Text, View} from 'react-native'; 3*ccac153aS猫头猫import rpx from '@/utils/rpx'; 4*ccac153aS猫头猫import MusicQueue from '@/common/musicQueue'; 5*ccac153aS猫头猫import Image from '@/components/base/image'; 6*ccac153aS猫头猫import { ImgAsset } from '@/constants/assetsConst'; 7*ccac153aS猫头猫import FastImage from 'react-native-fast-image'; 8*ccac153aS猫头猫import AlbumCover from './albumCover'; 9*ccac153aS猫头猫import Lyric from './lyric'; 10*ccac153aS猫头猫 11*ccac153aS猫头猫interface IContentProps {} 12*ccac153aS猫头猫export default function Content(props: IContentProps) { 13*ccac153aS猫头猫 14*ccac153aS猫头猫 const [tab, selectTab] = useState<'album' | 'lyric'>('album'); 15*ccac153aS猫头猫 16*ccac153aS猫头猫 const onPress = () => { 17*ccac153aS猫头猫 if(tab === 'album') { 18*ccac153aS猫头猫 selectTab('lyric') 19*ccac153aS猫头猫 } else { 20*ccac153aS猫头猫 selectTab('album') 21*ccac153aS猫头猫 } 22*ccac153aS猫头猫 } 23*ccac153aS猫头猫 24*ccac153aS猫头猫 return ( 25*ccac153aS猫头猫 <Pressable style={style.wrapper} onPress={onPress}> 26*ccac153aS猫头猫 {tab === 'album' ? <AlbumCover></AlbumCover> : <Lyric></Lyric>} 27*ccac153aS猫头猫 </Pressable> 28*ccac153aS猫头猫 ); 29*ccac153aS猫头猫} 30*ccac153aS猫头猫 31*ccac153aS猫头猫const style = StyleSheet.create({ 32*ccac153aS猫头猫 wrapper: { 33*ccac153aS猫头猫 width: rpx(750), 34*ccac153aS猫头猫 flex: 1, 35*ccac153aS猫头猫 justifyContent: 'center', 36*ccac153aS猫头猫 alignItems: 'center', 37*ccac153aS猫头猫 }, 38*ccac153aS猫头猫}); 39