Appearance
large-list
属性
| 属性 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
| *initParam | object | 是 | 初始化配置信息 | 无 |
| initFocusPosition | int | 否 | 默认焦点位置/设置焦点位置 | 0 |
| display | boolean | 否 | 控制组件是否展示 | false |
| useCustomView | boolean | 否 | 是否使用自定义item(即将支持) | false |
initParam object属性说明:
| 属性 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
| totalCount | int | 是 | 总集数 | 无 |
| pageSize | int | 是 | 每次拉取数据个数 | 无 |
| contentWidth | int | 是 | 横向列表内容宽度 | 无 |
| contentHeight | int | 是 | 横向列表内容高度 | 无 |
| scrollType | int | 否 | 滚动方式:目前只支持0、1(具体效果见教程) | 0 |
| marginLeft | int | 否 | 横向列表距离父容器的左间距 | -1 |
| itemGap | int | 否 | 横向item间距 | 10 |
| paddingForPageLeft | int | 否 | scrollType为1时生效:横向列表内部左间距(不影响内容宽度) | 20 |
| paddingForPageRight | int | 否 | scrollType为1时生效:横向列表内部右间距(不影响内容宽度) | 20 |
| arrowWidth | int | 否 | scrollType为1时生效:箭头宽度 | 24 |
| arrowHeight | int | 否 | scrollType为1时生效:箭头高度 | 42 |
| arrowMarginLeft | int | 否 | scrollType为1时生效:左箭头左间距 | 45 |
| arrowMarginRight | int | 否 | scrollType为1时生效:右箭头右间距 | 45 |
| enableGroup | boolean | 否 | 是否展示快速选集功能 | true |
| groupSize | int | 是 | 快速选集每页个数(注意:目前无论快速选集展示与否,都必须传值) | 无 |
| groupHeight | int | 是 | 快速选集列表高度 | 无 |
| groupTopMargin | int | 否 | 快速选集列表和主列表间距 | 0 |
| *group | object | 是 | 快速选集列表的配置信息 | 无 |
| *template | object | 是 | 主选集列表的配置信息,使用自定义item时可忽略 | 无 |
initParam-group object属性说明:
| 属性 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
| itemWidth | int | 是 | 快速选集item宽度--暂时无效 | 无 |
| itemHeight | int | 是 | 快速选集item高度--暂时无效 | 无 |
| itemGap | int | 否 | 快速选集item间距 | 50 |
| textSize | int | 否 | 快速选集item字体大小 | 15 |
| *textColor | object | 是 | 快速选集item字体颜色 默认/获取焦点/选中 | 无 |
| *focusBackground | object | 是 | 快速选集item获取焦点时的背景配置 | 无 |
| *mark | object | 否 | 快速选集item选中标识配置 |
initParam-group object下级object属性说明textColor:{ normal: "", focused: """, selected: ""}normal:color---文字常态色值focused:color---文字获取焦点时色值selected:color---文字被选中时色值
focusBackground:{orientation: "",cornerRadius: [],color: [],padding: []}orientation:同下文orientationcornerRadius:同下文cornerRadiuscolor:同下文colorpadding:选中背景宽和高,eg:[34,6]
mark:{color:"",width:36,height:6,corner: 4,margin: 5,}color:color--标识色值width:int--标识宽height:int--标识高corner:int--标识圆角角度margin:int--标识父间距
initParam-template object属性说明
| 属性 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
| type | string | 是 | item样式,取值:number / leftRight / topDown / text / custom | 无 |
| width | int | 是 | item宽度 | 无 |
| height | int | 是 | item高度 | 无 |
| titleSize | int | 是 | item文字大小 | 无 |
| floatTitleSize | int | 否 | 浮动标题字体大小 | |
| cornerTitleSize | int | 否 | 角标字体大小 | 20 |
| enablePlayIcon | boolean | 暂时未处理 | ||
| isFree | boolean | 否 | 是否是vip true:否, false: 是 | false |
| focusScale | float | 否 | item获取焦点方法倍数 | 1.1 |
| extra | object | 否 | 一些额外信息的配置 |
initParam-template-extra object属性说明
| 属性 | 类型 | 必填 | 说明 | 默认值 |
|---|---|---|---|---|
| titleLines | int | 否 | type为text时生效:文字最大行数 | Integer.MAX_VALUE |
| imgWidth | int | 否 | item图片的宽度 | item的宽度 |
| imgHeight | int | 否 | item图片的高度 | item的高度 |
| *textColor | object | 否 | 标题文字颜色 | |
| *cornerBgColor | object | 否 | 角标背景色 | |
| cornerTextColor | color | 否 | 角标字体颜色 | #ffffff |
| *numberFocusBg | object | 否 | type为number或text时的背景色 | |
| *topDownFocusBg | object | 否 | type为topDown 时,获取焦点背景色 | |
| hideRipper | boolean | 否 | 是否隐藏水波纹 | false |
initParam-template-extra object下级object属性说明textColor:{ normal: "", focused: """, selected: ""}normal:color---文字常态色值focused:color---文字获取焦点时色值selected:color---文字被选中时色值
cornerBgColor:{orientation: '',cornerRadius: [],color: []}orientation--颜色渐变方向,可选值:TOP_BOTTOM:从上到下TR_BL:从右上到左下RIGHT_LEFT:从右向左BR_TL:从右下到左上BOTTOM_TOP:从下到上BL_TR:从左下到右上LEFT_RIGHT:从左到右TL_BR:从左上到右下
cornerRadius:array圆角度数--[左上,右上,右下,左下],eg:[6,6,6,6]color:array渐变色值,eg:["#B67827", "#DBAF5C"]
numberFocusBg:{orientation: '',cornerRadius: [],color: [],focused: []}orientation:同cornerBgColor-orientationcornerRadius:同cornerBgColor-cornerRadiuscolor:同cornerBgColor-colorfocused:array获取焦点时渐变色值,eg:["#B67827", "#DBAF5C"]
topDownFocusBg:同cornerBgColor
方法
setPageData(page,array)
设置某一页的数据;
| 参数名 | 类型 | 说明 |
|---|---|---|
| page | int | 分页获取选集数据,第几页 |
| array | array | 列表数据 |
requestChildFocus(pos)
item主动请求获取焦点;
| 参数名 | 类型 | 说明 |
|---|---|---|
| pos | int | 请求焦点item位置 |
setSelectChildPosition(pos)
选中item;
| 参数名 | 类型 | 说明 |
|---|---|---|
| pos | int | 选中的item的位置 |
scrollToPositionWithOffset(pos,offset,anim)
滚动到指定位置,加偏移量
| 参数名 | 类型 | 说明 |
|---|---|---|
| pos | int | 需要滚动到的item位置 |
| offset | int | 偏移量 |
| anim | boolean | 暂时没用 |
scrollToPosition(pos)
滚动到指定位置
| 参数名 | 类型 | 说明 |
|---|---|---|
| pos | int | 需要滚动到的item位置 |
setup()
组件重新渲染
setGroupChildSelectByItemPosition(pos)
通过选集item位置滚动到指定group
| 参数名 | 类型 | 说明 |
|---|---|---|
| pos | int | item在总集数中的位置 |
destroy()
页面销毁,释放资源
getEsInfo()
获取native容器基本信息
事件
- 注意:事件回调方法参数都由
event对象封装,下文列出的均为event对象内的属性
load-data
加载数据回调接口,通知前端获取某页数据。应该在该方法中拉取服务端数据,并调用setPageData方法传到native层
| 参数名 | 类型 | 说明 |
|---|---|---|
| page | int | 需要拉取数据的页数 |
item-focused
选集列表item获取焦点事件
| 参数名 | 类型 | 说明 |
|---|---|---|
| position | int | 获取焦点item的位置 |
item-click
选集列表item点击事件
| 参数名 | 类型 | 说明 |
|---|---|---|
| position | int | 被点击item的位置 |
| data | object | 该item数据 |
group-item-focused
快速选集列表item获取焦点事件
| 参数名 | 类型 | 说明 |
|---|---|---|
| position | int | 获取焦点item的位置 |