|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var turnplate={ |
|
|
|
|
restaraunts:[], //大转盘奖品名称
|
|
|
|
|
colors:[], //大转盘奖品区块对应背景颜色
|
|
|
|
@ -17,6 +16,7 @@ function chongzhi(){
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(document).ready(function(){ |
|
|
|
|
//重置功能
|
|
|
|
|
$("#Reset").on("click",function(){ |
|
|
|
|
drawRouletteWheel() |
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png") |
|
|
|
@ -35,7 +35,7 @@ $(document).ready(function(){
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//左侧表格点击事件
|
|
|
|
|
$("span[name='aaa']").on("click",function(){ |
|
|
|
|
//console.log($(this).html().substring(0,3))
|
|
|
|
|
$(".turnplate").css("background-image","url(../../../assets/images/ceshi.png)"); |
|
|
|
@ -205,7 +205,7 @@ $(document).ready(function(){
|
|
|
|
|
drawRouletteWheel() |
|
|
|
|
}else if($(this).html().substring(0,4)=="来宾支队") |
|
|
|
|
{ |
|
|
|
|
turnplate.restaraunts = ["来宾饭店", "天成百货","来宾市方盛广场","宝晨化工"]; |
|
|
|
|
turnplate.restaraunts = ["来宾饭店","来宾市方盛广场","宝晨化工", "天成百货"]; |
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
|
num=12 |
|
|
|
|
if(window.localStorage["12"]==undefined) |
|
|
|
@ -597,14 +597,8 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
//console.log(turnplate.restaraunts)
|
|
|
|
|
//动态添加大转盘的奖品与奖品区域背景颜色
|
|
|
|
|
/* turnplate.restaraunts = ["广西东油沥青有限公司", "钦州天亿石化有限公司", "九洲国际(超高层)", "南宁国际会展中心 ", "维景国际酒店", "荔园山庄"]; |
|
|
|
|
turnplate.colors = ["#FFF4D6", "#FFFFFF", "#FFF4D6", "#FFFFFF","#FFF4D6", "#FFFFFF"]; */ |
|
|
|
|
/* turnplate.restaraunts = ["白云边", "关公坊", "黄鹤楼", "国宝 ", "陈克明", "金沙河", "雪花", "康师傅", "脉动","奥星","金龙鱼","中昌"]; |
|
|
|
|
turnplate.colors = ["#FFF4D6", "#FFFFFF", "#FFF4D6", "#FFFFFF","#FFF4D6", "#FFFFFF", "#FFF4D6", "#FFFFFF","#FFF4D6", "#FFFFFF", "#FFF4D6", "#FFFFFF"]; */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//网络检测
|
|
|
|
|
var rotateTimeOut = function (){ |
|
|
|
|
$('#wheelcanvas').rotate({ |
|
|
|
|
angle:0, |
|
|
|
@ -618,7 +612,6 @@ var rotateTimeOut = function (){
|
|
|
|
|
|
|
|
|
|
//旋转转盘 item:奖品位置; txt:提示语;
|
|
|
|
|
var rotateFn = function (item, txt){ |
|
|
|
|
//$("#chooseZhi").addClass("stop")
|
|
|
|
|
var angles = item * (360 / turnplate.restaraunts.length) - (360 / (turnplate.restaraunts.length*2)); |
|
|
|
|
if(angles<270){ |
|
|
|
|
angles = 270 - angles;
|
|
|
|
@ -631,9 +624,9 @@ var rotateFn = function (item, txt){
|
|
|
|
|
animateTo:angles+1800, |
|
|
|
|
duration:8000, |
|
|
|
|
callback:function (){ |
|
|
|
|
//console.log(item)
|
|
|
|
|
//$("#chooseZhi").removeClass("stop")
|
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png") |
|
|
|
|
$("span[name='aaa']").removeClass("stop") |
|
|
|
|
//抽签完成后左侧表格点击事件
|
|
|
|
|
$("span[name='aaa']").on("click",function(){ |
|
|
|
|
|
|
|
|
|
if($(this).html().substring(0,4)=="钦州支队"){ |
|
|
|
@ -785,7 +778,7 @@ var rotateFn = function (item, txt){
|
|
|
|
|
drawRouletteWheel() |
|
|
|
|
}else if($(this).html().substring(0,4)=="来宾支队") |
|
|
|
|
{ |
|
|
|
|
turnplate.restaraunts = ["来宾饭店", "天成百货","来宾市方盛广场", "宝晨化工"]; |
|
|
|
|
turnplate.restaraunts = ["来宾饭店","来宾市方盛广场", "宝晨化工", "天成百货"]; |
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245","#FFEBEA", "#FF7245"];
|
|
|
|
|
num=12 |
|
|
|
|
if(window.localStorage["12"]==undefined) |
|
|
|
@ -1152,17 +1145,11 @@ var rotateFn = function (item, txt){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
console.log(turnplate.startAngle) |
|
|
|
|
//console.log(turnplate.startAngle)
|
|
|
|
|
var zhuanpan=document.getElementById("zhuanpan") |
|
|
|
|
var con1=document.getElementById("con1") |
|
|
|
|
/* var shuaxin="<div class='banner' name='banner' id='zhuanpan'>"+ |
|
|
|
|
"<div class='turnplate' style='background-image:url(../../../assets/images/turnplate-bg.png);background-size:100% 100%;'>"+ |
|
|
|
|
"<canvas class='item' id='wheelcanvas' width='422px' height='422px' ></canvas>"+ |
|
|
|
|
"<img class='pointer' src='../../../assets/images/turnplate-pointer.png' id='clickButton' disabled/>"+ |
|
|
|
|
"</div></div>" |
|
|
|
|
zhuanpan.remove() |
|
|
|
|
$("#con1").append(shuaxin) */ |
|
|
|
|
var dataLength=turnplate.restaraunts.length |
|
|
|
|
//往localStorage里面写入数据
|
|
|
|
|
if(num==0){ |
|
|
|
|
window.localStorage.setItem( 0, turnplate.restaraunts[item-1]); |
|
|
|
|
$("#endjieguo span").eq(1).html(window.localStorage["0"]) |
|
|
|
@ -1306,15 +1293,6 @@ var rotateFn = function (item, txt){
|
|
|
|
|
$("#chooseZhi img").eq(13).show() |
|
|
|
|
$('.pointer').addClass("stop") |
|
|
|
|
} |
|
|
|
|
/* if(dataLength>=5) |
|
|
|
|
{ |
|
|
|
|
$("#jieguo").append("您的抽签结果为:</br>"+turnplate.restaraunts[4]) |
|
|
|
|
}else if(dataLength==3){ |
|
|
|
|
$("#jieguo").append("您的抽签结果为:</br>"+turnplate.restaraunts[1]) |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
$("#jieguo").append("您的抽签结果为:</br>"+turnplate.restaraunts[0]) |
|
|
|
|
} */ |
|
|
|
|
turnplate.bRotate = !turnplate.bRotate; |
|
|
|
|
turnplate.startAngle=0 |
|
|
|
|
} |
|
|
|
@ -1322,6 +1300,7 @@ var rotateFn = function (item, txt){
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$('.pointer').click(function (){ |
|
|
|
|
$("span[name='aaa']").addClass("stop") |
|
|
|
|
if(turnplate.bRotate)return; |
|
|
|
|
turnplate.bRotate = !turnplate.bRotate; |
|
|
|
|
//获取随机数(奖品个数范围内)
|
|
|
|
@ -1331,9 +1310,9 @@ $('.pointer').click(function (){
|
|
|
|
|
item=Math.floor(Math.random()*(4+1-1)+1); |
|
|
|
|
}else if(num==1||num==11||num==15||num==25){ |
|
|
|
|
item=Math.floor(Math.random()*(2+1-1)+1); |
|
|
|
|
}else if(num==12){ |
|
|
|
|
}/* else if(num==12){ |
|
|
|
|
item=Math.floor(Math.random()*(3+1-1)+1); |
|
|
|
|
} |
|
|
|
|
} */ |
|
|
|
|
else{ |
|
|
|
|
item=rnd(1,turnplate.restaraunts.length); |
|
|
|
|
} |
|
|
|
|