报名抽奖

功能概述

本模块主要处理报名抽奖相关逻辑,如抽奖开始、结束和更新等事件消息。

初始化及销毁

在实例化该模块并进行使用之前,需要对SDK进行初始化配置,详细见参考文档

在线文件引入方式

// 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 方式引入(推荐)

import { EnrollLottery } from '@polyv/interactions-receive-sdk';

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

使用流程

监听 “报名抽奖” 事件

// 更新抽奖信息事件
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);
});

Last updated