01 / Overview
cu-shop-quick-enter
首页顶部的宫格快捷入口:按 `columns × rows` 切屏,可滑动切换或横向平铺滚动,入口图标支持空图占位与角标。点击抛出入口数据与全局下标,跳转由使用方决定。
商品与导购
13 条 props
1 事件
已实现
02 / Demo
实时预览
演示页:/pages/shop/quick-enter。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。
依赖
- 基础件:无(多屏用平台原生
<swiper>/<scroll-view>) - Shop 共享件:无
- 实体:
ShopQuickEnterItem(字段见docs/01-交付与接入/电商数据字典.md)
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| columns | 每行入口数 | number | 5 |
| rows | 每屏行数 | number | 2 |
| data | 入口数据;元素按 title / iconUrl / badge / url 读取 | Array | [] |
| slideMode | 多屏方式:swiper(分屏滑动)/ slide(横向平铺滚动) | string | 'swiper' |
| iconWidth | 图标宽(px 语义,内部 ×2 落 rpx) | number | 30 |
| iconHeight | 图标高(px 语义,内部 ×2 落 rpx) | number | 30 |
| indicatorVisible | 是否显示指示点(仅 swiper 档) | boolean | false |
| indicatorBgColor | 指示点颜色 | string | 'rgba(0, 0, 0, 0.2)' |
| indicatorActiveColor | 当前指示点颜色 | string | '#fa2c19' |
| customStyle | 根节点自定义样式 | Object | {} |
| customClass | 根节点自定义类名 | string | '' |
| url | 透传字段,本件未接线 | string | '' |
| linkType | 透传字段,本件未接线 | string | 'navigateTo' |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @click | 入口点击;index 为跨屏全局下标 | { item, index } |
slots
| 插槽 | 作用域 | 说明 |
|---|---|---|
| icon | `{ item, index }` | 替换入口图标,优先于 item.iconUrl |
04 / Example
代码示例
<cu-shop-quick-enter
:data="items"
:columns="4"
:rows="1"
:indicatorVisible="true"
@click="onClick"
/>
05 / Notes
注意事项
仅 swiper 档显示指示点,走平台原生 indicator-* 属性;slide 档不显示指示器
iconUrl 为空串时渲染占位块,不引图标字体、不写图片资源
不请求接口、不持久化,分屏只按 columns × rows 对 data 切片
不处理跳转:入口的 url 字段原样随 item 抛出,导航动作由使用方实现
不做懒加载与增量请求,data 一次性传入
安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。