|
|
|
|
@ -1,118 +1,19 @@
@@ -1,118 +1,19 @@
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
/* var running; |
|
|
|
|
|
|
|
|
|
var settings = { |
|
|
|
|
entries: entries, |
|
|
|
|
width: 800, |
|
|
|
|
height: 600, |
|
|
|
|
radius: '65%', |
|
|
|
|
radiusMin: 75, |
|
|
|
|
bgDraw: true, |
|
|
|
|
bgColor: 'none', |
|
|
|
|
opacityOver: 0.90, |
|
|
|
|
opacityOut: 0.05, |
|
|
|
|
opacitySpeed: 1, |
|
|
|
|
fov: 500, |
|
|
|
|
speed: 1, |
|
|
|
|
fontFamily: 'Oswald, Arial, sans-serif', |
|
|
|
|
fontSize: '15', |
|
|
|
|
hoverFontSize: '55', |
|
|
|
|
fontColor: '#fff', |
|
|
|
|
fontWeight: 'normal',//bold
|
|
|
|
|
fontStyle: 'normal',//italic
|
|
|
|
|
fontStretch: 'wider',//wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded
|
|
|
|
|
fontToUpperCase: true, |
|
|
|
|
// tooltipFontFamily: 'Oswald, Arial, sans-serif',
|
|
|
|
|
// tooltipFontSize: '11',
|
|
|
|
|
// tooltipFontColor: '#fff',
|
|
|
|
|
// tooltipFontWeight: 'normal',//bold
|
|
|
|
|
// tooltipFontStyle: 'normal',//italic
|
|
|
|
|
// tooltipFontStretch: 'normal',//wider, narrower, ultra-condensed, extra-condensed, condensed, semi-condensed, semi-expanded, expanded, extra-expanded, ultra-expanded
|
|
|
|
|
// tooltipFontToUpperCase: false,
|
|
|
|
|
// tooltipTextAnchor: 'left',
|
|
|
|
|
// tooltipDiffX: 0,
|
|
|
|
|
// tooltipDiffY: 10
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var svg3DTagCloud = new SVG3DTagCloud(document.getElementById('holder'), settings);*/ |
|
|
|
|
|
|
|
|
|
/* $('#start').click(function () { |
|
|
|
|
if (running) { |
|
|
|
|
alert('正在抽奖'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
svg3DTagCloud.speed(6); |
|
|
|
|
running = true; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
$('#end').click(function () { |
|
|
|
|
stop(); |
|
|
|
|
render(1); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#test').click(function () { |
|
|
|
|
list(); |
|
|
|
|
});*/ |
|
|
|
|
|
|
|
|
|
// $( '#holder' ).svg3DTagCloud( settings );
|
|
|
|
|
/* function render(i) { |
|
|
|
|
console.log(i); |
|
|
|
|
if (i === 5) { |
|
|
|
|
setTimeout(function () { |
|
|
|
|
list(); |
|
|
|
|
stop(); |
|
|
|
|
}, 1000); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
setTimeout(function () { |
|
|
|
|
stop(); |
|
|
|
|
setTimeout(function () { |
|
|
|
|
chose(i); |
|
|
|
|
render(++i); |
|
|
|
|
}, 500) |
|
|
|
|
}, 2500) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function stop() { |
|
|
|
|
running = false; |
|
|
|
|
svg3DTagCloud.reset(); |
|
|
|
|
svg3DTagCloud.speed(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function chose(i) { |
|
|
|
|
svg3DTagCloud.chose([{ |
|
|
|
|
index: i |
|
|
|
|
}]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function list() { |
|
|
|
|
var offset = $(".holder").offset(); |
|
|
|
|
layer.open({ |
|
|
|
|
type: 1, |
|
|
|
|
area: '800px', |
|
|
|
|
offset: [offset.top, offset.left], |
|
|
|
|
closeBtn: 1, //不显示关闭按钮
|
|
|
|
|
anim: 3, |
|
|
|
|
title: '中奖名单', |
|
|
|
|
shadeClose: false, //开启遮罩关闭
|
|
|
|
|
content: '<div class="luckerList"><ul><li>1111</li><li>111</li><li>2222</li></ul></div>' |
|
|
|
|
}); |
|
|
|
|
}*/ |
|
|
|
|
new UI(); |
|
|
|
|
}); |
|
|
|
|
class BS{ |
|
|
|
|
constructor(){ |
|
|
|
|
|
|
|
|
|
class BS { |
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
static fetch(url,data,type){ |
|
|
|
|
return new Promise((resolve)=>{ |
|
|
|
|
|
|
|
|
|
static fetch(url, data, type) { |
|
|
|
|
return new Promise((resolve) => { |
|
|
|
|
$.ajax({ |
|
|
|
|
type:type?type:'GET', |
|
|
|
|
data:data?data:{}, |
|
|
|
|
type: type ? type : 'GET', |
|
|
|
|
data: data ? data : {}, |
|
|
|
|
url, |
|
|
|
|
success(resp){ |
|
|
|
|
success(resp) { |
|
|
|
|
resolve(resp) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
@ -120,153 +21,38 @@ class BS{
@@ -120,153 +21,38 @@ class BS{
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static run(award_id){ |
|
|
|
|
return this.fetch('/run',{ |
|
|
|
|
award_id |
|
|
|
|
},'POST'); |
|
|
|
|
static run() { |
|
|
|
|
return this.fetch('/run'); |
|
|
|
|
} |
|
|
|
|
static stopAndResult(){ |
|
|
|
|
return this.fetch('/draw_lottery'); |
|
|
|
|
|
|
|
|
|
static stopAndResult(award_id) { |
|
|
|
|
return this.fetch('/draw_lottery',{award_id}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static getLucklessUsers(){ |
|
|
|
|
static getLucklessUsers() { |
|
|
|
|
return this.fetch('/luckless_users'); |
|
|
|
|
} |
|
|
|
|
static getLuckyUsers(){ |
|
|
|
|
|
|
|
|
|
static getLuckyUsers() { |
|
|
|
|
return this.fetch('/luckless_users'); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
static getAwards(){ |
|
|
|
|
|
|
|
|
|
static getAwards() { |
|
|
|
|
return this.fetch('/awards'); |
|
|
|
|
} |
|
|
|
|
static getUsers(){ |
|
|
|
|
|
|
|
|
|
static getUsers() { |
|
|
|
|
return this.fetch('/users'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class UI { |
|
|
|
|
constructor() { |
|
|
|
|
this.running = false; |
|
|
|
|
this.entries = [ |
|
|
|
|
|
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '张三三', url:'javascript:void(0)', target: '_top', id: 'admin'}, |
|
|
|
|
{label: '李四', url: 'http://www.flashforum.de/', target: '_top'}, |
|
|
|
|
{label: '王污污', url: 'http://www.jqueryscript.net/', target: '_top'}, |
|
|
|
|
{label: '赵六六', url: 'http://www.jqueryscript.net/', target: '_top'}, |
|
|
|
|
{label: '赵六六', url: 'http://www.jqueryscript.net/', target: '_top'}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
|
|
this.entries = []; |
|
|
|
|
this.settings = { |
|
|
|
|
entries: this.entries, |
|
|
|
|
width: 800, |
|
|
|
|
height: 600, |
|
|
|
|
radius: '65%', |
|
|
|
|
@ -298,15 +84,26 @@ class UI {
@@ -298,15 +84,26 @@ class UI {
|
|
|
|
|
// tooltipDiffY: 10
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
this.svg3DTagCloud = new SVG3DTagCloud(document.getElementById('holder'), this.settings); |
|
|
|
|
this.buildCloud(); |
|
|
|
|
this.buildCloud().then(()=>{ |
|
|
|
|
this.settings.entries = this.entries; |
|
|
|
|
this.svg3DTagCloud = new SVG3DTagCloud(document.getElementById('holder'), this.settings); |
|
|
|
|
}); |
|
|
|
|
this.bindEvent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
buildCloud() { |
|
|
|
|
BS.getUsers().then((resp)=>{ |
|
|
|
|
console.log(resp) |
|
|
|
|
return BS.getUsers().then((resp) => { |
|
|
|
|
console.log(resp); |
|
|
|
|
let entry = []; |
|
|
|
|
$(resp.data).each((i, val) => { |
|
|
|
|
entry.push({ |
|
|
|
|
label: val.name, |
|
|
|
|
uid:val.uid, |
|
|
|
|
role:val.role, |
|
|
|
|
url: 'javascript:void(0)', |
|
|
|
|
target: '_top' |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.entries = entry; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -316,14 +113,23 @@ class UI {
@@ -316,14 +113,23 @@ class UI {
|
|
|
|
|
alert('正在抽奖'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.svg3DTagCloud.speed(6); |
|
|
|
|
this.running = true; |
|
|
|
|
|
|
|
|
|
//todo
|
|
|
|
|
BS.run().then(resp=>{ |
|
|
|
|
console.log(resp); |
|
|
|
|
this.svg3DTagCloud.speed(6); |
|
|
|
|
this.running = true; |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
$('#end').click(() => { |
|
|
|
|
console.log('click'); |
|
|
|
|
this.stop(); |
|
|
|
|
this.render(1); |
|
|
|
|
//todo
|
|
|
|
|
BS.stopAndResult("9f7cfd85a39e40f2975e7a62ca9dbca5").then(resp=>{ |
|
|
|
|
console.log(resp); |
|
|
|
|
this.stop(); |
|
|
|
|
let uid= 'G0001'; |
|
|
|
|
let index = $(`[data-uid=${uid}]`).data('index'); |
|
|
|
|
this.render(index); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
$('#test').click(() => { |
|
|
|
|
this.list(); |
|
|
|
|
@ -332,13 +138,14 @@ class UI {
@@ -332,13 +138,14 @@ class UI {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
render(i) { |
|
|
|
|
console.log(i); |
|
|
|
|
this.chose(i); |
|
|
|
|
/* console.log(i); |
|
|
|
|
if (i >= 5) { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.stop(); |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.list(); |
|
|
|
|
},1000) |
|
|
|
|
}, 1000) |
|
|
|
|
}, 1000); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
@ -348,7 +155,7 @@ class UI {
@@ -348,7 +155,7 @@ class UI {
|
|
|
|
|
this.chose(i); |
|
|
|
|
this.render(++i); |
|
|
|
|
}, 500) |
|
|
|
|
}, 2500) |
|
|
|
|
}, 2500)*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stop() { |
|
|
|
|
|