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