We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src/pages/index/index.tsx
import React from 'react'; import { View, Text } from '@tarojs/components'; import { LuckyGrid } from '@lucky-canvas/taro/react'; import './index.less'; export default class Index extends React.Component { constructor(props) { super(props); console.log(this); this.myLucky = React.createRef(); this.state = { blocks: [{ padding: '13px', background: '#617df2' }], prizes: [ { fonts: [{ text: '0', top: '10%' }], background: '#e9e8fe' }, { fonts: [{ text: '1', top: '10%' }], background: '#b8c5f2' }, { fonts: [{ text: '2', top: '10%' }], background: '#e9e8fe' }, { fonts: [{ text: '3', top: '10%' }], background: '#b8c5f2' }, { fonts: [{ text: '4', top: '10%' }], background: '#e9e8fe' }, { fonts: [{ text: '5', top: '10%' }], background: '#b8c5f2' }, ], buttons: [ { radius: '50px', background: '#617df2' }, { radius: '45px', background: '#afc8ff' }, { radius: '40px', background: '#869cfa', pointer: true, fonts: [{ text: '开始\n抽奖', top: '-20px' }] }, ], }; } componentWillMount() { } componentDidMount() { } componentWillUnmount() { } componentDidShow() { } componentDidHide() { } render() { const { blocks, prizes, buttons } = this.state; return ( <View className='index'> <Text>Hello world!</Text> <LuckyGrid ref={this.myLucky} width="300px" height="300px" blocks={blocks} prizes={prizes} buttons={buttons} onStart={() => { // 点击抽奖按钮会触发star回调 // 调用抽奖组件的play方法开始游戏 this.myLucky.current.play(); // 模拟调用接口异步抽奖 setTimeout(() => { // 假设后端返回的中奖索引是0 const index = 0; // 调用stop停止旋转并传递中奖索引 this.myLucky.current.stop(index); }, 2500); }} onEnd={prize => { // 抽奖结束会触发end回调 console.log(prize); }} /> </View> ); } }
The text was updated successfully, but these errors were encountered:
??? 什么情况
Sorry, something went wrong.
你这配置项也不是九宫格的配置啊, 这不是大转盘的配置吗???
我配置错了😭,所以关闭了。。。
No branches or pull requests
src/pages/index/index.tsx
文件下加入以下代码The text was updated successfully, but these errors were encountered: