Browse Source

功能迁移

master
左文祺 8 years ago
parent
commit
ddcecad15d
  1. 28
      src/static/js/index.js

28
src/static/js/index.js

@ -62,7 +62,7 @@ class Tag{
let html = [ '<ul>' ]; let html = [ '<ul>' ];
$(this.entries).each((i, val) => { $(this.entries).each((i, val) => {
let color = (val.role===2||val.role===3)? 'yellow' : 'white'; let color = (val.role===2||val.role===3)? 'yellow' : 'white';
html.push(`<li><a href="javascript:void(0)" style="color: ${color};" data-uid="${val.uid}" data-role="${val.role}">${val.name}</a></li>`); html.push(`<li><a href="javascript:void(0)" style="color: ${color};" data-uid="${val.uid}" data-role="${val.name}">${val.uid}</a></li>`);
// html.push(`<li><a href="#" style="color:${color};">' + item.name + '</a></li>`); // html.push(`<li><a href="#" style="color:${color};">' + item.name + '</a></li>`);
}); });
html.push('</ul>'); html.push('</ul>');
@ -91,7 +91,6 @@ class Tag{
stop(){ stop(){
TagCanvas.SetSpeed('myCanvas', Tag.speed()); TagCanvas.SetSpeed('myCanvas', Tag.speed());
TagCanvas.Reload('myCanvas'); TagCanvas.Reload('myCanvas');
} }
} }
class Index { class Index {
@ -216,19 +215,23 @@ class Index {
this.running = false; this.running = false;
console.log(resp); console.log(resp);
if (resp.status === 200) { if (resp.status === 200) {
this.svg3DTagCloud.stop(); this.stopLottery(resp.data);
this.render(resp.data, 0);
} }
}); });
}); });
$(document).on('click',function () {
$('#result').hide();
$('.holder').removeClass('mask');
});
$('#luckyUsers').click(() => { $('#luckyUsers').click(() => {
this.list(); this.list();
}); });
} }
tips(){ stopLottery(data){
this.svg3DTagCloud.stop();
this.currentlist(data);
} }
render(data, i) { render(data, i) {
@ -283,21 +286,10 @@ class Index {
DOM += `<span>${user.name}<br>${user.uid}</span>`; DOM += `<span>${user.name}<br>${user.uid}</span>`;
} }
DOM += ``; DOM += ``;
$('#result').css('display', 'block').html(DOM); $('#result').show().html(DOM);
setTimeout(function(){ setTimeout(function(){
$('.holder').addClass('mask'); $('.holder').addClass('mask');
}, 300); }, 300);
/* layer.open({
type: 1,
area: '800px',
skin: 'layui-layer-lan', //样式类名
offset: [offset.top, offset.left],
closeBtn: 1, //不显示关闭按钮
anim: 3,
title: '本次中奖名单',
shadeClose: false, //开启遮罩关闭
content: `<div class="luckerList">${DOM}</div>`
});*/
} }
list() { list() {

Loading…
Cancel
Save