You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
151 lines
6.9 KiB
151 lines
6.9 KiB
5 years ago
|
$(document).ready(function(){
|
||
|
var index = 0
|
||
|
var selected = null //点击的单位名称
|
||
|
var selectedtime = null //点击的单位名称 + 'time'
|
||
|
var selectedIndex = null //点击的单位index
|
||
5 years ago
|
var machine = $("#machine12").slotMachine({
|
||
5 years ago
|
active : 0,
|
||
|
delay : 500,
|
||
|
randomize : function(activeElementIndex){
|
||
|
if(selected == "南宁支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"11号",fuzhi:"17号"}))
|
||
|
return 10;
|
||
5 years ago
|
}else if(selected == "柳州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"8号",fuzhi:"15号"}))
|
||
|
return 7;
|
||
5 years ago
|
}else if(selected == "桂林支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"4号",fuzhi:"21号"}))
|
||
|
return 3;
|
||
5 years ago
|
}else if(selected == "梧州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"2号",fuzhi:"26号"}))
|
||
|
return 1;
|
||
5 years ago
|
}else if(selected == "北海支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"7号",fuzhi:"27号"}))
|
||
|
return 6;
|
||
5 years ago
|
}else if(selected == "防城港支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"12号",fuzhi:"22号"}))
|
||
|
return 11;
|
||
5 years ago
|
}else if(selected == "钦州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"3号",fuzhi:"25号"}))
|
||
|
return 2;
|
||
5 years ago
|
}else if(selected == "贵港支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"1号",fuzhi:"16号"}))
|
||
|
return 0;
|
||
5 years ago
|
}else if(selected == "玉林支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"9号",fuzhi:"20号"}))
|
||
|
return 8;
|
||
5 years ago
|
}else if(selected == "百色支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"6号",fuzhi:"18号"}))
|
||
|
return 5;
|
||
5 years ago
|
}else if(selected == "贺州支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"5号",fuzhi:"23号"}))
|
||
|
return 4;
|
||
|
}else if(selected == "河池支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"14号",fuzhi:"19号"}))
|
||
|
return 13;
|
||
5 years ago
|
}else if(selected == "来宾支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"10号",fuzhi:"24号"}))
|
||
|
return 9;
|
||
5 years ago
|
}else if(selected == "崇左支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"13号",fuzhi:"28号"}))
|
||
|
return 12;
|
||
5 years ago
|
}
|
||
|
}
|
||
|
});
|
||
5 years ago
|
var machine6 = $("#machine16").slotMachine({
|
||
5 years ago
|
active : 1,
|
||
|
delay : 500,
|
||
|
randomize : function(activeElementIndex){
|
||
|
if(selected == "南宁支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"11号",fuzhi:"17号"}))
|
||
|
return 2;
|
||
5 years ago
|
}else if(selected == "柳州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"8号",fuzhi:"15号"}))
|
||
5 years ago
|
return 0;
|
||
5 years ago
|
}else if(selected == "桂林支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"4号",fuzhi:"21号"}))
|
||
|
return 6;
|
||
5 years ago
|
}else if(selected == "梧州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"2号",fuzhi:"26号"}))
|
||
|
return 11;
|
||
5 years ago
|
}else if(selected == "北海支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"7号",fuzhi:"27号"}))
|
||
|
return 12;
|
||
5 years ago
|
}else if(selected == "防城港支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"12号",fuzhi:"22号"}))
|
||
|
return 7;
|
||
5 years ago
|
}else if(selected == "钦州支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"3号",fuzhi:"25号"}))
|
||
5 years ago
|
return 10;
|
||
|
}else if(selected == "贵港支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"1号",fuzhi:"16号"}))
|
||
|
return 1;
|
||
5 years ago
|
}else if(selected == "玉林支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"9号",fuzhi:"20号"}))
|
||
|
return 5;
|
||
5 years ago
|
}else if(selected == "百色支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"6号",fuzhi:"18号"}))
|
||
|
return 3;
|
||
5 years ago
|
}else if(selected == "贺州支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"5号",fuzhi:"23号"}))
|
||
5 years ago
|
return 8;
|
||
5 years ago
|
}else if(selected == "河池支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"14号",fuzhi:"19号"}))
|
||
|
return 4;
|
||
|
}else if(selected == "来宾支队"){
|
||
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"10号",fuzhi:"24号"}))
|
||
|
return 9;
|
||
5 years ago
|
}else if(selected == "崇左支队"){
|
||
5 years ago
|
localStorage.setItem(selectedtime,JSON.stringify({zhi:"13号",fuzhi:"28号"}))
|
||
|
return 13;
|
||
5 years ago
|
}
|
||
|
}
|
||
|
});
|
||
|
var data = [
|
||
5 years ago
|
{'南宁支队':'11号17号'},
|
||
|
{'柳州支队':'8号15号'},
|
||
|
{'桂林支队':'4号21号'},
|
||
|
{'梧州支队':'2号26号'},
|
||
|
{'北海支队':'7号27号'},
|
||
|
{'防城港支队':'12号22号'},
|
||
|
{'钦州支队':'3号25号'},
|
||
|
{'贵港支队':'1号16号'},
|
||
|
{'玉林支队':'9号20号'},
|
||
|
{'百色支队':'6号18号'},
|
||
|
{'贺州支队':'5号23号'},
|
||
|
{'河池支队':'14号19号'},
|
||
|
{'来宾支队':'10号24号'},
|
||
|
{'崇左支队':'13号28号'}
|
||
5 years ago
|
]
|
||
|
|
||
5 years ago
|
$("#slotMachineButtonShuffle22").click(function(){
|
||
5 years ago
|
if(!selected){
|
||
|
alert("请先选择单位")
|
||
|
}else{
|
||
|
machine.shuffle();
|
||
|
machine6.shuffle();
|
||
5 years ago
|
$("#slotMachineButtonShuffle22").addClass("disabled");
|
||
5 years ago
|
setTimeout(() => {
|
||
|
machine.stop();
|
||
|
machine6.stop();
|
||
|
setTimeout(() => {
|
||
5 years ago
|
$("#endjieguo22 span").eq(selectedIndex).html(data[selectedIndex - 1][selected])
|
||
|
$("#chooseZhi22 .img").eq(selectedIndex - 1).css("display","inline-block");
|
||
5 years ago
|
}, 1300);
|
||
|
}, 1000);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
//左侧表格点击事件
|
||
5 years ago
|
$("span[name='zzz']").on("click",function(e,index){
|
||
5 years ago
|
selected = $(this)[0].innerText
|
||
5 years ago
|
selectedtime = $(this)[0].innerText + 'seatnumbercopy'
|
||
5 years ago
|
selectedIndex = localStorage.getItem("indexNum")
|
||
5 years ago
|
// console.log(456,selected,selectedIndex)
|
||
|
if($("#endjieguo22 span").eq(selectedIndex)[0].innerText){
|
||
|
$("#slotMachineButtonShuffle22").addClass("disabled");
|
||
5 years ago
|
}else{
|
||
5 years ago
|
$("#slotMachineButtonShuffle22").removeClass("disabled");
|
||
5 years ago
|
}
|
||
|
})
|
||
|
});
|