适用于活动抽奖等需求
# 何时使用
import { HiDrawlottery } from 'hi-kits/drawlottery'
1
# 基本用法
通过onclick
事件设置转盘的奖品索引及是否开始抽奖。
Copy
# 自定义转盘方块
通过 prizeListStyle
配置转盘方块的样式
Copy
# 自定义转盘控制按钮
通过 lotteryInfo
配置转盘中心控制按钮文字及描述,lotteryTextStyle
配置按钮文字的样式, lotteryDecStyle
配置描述文字的样式,lotteryWarpStyle
配置控制按钮的样式
Copy
# 自定义配置
可设置奖品方块内容
Copy
# 参数说明
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
gutter | 每个奖品块的间距 | number | - | - |
lotteryInfo | 抽奖按钮信息 | string | - | - |
lotteryDecStyle | 抽奖按钮描述文本样式信息 | string | - | `` |
lotteryTextStyle | 抽奖按钮文字样式信息 | string | - | `` |
lotteryWarpStyle | 抽奖按钮整体样式信息 | string | - | `` |
prizeListStyle | 奖品按钮样式信息 | string | - | `` |
start | 是否开始抽奖 | boolean | - | - |
index | 奖品索引 | number | - | - |
prizeOptionList | 父级传入的奖品列表 | Array[] | - | - |
onclick | 点击抽奖时触发的回调函数 | Function | - | - |
onlottchange | 开始抽奖的回调 | Function | - | - |
prizeOptionList
: 自定义转盘抽奖数据,格式如下
prizeOptionList: [{
prizeImg: 'https://ys-zjrs.haier.net/image/logo(1).svg', // 图片地址
prizeQuota: '88', // 奖品说明
background: '#dee', // 转盘背景颜色
index: 0, // 索引
prizeName: '0088海贝' // 奖品名称
},...]
1
2
3
4
5
6
7
2
3
4
5
6
7