Skip to content

魔方 ​

把图片格按声明式布局组合,并支持按星期和时间段投放覆盖图片。

完整信封 ​

ts
{
    component: 'v2.magiccube', text: '魔方', type: '3-11', active: true,
    props: {
        layout: 'row', columns: 4,
        style: { pageMargin: 0, gap: 0, radius: 0, height: 188, backgroundColor: '#FFFFFF' },
        play: { interval: 3 },
        cells: [{ src: 'https://example.com/a.png', link: { httpType: 10, http: '/pages/a' }, schedules: [] }]
    }
}

Props ​

字段类型默认值说明
layoutMagicCubeLayout'row'布局模板
columns1..64row 模式列数
style.pageMargin/gap/radius/heightnumber0/0/0/188rpx 尺寸
style.backgroundColorstring'#FFFFFF'背景色
play.intervalnumber3多图轮换间隔,秒
cellsMagicCubeCell[][]图片格列表
cells[].src/linkstring / CmsV2Link-默认图片与链接
cells[].schedulesMagicCubeSchedule[][]定时覆盖
schedules[].weeksnumber[][]星期 1–7
schedules[].startTime/endTimestring''HH:mm 时间段

MagicCubeLayout 可选 row、grid2x2、left1right2、top1bottom2、left1right3、left2right1、left3right1。定时项还包含自己的 src 和 link。跳转依赖 link service。

为 uni-app 商城与 CMS 场景设计