From 92fc11d4a793902a6f17a3ebd0e9a9f89f3c6dd6 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Sun, 18 Oct 2020 14:21:48 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=87=8D=E7=BD=AE=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E6=8C=89=E9=94=AE=E4=BB=A3=E8=A1=A8=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/ui/luck-draw/luck-draw.component.html | 4 +-- src/app/ui/reset/reset.component.ts | 3 ++- src/assets/js/zhuanpan.js | 26 ++++++++++++++----- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/app/ui/luck-draw/luck-draw.component.html b/src/app/ui/luck-draw/luck-draw.component.html index 656d47e..5581768 100644 --- a/src/app/ui/luck-draw/luck-draw.component.html +++ b/src/app/ui/luck-draw/luck-draw.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-09-25 08:48:50 * @LastEditors: sueRimn - * @LastEditTime: 2020-10-18 10:41:21 + * @LastEditTime: 2020-10-18 14:09:42 --> @@ -50,7 +50,7 @@ -
+ diff --git a/src/app/ui/reset/reset.component.ts b/src/app/ui/reset/reset.component.ts index 2f29ed2..7d9ebde 100644 --- a/src/app/ui/reset/reset.component.ts +++ b/src/app/ui/reset/reset.component.ts @@ -4,9 +4,10 @@ * @Author: sueRimn * @Date: 2020-10-07 15:38:37 * @LastEditors: sueRimn - * @LastEditTime: 2020-10-14 09:17:22 + * @LastEditTime: 2020-10-18 13:28:58 */ import { Component, OnInit } from '@angular/core'; +import '../../../assets/js/zhuanpan' @Component({ selector: 'app-reset', diff --git a/src/assets/js/zhuanpan.js b/src/assets/js/zhuanpan.js index 06d4647..a08767b 100644 --- a/src/assets/js/zhuanpan.js +++ b/src/assets/js/zhuanpan.js @@ -17,12 +17,20 @@ function chongzhi(){ $(document).ready(function(){ console.log(url) - if(url=="twoStep"){ - $('.chongzhi').addClass("stop") + if(url=="twoStep"||url=="Reset"){ + //$('.chongzhi').addClass("stop") $("#Reset").on("click",function(){ drawRouletteWheel() $("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png") localStorage.clear(); + localStorage.setItem("Luckdraw","succed") + $('.pointer').removeClass("stop") + }) + $("#Reset").on("contextmenu",function(){ + drawRouletteWheel() + $("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png") + localStorage.clear(); + localStorage.removeItem("Luckdraw") $('.pointer').removeClass("stop") }) for(var i=0;i<14;i++){ @@ -80,7 +88,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) @@ -625,6 +633,7 @@ $(document).ready(function(){ $("#clickButton").attr("src", "../../../assets/images/turnplate-pointer-hui.png") $("span[name='aaachen']").removeClass("stop") $('.chongzhi').removeClass("stop") + $('.chongzhi').show() //抽签完成后左侧表格点击事件 $("span[name='aaachen']").on("click",function(){ @@ -669,7 +678,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) @@ -1304,17 +1313,20 @@ $(document).ready(function(){ turnplate.bRotate = !turnplate.bRotate; //获取随机数(奖品个数范围内) var item - if(num==0||num==3||num==8||num==13||num==14||num==17||num==22||num==27) + if(window.localStorage["Luckdraw"]=="succed"){ + if(num==3||num==8||num==13) { 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==0){ item=Math.floor(Math.random()*(3+1-1)+1); - } */ + } else{ item=rnd(1,turnplate.restaraunts.length); } + }else{item=Math.floor(Math.random()*(4+1-1)+1);} + console.log(item) //奖品数量等于10,指针落在对应奖品区域的中心角度[252, 216, 180, 144, 108, 72, 36, 360, 324, 288] rotateFn(item, turnplate.restaraunts[item-1]);