|
|
|
|
|
|
|
var turnplate={
|
|
|
|
restaraunts:[], //大转盘奖品名称
|
|
|
|
colors:[], //大转盘奖品区块对应背景颜色
|
|
|
|
outsideRadius:176, //大转盘外圆的半径outsideRadius:192,
|
|
|
|
textRadius:125, //大转盘奖品位置距离圆心的距离155
|
|
|
|
insideRadius:52, //大转盘内圆的半径insideRadius:68,
|
|
|
|
startAngle:0, //开始角度
|
|
|
|
bRotate:false //false:停止;ture:旋转
|
|
|
|
};
|
|
|
|
var url=(window.location.href).substring(22.26)
|
|
|
|
|
|
|
|
num=-1
|
|
|
|
function chongzhi(){
|
|
|
|
localStorage.removeItem(num);
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
//重置功能
|
|
|
|
$("#Reset").on("click",function(){
|
|
|
|
drawRouletteWheel()
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
for(var i=0;i<29;i++){
|
|
|
|
localStorage.removeItem(i);
|
|
|
|
$("#endjieguo span").eq(i+1).html("")
|
|
|
|
$("#chooseZhi img").eq(i).hide()
|
|
|
|
}
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
})
|
|
|
|
for(var i=0;i<14;i++){
|
|
|
|
if(window.localStorage[i]!=undefined){
|
|
|
|
$("#endjieguo span").eq(i+1).html(window.localStorage[i])
|
|
|
|
$("#chooseZhi img").eq(i).show()
|
|
|
|
//$(".check-style-unequal-width").show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//左侧表格点击事件
|
|
|
|
$("span[name='aaa']").on("click",function(){
|
|
|
|
//console.log($(this).html().substring(0,3))
|
|
|
|
$(".turnplate").css("background-image","url(../../../assets/images/ceshi.png)");
|
|
|
|
|
|
|
|
if($(this).html().substring(0,4)=="钦州支队"){
|
|
|
|
//console.log(item)
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街(模板)", "钦州吾悦广场","广西东油沥青有限公司"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=6
|
|
|
|
if(window.localStorage["6"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==7){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(7).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==7){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(7).html(window.localStorage["6"])
|
|
|
|
//$("#endjieguo").append("</br><span>"+"您的抽签结果为:</br>"+window.localStorage["0"]+"</span>")
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="南宁支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) ","九洲国际"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=0
|
|
|
|
if(window.localStorage["0"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==1){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(1).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==1){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(1).html(window.localStorage["0"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="柳州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街", "板栗园加气站 ","柳州万达广场"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=1
|
|
|
|
if(window.localStorage["1"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==2){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$("#endjieguo span").eq(2).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==2){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(2).html(window.localStorage["1"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="河池支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)","广西河池市大洋购物中心", "河池市宜州区地下商业街", "河池市中石化金城江油库 "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=11
|
|
|
|
if(window.localStorage["11"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==12){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$("#endjieguo span").eq(12).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==12){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(12).html(window.localStorage["11"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="来宾支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["来宾饭店","来宾市方盛广场","宝晨化工", "天成百货"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=12
|
|
|
|
if(window.localStorage["12"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==13){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$("#endjieguo span").eq(13).html("")
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==13){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(13).html(window.localStorage["12"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="贺州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["远东国贸地下停车场", "宝晨化工有限公司", "贺州市南宁百货大楼", "贺州市国际酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=10
|
|
|
|
if(window.localStorage["10"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==11){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$("#endjieguo span").eq(11).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==11){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
turnplate.startAngle=5.48
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(11).html(window.localStorage["10"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}
|
|
|
|
else if($(this).html().substring(0,5)=="防城港支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["港宸国际大酒店", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "广西中油能源有限公司 "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=5
|
|
|
|
if(window.localStorage["5"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==6){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$("#endjieguo span").eq(6).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==6){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(6).html(window.localStorage["5"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="崇左支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)","龙城地下商业街(模板)","地王国际财富中心(模板)","崇左油库"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=13
|
|
|
|
if(window.localStorage["13"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==14){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(14).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==14){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(14).html(window.localStorage["13"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="贵港支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "平南中心购物广场", "贵港市中国石油分公司油库", "维多利亚酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
|
|
|
|
num=7
|
|
|
|
if(window.localStorage["7"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==8){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$("#endjieguo span").eq(8).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==8){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
$("#endjieguo span").eq(8).html(window.localStorage["7"])
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="梧州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "梧州市中石化火山油库" ];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=3
|
|
|
|
if(window.localStorage["3"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==4){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(10).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==4){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$("#endjieguo span").eq(4).html(window.localStorage["3"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="百色支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["安达曼国际酒店", "恒宁城市广场", "三雷油库", "平果地下商业街"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=9
|
|
|
|
if(window.localStorage["9"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==10){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(10).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==10){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
turnplate.startAngle=5.48
|
|
|
|
$("#endjieguo span").eq(10).html(window.localStorage["9"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="玉林支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=8
|
|
|
|
if(window.localStorage["8"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==9){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(9).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==9){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(9).html(window.localStorage["8"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="北海支队")
|
|
|
|
{
|
|
|
|
console.log(turnplate.startAngle)
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街(模板)", "和安宁春城","广西东油沥青有限公司(模板)"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=4
|
|
|
|
if(window.localStorage["4"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==5){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(5).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==5){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$("#endjieguo span").eq(5).html(window.localStorage["4"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="桂林支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","兴安油库","宏谋酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=2
|
|
|
|
if(window.localStorage["2"]==undefined)
|
|
|
|
{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==3){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(3).html("")
|
|
|
|
}else{
|
|
|
|
for(var i=1;i<15;i++){
|
|
|
|
if(i==3){
|
|
|
|
$("#endjieguo span").eq(i).css("color","#ff4d29")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#FFF")
|
|
|
|
}else{
|
|
|
|
$("#endjieguo span").eq(i).css("color","#000")
|
|
|
|
$("#chooseZhi span").eq(i).css("color","#000")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png")
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[3]){turnplate.startAngle=5.48}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[0]){turnplate.startAngle=3.9}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[1]){turnplate.startAngle=2.4}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[2]){turnplate.startAngle=0.8}
|
|
|
|
$("#endjieguo span").eq(3).html(window.localStorage["2"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
//网络检测
|
|
|
|
var rotateTimeOut = function (){
|
|
|
|
$('#wheelcanvas').rotate({
|
|
|
|
angle:0,
|
|
|
|
animateTo:2160,
|
|
|
|
duration:8000,
|
|
|
|
callback:function (){
|
|
|
|
alert('网络超时,请检查您的网络设置!');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
//旋转转盘 item:奖品位置; txt:提示语;
|
|
|
|
var rotateFn = function (item, txt){
|
|
|
|
var angles = item * (360 / turnplate.restaraunts.length) - (360 / (turnplate.restaraunts.length*2));
|
|
|
|
if(angles<270){
|
|
|
|
angles = 270 - angles;
|
|
|
|
}else{
|
|
|
|
angles = 360 - angles + 270;
|
|
|
|
}
|
|
|
|
$('#wheelcanvas').stopRotate();
|
|
|
|
$('#wheelcanvas').rotate({
|
|
|
|
angle:0,
|
|
|
|
animateTo:angles+1800,
|
|
|
|
duration:8000,
|
|
|
|
callback:function (){
|
|
|
|
$("#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)=="钦州支队"){
|
|
|
|
console.log(turnplate.startAngle)
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街(模板)", "钦州吾悦广场","广西东油沥青有限公司"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=6
|
|
|
|
//turnplate.startAngle=3
|
|
|
|
if(window.localStorage["6"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(7).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["6"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(7).html(window.localStorage["6"])
|
|
|
|
//$("#endjieguo").append("</br><span>"+"您的抽签结果为:</br>"+window.localStorage["0"]+"</span>")
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="南宁支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) ","九洲国际"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=0
|
|
|
|
if(window.localStorage["0"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(1).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["0"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(1).html(window.localStorage["0"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="柳州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街", "板栗园加气站 ","柳州万达广场"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=1
|
|
|
|
if(window.localStorage["1"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(2).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["1"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(2).html(window.localStorage["1"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="河池支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)","广西河池市大洋购物中心", "河池市宜州区地下商业街", "河池市中石化金城江油库 "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=11
|
|
|
|
if(window.localStorage["11"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$("#endjieguo span").eq(12).html("")
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["11"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(12).html(window.localStorage["11"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="来宾支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["来宾饭店","来宾市方盛广场", "宝晨化工", "天成百货"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245","#FFEBEA", "#FF7245"];
|
|
|
|
num=12
|
|
|
|
if(window.localStorage["12"]==undefined)
|
|
|
|
{
|
|
|
|
$("#endjieguo span").eq(13).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["12"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(13).html(window.localStorage["12"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="贺州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["远东国贸地下停车场", "宝晨化工有限公司", "贺州市南宁百货大楼", "贺州市国际酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=10
|
|
|
|
if(window.localStorage["10"]==undefined)
|
|
|
|
{
|
|
|
|
$("#endjieguo span").eq(11).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
//turnplate.startAngle=5.48
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["10"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(11).html(window.localStorage["10"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}
|
|
|
|
else if($(this).html().substring(0,5)=="防城港支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["港宸国际大酒店", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "广西中油能源有限公司 "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=5
|
|
|
|
if(window.localStorage["5"]==undefined)
|
|
|
|
{
|
|
|
|
$("#endjieguo span").eq(6).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["5"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(6).html(window.localStorage["5"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="崇左支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)","龙城地下商业街(模板)","地王国际财富中心(模板)","崇左油库"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=13
|
|
|
|
if(window.localStorage["13"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(14).html("")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["13"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(14).html(window.localStorage["13"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="贵港支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "平南中心购物广场", "贵港市中国石油分公司油库", "维多利亚酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
|
|
|
|
num=7
|
|
|
|
if(window.localStorage["7"]==undefined)
|
|
|
|
{
|
|
|
|
$("#endjieguo span").eq(8).html("")
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["7"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$("#endjieguo span").eq(8).html(window.localStorage["7"])
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="梧州支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "梧州市中石化火山油库" ];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=3
|
|
|
|
if(window.localStorage["3"]==undefined)
|
|
|
|
{
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(4).html("")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["3"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(4).html(window.localStorage["3"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="百色支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["安达曼国际酒店", "恒宁城市广场", "三雷油库", "平果地下商业街"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=9
|
|
|
|
if(window.localStorage["9"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(10).html()
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["9"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
//console.log(window.localStorage["10"]==turnplate.restaraunts[3])
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(10).html(window.localStorage["9"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="玉林支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) "];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=8
|
|
|
|
if(window.localStorage["8"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(9).html("")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["8"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(9).html(window.localStorage["8"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="北海支队")
|
|
|
|
{
|
|
|
|
console.log(turnplate.startAngle)
|
|
|
|
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街(模板)", "和安宁春城","广西东油沥青有限公司(模板)"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=4
|
|
|
|
if(window.localStorage["4"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(5).html("")
|
|
|
|
}else{
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["4"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#endjieguo span").eq(5).html(window.localStorage["4"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}else if($(this).html().substring(0,4)=="桂林支队")
|
|
|
|
{
|
|
|
|
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","兴安油库","宏谋酒店"];
|
|
|
|
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
|
|
|
|
num=2
|
|
|
|
if(window.localStorage["2"]==undefined)
|
|
|
|
{
|
|
|
|
turnplate.startAngle=0
|
|
|
|
$('.pointer').removeClass("stop")
|
|
|
|
$("#endjieguo span").eq(3).html("")
|
|
|
|
}else{
|
|
|
|
if(item==2){
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[3]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[0]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[1]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[2]){turnplate.startAngle=4.7}
|
|
|
|
}else if(item==1){
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[3]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[0]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[1]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[2]){turnplate.startAngle=3.2}
|
|
|
|
}else if(item==3){
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[3]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[0]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[1]){turnplate.startAngle=1.5}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[2]){turnplate.startAngle=0}
|
|
|
|
}else if(item==4){
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[3]){turnplate.startAngle=0}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[0]){turnplate.startAngle=4.7}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[1]){turnplate.startAngle=3.2}
|
|
|
|
if(window.localStorage["2"]==turnplate.restaraunts[2]){turnplate.startAngle=1.5}
|
|
|
|
}
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
$("#endjieguo span").eq(3).html(window.localStorage["2"])
|
|
|
|
}
|
|
|
|
drawRouletteWheel()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
//console.log(turnplate.startAngle)
|
|
|
|
var zhuanpan=document.getElementById("zhuanpan")
|
|
|
|
var con1=document.getElementById("con1")
|
|
|
|
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"])
|
|
|
|
$("#chooseZhi img").eq(0).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==1){
|
|
|
|
window.localStorage.setItem( 1, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(2).html(window.localStorage["1"])
|
|
|
|
$("#chooseZhi img").eq(1).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==2){
|
|
|
|
window.localStorage.setItem( 2, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(3).html(window.localStorage["2"])
|
|
|
|
$("#chooseZhi img").eq(2).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==3){
|
|
|
|
window.localStorage.setItem( 3, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(4).html(window.localStorage["3"])
|
|
|
|
$("#chooseZhi img").eq(3).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}
|
|
|
|
else if(num==4){
|
|
|
|
window.localStorage.setItem( 4, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(5).html(window.localStorage["4"])
|
|
|
|
$("#chooseZhi img").eq(4).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==5){
|
|
|
|
window.localStorage.setItem( 5, "广西中油能源有限公司");
|
|
|
|
$("#endjieguo span").eq(6).html(window.localStorage["5"])
|
|
|
|
$("#chooseZhi img").eq(5).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==6){
|
|
|
|
window.localStorage.setItem( 6, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(7).html(window.localStorage["6"])
|
|
|
|
$("#chooseZhi img").eq(6).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==7){
|
|
|
|
window.localStorage.setItem( 7, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(8).html(window.localStorage["7"])
|
|
|
|
$("#chooseZhi img").eq(7).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==8){
|
|
|
|
window.localStorage.setItem( 8, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(9).html(window.localStorage["8"])
|
|
|
|
$("#chooseZhi img").eq(8).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==9){
|
|
|
|
window.localStorage.setItem( 9, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(10).html(window.localStorage["9"])
|
|
|
|
$("#chooseZhi img").eq(9).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==10){
|
|
|
|
window.localStorage.setItem( 10, "贺州市国际酒店");
|
|
|
|
$("#endjieguo span").eq(11).html(window.localStorage["10"])
|
|
|
|
$("#chooseZhi img").eq(10).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==11){
|
|
|
|
window.localStorage.setItem( 11, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(12).html(window.localStorage["11"])
|
|
|
|
$("#chooseZhi img").eq(11).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==12){
|
|
|
|
window.localStorage.setItem( 12, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(13).html(window.localStorage["12"])
|
|
|
|
$("#chooseZhi img").eq(12).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==13){
|
|
|
|
window.localStorage.setItem( 13, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(14).html(window.localStorage["13"])
|
|
|
|
$("#chooseZhi img").eq(13).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}if(num==14){
|
|
|
|
window.localStorage.setItem( 14, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(1).html(window.localStorage["14"])
|
|
|
|
$("#chooseZhi img").eq(0).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==15){
|
|
|
|
window.localStorage.setItem( 15, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(2).html(window.localStorage["15"])
|
|
|
|
$("#chooseZhi img").eq(1).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==16){
|
|
|
|
window.localStorage.setItem( 16, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(3).html(window.localStorage["16"])
|
|
|
|
$("#chooseZhi img").eq(2).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==17){
|
|
|
|
window.localStorage.setItem( 17, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(4).html(window.localStorage["17"])
|
|
|
|
$("#chooseZhi img").eq(3).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}
|
|
|
|
else if(num==18){
|
|
|
|
window.localStorage.setItem( 18, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(5).html(window.localStorage["18"])
|
|
|
|
$("#chooseZhi img").eq(4).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==19){
|
|
|
|
window.localStorage.setItem( 19, "贺州市国际酒店");
|
|
|
|
$("#endjieguo span").eq(6).html(window.localStorage["19"])
|
|
|
|
$("#chooseZhi img").eq(5).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==20){
|
|
|
|
window.localStorage.setItem( 20, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(7).html(window.localStorage["20"])
|
|
|
|
$("#chooseZhi img").eq(6).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==21){
|
|
|
|
window.localStorage.setItem( 21, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(8).html(window.localStorage["21"])
|
|
|
|
$("#chooseZhi img").eq(7).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==22){
|
|
|
|
window.localStorage.setItem( 22, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(9).html(window.localStorage["22"])
|
|
|
|
$("#chooseZhi img").eq(8).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==23){
|
|
|
|
window.localStorage.setItem( 23, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(10).html(window.localStorage["23"])
|
|
|
|
$("#chooseZhi img").eq(9).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==24){
|
|
|
|
window.localStorage.setItem( 24, "平果地下商业街");
|
|
|
|
$("#endjieguo span").eq(11).html(window.localStorage["24"])
|
|
|
|
$("#chooseZhi img").eq(10).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==25){
|
|
|
|
window.localStorage.setItem( 25, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(12).html(window.localStorage["25"])
|
|
|
|
$("#chooseZhi img").eq(11).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==26){
|
|
|
|
window.localStorage.setItem( 26, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(13).html(window.localStorage["26"])
|
|
|
|
$("#chooseZhi img").eq(12).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}else if(num==27){
|
|
|
|
window.localStorage.setItem( 27, turnplate.restaraunts[item-1]);
|
|
|
|
$("#endjieguo span").eq(14).html(window.localStorage["27"])
|
|
|
|
$("#chooseZhi img").eq(13).show()
|
|
|
|
$('.pointer').addClass("stop")
|
|
|
|
}
|
|
|
|
turnplate.bRotate = !turnplate.bRotate;
|
|
|
|
turnplate.startAngle=0
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
$('.pointer').click(function (){
|
|
|
|
$("span[name='aaa']").addClass("stop")
|
|
|
|
if(turnplate.bRotate)return;
|
|
|
|
turnplate.bRotate = !turnplate.bRotate;
|
|
|
|
//获取随机数(奖品个数范围内)
|
|
|
|
var item
|
|
|
|
if(num==0||num==3||num==8||num==13||num==14||num==17||num==22||num==27)
|
|
|
|
{
|
|
|
|
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){
|
|
|
|
item=Math.floor(Math.random()*(3+1-1)+1);
|
|
|
|
} */
|
|
|
|
else{
|
|
|
|
item=rnd(1,turnplate.restaraunts.length);
|
|
|
|
}
|
|
|
|
console.log(item)
|
|
|
|
//奖品数量等于10,指针落在对应奖品区域的中心角度[252, 216, 180, 144, 108, 72, 36, 360, 324, 288]
|
|
|
|
rotateFn(item, turnplate.restaraunts[item-1]);
|
|
|
|
/* switch (item) {
|
|
|
|
case 1:
|
|
|
|
rotateFn(252, turnplate.restaraunts[0]);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rotateFn(216, turnplate.restaraunts[1]);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
rotateFn(180, turnplate.restaraunts[2]);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rotateFn(144, turnplate.restaraunts[3]);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
rotateFn(108, turnplate.restaraunts[4]);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
rotateFn(72, turnplate.restaraunts[5]);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
rotateFn(36, turnplate.restaraunts[6]);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
rotateFn(360, turnplate.restaraunts[7]);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
rotateFn(324, turnplate.restaraunts[8]);
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
rotateFn(288, turnplate.restaraunts[9]);
|
|
|
|
break;
|
|
|
|
} */
|
|
|
|
console.log(item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
//控制中奖结果
|
|
|
|
function rnd(n, m){
|
|
|
|
var random = 4;
|
|
|
|
//var random = Math.floor(Math.random()*(m-n+1)+n);
|
|
|
|
return random;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//页面所有元素加载完毕后执行drawRouletteWheel()方法对转盘进行渲染
|
|
|
|
window.onload=function(){
|
|
|
|
drawRouletteWheel();
|
|
|
|
};
|
|
|
|
|
|
|
|
function drawRouletteWheel() {
|
|
|
|
var canvas = document.getElementById("wheelcanvas");
|
|
|
|
if (canvas.getContext) {
|
|
|
|
//根据奖品个数计算圆周角度
|
|
|
|
var arc = Math.PI / (turnplate.restaraunts.length/2);
|
|
|
|
var ctx = canvas.getContext("2d");
|
|
|
|
//在给定矩形内清空一个矩形
|
|
|
|
ctx.clearRect(0,0,422,422);
|
|
|
|
//strokeStyle 属性设置或返回用于笔触的颜色、渐变或模式
|
|
|
|
ctx.strokeStyle = "#FFBE04";
|
|
|
|
//font 属性设置或返回画布上文本内容的当前字体属性
|
|
|
|
ctx.font = '18px Microsoft YaHei';
|
|
|
|
for(var i = 0; i < turnplate.restaraunts.length; i++) {
|
|
|
|
var angle = turnplate.startAngle + i * arc;
|
|
|
|
ctx.fillStyle = turnplate.colors[i];
|
|
|
|
ctx.beginPath();
|
|
|
|
//arc(x,y,r,起始角,结束角,绘制方向) 方法创建弧/曲线(用于创建圆或部分圆)
|
|
|
|
ctx.arc(211, 211, turnplate.outsideRadius, angle, angle + arc, false);
|
|
|
|
ctx.arc(211, 211, turnplate.insideRadius, angle + arc, angle, true);
|
|
|
|
ctx.stroke();
|
|
|
|
ctx.fill();
|
|
|
|
//锁画布(为了保存之前的画布状态)
|
|
|
|
ctx.save();
|
|
|
|
|
|
|
|
//----绘制奖品开始----
|
|
|
|
//ctx.fillStyle = "#E5302F";
|
|
|
|
if(turnplate.colors[i]=="#FFEBEA"){ctx.fillStyle = "#ff4d29"}
|
|
|
|
else{ctx.fillStyle = "#FFF"}
|
|
|
|
/* for(var i=0;i<4;i++){
|
|
|
|
console.log()
|
|
|
|
if(turnplate.colors[i]=="#FFEBEA"){ctx.fillStyle = "#FFF"}
|
|
|
|
else{ctx.fillStyle = "#E5302F"}
|
|
|
|
} */
|
|
|
|
//ctx.fillStyle = "#FFF";
|
|
|
|
var text = turnplate.restaraunts[i];
|
|
|
|
var line_height = 17;
|
|
|
|
//translate方法重新映射画布上的 (0,0) 位置
|
|
|
|
ctx.translate(211 + Math.cos(angle + arc / 2) * turnplate.textRadius, 211 + Math.sin(angle + arc / 2) * turnplate.textRadius);
|
|
|
|
|
|
|
|
//rotate方法旋转当前的绘图
|
|
|
|
ctx.rotate(angle + arc / 2 + Math.PI / 2);
|
|
|
|
|
|
|
|
/** 下面代码根据奖品类型、奖品名称长度渲染不同效果,如字体、颜色、图片效果。(具体根据实际情况改变) **/
|
|
|
|
if(text.indexOf("M")>0){//流量包
|
|
|
|
var texts = text.split("M");
|
|
|
|
for(var j = 0; j<texts.length; j++){
|
|
|
|
ctx.font = j == 0?'bold 20px Microsoft YaHei':'16px Microsoft YaHei';
|
|
|
|
if(j == 0){
|
|
|
|
ctx.fillText(texts[j]+"M", -ctx.measureText(texts[j]+"M").width / 2, j * line_height);
|
|
|
|
}else{
|
|
|
|
ctx.fillText(texts[j], -ctx.measureText(texts[j]).width / 2, j * line_height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if(text.indexOf("M") == -1 && text.length>6){//奖品名称长度超过一定范围
|
|
|
|
text = text.substring(0,6)+"||"+text.substring(6);
|
|
|
|
var texts = text.split("||");
|
|
|
|
for(var j = 0; j<texts.length; j++){
|
|
|
|
ctx.fillText(texts[j], -ctx.measureText(texts[j]).width / 2, j * line_height);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
//在画布上绘制填色的文本。文本的默认颜色是黑色
|
|
|
|
//measureText()方法返回包含一个对象,该对象包含以像素计的指定字体宽度
|
|
|
|
ctx.fillText(text, -ctx.measureText(text).width / 2, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
//添加对应图标
|
|
|
|
if(text.indexOf("闪币")>0){
|
|
|
|
var img= document.getElementById("shan-img");
|
|
|
|
img.onload=function(){
|
|
|
|
ctx.drawImage(img,-15,10);
|
|
|
|
};
|
|
|
|
ctx.drawImage(img,-15,10);
|
|
|
|
}else if(text.indexOf("谢谢参与")>=0){
|
|
|
|
var img= document.getElementById("sorry-img");
|
|
|
|
img.onload=function(){
|
|
|
|
ctx.drawImage(img,-15,10);
|
|
|
|
};
|
|
|
|
ctx.drawImage(img,-15,10);
|
|
|
|
}
|
|
|
|
//把当前画布返回(调整)到上一个save()状态之前
|
|
|
|
ctx.restore();
|
|
|
|
//----绘制奖品结束----
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|