中秋节快到,有没有抽奖源码分享?

2017-09-29 00:53:25 +08:00
 Yingc

最近公司筹划抽奖活动,希望通过网页形式实现。 员工通过简单登记,并且去抽奖,带后台方便记录中奖者信息。 不要微信的,单纯 web。

2744 次点击
所在节点    问与答
6 条回复
Nathanzheng
2017-09-29 03:12:07 +08:00
员工发个号,随便找个随机摇号网站,bingo !
Perry
2017-09-29 07:05:09 +08:00
psirnull
2017-09-29 09:44:38 +08:00
公司想借机开除几个抢月饼的程序员
justfindu
2017-09-29 09:51:49 +08:00
function random(){
return 'Yingc';
}
lifesimple
2017-09-29 10:13:03 +08:00
let ids = []; // 输入员工工号
for(let i = 0;i < 100;i++) {
ids.push(`id-${i}`)
}
let maxIndex = ids.length; // 总数
let awardCount = 10; // 中奖数
let awardNos = []; // 获奖序号
while(awardNos.length < awardCount) {
let index = Math.floor(Math.random()*maxIndex);
if(awardNos.indexOf(index) == -1) {
awardNos.push(index);
console.log(ids[index]); // 输出中奖员工工号
}
}
hgc81538
2017-09-29 11:04:37 +08:00
5 分钟现场撸代码——谈总结会抽奖程序
https://75team.com/post/luckey-draw-in-5-minutes.html

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/394486

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX