Polyv Help Center

Help Center

Registration Lottery

Updated: 2024-04-22 19:18:32

Feature Overview

This module primarily handles logic related to registration lotteries, such as event messages for lottery start, end, and updates.

Initialization and Destruction

Before instantiating and using this module, the SDK must be initialized and configured. For details, see the reference documentation.

Online File Import Method

// script 标签引入,根据版本号引入JS版本。
<script src="https://websdk.videocc.net/interactions-receive-sdk/0.24.0/lib/polyv-ir.umd.js"></script>

<script>
    const { EnrollLottery } = window.PolyvIRSDK;
</script>
import { EnrollLottery } from '@polyv/interactions-receive-sdk';

const enrollLotterySdk = new EnrollLottery();
// ...
// 销毁 SDK 实例,清除逻辑
enrollLotterySdk.destroy();

Usage Flow

Listening to the "Registration Lottery" Event

// 更新抽奖信息事件
this.enrollLotterySdk.on(this.enrollLotterySdk.events.UpdateLotteryDetail, (msg) => {
    console.log('收到更新抽奖信息消息', msg);
});
this.enrollLotterySdk.on(this.enrollLotterySdk.events.StartLotteryForSignUp, (msg) => {
    console.log('收到开始抽奖事件', msg);
});
this.enrollLotterySdk.on(this.enrollLotterySdk.events.EndLotteryForSignUp, (msg) => {
    console.log('收到结束抽奖事件', msg);
});
联系客服,在线咨询
在线咨询