邵佳豪 4 years ago
parent
commit
abdc6bfb4a
  1. 4
      src/app/ui/luck-draw/luck-draw.component.html
  2. 3
      src/app/ui/reset/reset.component.ts
  3. BIN
      src/assets/images/tophead.png
  4. 26
      src/assets/js/zhuanpan.js

4
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
-->
<html>
@ -51,7 +51,7 @@
</div>
</div>
<div class="chongzhi" style="height: 20%;"><button type="button" (click)="nextStep()" class="button">下一步</button></div>
<div class="chongzhi" style="height: 20%;display: none;"><button type="button" (click)="nextStep()" class="button">下一步</button></div>
</div>

3
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',

BIN
src/assets/images/tophead.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

26
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]);

Loading…
Cancel
Save