diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 67e5b50..a070bca 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-10-07 15:00:15 * @LastEditors: sueRimn - * @LastEditTime: 2020-10-18 08:53:00 + * @LastEditTime: 2020-10-18 10:24:14 */ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; @@ -23,15 +23,20 @@ import { from } from 'rxjs'; import { FirstStepComponent } from './ui/first-step/first-step.component'; import { FourStepComponent } from './ui/four-step/four-step.component'; import { DrawingResultComponent } from './ui/drawing-result/drawing-result.component'; +import { FirstStepCopyComponent } from './ui/first-step-copy/first-step-copy.component'; +import { FourStepCopyComponent } from './ui/four-step-copy/four-step-copy.component'; const routes: Routes = [ {path:'',component:FirstStepComponent},//LuckDrawComponent {path:'twoStep',component:LuckDrawComponent}, + {path:'firstStep',component:FirstStepComponent}, + {path:'firstStep2',component:FirstStepCopyComponent}, {path:'Reset',component:ResetComponent}, //{path:'LuckDrawBatch',component:LuckDrawBatchComponent} {path:'fourStep',component:FourStepComponent}, - {path: 'drawingResult', component:DrawingResultComponent} + {path:'fourStep2',component:FourStepCopyComponent}, + {path:'drawingResult', component:DrawingResultComponent} // {path:'login', // component:LoginComponent}, diff --git a/src/app/ui/drawing-result/drawing-result.component.ts b/src/app/ui/drawing-result/drawing-result.component.ts index 3c35d99..c5ed57e 100644 --- a/src/app/ui/drawing-result/drawing-result.component.ts +++ b/src/app/ui/drawing-result/drawing-result.component.ts @@ -14,20 +14,20 @@ export class DrawingResultComponent implements OnInit { headersZero:string [] = ['序号','支队名称','抽签顺序', '职级','座位号'] tableDataZero = [ - {order: 1, fireName: '南宁支队', drawLotsOrder: '01', name: ['支队长','副支队长'], seatNum: ['01','02'] }, - {order: 2, fireName: '柳州支队', drawLotsOrder: '02', name: ['支队长','副支队长'], seatNum: ['03','04'] }, - {order: 3, fireName: '桂林支队', drawLotsOrder: '03', name: ['支队长','副支队长'], seatNum: ['05','06'] }, - {order: 4, fireName: '梧州支队', drawLotsOrder: '04', name: ['支队长','副支队长'], seatNum: ['01','02'] }, - {order: 5, fireName: '北海支队', drawLotsOrder: '05', name: ['支队长','副支队长'], seatNum: ['03','04'] }, - {order: 6, fireName: '防城港支队', drawLotsOrder: '06', name: ['支队长','副支队长'], seatNum: ['05','06'] }, - {order: 7, fireName: '钦州支队', drawLotsOrder: '07', name: ['支队长','副支队长'], seatNum: ['01','02'] }, - {order: 8, fireName: '贵港支队', drawLotsOrder: '08', name: ['支队长','副支队长'], seatNum: ['03','04'] }, - {order: 9, fireName: '玉林支队', drawLotsOrder: '09', name: ['支队长','副支队长'], seatNum: ['05','06'] }, - {order: 10, fireName: '百色支队', drawLotsOrder: '10', name: ['支队长','副支队长'], seatNum: ['01','02'] }, - {order: 11, fireName: '贺州支队', drawLotsOrder: '11', name: ['支队长','副支队长'], seatNum: ['03','04'] }, - {order: 12, fireName: '河池支队', drawLotsOrder: '12', name: ['支队长','副支队长'], seatNum: ['05','06'] }, - {order: 13, fireName: '来宾支队', drawLotsOrder: '13', name: ['支队长','副支队长'], seatNum: ['03','04'] }, - {order: 14, fireName: '崇左支队', drawLotsOrder: '14', name: ['支队长','副支队长'], seatNum: ['05','06'] }, + {order: 1, fireName: '南宁支队', drawLotsOrder: '12', name: ['支队长','副支队长'], seatNum: ['11号','17号'] }, + {order: 2, fireName: '柳州支队', drawLotsOrder: '07', name: ['支队长','副支队长'], seatNum: ['08号','15号'] }, + {order: 3, fireName: '桂林支队', drawLotsOrder: '01', name: ['支队长','副支队长'], seatNum: ['04号','21号'] }, + {order: 4, fireName: '梧州支队', drawLotsOrder: '06', name: ['支队长','副支队长'], seatNum: ['02号','26号'] }, + {order: 5, fireName: '北海支队', drawLotsOrder: '11', name: ['支队长','副支队长'], seatNum: ['07号','27号'] }, + {order: 6, fireName: '防城港支队', drawLotsOrder: '02', name: ['支队长','副支队长'], seatNum: ['12号','22号'] }, + {order: 7, fireName: '钦州支队', drawLotsOrder: '05', name: ['支队长','副支队长'], seatNum: ['03号','25号'] }, + {order: 8, fireName: '贵港支队', drawLotsOrder: '08', name: ['支队长','副支队长'], seatNum: ['01号','16号'] }, + {order: 9, fireName: '玉林支队', drawLotsOrder: '14', name: ['支队长','副支队长'], seatNum: ['09号','20号'] }, + {order: 10, fireName: '百色支队', drawLotsOrder: '3', name: ['支队长','副支队长'], seatNum: ['06号','18号'] }, + {order: 11, fireName: '贺州支队', drawLotsOrder: '9', name: ['支队长','副支队长'], seatNum: ['05号','23号'] }, + {order: 12, fireName: '河池支队', drawLotsOrder: '4', name: ['支队长','副支队长'], seatNum: ['14号','19号'] }, + {order: 13, fireName: '来宾支队', drawLotsOrder: '10', name: ['支队长','副支队长'], seatNum: ['10号','24号'] }, + {order: 14, fireName: '崇左支队', drawLotsOrder: '13', name: ['支队长','副支队长'], seatNum: ['13号','28号'] }, ] headers:string [] = ['序号','支队名称','抽签顺序','场景类型', '职级','座位号'] diff --git a/src/app/ui/first-step-copy/first-step-copy.component.html b/src/app/ui/first-step-copy/first-step-copy.component.html new file mode 100644 index 0000000..f71eebd --- /dev/null +++ b/src/app/ui/first-step-copy/first-step-copy.component.html @@ -0,0 +1,74 @@ + +
+
+ + + +
+
+ +
+
+
+ 请选择支队 + {{item.name}} + + +
+
+
+
+
+
+ 抽签结果: + {{item.result}} +
+
+
+ +
+ +
+ +
+
+
+ {{isDraw ? '已抽签' : '开始抽签'}} +
+
{{item.name}}
+
+ +
+ +
+ +
+
开始抽签
+ +
+ +
+ + +
+
+ + + + \ No newline at end of file diff --git a/src/app/ui/first-step-copy/first-step-copy.component.scss b/src/app/ui/first-step-copy/first-step-copy.component.scss new file mode 100644 index 0000000..85b9fd4 --- /dev/null +++ b/src/app/ui/first-step-copy/first-step-copy.component.scss @@ -0,0 +1,183 @@ + + + @import "../../../assets/css/laohujistyle.css"; + .box{ + width: 100%; + height: 100%; + overflow: hidden; + background-image: url("../../../assets/images/backgroud.png"); + background-size: 100%; + overflow: hidden; + } + .head{ + width: 100%; + height: 50px; + img{ + width: 100%; + height: 100%; + } + .ziti{ + position: relative; + bottom: 70%; + left: 40%; + width: 20%; + height: 53%; + } + span{ + position: relative; + bottom: 70%; + left: 45%; + font-size: 28px; + background:linear-gradient(#ff4b27, #ff6e41); + -webkit-background-clip: text; + color: transparent; + -webkit-text-fill-color: transparent; + text-fill-color: transparent; + } + } + .mainbox { + width: 99%; + height: 90%; + padding: 0.125rem 0.125rem 0; + display: flex; + } + + .centerLeft{ + background-color: #FFF; + float: left; + height: 98%; + width: 100%; + position: relative; + flex-direction: column; + flex: 2%; + display: flex; + align-items:center; + box-sizing: border-box; + margin: 0 0; + .tanCenterbtn{ + width: 350px; + height: 100%; + border: 1px solid #ECEDEE; + display: flex; + flex-direction: column; + user-select: none; + background-size:100% 100%; + span{ + white-space: nowrap; + font-family: Arial; + color: #000; + z-index:99; + width: 300px; + height: 40px; + cursor:pointer; + border-bottom:1px solid #ECEDEE; + padding:8px 24px ; + text-align: center; + font-size: 24px; + } + } + } + .centerLefta{ + background-color: #FFF; + float: left; + height: 98%; + width: 100%; + position: relative; + flex-direction: column; + flex: 2%; + display: flex; + align-items:center; + box-sizing: border-box; + margin: 0 0; + .tanCenterbtna{ + width: 100px; + height: 100%; + border: 1px solid #ECEDEE; + display: flex; + flex-direction: column; + user-select: none; + background-size:100% 100%; + span{ + white-space: nowrap; + font-family: Arial; + color: #000; + z-index:99; + width: 50px; + height: 40px; + cursor:pointer; + border-bottom:1px solid #ECEDEE; + padding:8px 24px ; + text-align: center; + font-size: 24px; + } + } + } + .colum{ + height: 90%; + width: 350px; + margin-top: 72px; + display:table-cell; + vertical-align:middle; + text-align: center; + span{ + font-size: 24px; + + //padding-top: 50%; + } + } + .zhuan{ + width: 500px; + margin-left: 160px; + margin-top: 10%; + } + .stop{ + pointer-events: none; + } + .button { + height: 48px; + width: 130px; + background-color:transparent; + border-radius: 4px; + border: 1px solid #ECEDEE; + color: #FFF; + padding: 12px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + } + .chongzhi{ + position: relative; + top: 85%; + right: 17%; + } + + //选择后加背景色 + .beijicolor{ + background-color:#FE693E ; + } + body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{margin:0;padding:0;border:0;} + body{color:#333; font-size:12px;font-family:"Microsoft YaHei"} + ul,ol{list-style-type:none;} + select,input,img,select{vertical-align:middle;} + input{ font-size:12px;} + a{ text-decoration:none; color:#000;} + a:hover{color:#c00; text-decoration:none;} + .clear{clear:both;} + + /* 大转盘样式 */ + .banner{//max-height: 650px; + display: block; + width: 95%; + //max-width: 650px; + margin-left: auto; + margin-right: auto; + margin-bottom: 20px; + } + .banner .turnplate{display:block;width:100%;position:relative;} + .banner .turnplate canvas.item{width:100%;height: 100%;} + .banner .turnplate img.pointer{position:absolute;width:30.5%;height:36.5%;left:34.6%;top:28.5%;} + + \ No newline at end of file diff --git a/src/app/ui/first-step-copy/first-step-copy.component.spec.ts b/src/app/ui/first-step-copy/first-step-copy.component.spec.ts new file mode 100644 index 0000000..b278102 --- /dev/null +++ b/src/app/ui/first-step-copy/first-step-copy.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FirstStepCopyComponent } from './first-step-copy.component'; + +describe('FirstStepCopyComponent', () => { + let component: FirstStepCopyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FirstStepCopyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FirstStepCopyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/first-step-copy/first-step-copy.component.ts b/src/app/ui/first-step-copy/first-step-copy.component.ts new file mode 100644 index 0000000..0960420 --- /dev/null +++ b/src/app/ui/first-step-copy/first-step-copy.component.ts @@ -0,0 +1,67 @@ +import { Component, OnInit } from '@angular/core'; +import '../../../assets/js/firststepcopy' +import { Router } from '@angular/router'; +@Component({ + selector: 'app-first-step-copy', + templateUrl: './first-step-copy.component.html', + styleUrls: ['./first-step-copy.component.scss'] +}) +export class FirstStepCopyComponent implements OnInit { + + constructor(private router: Router) { } + + ngOnInit(){ + window.setTimeout(()=>{ + //zhuan.drawRouletteWheel() + },0) + + } + //支队数据和是否抽奖 + choujiang=[ + {name:"南宁支队",id:1,result :localStorage.getItem("南宁支队copy") || ""}, + {name:"柳州支队",id:2,result :localStorage.getItem("柳州支队copy") || ""}, + {name:"桂林支队",id:3,result :localStorage.getItem("桂林支队copy") || ""}, + {name:"梧州支队",id:4,result :localStorage.getItem("梧州支队copy") || ""}, + {name:"北海支队",id:5,result :localStorage.getItem("北海支队copy") || ""}, + {name:"防城港支队",id:6,result :localStorage.getItem("防城港支队copy") || ""}, + {name:"钦州支队",id:7,result :localStorage.getItem("钦州支队copy") || ""}, + {name:"贵港支队",id:8,result :localStorage.getItem("贵港支队copy") || ""}, + {name:"玉林支队",id:9,result :localStorage.getItem("玉林支队copy") || ""}, + {name:"百色支队",id:10,result :localStorage.getItem("百色支队copy") || ""}, + {name:"贺州支队",id:11,result :localStorage.getItem("贺州支队copy") || ""}, + {name:"河池支队",id:12,result :localStorage.getItem("河池支队copy") || ""}, + {name:"来宾支队",id:13,result :localStorage.getItem("来宾支队copy") || ""}, + {name:"崇左支队",id:14,result :localStorage.getItem("崇左支队copy") || ""} + ] + numList = [ + {name:"1号",id:1}, + {name:"2号",id:2}, + {name:"3号",id:3}, + {name:"4号",id:4}, + {name:"5号",id:5}, + {name:"6号",id:6}, + {name:"7号",id:7}, + {name:"8号",id:8}, + {name:"9号",id:9}, + {name:"10号",id:10}, + {name:"11号",id:11}, + {name:"12号",id:12}, + {name:"13号",id:13}, + {name:"14号",id:14} + ] + //选中支队 + chooseid=-1 + isDraw = false + clickName(item){ + this.chooseid= item.id - 1 + localStorage.setItem("indexNum",item.id) + if(localStorage.getItem(item.name + 'copy')){//如果已经抽过 + this.isDraw = true + }else{ + this.isDraw = false + } + } + nextstep(){ + this.router.navigate(['/fourStep2']); + } +} diff --git a/src/app/ui/first-step/first-step.component.html b/src/app/ui/first-step/first-step.component.html index 3e17665..96a1e89 100644 --- a/src/app/ui/first-step/first-step.component.html +++ b/src/app/ui/first-step/first-step.component.html @@ -23,7 +23,7 @@ -->
-
+
请选择支队 {{item.name}} @@ -33,7 +33,7 @@
-
+
抽签结果: {{item.result}}
@@ -60,7 +60,6 @@
开始抽签
-
diff --git a/src/app/ui/four-step-copy/four-step-copy.component.html b/src/app/ui/four-step-copy/four-step-copy.component.html new file mode 100644 index 0000000..7eb1100 --- /dev/null +++ b/src/app/ui/four-step-copy/four-step-copy.component.html @@ -0,0 +1,77 @@ + +
+
+ + + +
+
+
+
+
+ 序号 + {{item.seatnum}} +
+
+
+
+
+
+ 请选择支队 + {{item.name}} + + +
+
+
+
+
+
+ 座位抽签结果: + {{item.result.zhi}}{{item.result.fuzhi}} +
+
+
+ +
+ +
+ +
+
+ +
{{item.name}}
+
+
+
{{item.name}}
+
+ +
+ +
+ +
+
开始抽签
+ +
+ +
+ + +
+
+ + + + \ No newline at end of file diff --git a/src/app/ui/four-step-copy/four-step-copy.component.scss b/src/app/ui/four-step-copy/four-step-copy.component.scss new file mode 100644 index 0000000..85b9fd4 --- /dev/null +++ b/src/app/ui/four-step-copy/four-step-copy.component.scss @@ -0,0 +1,183 @@ + + + @import "../../../assets/css/laohujistyle.css"; + .box{ + width: 100%; + height: 100%; + overflow: hidden; + background-image: url("../../../assets/images/backgroud.png"); + background-size: 100%; + overflow: hidden; + } + .head{ + width: 100%; + height: 50px; + img{ + width: 100%; + height: 100%; + } + .ziti{ + position: relative; + bottom: 70%; + left: 40%; + width: 20%; + height: 53%; + } + span{ + position: relative; + bottom: 70%; + left: 45%; + font-size: 28px; + background:linear-gradient(#ff4b27, #ff6e41); + -webkit-background-clip: text; + color: transparent; + -webkit-text-fill-color: transparent; + text-fill-color: transparent; + } + } + .mainbox { + width: 99%; + height: 90%; + padding: 0.125rem 0.125rem 0; + display: flex; + } + + .centerLeft{ + background-color: #FFF; + float: left; + height: 98%; + width: 100%; + position: relative; + flex-direction: column; + flex: 2%; + display: flex; + align-items:center; + box-sizing: border-box; + margin: 0 0; + .tanCenterbtn{ + width: 350px; + height: 100%; + border: 1px solid #ECEDEE; + display: flex; + flex-direction: column; + user-select: none; + background-size:100% 100%; + span{ + white-space: nowrap; + font-family: Arial; + color: #000; + z-index:99; + width: 300px; + height: 40px; + cursor:pointer; + border-bottom:1px solid #ECEDEE; + padding:8px 24px ; + text-align: center; + font-size: 24px; + } + } + } + .centerLefta{ + background-color: #FFF; + float: left; + height: 98%; + width: 100%; + position: relative; + flex-direction: column; + flex: 2%; + display: flex; + align-items:center; + box-sizing: border-box; + margin: 0 0; + .tanCenterbtna{ + width: 100px; + height: 100%; + border: 1px solid #ECEDEE; + display: flex; + flex-direction: column; + user-select: none; + background-size:100% 100%; + span{ + white-space: nowrap; + font-family: Arial; + color: #000; + z-index:99; + width: 50px; + height: 40px; + cursor:pointer; + border-bottom:1px solid #ECEDEE; + padding:8px 24px ; + text-align: center; + font-size: 24px; + } + } + } + .colum{ + height: 90%; + width: 350px; + margin-top: 72px; + display:table-cell; + vertical-align:middle; + text-align: center; + span{ + font-size: 24px; + + //padding-top: 50%; + } + } + .zhuan{ + width: 500px; + margin-left: 160px; + margin-top: 10%; + } + .stop{ + pointer-events: none; + } + .button { + height: 48px; + width: 130px; + background-color:transparent; + border-radius: 4px; + border: 1px solid #ECEDEE; + color: #FFF; + padding: 12px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + margin: 4px 2px; + cursor: pointer; + } + .chongzhi{ + position: relative; + top: 85%; + right: 17%; + } + + //选择后加背景色 + .beijicolor{ + background-color:#FE693E ; + } + body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{margin:0;padding:0;border:0;} + body{color:#333; font-size:12px;font-family:"Microsoft YaHei"} + ul,ol{list-style-type:none;} + select,input,img,select{vertical-align:middle;} + input{ font-size:12px;} + a{ text-decoration:none; color:#000;} + a:hover{color:#c00; text-decoration:none;} + .clear{clear:both;} + + /* 大转盘样式 */ + .banner{//max-height: 650px; + display: block; + width: 95%; + //max-width: 650px; + margin-left: auto; + margin-right: auto; + margin-bottom: 20px; + } + .banner .turnplate{display:block;width:100%;position:relative;} + .banner .turnplate canvas.item{width:100%;height: 100%;} + .banner .turnplate img.pointer{position:absolute;width:30.5%;height:36.5%;left:34.6%;top:28.5%;} + + \ No newline at end of file diff --git a/src/app/ui/four-step-copy/four-step-copy.component.spec.ts b/src/app/ui/four-step-copy/four-step-copy.component.spec.ts new file mode 100644 index 0000000..23d81d8 --- /dev/null +++ b/src/app/ui/four-step-copy/four-step-copy.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FourStepCopyComponent } from './four-step-copy.component'; + +describe('FourStepCopyComponent', () => { + let component: FourStepCopyComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FourStepCopyComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(FourStepCopyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/ui/four-step-copy/four-step-copy.component.ts b/src/app/ui/four-step-copy/four-step-copy.component.ts new file mode 100644 index 0000000..503fed5 --- /dev/null +++ b/src/app/ui/four-step-copy/four-step-copy.component.ts @@ -0,0 +1,80 @@ +import { Component, OnInit } from '@angular/core'; +import '../../../assets/js/fourstepcopy' +@Component({ + selector: 'app-four-step-copy', + templateUrl: './four-step-copy.component.html', + styleUrls: ['./four-step-copy.component.scss'] +}) +export class FourStepCopyComponent implements OnInit { + + constructor() { } + + ngOnInit(){ + window.setTimeout(()=>{ + //zhuan.drawRouletteWheel() + },0) + + } + + choujiang = [ + {name:"南宁支队",id:1,result :JSON.parse(localStorage.getItem("南宁支队seatnumbercopy")) || "",seatnum:"12"}, + {name:"柳州支队",id:2,result :JSON.parse(localStorage.getItem("柳州支队seatnumbercopy")) || "",seatnum:"7"}, + {name:"桂林支队",id:3,result :JSON.parse(localStorage.getItem("桂林支队seatnumbercopy")) || "",seatnum:"1"}, + {name:"梧州支队",id:4,result :JSON.parse(localStorage.getItem("梧州支队seatnumbercopy")) || "",seatnum:"6"}, + {name:"北海支队",id:5,result :JSON.parse(localStorage.getItem("北海支队seatnumbercopy")) || "",seatnum:"11"}, + {name:"防城港支队",id:6,result :JSON.parse(localStorage.getItem("防城港支队seatnumbercopy")) || "",seatnum:"2"}, + {name:"钦州支队",id:7,result :JSON.parse(localStorage.getItem("钦州支队seatnumbercopy")) || "",seatnum:"5"}, + {name:"贵港支队",id:8,result :JSON.parse(localStorage.getItem("贵港支队seatnumbercopy")) || "",seatnum:"8"}, + {name:"玉林支队",id:9,result :JSON.parse(localStorage.getItem("玉林支队seatnumbercopy")) || "",seatnum:"14"}, + {name:"百色支队",id:10,result :JSON.parse(localStorage.getItem("百色支队seatnumbercopy")) || "",seatnum:"3"}, + {name:"贺州支队",id:11,result :JSON.parse(localStorage.getItem("贺州支队seatnumbercopy")) || "",seatnum:"9"}, + {name:"河池支队",id:12,result :JSON.parse(localStorage.getItem("河池支队seatnumbercopy")) || "",seatnum:"4"}, + {name:"来宾支队",id:13,result :JSON.parse(localStorage.getItem("来宾支队seatnumbercopy")) || "",seatnum:"10"}, + {name:"崇左支队",id:14,result :JSON.parse(localStorage.getItem("崇左支队seatnumbercopy")) || "",seatnum:"13"} + ] + numList = [ + {name:"1号",id:1}, + {name:"2号",id:2}, + {name:"3号",id:3}, + {name:"4号",id:4}, + {name:"5号",id:5}, + {name:"6号",id:6}, + {name:"7号",id:7}, + {name:"8号",id:8}, + {name:"9号",id:9}, + {name:"10号",id:10}, + {name:"11号",id:11}, + {name:"12号",id:12}, + {name:"13号",id:13}, + {name:"14号",id:14} + ] + numList2 = [ + {name:"15号",id:15}, + {name:"16号",id:16}, + {name:"17号",id:17}, + {name:"18号",id:18}, + {name:"19号",id:19}, + {name:"20号",id:20}, + {name:"21号",id:21}, + {name:"22号",id:22}, + {name:"23号",id:23}, + {name:"24号",id:24}, + {name:"25号",id:25}, + {name:"26号",id:26}, + {name:"27号",id:27}, + {name:"28号",id:28} + ] + //选中支队 + chooseid=-1 + isDraw = false + clickName(item){ + this.chooseid = item.id - 1 + localStorage.setItem("indexNum",item.id) + if(localStorage.getItem(item.name + 'seatnumbercopy')){//如果已经抽过 + this.isDraw = true + }else{ + this.isDraw = false + } + } + +} diff --git a/src/app/ui/four-step/four-step.component.html b/src/app/ui/four-step/four-step.component.html index 40967bc..58f9bc5 100644 --- a/src/app/ui/four-step/four-step.component.html +++ b/src/app/ui/four-step/four-step.component.html @@ -13,15 +13,15 @@
- -
+
+
请选择支队 @@ -34,7 +34,7 @@
- 抽签结果: + 座位抽签结果: {{item.result.zhi}}{{item.result.fuzhi}}
diff --git a/src/app/ui/four-step/four-step.component.ts b/src/app/ui/four-step/four-step.component.ts index a3f2614..8fbafe2 100644 --- a/src/app/ui/four-step/four-step.component.ts +++ b/src/app/ui/four-step/four-step.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import '../../../assets/js/firststep2' +import '../../../assets/js/fourstep' @Component({ selector: 'app-four-step', templateUrl: './four-step.component.html', @@ -17,20 +17,20 @@ export class FourStepComponent implements OnInit { } //支队数据和是否抽奖 choujiang = [ - {name:"南宁支队",id:1,result :JSON.parse(localStorage.getItem("南宁支队seatnumber")) || ""}, - {name:"柳州支队",id:2,result :JSON.parse(localStorage.getItem("柳州支队seatnumber")) || ""}, - {name:"桂林支队",id:3,result :JSON.parse(localStorage.getItem("桂林支队seatnumber")) || ""}, - {name:"梧州支队",id:4,result :JSON.parse(localStorage.getItem("梧州支队seatnumber")) || ""}, - {name:"北海支队",id:5,result :JSON.parse(localStorage.getItem("北海支队seatnumber")) || ""}, - {name:"防城港支队",id:6,result :JSON.parse(localStorage.getItem("防城港支队seatnumber")) || ""}, - {name:"钦州支队",id:7,result :JSON.parse(localStorage.getItem("钦州支队seatnumber")) || ""}, - {name:"贵港支队",id:8,result :JSON.parse(localStorage.getItem("贵港支队seatnumber")) || ""}, - {name:"玉林支队",id:9,result :JSON.parse(localStorage.getItem("玉林支队seatnumber")) || ""}, - {name:"百色支队",id:10,result :JSON.parse(localStorage.getItem("百色支队seatnumber")) || ""}, - {name:"贺州支队",id:11,result :JSON.parse(localStorage.getItem("贺州支队seatnumber")) || ""}, - {name:"河池支队",id:12,result :JSON.parse(localStorage.getItem("河池支队seatnumber")) || ""}, - {name:"来宾支队",id:13,result :JSON.parse(localStorage.getItem("来宾支队seatnumber")) || ""}, - {name:"崇左支队",id:14,result :JSON.parse(localStorage.getItem("崇左支队seatnumber")) || ""} + {name:"南宁支队",id:1,result :JSON.parse(localStorage.getItem("南宁支队seatnumber")) || "",seatnum:"5"}, + {name:"柳州支队",id:2,result :JSON.parse(localStorage.getItem("柳州支队seatnumber")) || "",seatnum:"10"}, + {name:"桂林支队",id:3,result :JSON.parse(localStorage.getItem("桂林支队seatnumber")) || "",seatnum:"14"}, + {name:"梧州支队",id:4,result :JSON.parse(localStorage.getItem("梧州支队seatnumber")) || "",seatnum:"3"}, + {name:"北海支队",id:5,result :JSON.parse(localStorage.getItem("北海支队seatnumber")) || "",seatnum:"8"}, + {name:"防城港支队",id:6,result :JSON.parse(localStorage.getItem("防城港支队seatnumber")) || "",seatnum:"13"}, + {name:"钦州支队",id:7,result :JSON.parse(localStorage.getItem("钦州支队seatnumber")) || "",seatnum:"6"}, + {name:"贵港支队",id:8,result :JSON.parse(localStorage.getItem("贵港支队seatnumber")) || "",seatnum:"1"}, + {name:"玉林支队",id:9,result :JSON.parse(localStorage.getItem("玉林支队seatnumber")) || "",seatnum:"7"}, + {name:"百色支队",id:10,result :JSON.parse(localStorage.getItem("百色支队seatnumber")) || "",seatnum:"12"}, + {name:"贺州支队",id:11,result :JSON.parse(localStorage.getItem("贺州支队seatnumber")) || "",seatnum:"2"}, + {name:"河池支队",id:12,result :JSON.parse(localStorage.getItem("河池支队seatnumber")) || "",seatnum:"4"}, + {name:"来宾支队",id:13,result :JSON.parse(localStorage.getItem("来宾支队seatnumber")) || "",seatnum:"9"}, + {name:"崇左支队",id:14,result :JSON.parse(localStorage.getItem("崇左支队seatnumber")) || "",seatnum:"11"} ] numList = [ {name:"1号",id:1}, diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index 6ac5179..4859b38 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -64,10 +64,12 @@ import { ResetComponent } from './reset/reset.component'; import { FirstStepComponent } from './first-step/first-step.component'; import { FourStepComponent } from './four-step/four-step.component'; import { DrawingResultComponent } from './drawing-result/drawing-result.component'; +import { FirstStepCopyComponent } from './first-step-copy/first-step-copy.component'; +import { FourStepCopyComponent } from './four-step-copy/four-step-copy.component'; @NgModule({ - declarations: [SafeHtmlPipe,UiComponent,PersonaldataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe,WorkingAreaComponent, LuckDrawComponent, ResetComponent, DrawingResultComponent, FirstStepComponent, FourStepComponent], + declarations: [SafeHtmlPipe,UiComponent,PersonaldataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe,WorkingAreaComponent, LuckDrawComponent, ResetComponent, DrawingResultComponent, FirstStepComponent, FourStepComponent, FirstStepCopyComponent, FourStepCopyComponent], imports: [ CommonModule, diff --git a/src/assets/js/firststep.js b/src/assets/js/firststep.js index bdb836a..19b8b84 100644 --- a/src/assets/js/firststep.js +++ b/src/assets/js/firststep.js @@ -6,7 +6,6 @@ $(document).ready(function(){ active : 0, delay : 500, randomize : function(activeElementIndex){ - console.log("xxxxx") if(selected == "南宁支队"){ localStorage.setItem(selected,"5号") return 5; @@ -65,8 +64,8 @@ $(document).ready(function(){ machine.stop(); // $("#slotMachineButtonShuffle").removeClass("disabled"); setTimeout(() => { - $("#endjieguo span").eq(selectedIndex).html(window.localStorage[selected]) - $("#chooseZhi .img").eq(selectedIndex - 1).css("display","inline-block"); + $("#endjieguoshao span").eq(selectedIndex).html(window.localStorage[selected]) + $("#chooseZhishao .img").eq(selectedIndex - 1).css("display","inline-block"); }, 1300); }, 1000); } @@ -77,7 +76,7 @@ $(document).ready(function(){ $("span[name='aaa']").on("click",function(e,index){ selected = $(this)[0].innerText selectedIndex = localStorage.getItem("indexNum") - if($("#endjieguo span").eq(selectedIndex)[0].innerText){ + if($("#endjieguoshao span").eq(selectedIndex)[0].innerText){ $("#slotMachineButtonShuffle").addClass("disabled"); }else{ $("#slotMachineButtonShuffle").removeClass("disabled"); diff --git a/src/assets/js/firststepcopy.js b/src/assets/js/firststepcopy.js new file mode 100644 index 0000000..cbdc8c1 --- /dev/null +++ b/src/assets/js/firststepcopy.js @@ -0,0 +1,85 @@ +$(document).ready(function(){ + var index = 0 + var selected = null //点击的单位名称 + var selectedcopy = null + var selectedIndex = null //点击的单位index + var machine = $("#machine10").slotMachine({ + active : 0, + delay : 500, + randomize : function(activeElementIndex){ + if(selected == "南宁支队"){ + localStorage.setItem(selectedcopy,"12号") + return 12; + }else if(selected == "柳州支队"){ + localStorage.setItem(selectedcopy,'7号') + return 7; + }else if(selected == "桂林支队"){ + localStorage.setItem(selectedcopy,'1号') + return 1; + }else if(selected == "梧州支队"){ + localStorage.setItem(selectedcopy,'6号') + return 6; + }else if(selected == "北海支队"){ + localStorage.setItem(selectedcopy,'11号') + return 11; + }else if(selected == "防城港支队"){ + localStorage.setItem(selectedcopy,'2号') + return 2; + }else if(selected == "钦州支队"){ + localStorage.setItem(selectedcopy,'5号') + return 5; + }else if(selected == "贵港支队"){ + localStorage.setItem(selectedcopy,'8号') + return 8; + }else if(selected == "玉林支队"){ + localStorage.setItem(selectedcopy,'14号') + return 14; + }else if(selected == "百色支队"){ + localStorage.setItem(selectedcopy,'3号') + return 3; + }else if(selected == "贺州支队"){ + localStorage.setItem(selectedcopy,'9号') + return 9; + }else if(selected == "河池支队"){ + localStorage.setItem(selectedcopy,'4号') + return 4; + }else if(selected == "来宾支队"){ + localStorage.setItem(selectedcopy,'10号') + return 10; + }else if(selected == "崇左支队"){ + localStorage.setItem(selectedcopy,'13号') + return 13; + } + } + }); + + $("#slotMachineButtonShuffle10").click(function(){ + if(!selected){ + alert("请先选择单位") + }else{ + machine.shuffle(); + $("#slotMachineButtonShuffle10").addClass("disabled"); + setTimeout(() => { + machine.stop(); + // $("#slotMachineButtonShuffle").removeClass("disabled"); + setTimeout(() => { + $("#endjieguo10 span").eq(selectedIndex).html(window.localStorage[selectedcopy]) + $("#chooseZhi10 .img").eq(selectedIndex - 1).css("display","inline-block"); + }, 1300); + }, 1000); + } + + }); + + //左侧表格点击事件 + $("span[name='yyy']").on("click",function(e,index){ + selected = $(this)[0].innerText + selectedcopy = $(this)[0].innerText + 'copy' + selectedIndex = localStorage.getItem("indexNum") + if($("#endjieguo10 span").eq(selectedIndex)[0].innerText){ + $("#slotMachineButtonShuffle10").addClass("disabled"); + }else{ + $("#slotMachineButtonShuffle10").removeClass("disabled"); + } + }) +}); \ No newline at end of file diff --git a/src/assets/js/firststep2.js b/src/assets/js/fourstep.js similarity index 100% rename from src/assets/js/firststep2.js rename to src/assets/js/fourstep.js diff --git a/src/assets/js/fourstepcopy.js b/src/assets/js/fourstepcopy.js new file mode 100644 index 0000000..39f9f04 --- /dev/null +++ b/src/assets/js/fourstepcopy.js @@ -0,0 +1,151 @@ +$(document).ready(function(){ + var index = 0 + var selected = null //点击的单位名称 + var selectedtime = null //点击的单位名称 + 'time' + var selectedIndex = null //点击的单位index + var machine = $("#machine12").slotMachine({ + active : 0, + delay : 500, + randomize : function(activeElementIndex){ + if(selected == "南宁支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"11号",fuzhi:"17号"})) + return 10; + }else if(selected == "柳州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"8号",fuzhi:"15号"})) + return 7; + }else if(selected == "桂林支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"4号",fuzhi:"21号"})) + return 3; + }else if(selected == "梧州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"2号",fuzhi:"26号"})) + return 1; + }else if(selected == "北海支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"7号",fuzhi:"27号"})) + return 6; + }else if(selected == "防城港支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"12号",fuzhi:"22号"})) + return 11; + }else if(selected == "钦州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"3号",fuzhi:"25号"})) + return 2; + }else if(selected == "贵港支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"1号",fuzhi:"16号"})) + return 0; + }else if(selected == "玉林支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"9号",fuzhi:"20号"})) + return 8; + }else if(selected == "百色支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"6号",fuzhi:"18号"})) + return 5; + }else if(selected == "贺州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"5号",fuzhi:"23号"})) + return 4; + }else if(selected == "河池支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"14号",fuzhi:"19号"})) + return 13; + }else if(selected == "来宾支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"10号",fuzhi:"24号"})) + return 9; + }else if(selected == "崇左支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"13号",fuzhi:"28号"})) + return 12; + } + } + }); + var machine6 = $("#machine16").slotMachine({ + active : 1, + delay : 500, + randomize : function(activeElementIndex){ + if(selected == "南宁支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"11号",fuzhi:"17号"})) + return 2; + }else if(selected == "柳州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"8号",fuzhi:"15号"})) + return 0; + }else if(selected == "桂林支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"4号",fuzhi:"21号"})) + return 6; + }else if(selected == "梧州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"2号",fuzhi:"26号"})) + return 11; + }else if(selected == "北海支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"7号",fuzhi:"27号"})) + return 12; + }else if(selected == "防城港支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"12号",fuzhi:"22号"})) + return 7; + }else if(selected == "钦州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"3号",fuzhi:"25号"})) + return 10; + }else if(selected == "贵港支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"1号",fuzhi:"16号"})) + return 1; + }else if(selected == "玉林支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"9号",fuzhi:"20号"})) + return 5; + }else if(selected == "百色支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"6号",fuzhi:"18号"})) + return 3; + }else if(selected == "贺州支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"5号",fuzhi:"23号"})) + return 8; + }else if(selected == "河池支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"14号",fuzhi:"19号"})) + return 4; + }else if(selected == "来宾支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"10号",fuzhi:"24号"})) + return 9; + }else if(selected == "崇左支队"){ + localStorage.setItem(selectedtime,JSON.stringify({zhi:"13号",fuzhi:"28号"})) + return 13; + } + } + }); + var data = [ + {'南宁支队':'11号17号'}, + {'柳州支队':'8号15号'}, + {'桂林支队':'4号21号'}, + {'梧州支队':'2号26号'}, + {'北海支队':'7号27号'}, + {'防城港支队':'12号22号'}, + {'钦州支队':'3号25号'}, + {'贵港支队':'1号16号'}, + {'玉林支队':'9号20号'}, + {'百色支队':'6号18号'}, + {'贺州支队':'5号23号'}, + {'河池支队':'14号19号'}, + {'来宾支队':'10号24号'}, + {'崇左支队':'13号28号'} + ] + + $("#slotMachineButtonShuffle22").click(function(){ + if(!selected){ + alert("请先选择单位") + }else{ + machine.shuffle(); + machine6.shuffle(); + $("#slotMachineButtonShuffle22").addClass("disabled"); + setTimeout(() => { + machine.stop(); + machine6.stop(); + setTimeout(() => { + $("#endjieguo22 span").eq(selectedIndex).html(data[selectedIndex - 1][selected]) + $("#chooseZhi22 .img").eq(selectedIndex - 1).css("display","inline-block"); + }, 1300); + }, 1000); + } + }); + + //左侧表格点击事件 + $("span[name='zzz']").on("click",function(e,index){ + selected = $(this)[0].innerText + selectedtime = $(this)[0].innerText + 'seatnumbercopy' + selectedIndex = localStorage.getItem("indexNum") + // console.log(456,selected,selectedIndex) + if($("#endjieguo22 span").eq(selectedIndex)[0].innerText){ + $("#slotMachineButtonShuffle22").addClass("disabled"); + }else{ + $("#slotMachineButtonShuffle22").removeClass("disabled"); + } + }) +}); \ No newline at end of file