Skip to content

large-list

属性

属性类型必填说明默认值
*initParamobject初始化配置信息
initFocusPositionint默认焦点位置/设置焦点位置0
displayboolean控制组件是否展示false
useCustomViewboolean是否使用自定义item(即将支持)false

initParam object属性说明:

属性类型必填说明默认值
totalCountint总集数
pageSizeint每次拉取数据个数
contentWidthint横向列表内容宽度
contentHeightint横向列表内容高度
scrollTypeint滚动方式:目前只支持0、1(具体效果见教程)0
marginLeftint横向列表距离父容器的左间距-1
itemGapint横向item间距10
paddingForPageLeftintscrollType为1时生效:横向列表内部左间距(不影响内容宽度)20
paddingForPageRightintscrollType为1时生效:横向列表内部右间距(不影响内容宽度)20
arrowWidthintscrollType为1时生效:箭头宽度24
arrowHeightintscrollType为1时生效:箭头高度42
arrowMarginLeftintscrollType为1时生效:左箭头左间距45
arrowMarginRightintscrollType为1时生效:右箭头右间距45
enableGroupboolean是否展示快速选集功能true
groupSizeint快速选集每页个数(注意:目前无论快速选集展示与否,都必须传值)
groupHeightint快速选集列表高度
groupTopMarginint快速选集列表和主列表间距0
*groupobject快速选集列表的配置信息
*templateobject主选集列表的配置信息,使用自定义item时可忽略

initParam-group object属性说明:

属性类型必填说明默认值
itemWidthint快速选集item宽度--暂时无效
itemHeightint快速选集item高度--暂时无效
itemGapint快速选集item间距50
textSizeint快速选集item字体大小15
*textColorobject快速选集item字体颜色 默认/获取焦点/选中
*focusBackgroundobject快速选集item获取焦点时的背景配置
*markobject快速选集item选中标识配置
  • initParam-group object下级object属性说明
    • textColor{ normal: "", focused: """, selected: ""}
      • normalcolor---文字常态色值
      • focusedcolor---文字获取焦点时色值
      • selectedcolor---文字被选中时色值
    • focusBackground{orientation: "",cornerRadius: [],color: [],padding: []}
      • orientation:同下文 orientation
      • cornerRadius:同下文cornerRadius
      • color:同下文color
      • padding:选中背景宽和高,eg:[34,6]
    • mark{color:"",width:36,height:6,corner: 4,margin: 5,}
      • colorcolor--标识色值
      • widthint--标识宽
      • heightint--标识高
      • cornerint--标识圆角角度
      • marginint--标识父间距

initParam-template object属性说明

属性类型必填说明默认值
typestringitem样式,取值:number / leftRight / topDown / text / custom
widthintitem宽度
heightintitem高度
titleSizeintitem文字大小
floatTitleSizeint浮动标题字体大小
cornerTitleSizeint角标字体大小20
enablePlayIconboolean暂时未处理
isFreeboolean是否是vip true:否, false: 是false
focusScalefloatitem获取焦点方法倍数1.1
extraobject一些额外信息的配置
initParam-template-extra object属性说明
属性类型必填说明默认值
titleLinesinttype为text时生效:文字最大行数Integer.MAX_VALUE
imgWidthintitem图片的宽度item的宽度
imgHeightintitem图片的高度item的高度
*textColorobject标题文字颜色
*cornerBgColorobject角标背景色
cornerTextColorcolor角标字体颜色#ffffff
*numberFocusBgobjecttype为numbertext时的背景色
*topDownFocusBgobjecttype为topDown 时,获取焦点背景色
hideRipperboolean是否隐藏水波纹false
  • initParam-template-extra object下级object属性说明
    • textColor{ normal: "", focused: """, selected: ""}
      • normalcolor---文字常态色值
      • focusedcolor---文字获取焦点时色值
      • selectedcolor---文字被选中时色值
    • cornerBgColor{orientation: '',cornerRadius: [],color: []}
      • orientation--颜色渐变方向,可选值:
        • TOP_BOTTOM:从上到下
        • TR_BL:从右上到左下
        • RIGHT_LEFT:从右向左
        • BR_TL:从右下到左上
        • BOTTOM_TOP:从下到上
        • BL_TR:从左下到右上
        • LEFT_RIGHT:从左到右
        • TL_BR:从左上到右下
      • cornerRadiusarray 圆角度数--[左上,右上,右下,左下],eg:[6,6,6,6]
      • colorarray 渐变色值,eg:["#B67827", "#DBAF5C"]
    • numberFocusBg{orientation: '',cornerRadius: [],color: [],focused: []}
      • orientation:同cornerBgColor-orientation
      • cornerRadius:同cornerBgColor-cornerRadius
      • color:同cornerBgColor-color
      • focusedarray 获取焦点时渐变色值,eg:["#B67827", "#DBAF5C"]
    • topDownFocusBg:同cornerBgColor

方法

setPageData(page,array)

设置某一页的数据;

参数名类型说明
pageint分页获取选集数据,第几页
arrayarray列表数据

requestChildFocus(pos)

item主动请求获取焦点

参数名类型说明
posint请求焦点item位置

setSelectChildPosition(pos)

选中item;

参数名类型说明
posint选中的item的位置

scrollToPositionWithOffset(pos,offset,anim)

滚动到指定位置,加偏移量

参数名类型说明
posint需要滚动到的item位置
offsetint偏移量
animboolean暂时没用

scrollToPosition(pos)

滚动到指定位置

参数名类型说明
posint需要滚动到的item位置

setup()

组件重新渲染

setGroupChildSelectByItemPosition(pos)

通过选集item位置滚动到指定group

参数名类型说明
posintitem在总集数中的位置

destroy()

页面销毁,释放资源

getEsInfo()

获取native容器基本信息

事件

  • 注意:事件回调方法参数都由event对象封装,下文列出的均为event对象内的属性

load-data

加载数据回调接口,通知前端获取某页数据。应该在该方法中拉取服务端数据,并调用setPageData方法传到native层

参数名类型说明
pageint需要拉取数据的页数

item-focused

选集列表item获取焦点事件

参数名类型说明
positionint获取焦点item的位置

item-click

选集列表item点击事件

参数名类型说明
positionint被点击item的位置
dataobject该item数据

group-item-focused

快速选集列表item获取焦点事件

参数名类型说明
positionint获取焦点item的位置