Polyv Help Center

Help Center

Lucky Draw

Updated: 2022-03-23 17:51:24

Unconditional Lucky Draw

Feature Overview

Allows configuration of prizes, number of winners, and winner selection before the draw begins. Once configured, the draw can be started.

  • Only lecturers, guests, teaching assistants, and administrators can initiate and stop the draw.
  • Supports custom configuration of winner information collection fields.
  • Supports setting preset winners.
  • Supports scheduled draw activation.
  • Allows viewing the list of winners.

Conditional Lucky Draw

Feature Overview

Building on the unconditional lucky draw, this adds draw conditions. Only viewers who meet the preset conditions can participate in the draw.

  • This feature requires presetting the lucky draw activity in the live streaming backend before initiation.
  • Currently supported condition types: Invite friends (additional conditions to be added: watch duration, follow, specific comments).

Code Example

Note: Global initialization must be completed before proceeding with the following steps. Refer to the documentation.

Basic Flow

const app = new LotteryNew();

// 订阅事件监听。
app
  // 条件抽奖状态开始。
  .on('handleConditionLotteryStart', () => {})
  // 条件抽奖状态结束。
  .on('handleConditionLotteryEnd', () => {})

// 开始抽奖前。

// 获取可参与抽奖的在线人数。
app.checkedUserCount(lotteryRange);
// 获取中奖人信息收集配置。
app.getCollectInfo();

// 查询后台预设的抽奖活动列表。
app.searchLotteryCardList(pageNumber);

// 发起抽奖。
app.lotteryStart(lotteryStartParams);

// 获取当前条件抽奖和无条件抽奖状态。
app.getLotteryStatus();

// 查询已发起抽奖活动列表
app.searchLotteryCardList(pageNumber)

// 取消定时抽奖。
app.lotteryCancel(lotteryId);

// 结束抽奖。
app.lotteryEnd(lotteryId);

// 无条件抽奖需要二次结束。
app.lotteryFinish();

// 获取中奖名单。
app.getWinnersList(page, lotteryId);
联系客服,在线咨询
在线咨询