Skip to content

Commit

Permalink
修复搜索翻页问题及其他bug
Browse files Browse the repository at this point in the history
  • Loading branch information
XboxYan committed Feb 19, 2019
1 parent 5598210 commit 7e8ac06
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 465 deletions.
1 change: 1 addition & 0 deletions src/components/MovieList.js
Expand Up @@ -107,6 +107,7 @@ const styles = StyleSheet.create({
width: '100%',
height:($.WIDTH - 40) / 2,
flex: 1,
backgroundColor:'#f1f1f1',
resizeMode: 'cover'
},
movietext: {
Expand Down
7 changes: 4 additions & 3 deletions src/components/SearchList.js
Expand Up @@ -71,7 +71,7 @@ export default class extends PureComponent {

render() {
const { data, isRender,themeColor,style,onEndReached=()=>{} } = this.props;
const height = ($.WIDTH - 40) / 2+40;
const height = 150;
if (!isRender) {
return <Loading style={{height:100}} size='small' text='' themeColor={themeColor} />
}
Expand All @@ -85,10 +85,10 @@ export default class extends PureComponent {
ItemSeparatorComponent={() => <View style={{height:10}} />}
ListFooterComponent={this.renderFooter}
data={data}
//getItemLayout={(data, index) => ( {length: height, offset: height * index, index} )}
getItemLayout={(data, index) => ( {length: height, offset: height * index, index} )}
onEndReached={onEndReached}
onEndReachedThreshold={0.1}
keyExtractor={(item, index) => item.ID.toString()}
keyExtractor={(item, index) => index+item.ID.toString()}
renderItem={this.renderItem}
/>
)
Expand All @@ -112,6 +112,7 @@ const styles = StyleSheet.create({
width:90,
height:120,
borderRadius:3,
backgroundColor:'#f1f1f1',
resizeMode: 'cover'
},
movietext: {
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Expand Up @@ -9,19 +9,19 @@ import Icon from 'react-native-vector-icons/Feather';

const tablist = [
{
type: 'dy',
type: 'movie',
name: '电影'
},
{
type: 'dsj',
type: 'tv',
name: '电视剧'
},
{
type: 'Animation',
type: 'comic',
name: '动漫'
},
{
type: 'Arts',
type: 'variety',
name: '综艺'
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/page/Home.js
Expand Up @@ -17,22 +17,22 @@ const maps = [
isRender:true
},
{
listType:'dy',
listType:'movie',
name:'电影',
icon:'film'
},
{
listType:'dsj',
listType:'tv',
name:'电视剧',
icon:'tv'
},
{
listType:'Animation',
listType:'comic',
name:'动漫',
icon:'gitlab'
},
{
listType:'Arts',
listType:'variety',
name:'娱乐',
icon:'anchor'
},
Expand Down

0 comments on commit 7e8ac06

Please sign in to comment.