diff --git a/README-cn.md b/README-cn.md index c8783ed2..b662311b 100644 --- a/README-cn.md +++ b/README-cn.md @@ -40,7 +40,7 @@ import { LargeList } from "react-native-largelist"; }} safeMargin={600} numberOfRowsInSection={section => this.props.numberOfEachSection} - numberOfSections={this.props.numberOfSections} + numberOfSections={()=>this.props.numberOfSections} heightForCell={(section, row) => row % 2 ? this.minCellHeight : this.maxCellHeight} renderCell={this.renderItem.bind(this)} @@ -79,12 +79,12 @@ import { LargeList } from "react-native-largelist" 属性 | 类型 | 默认 |  作用   ------ | ------ | --------- | -------- (ViewPropTypes) | (ViewPropTypes) | | View的所有属性 -numberOfSections | number | 1 | 总的Section数量 +numberOfSections | ()=>number | ()=>1 | 总的Section数量 numberOfRowsInSection | (section:number) => number | section=>0 | 函数:根据section索引返回当前section的Cell数量 renderCell | (section:number,row:number) => React.Element | 必须 | 函数:根据当前Section和Row,返回当前Cell的render heightForCell | (section:number,row:number) => number | 必须 | 函数:根据Section和row index,返回当前Cell的高度 renderSection | (section:number) => React.Element | section=>null | 函数:当前Section的render函数 -heightForSection | (section:number) => number | 0 | 函数:返回当前section的高度 +heightForSection | (section:number) => number | ()=>0 | 函数:返回当前section的高度 renderHeader | () => React.Element | ()=>null | 函数:列表的头部组件的render函数 renderFooter | () => React.Element | ()=>null | 函数:列表的尾部组件的render函数 bounces | boolean | true | 组件滑动到边缘是否可以继续滑动,松开后弹回 @@ -107,27 +107,80 @@ onScroll | ({nativeEvent:{contentOffset:{x:number,y:number}}})=> any | | 滑动 # 高级属性 -### safeMargin ( type:number ,default: 600) -上下额外的预渲染高度,值越大在快速滑动过程中越不容易看到空白,但是第一次加载的时间越长 -### dynamicMargin (type:number,default: 500) -在快速滑动过程中,允许上下端相互借用的预渲染高度。比如假设safeMargin=600,dynamicMargin=500,在快速下滑过程中,上端只额外渲染100高度,下端额外渲染1100高度,反之亦然。 在慢速滑动过程中该属性无作用。请注意:该属性不能大于safeMargin -### scrollEventThrottle (type: number ,default: ios:16 android:32) -同ScrollView的scrollEventThrottle,滑动过程中,onScroll回调时间最小间隔,值越小,相同的滑动追踪次数越多,越不容易出现空白,性能越差。 -### onIndexPathDidEnterSafeArea (type:(indexPath:IndexPath)=>any) -当一个indexPath进入SafeArea时回调 -### onIndexPathDidLeaveSafeArea (type:(indexPath:IndexPath)=>any) -当一个indexPath离开SafeArea时回调 -### showsVerticalScrollIndicator (type:bool,default:true) -显示垂直滚动指示器 -### onSectionDidHangOnTop (type:section=>any, default: ()=>{}) -当一个新的Section被挂在LargeList顶部时的回调 -### speedLevel1 (type:number, default:4) -当滑动的速度超过这个speedLevel1,LargeList则不会rerender,仅仅只是移动位置。 单位是 每毫秒移动的逻辑像素量。 -### speedLevel2 (type:number, default:10) -当前版本无意义 -### nativeOptimize (type:bool, default: false) -启用原生优化,iOS专用。这是一个实验性的功能,使用该功能以后,safeArea就没有意义了。要使用改功能,请将"${YourProject}/node_modules/react-native-largelist/ios/STTVTableView.xcodeproj"拖入您的iOS项目,并且保证链接了它 - +### safeMargin +* type: number +* default: 600 +* 上下额外的预渲染高度,值越大在快速滑动过程中越不容易看到空白,但是第一次加载的时间越长 + +### dynamicMargin +* type: number +* default: 500 +* 在快速滑动过程中,允许上下端相互借用的预渲染高度。比如假设safeMargin=600,dynamicMargin=500,在快速下滑过程中,上端只额外渲染100高度,下端额外渲染1100高度,反之亦然。 在慢速滑动过程中该属性无作用。请注意:该属性不能大于safeMargin + +### scrollEventThrottle +* type: number +* default: ios:16 +* 同ScrollView的scrollEventThrottle,滑动过程中,onScroll回调时间最小间隔,值越小,相同的滑动追踪次数越多,越不容易出现空白,性能越差。 + +### onIndexPathDidEnterSafeArea +* type: (indexPath:IndexPath)=>any +* default: ()=>null +* 当一个indexPath进入SafeArea时回调 + +### onIndexPathDidLeaveSafeArea +* type: (indexPath:IndexPath)=>any +* default: ()=>null +* 当一个indexPath离开SafeArea时回调 + +### showsVerticalScrollIndicator +* type: bool +* default: true +* 显示垂直滚动指示器 + +### onSectionDidHangOnTop +* type: section=>any +* default: ()=>null +* 当一个新的Section被挂在LargeList顶部时的回调 + +### speedLevel1 +* type: number +* default: 4 +* 当滑动的速度超过这个speedLevel1,LargeList则不会rerender,仅仅只是移动位置。 单位是 每毫秒移动的逻辑像素量。 + +### speedLevel2 +* type: number +* default: 10 +* 当前版本无意义 + +### nativeOptimize +* type: bool +* default: false +* 启用原生优化,iOS专用。这是一个实验性的功能,使用该功能以后,safeArea就没有意义了。要使用改功能,请将"${YourProject}/node_modules/react-native-largelist/ios/STTVTableView.xcodeproj"拖入您的iOS项目,并且保证链接了它 + +### onLoadMore +* type: ()=>any +* default: null +* 上拉加载更多的回调,如果设置了此属性,则在下面会有一个上拉的控件 + +### heightForLoadMore +* type: ()=>number +* default: ()=>70 +* 上拉控件的高度 + +### allLoadCompleted +* type: bool +* default: false +* 数据源是否全部加载完成 + +### renderLoadingMore +* type: ()=>React.Element +* default: ()=> < ActivityIndicator style={{ marginTop: 10, alignSelf: "center" }} size={"large"}/ > +* 用户自定义上拉加载更多的动画视图,目前暂不支持事件驱动动画 + +### renderLoadCompleted +* type: ()=>React.Element +* default: ()=> < Text style={{ marginTop: 20, alignSelf: "center", fontSize: 16 }}>No more data< /Text > +* 用户自定义上拉时,加载完成的动画视图。 # 方法 ### scrollTo(offset:Offset, animated:boolean=true) @@ -136,7 +189,7 @@ onScroll | ({nativeEvent:{contentOffset:{x:number,y:number}}})=> any | | 滑动 滑动到一个指定的IndexPath:{section:number,row:number} ### scrollToEnd(animated:boolean=true) 滑动到最底部 -### visiableIndexPaths():IndexPath[] +### visibleIndexPaths():IndexPath[] 获取当前可见的所有IndexPaths ### renderedIndexPaths():IndexPath[] 获取当前已经渲染好的所有IndexPaths @@ -183,6 +236,20 @@ onScroll | ({nativeEvent:{contentOffset:{x:number,y:number}}})=> any | | 滑动 ## 目标计划 1. 修正细节问题 -2. 提供编辑功能 +2. 提供左右滑动编辑功能 +3. 代码优化,支持TypeScript类型检查 + + +# 更新日志 + +### 版本 1.1.0 +* 添加上拉加载更多 +* 修复reloadData有时候出现问题 +* 修复scrollTo几个方法,如果动画为false,会出现bug的问题 +* 将 "visiableIndexPaths" 修改为 "visibleIndexPaths", "visiableIndexPaths" 将在2.0.0版本后完全不支持 +* "numberOfSections"的类型由number改变为function, number 将在2.0.0版本后完全不支持 + +### Version 1.0.0 +* release diff --git a/README.md b/README.md index ad102559..b61b4453 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ import { LargeList } from "react-native-largelist"; }} safeMargin={600} numberOfRowsInSection={section => this.props.numberOfEachSection} - numberOfSections={this.props.numberOfSections} + numberOfSections={()=>this.props.numberOfSections} heightForCell={(section, row) => row % 2 ? this.minCellHeight : this.maxCellHeight} renderCell={this.renderItem.bind(this)} @@ -86,12 +86,12 @@ Props: Props | type | default |  effect   ------ | ------ | --------- | -------- (ViewPropTypes) | (ViewPropTypes) | | All props of View -numberOfSections | number | 1 | number of sections in tableview +numberOfSections | ()=>number | ()=>1 | number of sections in tableview numberOfRowsInSection | (section:number) => number | section=>0 | function:return the number of rows in section renderCell | (section:number,row:number) => React.Element | required | function: render of cell with section and row index heightForCell | (section:number,row:number) => number | required | function:return height for cell with section and row index renderSection | (section:number) => React.Element | section=>null | function:render of section with section index -heightForSection | (section:number) => number | 0 | function:return height of section with section index +heightForSection | (section:number) => number | ()=>0 | function:return height of section with section index renderHeader | () => React.Element | ()=>null | function:render of header in the tableview renderFooter | () => React.Element | ()=>null | function:render of footer in tableview bounces | boolean | true | bounces @@ -111,10 +111,15 @@ Look up the design of react-native-largelist: ![](./readme_resources/largelist_advanced_usage.png) # Advanced Usage -### safeMargin ( type:number ,default: 600) -The height of rendering children out side of visiable area. The greater the value is, the less easily you see the blank in the fast sliding process, but the longer the first time it is loaded -### dynamicMargin (type:number,default: 500) -The height of dynamic safe margin when sliding too fast. For example, if safeMargin=600 and dynamicMargin=500, it will render 100 height on top and 1100 height on bottom out side of the visiable area when sliding down too fast. +### safeMargin +* type: number +* default: 600 +* The height of rendering children out side of visible area. The greater the value is, the less easily you see the blank in the fast sliding process, but the longer the first time it is loaded + +### dynamicMargin +* type: number +* default: 500 +* The height of dynamic safe margin when sliding too fast. For example, if safeMargin=600 and dynamicMargin=500, it will render 100 height on top and 1100 height on bottom out side of the visible area when sliding down too fast. Notice: @@ -122,22 +127,71 @@ Notice: 2. It can not be set larger than safeMargin -### scrollEventThrottle (type: number ,default: ios:16 android:32) -It is the same as scrollEventThrottle on ScrollView -### onIndexPathDidEnterSafeArea (type:(indexPath:IndexPath)=>any) -The callback when an indexpath did enter safeArea. -### onIndexPathDidLeaveSafeArea (type:(indexPath:IndexPath)=>any) -The callback when an indexpath did leave safeArea. -### showsVerticalScrollIndicator (type:bool,default:true) -Show vertical scroll indicator. -### onSectionDidHangOnTop (type:section=>any, default: ()=>{}) -The callback when a new Section hang on the top of the LargeList. -### speedLevel1 (type:number, default:4) -If the speed of scrolling is faster than speedLevel1, LargeList will not rerender, just use "setNativeProps" to move the position. Unit is logic pixels/ms. -### speedLevel2 (type:number, default:10) -It does not work for the current version. -### nativeOptimize (type:bool, default: false) -Use native optimize, iOS only. This is an experimental prop.If it is set, safeArea doesn't make sense. To use the prop, you should add "${YourProject}/node_modules/react-native-largelist/ios/STTVTableView.xcodeproj" to your iOS project. And make sure link it. +### scrollEventThrottle +* type: number +* default: ios:16 +* It is the same as scrollEventThrottle on ScrollView + +### onIndexPathDidEnterSafeArea +* type: (indexPath:IndexPath)=>any +* default: ()=>null +* The callback when an indexpath did enter safeArea. + +### onIndexPathDidLeaveSafeArea +* type: (indexPath:IndexPath)=>any +* default: ()=>null +* The callback when an indexpath did leave safeArea. + +### showsVerticalScrollIndicator +* type: bool +* default: true +* Show vertical scroll indicator. + +### onSectionDidHangOnTop +* type: section=>any +* default: ()=>null +* The callback when a new Section hang on the top of the LargeList. + +### speedLevel1 +* type: number +* default: 4 +* If the speed of scrolling is faster than speedLevel1, LargeList will not rerender, just use "setNativeProps" to move the position. Unit is logic pixels/ms. + +### speedLevel2 +* type: number +* default: 10 +* It does not work for the current version. + +### nativeOptimize +* type: bool +* default: false +* Use native optimize, iOS only. This is an experimental prop.If it is set, safeArea doesn't make sense. To use the prop, you should add "${YourProject}/node_modules/react-native-largelist/ios/STTVTableView.xcodeproj" to your iOS project. And make sure link it. + +### onLoadMore +* type: ()=>any +* default: null +* The callback when pull up on the bottom + +### heightForLoadMore +* type: ()=>number +* default: ()=>70 +* function: return the height of Loading More View. + +### allLoadCompleted +* type: bool +* default: false +* Did all data source load completed? + +### renderLoadingMore +* type: ()=>React.Element +* default: ()=> < ActivityIndicator style={{ marginTop: 10, alignSelf: "center" }} size={"large"}/ > +* The render of custom Loading More View + +### renderLoadCompleted +* type: ()=>React.Element +* default: ()=> < Text style={{ marginTop: 20, alignSelf: "center", fontSize: 16 }}>No more data< /Text > +* The render of custom Loading Completed View. + # Method ### scrollTo(offset:Offset, animated:boolean=true) @@ -146,8 +200,8 @@ Scroll to offset. Scroll to an indexpath. ### scrollToEnd(animated:boolean=true) Scroll to the end of the LargeList. -### visiableIndexPaths():IndexPath[] -Get the visiable indexpaths at this time. +### visibleIndexPaths():IndexPath[] +Get the visible indexpaths at this time. ### renderedIndexPaths():IndexPath[] Get the rendered indexpaths at this time. ### freeCount(): number @@ -191,3 +245,20 @@ Get LargeList's header height ### footerHeight:number Get LargeList's footer height +### Goals and plans +* Fix bug +* Left and right swipe out to edit cell. +* Code optimization, support typescript. + +# Update Log + +### Version 1.1.0 +* Add loading more +* Fix bug when reload data +* Fix bug on "scrollTo" when animated == false +* Change "visiableIndexPaths" to "visibleIndexPaths", "visiableIndexPaths" will not support after 2.0.0 +* Change the type of "numberOfSections" from number to function, number will not support after 2.0.0 + +### Version 1.0.0 +* release + diff --git a/ios/LargeListDemo.xcodeproj/project.pbxproj b/ios/LargeListDemo.xcodeproj/project.pbxproj index d1f0f61a..d92c1970 100644 --- a/ios/LargeListDemo.xcodeproj/project.pbxproj +++ b/ios/LargeListDemo.xcodeproj/project.pbxproj @@ -268,6 +268,34 @@ remoteGlobalIDString = 8E87A9901FAB62CC00B9C54E; remoteInfo = STTVTableView; }; + 8E60FB641FECB89400712E86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3DBE0D001F3B181A0099AA32; + remoteInfo = fishhook; + }; + 8E60FB661FECB89400712E86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; + remoteInfo = "fishhook-tvOS"; + }; + 8E60FB761FECB89400712E86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9936F3131F5F2E4B0010BF04; + remoteInfo = privatedata; + }; + 8E60FB781FECB89400712E86 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04; + remoteInfo = "privatedata-tvOS"; + }; 8E919F2F1FD2E20B00D1D5AC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; @@ -443,6 +471,8 @@ children = ( 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, + 8E60FB651FECB89400712E86 /* libfishhook.a */, + 8E60FB671FECB89400712E86 /* libfishhook-tvOS.a */, ); name = Products; sourceTree = ""; @@ -478,6 +508,8 @@ 8E2E20B41FE00D2700ADC778 /* libthird-party.a */, 8E2E20B61FE00D2700ADC778 /* libdouble-conversion.a */, 8E2E20B81FE00D2700ADC778 /* libdouble-conversion.a */, + 8E60FB771FECB89400712E86 /* libprivatedata.a */, + 8E60FB791FECB89400712E86 /* libprivatedata-tvOS.a */, ); name = Products; sourceTree = ""; @@ -606,7 +638,6 @@ 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, ); buildRules = ( ); @@ -966,6 +997,34 @@ remoteRef = 8E2E20BE1FE00D2700ADC778 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 8E60FB651FECB89400712E86 /* libfishhook.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libfishhook.a; + remoteRef = 8E60FB641FECB89400712E86 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8E60FB671FECB89400712E86 /* libfishhook-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libfishhook-tvOS.a"; + remoteRef = 8E60FB661FECB89400712E86 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8E60FB771FECB89400712E86 /* libprivatedata.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libprivatedata.a; + remoteRef = 8E60FB761FECB89400712E86 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8E60FB791FECB89400712E86 /* libprivatedata-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libprivatedata-tvOS.a"; + remoteRef = 8E60FB781FECB89400712E86 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 8E919F301FD2E20B00D1D5AC /* libRCTBlob-tvOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1020,20 +1079,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Bundle React Native code and images"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; - }; 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/ios/LargeListDemo/AppDelegate.m b/ios/LargeListDemo/AppDelegate.m index 87f029e9..64a8cf2b 100644 --- a/ios/LargeListDemo/AppDelegate.m +++ b/ios/LargeListDemo/AppDelegate.m @@ -18,9 +18,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { NSURL *jsCodeLocation; #ifdef DEBUG -// jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; jsCodeLocation = [NSURL URLWithString:@"http://10.16.64.93:8081/index.bundle?platform=ios&dev=true"]; -// jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.106:8081/index.bundle?platform=ios&dev=true"]; +// jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.103:8081/index.bundle?platform=ios&dev=true"]; // jsCodeLocation = [NSURL URLWithString:@"http://172.20.10.4:8081/index.bundle?platform=ios&dev=true"]; #else jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; diff --git a/package.json b/package.json index 357db630..9f7f368a 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ }, "dependencies": { "prop-types": "^15.6.0", - "react": "16.0.0", - "react-native": "0.50.4", + "react": "^16.0.0", + "react-native": "^0.50.4", "react-native-largelist": "^1.0.0" }, "devDependencies": { diff --git a/react-native-largelist/largelist/EventScrollView.js b/react-native-largelist/largelist/EventScrollView.js new file mode 100644 index 00000000..062522c4 --- /dev/null +++ b/react-native-largelist/largelist/EventScrollView.js @@ -0,0 +1,90 @@ +/* + * + * Created by Stone + * https://github.com/bolan9999 + * Email: bolan999999@gmail.com + * Date: 2017/12/23 + * + */ + +import React from "react"; +import { ScrollView, ViewPropTypes, Platform } from "react-native"; +import PropTypes from "prop-types"; + +// Event List: +// +// onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin, +// onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd, //not fire when scroll out of the visible area. +// onResponderGrant: this.scrollResponderHandleResponderGrant, +// onResponderReject: this.scrollResponderHandleResponderReject, +// onResponderRelease: this.scrollResponderHandleResponderRelease, //bug on Android +// onResponderTerminate: this.scrollResponderHandleTerminate, +// onResponderTerminationRequest: this.scrollResponderHandleTerminationRequest, +// onScroll: this._handleScroll, +// onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag, +// onScrollEndDrag: this.scrollResponderHandleScrollEndDrag, +// onScrollShouldSetResponder: this.scrollResponderHandleScrollShouldSetResponder, +// onStartShouldSetResponder: this.scrollResponderHandleStartShouldSetResponder, +// onStartShouldSetResponderCapture: this.scrollResponderHandleStartShouldSetResponderCapture, +// onTouchEnd: this.scrollResponderHandleTouchEnd, +// onTouchMove: this.scrollResponderHandleTouchMove, +// onTouchStart: this.scrollResponderHandleTouchStart, + +class EventScrollView extends ScrollView { + static propTypes = { + ...ViewPropTypes, + llonTouchStart: PropTypes.func, + llonTouchMove: PropTypes.func, + llonTouchEnd: PropTypes.func + }; + + static defaultProps = { + llonTouchStart: () => {}, + llonTouchMove: () => {}, + llonTouchEnd: () => {} + }; + + orgOnTouchStart; + orgOnTouchMove; + orgOnTouchEnd; + orgOnScrollBeginDrag; + orgOnScrollEndDrag; + orgOnResponderRelease; + orgOnMomentumScrollEnd; + + constructor(props) { + super(props); + this.orgOnTouchStart = this.scrollResponderHandleTouchStart; + this.scrollResponderHandleTouchStart = this.onTouchStart.bind(this); + + this.orgOnTouchMove = this.scrollResponderHandleTouchMove; + this.scrollResponderHandleTouchMove = this.onTouchMove.bind(this); + + this.orgOnScrollEndDrag = this.scrollResponderHandleScrollEndDrag; + this.scrollResponderHandleScrollEndDrag = this.onScrollEndDrag.bind(this); + } + onTouchStart(e) { + this.orgOnTouchStart(e); + this.props.llonTouchStart({ + x: e.nativeEvent.locationX, + y: e.nativeEvent.locationY + }); + } + onTouchMove(e) { + this.orgOnTouchMove(e); + this.props.llonTouchMove({ + x: e.nativeEvent.locationX, + y: e.nativeEvent.locationY + }); + } + onScrollEndDrag(e) { + this.orgOnScrollEndDrag(e); + this.props.llonTouchEnd({ + x: e.nativeEvent.locationX, + y: e.nativeEvent.locationY + }); + } + +} + +export { EventScrollView }; diff --git a/react-native-largelist/largelist/LargeList.js b/react-native-largelist/largelist/LargeList.js index 57d1dc68..383f0e74 100644 --- a/react-native-largelist/largelist/LargeList.js +++ b/react-native-largelist/largelist/LargeList.js @@ -16,12 +16,15 @@ import { Text, RefreshControl, Platform, - ViewPropTypes + ViewPropTypes, + ActivityIndicator, + PanResponder } from "react-native"; import PropTypes from "prop-types"; import { LargeListCell } from "./LargeListCell"; import { LargeListSection } from "./LargeListSection"; import { TableView } from "../tableview"; +import { EventScrollView } from "./EventScrollView"; interface Size { width: number, @@ -46,10 +49,10 @@ interface Range { class LargeList extends React.Component { static propTypes = { ...ViewPropTypes, - numberOfSections: PropTypes.number, + numberOfSections: PropTypes.oneOfType([PropTypes.number, PropTypes.func]), numberOfRowsInSection: PropTypes.func, - renderCell: PropTypes.func, - heightForCell: PropTypes.func, + renderCell: PropTypes.func.isRequired, + heightForCell: PropTypes.func.isRequired, renderSection: PropTypes.func, heightForSection: PropTypes.func, renderHeader: PropTypes.func, @@ -72,7 +75,13 @@ class LargeList extends React.Component { onIndexPathDidEnterSafeArea: PropTypes.func, onIndexPathDidLeaveSafeArea: PropTypes.func, - onSectionDidHangOnTop: PropTypes.func + onSectionDidHangOnTop: PropTypes.func, + + onLoadMore: PropTypes.func, + heightForLoadMore: PropTypes.func, + allLoadCompleted: PropTypes.bool, + renderLoadingMore: PropTypes.func, + renderLoadCompleted: PropTypes.func // onIndexPathDidAppear: PropTypes.func, // onIndexPathDidDisappear: PropTypes.func, @@ -80,7 +89,7 @@ class LargeList extends React.Component { // onSectionDidDisappear: PropTypes.func }; static defaultProps = { - numberOfSections: 1, + numberOfSections: () => 1, numberOfRowsInSection: section => 0, renderSection: () => null, heightForSection: section => 0, @@ -88,6 +97,8 @@ class LargeList extends React.Component { renderFooter: () => null, bounces: true, nativeOptimize: false, + onIndexPathDidEnterSafeArea: () => null, + onIndexPathDidLeaveSafeArea: () => null, safeMargin: 600, dynamicMargin: 500, @@ -95,7 +106,18 @@ class LargeList extends React.Component { speedLevel1: Platform.OS === "ios" ? 4 : 4, speedLevel2: Platform.OS === "ios" ? 10 : 10, showsVerticalScrollIndicator: true, - onSectionDidHangOnTop: () => {} + onSectionDidHangOnTop: () => null, + heightForLoadMore: () => 70, + allLoadCompleted: false, + renderLoadingMore: () => + , + renderLoadCompleted: () => + + No more data + }; sections: Element[] = []; @@ -126,24 +148,42 @@ class LargeList extends React.Component { minSectionHeight: number = 40; scrollViewRef: ScrollView | TableView; native: boolean = false; + loadingMore: boolean = false; + enoughLoadMore: boolean = false; + draging: boolean = false; + scrollingAfterDraging = false; + + numberOfSections: number; constructor(props) { + let safeProps = { ...props }; + super(props); this.initVar(); } initVar() { + this.numberOfSections = this.props.numberOfSections; + if (typeof this.numberOfSections !== "function") { + console.warn( + "LargeList warning: numberOfSections's prop type has changed to function, use 'numberOfSections={()=>100}' instead of 'numberOfSections={100}, number will not support after 2.0'." + ); + this.numberOfSections = () => this.props.numberOfSections; + } + this.enoughLoadMore = false; + this.loadingMore = false; + this.scrollingAfterDraging = false; this.safeArea = { top: 0, bottom: 0 }; this.topIndexPath = { section: 0, row: -2 }; this.bottomIndexPath = { section: 0, row: -2 }; this.contentSize = { width: 0, height: 0 }; this.lastScrollTime = 0; this.currentSection = 0; - this.keyForCreating = 0; this.minCellHeight = 40; this.minSectionHeight = 40; - this.native = Platform.OS === "ios" && this.props.nativeOptimize && TableView; - for (let i = 0; i < this.props.numberOfSections; ++i) { + this.native = + Platform.OS === "ios" && this.props.nativeOptimize && TableView; + for (let i = 0; i < this.numberOfSections(); ++i) { if ( this.minSectionHeight > this.props.heightForSection(i) && this.props.heightForSection(i) > 10 @@ -171,7 +211,7 @@ class LargeList extends React.Component { let row = 0; for ( section = 0; - section < this.props.numberOfSections && + section < this.numberOfSections() && sumHeight < this.size.height + this.props.safeMargin; ++section ) { @@ -235,7 +275,7 @@ class LargeList extends React.Component { bounces={false} contentContainerStyle={{ flex: 1 }} > - (this.scrollViewRef = ref)} bounces={this.props.bounces} refreshControl={ @@ -247,17 +287,23 @@ class LargeList extends React.Component { : null } contentContainerStyle={{ + justifyContent: "flex-end", alignSelf: "stretch", - height: this.contentSize.height + height: + this.contentSize.height + + (this.props.onLoadMore ? this.props.heightForLoadMore() : 0) }} onLayout={this._onLayout.bind(this)} style={{ flex: 1 }} scrollEventThrottle={this.props.scrollEventThrottle} onScroll={this._onScroll.bind(this)} - onMomentumScrollEnd={this._onMomentumScrollEnd.bind(this)} + onMomentumScrollEnd={this._onScrollEnd.bind(this)} showsVerticalScrollIndicator={ this.props.showsVerticalScrollIndicator } + llonTouchStart={this._onTouchStart.bind(this)} + llonTouchMove={this._onTouchMove.bind(this)} + llonTouchEnd={this._onTouchEnd.bind(this)} > {this.props.renderFooter()} - + {this.props.onLoadMore && + + {this.props.allLoadCompleted + ? this.props.renderLoadCompleted() + : this.props.renderLoadingMore()} + } + (this.currentSectionRef = reference)} - numberOfSections={this.props.numberOfSections} + numberOfSections={this.numberOfSections} /> @@ -319,7 +379,7 @@ class LargeList extends React.Component { ? this.props.heightForSection(section) : 0 }} - numberOfSections={this.props.numberOfSections} + numberOfSections={this.numberOfSections} section={section} renderSection={this.props.renderSection} /> @@ -347,24 +407,15 @@ class LargeList extends React.Component { }} renderCell={this.props.renderCell} indexPath={{ section: section, row: row }} - numberOfSections={this.props.numberOfSections} + numberOfSections={this.numberOfSections} numberOfRowsInSection={this.props.numberOfRowsInSection} /> ); } - _onMomentumScrollEnd() { - this.lastScrollTime = 0; - this._forceUpdate(); - } - _onScroll(e) { let offset: Offset = e.nativeEvent.contentOffset; let distance = Math.abs(offset.y - this.contentOffset.y); - // if (distance < this.minCellHeight) { - // this._exchangeSection(offset); - // return; - // } let now: number = new Date().getTime(); let speed: number = 0; let topMargin: number = this.props.safeMargin; @@ -409,11 +460,10 @@ class LargeList extends React.Component { lastIndexPath.section, lastIndexPath.row ); - this.props.onIndexPathDidLeaveSafeArea && - this.props.onIndexPathDidLeaveSafeArea({ - section: lastIndexPath.section, - row: lastIndexPath.row - }); + this.props.onIndexPathDidLeaveSafeArea({ + section: lastIndexPath.section, + row: lastIndexPath.row + }); } } @@ -445,7 +495,7 @@ class LargeList extends React.Component { let nextIndexPath = this._nextIndexPathWithIndexPath( this.bottomIndexPath ); - if (nextIndexPath.section >= this.props.numberOfSections) { + if (nextIndexPath.section >= this.numberOfSections()) { break; } this.bottomIndexPath = nextIndexPath; @@ -491,11 +541,10 @@ class LargeList extends React.Component { this.safeArea.bottom, nextHeight ); - this.props.onIndexPathDidEnterSafeArea && - this.props.onIndexPathDidEnterSafeArea({ - section: this.bottomIndexPath.section, - row: this.bottomIndexPath.row - }); + this.props.onIndexPathDidEnterSafeArea({ + section: this.bottomIndexPath.section, + row: this.bottomIndexPath.row + }); this.safeArea.bottom += nextHeight; } } @@ -524,11 +573,10 @@ class LargeList extends React.Component { lastIndexPath.section, lastIndexPath.row ); - this.props.onIndexPathDidLeaveSafeArea && - this.props.onIndexPathDidLeaveSafeArea({ - section: lastIndexPath.section, - row: lastIndexPath.row - }); + this.props.onIndexPathDidLeaveSafeArea({ + section: lastIndexPath.section, + row: lastIndexPath.row + }); } } @@ -611,11 +659,10 @@ class LargeList extends React.Component { this.safeArea.top, nextHeight ); - this.props.onIndexPathDidEnterSafeArea && - this.props.onIndexPathDidEnterSafeArea({ - section: this.topIndexPath.section, - row: this.topIndexPath.row - }); + this.props.onIndexPathDidEnterSafeArea({ + section: this.topIndexPath.section, + row: this.topIndexPath.row + }); } } } @@ -640,6 +687,31 @@ class LargeList extends React.Component { } this.contentOffset = offset; this.props.onScroll && this.props.onScroll(e); + //解决冲量结束无法回调的问题 + if ( + this.contentOffset.y >= + this.contentSize.height - + this.size.height + + this.props.heightForLoadMore() - + 1 + ) { + if (this.props.onLoadMore && !this.props.allLoadCompleted) + this.enoughLoadMore = true; + this._onScrollEnd(); + } + //禁止手动滑动到最下面 + if ( + !this.draging && + this.scrollingAfterDraging && + offset.y > this.contentSize.height - this.size.height && + offset.y < + this.contentSize.height - + this.size.height + + this.props.heightForLoadMore() + ) { + this.scrollingAfterDraging = false; + this.scrollToEnd(); + } } _exchangeSection(offset: Offset) { @@ -701,7 +773,10 @@ class LargeList extends React.Component { ); } } - if (offset.y < this.headerHeight || offset.y > this.contentSize.height-this.footerHeight) { + if ( + offset.y < this.headerHeight || + offset.y > this.contentSize.height - this.footerHeight + ) { this.currentSectionRef.updateToSection( this.currentSection, -10000, @@ -730,10 +805,10 @@ class LargeList extends React.Component { if (this.currentSectionRef.waitForRender) { this.currentSectionRef.forceUpdate(); } - this.freeRefs.forEach(item=>{ + this.freeRefs.forEach(item => { if (item.waitForRender) item.positionUpdate(); }); - this.freeSectionRefs.forEach(section=>{ + this.freeSectionRefs.forEach(section => { if (section.waitForRender) section.forceUpdate(); }); } @@ -741,9 +816,9 @@ class LargeList extends React.Component { this.workRefs.forEach(item => { if (item.waitForRender) item.positionUpdate(); }); - this.freeRefs.forEach(item=>{ + this.freeRefs.forEach(item => { if (item.waitForRender) item.positionUpdate(); - }) + }); } _onLayout(e) { @@ -825,6 +900,13 @@ class LargeList extends React.Component { scrollTo(offset: Offset, animated: boolean = true) { offset.animated = animated; + if (offset.y < 0) offset.y = 0; + if (offset.y > this.contentSize.height - this.size.height) + offset.y = this.contentSize.height - this.size.height; + if (!animated) { + this._onScroll({nativeEvent: {contentOffset: offset}}); + this._forceUpdate(); + } this.scrollViewRef.scrollTo(offset); } @@ -836,7 +918,7 @@ class LargeList extends React.Component { let sumHeight = this.headerHeight ? this.headerHeight : 0; sumHeight -= this.props.heightForSection(indexPath.section); sumHeight += 1; - for (let section = 0; section < this.props.numberOfSections; ++section) { + for (let section = 0; section < this.numberOfSections(); ++section) { sumHeight += this.props.heightForSection(section); for ( let row = 0; @@ -849,7 +931,6 @@ class LargeList extends React.Component { ) { if (sumHeight > this.contentSize.height - this.size.height) sumHeight = this.contentSize.height - this.size.height - 1; - if (sumHeight < 0) sumHeight = 0; this.scrollTo({ x: 0, y: sumHeight }, animated); return; } @@ -859,7 +940,10 @@ class LargeList extends React.Component { } scrollToEnd(animated: boolean = true) { - this.scrollViewRef.scrollToEnd({ animated: animated }); + this.scrollTo( + { x: 0, y: this.contentSize.height - this.size.height }, + animated + ); } reloadIndexPath(indexPath: IndexPath) { @@ -885,6 +969,9 @@ class LargeList extends React.Component { reloadData() { let offset = this.contentOffset; this.initVar(); + this.safeArea = { top: this.headerHeight, bottom: this.headerHeight }; + this.contentSize.height += this.headerHeight; + this.contentSize.height += this.footerHeight; this.workRefs.forEach(cell => { this.freeRefs.splice(0, 0, cell); }); @@ -892,8 +979,7 @@ class LargeList extends React.Component { cell.waitForRender = true; let index = this.workRefs.indexOf(cell); this.workRefs.splice(index, index > -1 ? 1 : 0); - cell.updateToIndexPath(cell.indexPath,-10000,cell.height); - // cell.positionUpdate(); + cell.updateToIndexPath(cell.indexPath, -10000, cell.height); }); this.workSectionRefs.forEach(section => { this.freeSectionRefs.splice(0, 0, section); @@ -901,13 +987,13 @@ class LargeList extends React.Component { this.freeSectionRefs.forEach(section => { let index = this.workSectionRefs.indexOf(section); this.workSectionRefs.splice(index, index > -1 ? 1 : 0); - section.updateToSection(section.section,-10000,section.height,false); - // section.po(); + section.updateToSection(section.section, -10000, section.height, false); }); this._onScroll({ nativeEvent: { contentOffset: offset } }); + this.forceUpdate(); } - visiableIndexPaths(): IndexPath[] { + visibleIndexPaths(): IndexPath[] { let indexPaths: IndexPath[] = []; this.workRefs.forEach(item => { if ( @@ -923,6 +1009,13 @@ class LargeList extends React.Component { return indexPaths; } + visiableIndexPaths(): IndexPath[] { + console.warn( + "LargeList Warning: visiableIndexPaths is deprecated, use visibleIndexPaths instead. visiableIndexPaths will not support after 2.0.0" + ); + this.visibleIndexPaths(); + } + renderedIndexPaths(): IndexPath[] { let indexPaths: IndexPath[] = []; this.workRefs.forEach(item => { @@ -937,6 +1030,60 @@ class LargeList extends React.Component { freeCount(): number { return this.freeRefs.length; } + + _onTouchStart() { + this.draging = true; + } + + _onTouchMove(offset) {} + + _onTouchEnd() { + this.draging = false; + if ( + this.contentOffset.y > this.contentSize.height - this.size.height && + this.contentOffset.y < + this.contentSize.height - + this.size.height + + this.props.heightForLoadMore() + ) { + this.scrollToEnd(); + return; + } + if ( + Platform.OS !== "ios" && + this.props.allLoadCompleted && + this.contentOffset.y >= this.contentSize.height - this.size.height + ) { + this.scrollToEnd(); + return; + } + this.scrollingAfterDraging = true; + } + + _onScrollEnd() { + this.lastScrollTime = 0; + if ( + this.scrollingAfterDraging && + this.props.allLoadCompleted && + this.contentOffset.y > this.contentSize.height - this.size.height + ) { + this.scrollToEnd(); + } + this.scrollingAfterDraging = false; + this._forceUpdate(); + if ( + this.enoughLoadMore && + !this.loadingMore && + !this.props.allLoadCompleted && + this.contentOffset.y >= + this.contentSize.height - + this.size.height + + this.props.heightForLoadMore() + ) { + this.loadingMore = true; + this.props.onLoadMore(); + } + } } export { LargeList }; diff --git a/react-native-largelist/largelist/LargeListCell.js b/react-native-largelist/largelist/LargeListCell.js index 370a6837..56909f87 100644 --- a/react-native-largelist/largelist/LargeListCell.js +++ b/react-native-largelist/largelist/LargeListCell.js @@ -21,7 +21,7 @@ class LargeListCell extends React.Component { renderCell: PropTypes.func, indexPath: PropTypes.object, numberOfRowsInSection: PropTypes.func, - numberOfSections: PropTypes.number + numberOfSections: PropTypes.func }; rootView: View; @@ -68,7 +68,7 @@ class LargeListCell extends React.Component { let show = this.top !== -10000 && section >= 0 && - section < this.props.numberOfSections && + section < this.props.numberOfSections() && row >= 0 && row < this.props.numberOfRowsInSection(section); return ( diff --git a/react-native-largelist/largelist/LargeListSection.js b/react-native-largelist/largelist/LargeListSection.js index 7fcb7ac3..97c4f102 100644 --- a/react-native-largelist/largelist/LargeListSection.js +++ b/react-native-largelist/largelist/LargeListSection.js @@ -18,7 +18,7 @@ interface IndexPath { class LargeListSection extends React.Component { static propTypes = { - numberOfSections: PropTypes.number, + numberOfSections: PropTypes.func, renderSection: PropTypes.func, section: PropTypes.number }; @@ -71,7 +71,8 @@ class LargeListSection extends React.Component { } render() { - let show = this.section>=0 && this.section=0 && this.top !== -10000; + let show = this.section>=0 && this.section (this.rootView = ref)} diff --git a/react-native-largelist/package.json b/react-native-largelist/package.json index ee662c25..89af0b43 100644 --- a/react-native-largelist/package.json +++ b/react-native-largelist/package.json @@ -1,6 +1,6 @@ { "name": "react-native-largelist", - "version": "1.0.0", + "version": "1.1.0", "private": false, "description": "A high performance large list component which is much better than SectionList for React Native.", "author": "bolan9999 ", diff --git a/samples/DataSource.js b/samples/DataSource.js index 29fb4ca3..8dfaeff3 100644 --- a/samples/DataSource.js +++ b/samples/DataSource.js @@ -153,1381 +153,1381 @@ let contacts = [ } ] }, - { - header: "C", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ckali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Cppqq", - phone: "13333333333" - } - ] - }, - { - header: "D", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Dppqq", - phone: "13333333333" - } - ] - }, - { - header: "E", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Epple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Epp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Eee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Eliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Emliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Enni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ekali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ell", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Eba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Eppqq", - phone: "13333333333" - } - ] - }, - { - header: "F", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Fppqq", - phone: "13333333333" - } - ] - }, - { - header: "G", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Gppqq", - phone: "13333333333" - } - ] - }, - { - header: "H", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Hppqq", - phone: "13333333333" - } - ] - }, - { - header: "I", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ipple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ipp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Iee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Iliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Imliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Inni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ikali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ill", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Iba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ippqq", - phone: "13333333333" - } - ] - }, - { - header: "J", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Jppqq", - phone: "13333333333" - } - ] - }, - { - header: "K", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Knni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Kppqq", - phone: "13333333333" - } - ] - }, - { - header: "L", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Lppqq", - phone: "13333333333" - } - ] - }, - { - header: "M", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Mppqq", - phone: "13333333333" - } - ] - }, - { - header: "N", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Npple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Npp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Nppqq", - phone: "13333333333" - } - ] - }, - { - header: "O", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Opple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Opp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Oee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Oliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Omliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Onni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Okali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Oll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Oba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Oppqq", - phone: "13333333333" - } - ] - }, - { - header: "P", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ppple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ppp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Pppqq", - phone: "13333333333" - } - ] - }, - { - header: "Q", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Qppqq", - phone: "13333333333" - } - ] - }, - { - header: "R", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ree", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Rppqq", - phone: "13333333333" - } - ] - }, - { - header: "S", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Spple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Spp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "See", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Sliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Smliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Snni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Skali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Sll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Sba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Sppqq", - phone: "13333333333" - } - ] - }, - { - header: "T", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Tppqq", - phone: "13333333333" - } - ] - }, - { - header: "U", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Upple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Upp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Uee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Uliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Umliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Unni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ukali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ull", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Uba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Uppqq", - phone: "13333333333" - } - ] - }, - { - header: "V", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Vppqq", - phone: "13333333333" - } - ] - }, - { - header: "W", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Wppqq", - phone: "13333333333" - } - ] - }, - { - header: "X", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xnni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Xppqq", - phone: "13333333333" - } - ] - }, - { - header: "Y", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ypple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ypp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Yee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Yliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ymliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ynni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Ykali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Yll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Yba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Yppqq", - phone: "13333333333" - } - ] - }, - { - header: "Z", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zpple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zpp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zliy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zmliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Znni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zkali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "Zppqq", - phone: "13333333333" - } - ] - }, - { - header: "#", - info: [ - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#pple", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#pp", - phone: "13333333443" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#ee", - phone: "13333333553" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#liy", - phone: "13336633333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#mliy", - phone: "13333333003" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#nni", - phone: "13123333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#kali", - phone: "13322333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#ll", - phone: "13333333333" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#ba", - phone: "13333333310" - }, - { - icon: iconArray[Math.floor(Math.random() * 11)], - name: "#ppqq", - phone: "13333333333" - } - ] - } + // { + // header: "C", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ckali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Cppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "D", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Dppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "E", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Epple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Epp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Eee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Eliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Emliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Enni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ekali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ell", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Eba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Eppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "F", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Fppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "G", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Gppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "H", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Hppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "I", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ipple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ipp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Iee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Iliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Imliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Inni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ikali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ill", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Iba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ippqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "J", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Jppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "K", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Knni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Kppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "L", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Lppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "M", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Mppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "N", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Npple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Npp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Nppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "O", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Opple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Opp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Oee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Oliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Omliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Onni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Okali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Oll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Oba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Oppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "P", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ppple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ppp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Pppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "Q", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Qppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "R", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ree", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Rppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "S", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Spple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Spp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "See", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Sliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Smliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Snni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Skali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Sll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Sba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Sppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "T", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Tppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "U", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Upple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Upp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Uee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Uliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Umliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Unni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ukali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ull", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Uba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Uppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "V", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Vppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "W", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Wppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "X", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xnni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Xppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "Y", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ypple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ypp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Yee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Yliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ymliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ynni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Ykali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Yll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Yba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Yppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "Z", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zpple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zpp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zliy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zmliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Znni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zkali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "Zppqq", + // phone: "13333333333" + // } + // ] + // }, + // { + // header: "#", + // info: [ + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#pple", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#pp", + // phone: "13333333443" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#ee", + // phone: "13333333553" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#liy", + // phone: "13336633333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#mliy", + // phone: "13333333003" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#nni", + // phone: "13123333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#kali", + // phone: "13322333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#ll", + // phone: "13333333333" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#ba", + // phone: "13333333310" + // }, + // { + // icon: iconArray[Math.floor(Math.random() * 11)], + // name: "#ppqq", + // phone: "13333333333" + // } + // ] + // } ]; let foods = [ diff --git a/samples/LargeListSample.js b/samples/LargeListSample.js index 8550f7cf..7de2c19a 100644 --- a/samples/LargeListSample.js +++ b/samples/LargeListSample.js @@ -46,7 +46,7 @@ class LargeListSample extends React.Component { { - this.largeList.scrollToIndexPath({section:1,row:50}); + this.largeList.scrollToIndexPath({section:1,row:50},false); }} > ScrollToEnd @@ -63,7 +63,7 @@ class LargeListSample extends React.Component { setTimeout(() => this.setState({ refreshing: false }), 2000); }} numberOfRowsInSection={section => this.props.numberOfEachSection} - numberOfSections={this.props.numberOfSections} + numberOfSections={()=>this.props.numberOfSections} heightForCell={(section, row) => row % 2 ? this.minCellHeight : this.maxCellHeight} renderCell={this.renderItem.bind(this)} diff --git a/samples/LargeListSample3.js b/samples/LargeListSample3.js index 8fc4c86b..73ca09c8 100644 --- a/samples/LargeListSample3.js +++ b/samples/LargeListSample3.js @@ -10,47 +10,60 @@ import React from "react"; import { View, Text, Image } from "react-native"; import { LargeList } from "../react-native-largelist"; -import { contacts } from "./DataSource"; +import { contacts as orgContracts } from "./DataSource"; import { iconObject } from "./icons"; class LargeListSample3 extends React.Component { + contracts; + loadComplete =false; constructor(props) { super(props); - this.state = {refreshing:false}; + this.contacts = orgContracts; + this.state = { refreshing: false, loadingMore: false }; } render() { return ( (this.root = ref)} style={this.props.style} - numberOfSections={contacts.length} - numberOfRowsInSection={section => contacts[section].info.length} + numberOfSections={()=>this.contacts.length} + numberOfRowsInSection={section => this.contacts[section].info.length} renderSection={this.renderSection.bind(this)} renderCell={this.renderItem.bind(this)} heightForSection={() => 40} heightForCell={() => 60} renderHeader={this.renderHeader.bind(this)} renderFooter={this.renderFooter.bind(this)} - onRefresh={()=>{ - this.setState({refreshing:true}); - setTimeout(()=>this.setState({refreshing:false}),2000); + onRefresh={() => { + this.setState({ refreshing: true }); + setTimeout(() => this.setState({ refreshing: false }), 2000); }} refreshing={this.state.refreshing} + onLoadMore={() => { + setTimeout(() => { + this.contacts = this.contacts.concat(orgContracts); + this.loadComplete = true; + this.forceUpdate(); + this.root.reloadData(); + }, 2000); + }} + allLoadCompleted={this.loadComplete} /> ); } renderSection(section: number) { - if (!contacts[section]){ - console.log("section is error",section); + if (!this.contacts[section]) { + console.log("section is error", section); } return ( - {contacts[section].header} + {this.contacts[section].header} ); @@ -70,18 +83,21 @@ class LargeListSample3 extends React.Component { - {contacts[section].info[row].name} + {this.contacts[section].info[row].name} - {contacts[section].info[row].phone} + {this.contacts[section].info[row].phone} - {(row < contacts[section].info.length - 1 || section===contacts.length-1) && - } + {(row < this.contacts[section].info.length - 1 || + section === this.contacts.length - 1) && + } ); } @@ -105,21 +121,27 @@ class LargeListSample3 extends React.Component { 本机号码 - 15555555555 + 15555555555 ); } - renderFooter(){ + renderFooter() { let count = 0; - contacts.forEach(item=>{ - item.info.forEach(()=>{ + this.contacts.forEach(item => { + item.info.forEach(() => { count++; }); }); - return - 共{count}位联系人 - + return ( + + + 共{count}位联系人 + + + ); } } diff --git a/samples/LargeListSample4.js b/samples/LargeListSample4.js index 22107df5..fbd2f6f0 100644 --- a/samples/LargeListSample4.js +++ b/samples/LargeListSample4.js @@ -47,7 +47,7 @@ class LargeListSample4 extends React.Component { (this.listRef = ref)} style={{ flex: 4 }} - numberOfSections={foods.length} + numberOfSections={()=>foods.length} numberOfRowsInSection={section => foods[section].list.length} heightForSection={() => 36} renderSection={this.renderSection.bind(this)} @@ -175,7 +175,7 @@ class LargeListSample4 extends React.Component { // this.indexes.reloadData(); let bFind = false; - this.indexes.visiableIndexPaths().forEach(indexPath=>{ + this.indexes.visibleIndexPaths().forEach(indexPath=>{ if (indexPath.row===section) { bFind = true; }