Browse Source

[修改]重置功能变成两个

master
chenjingyu 4 years ago
parent
commit
f1bf7bdc23
  1. 5
      src/app/ui/reset/reset.component.html
  2. 98
      src/assets/js/zhuanpan.js

5
src/app/ui/reset/reset.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-09-25 08:48:50
* @LastEditors: sueRimn
* @LastEditTime: 2020-10-14 09:10:58
* @LastEditTime: 2020-10-19 09:01:26
-->
<html>
<meta charset="utf-8"/>
@ -48,7 +48,8 @@
</div>
</div>
<div class="chongzhi" style="height: 20%;"><button id="Reset" class="button">重置</button></div>
<div class="chongzhi" style="height: 20%;"><button id="Reset" class="button">重置考评</button></div>
<div class="chongzhi" style="height: 20%;"><button id="otherReset" class="button">重置业务</button></div>
<!-- <div class="colum" style="display: none;padding-left: 10%;margin-top: 20%;" id="end">

98
src/assets/js/zhuanpan.js

@ -9,7 +9,7 @@ var turnplate={
bRotate:false //false:停止;ture:旋转
};
var url=(window.location.href).split("/")[(window.location.href).split("/").length - 1]
var choujiang=[`南宁支队`,`柳州支队`,`桂林支队`,`梧州支队`,`北海支队`,`防城港支队`,`钦州支队`,`贵港支队`,`玉林支队`,`百色支队`,`贺州支队`,`河池支队`,`来宾支队`,`崇左支队`]
var num=-1
function chongzhi(){
localStorage.removeItem(num);
@ -22,21 +22,95 @@ $(document).ready(function(){
if(url=="twoStep"||url=="Reset"){
//$('.chongzhi').addClass("stop")
//console.log("aaa")
//能力考评重置右键
$("#Reset").on("contextmenu",function(){
alert("重置成功")
drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
localStorage.clear();
for(var i=0;i<14;i++){
localStorage.removeItem(i)
localStorage.removeItem(choujiang[i]+"seatnumber")
localStorage.removeItem(choujiang[i])
}
localStorage.removeItem("arr")
localStorage.removeItem("arrSeat")
localStorage.removeItem("arrSeat2")
localStorage.removeItem("orgArr")
localStorage.removeItem("indexNum")
/* localStorage.removeItem("seatnumber")
localStorage.removeItem("南宁支队seatnumber")
localStorage.removeItem("柳州支队seatnumber")
localStorage.removeItem("河池支队seatnumber")
localStorage.removeItem("来宾支队seatnumber")
localStorage.removeItem("贺州支队seatnumber")
localStorage.removeItem("防城港支队seatnumber")
localStorage.removeItem("崇左支队seatnumber")
localStorage.removeItem("贵港支队seatnumber")
localStorage.removeItem("梧州支队seatnumber")
localStorage.removeItem("钦州支队seatnumber")
localStorage.removeItem("钦州支队seatnumber")
localStorage.removeItem("钦州支队seatnumber")
localStorage.removeItem("钦州支队seatnumber") */
//localStorage.clear();
localStorage.setItem("Luckdraw","succed")
$('.pointer').removeClass("stop")
})
//能力考评重置左键
$("#Reset").on("click",function(){
alert("重置成功")
drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
localStorage.clear();
//localStorage.clear();
for(var i=0;i<14;i++){
localStorage.removeItem(i)
localStorage.removeItem(choujiang[i]+"seatnumber")
localStorage.removeItem(choujiang[i])
}
localStorage.removeItem("arr")
localStorage.removeItem("arrSeat")
localStorage.removeItem("arrSeat2")
localStorage.removeItem("orgArr")
localStorage.removeItem("indexNum")
localStorage.removeItem("Luckdraw")
$('.pointer').removeClass("stop")
})
//另一个重置右键
$("#otherReset").on("contextmenu",function(){
alert("重置成功")
drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
for(var i=0;i<14;i++){
localStorage.removeItem(i)
localStorage.removeItem(choujiang[i]+"copy")
localStorage.removeItem(choujiang[i]+"seatnumbercopy")
}
localStorage.removeItem("arr2")
localStorage.removeItem("arrSeatcopy")
localStorage.removeItem("arrSeat2copy")
localStorage.removeItem("orgArr")
localStorage.removeItem("indexNum")
//localStorage.clear();
localStorage.setItem("Luckdraw","succed")
$('.pointer').removeClass("stop")
})
//另一个重置左键
$("#otherReset").on("click",function(){
alert("重置成功")
drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
for(var i=0;i<14;i++){
localStorage.removeItem(i)
localStorage.removeItem(choujiang[i]+"copy")
localStorage.removeItem(choujiang[i]+"seatnumbercopy")
}
localStorage.removeItem("arr2")
localStorage.removeItem("arrSeatcopy")
localStorage.removeItem("arrSeat2copy")
localStorage.removeItem("orgArr")
localStorage.removeItem("indexNum")
//localStorage.clear();
localStorage.removeItem("Luckdraw","succed")
$('.pointer').removeClass("stop")
})
for(var i=0;i<14;i++){
if(window.localStorage[i]!=undefined){
@ -93,7 +167,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="南宁支队")
{
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","地王财富中心(模板)", "兴安油库(模板)"];
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","地王国际财富中心(模板)", "兴安油库(模板)"];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=0
if(window.localStorage["0"]==undefined)
@ -132,7 +206,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="柳州支队")
{
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街", "板栗园加气站 ","柳州万达广场"];
turnplate.restaraunts = ["龙城地下商业街", "板栗园加气站 ","柳州万达广场","地王国际财富中心(模板)"];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=1
if(window.localStorage["1"]==undefined)
@ -430,7 +504,7 @@ $(document).ready(function(){
turnplate.startAngle=0
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
$('.pointer').removeClass("stop")
$("#endjieguochen span").eq(10).html("")
$("#endjieguochen span").eq(4).html("")
}else{
for(var i=1;i<15;i++){
if(i==4){
@ -488,7 +562,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="玉林支队")
{
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) "];
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) ","地王国际财富中心(模板)"];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=8
if(window.localStorage["8"]==undefined)
@ -683,7 +757,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="南宁支队")
{
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","地王财富中心(模板)", "兴安油库(模板) "];
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)","地王国际财富中心(模板)", "兴安油库(模板) "];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=0
if(window.localStorage["0"]==undefined)
@ -719,7 +793,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="柳州支队")
{
turnplate.restaraunts = ["地王国际财富中心(模板)", "龙城地下商业街", "板栗园加气站 ","柳州万达广场"];
turnplate.restaraunts = ["龙城地下商业街", "板栗园加气站 ","柳州万达广场","地王国际财富中心(模板)"];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=1
if(window.localStorage["1"]==undefined)
@ -1046,7 +1120,7 @@ $(document).ready(function(){
drawRouletteWheel()
}else if($(this).html().substring(0,4)=="玉林支队")
{
turnplate.restaraunts = ["地王国际财富中心(模板)", "钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) "];
turnplate.restaraunts = ["钦州吾悦广场(模板)", "龙城地下商业街(模板)", "兴安油库(模板) ","地王国际财富中心(模板)"];
turnplate.colors = ["#FFEBEA", "#FF7245", "#FFEBEA", "#FF7245"];
num=8
if(window.localStorage["8"]==undefined)
@ -1319,10 +1393,10 @@ $(document).ready(function(){
//获取随机数(奖品个数范围内)
var item
if(window.localStorage["Luckdraw"]=="succed"){
if(num==3||num==8||num==13)
if(num==3||num==13)
{
item=Math.floor(Math.random()*(4+1-1)+1);
}else if(num==1||num==11||num==15||num==25){
}else if(num==11||num==15||num==25){
item=Math.floor(Math.random()*(2+1-1)+1);
} else if(num==0){
item=Math.floor(Math.random()*(3+1-1)+1);

Loading…
Cancel
Save