Browse Source

[完善]第一个页面跳转限制

master
邵佳豪 4 years ago
parent
commit
ac1e90473f
  1. 8
      src/app/ui/first-step/first-step.component.html
  2. 2
      src/app/ui/first-step/first-step.component.scss
  3. 40
      src/app/ui/first-step/first-step.component.ts

8
src/app/ui/first-step/first-step.component.html

@ -13,15 +13,15 @@
<img class="ziti" src="../../../assets/images/tophead.png"> <img class="ziti" src="../../../assets/images/tophead.png">
</div> </div>
<div class="mainbox"> <div class="mainbox">
<!-- <div class="colum" style="margin-left: 13%;width: 100px;"> <div class="colum" style="margin-left: 13%;width: 100px;">
<div class="centerLefta" > <div class="centerLefta" >
<div class="tanCenterbtna" id="chooseZhi"> <div class="tanCenterbtna" id="chooseZhi">
<span style="background-color: #ff4d29;color:#FFF;" >序号</span> <span style="background-color: #ff4d29;color:#FFF;" >序号</span>
<span *ngFor="let item of choujiang; let key=index" [ngClass]="{'beijicolor': chooseid ==key}" >{{item.idnum}}</span> <span *ngFor="let item of choujiang; let key=index" [ngClass]="{'beijicolor': chooseid ==key}" >{{item.id}}</span>
</div> </div>
</div> </div>
</div> --> </div>
<div class="colum" style="margin-left: 150px;"> <div class="colum">
<div class="centerLeft" > <div class="centerLeft" >
<div class="tanCenterbtn" id="chooseZhishao"> <div class="tanCenterbtn" id="chooseZhishao">
<span style="background-color: #ff4d29;color:#FFF;" name="zhidui" data-id=`{{chooseid}}`>请选择支队</span> <span style="background-color: #ff4d29;color:#FFF;" name="zhidui" data-id=`{{chooseid}}`>请选择支队</span>

2
src/app/ui/first-step/first-step.component.scss

@ -136,7 +136,7 @@ font-size: 24px;
.chongzhi{ .chongzhi{
position: relative; position: relative;
top: 85%; top: 85%;
right: 30%; right: 23.5%
} }
.button { .button {
height: 48px; height: 48px;

40
src/app/ui/first-step/first-step.component.ts

@ -15,23 +15,7 @@ export class FirstStepComponent implements OnInit {
},0) },0)
} }
//支队数据和是否抽奖
choujiang=[
{name:"南宁支队",id:1,result :localStorage.getItem("南宁支队") || ""},
{name:"柳州支队",id:2,result :localStorage.getItem("柳州支队") || ""},
{name:"桂林支队",id:3,result :localStorage.getItem("桂林支队") || ""},
{name:"梧州支队",id:4,result :localStorage.getItem("梧州支队") || ""},
{name:"北海支队",id:5,result :localStorage.getItem("北海支队") || ""},
{name:"防城港支队",id:6,result :localStorage.getItem("防城港支队") || ""},
{name:"钦州支队",id:7,result :localStorage.getItem("钦州支队") || ""},
{name:"贵港支队",id:8,result :localStorage.getItem("贵港支队") || ""},
{name:"玉林支队",id:9,result :localStorage.getItem("玉林支队") || ""},
{name:"百色支队",id:10,result :localStorage.getItem("百色支队") || ""},
{name:"贺州支队",id:11,result :localStorage.getItem("贺州支队") || ""},
{name:"河池支队",id:12,result :localStorage.getItem("河池支队") || ""},
{name:"来宾支队",id:13,result :localStorage.getItem("来宾支队") || ""},
{name:"崇左支队",id:14,result :localStorage.getItem("崇左支队") || ""}
]
numList = [ numList = [
{name:"1号",id:1}, {name:"1号",id:1},
{name:"2号",id:2}, {name:"2号",id:2},
@ -62,6 +46,28 @@ export class FirstStepComponent implements OnInit {
} }
//跳转第二个页面 //跳转第二个页面
nextStep(){ nextStep(){
if(localStorage.getItem("南宁支队") && localStorage.getItem("柳州支队") && localStorage.getItem("桂林支队") && localStorage.getItem("梧州支队") && localStorage.getItem("北海支队") && localStorage.getItem("防城港支队") && localStorage.getItem("钦州支队") && localStorage.getItem("贵港支队") && localStorage.getItem("玉林支队") && localStorage.getItem("百色支队") && localStorage.getItem("贺州支队") && localStorage.getItem("河池支队") && localStorage.getItem("来宾支队") && localStorage.getItem("崇左支队")){
window.location.href="/twoStep"; window.location.href="/twoStep";
}else{
alert("未全部抽完!")
} }
}
//支队数据和是否抽奖
choujiang=[
{name:"南宁支队",id:1,result :localStorage.getItem("南宁支队") || ""},
{name:"柳州支队",id:2,result :localStorage.getItem("柳州支队") || ""},
{name:"桂林支队",id:3,result :localStorage.getItem("桂林支队") || ""},
{name:"梧州支队",id:4,result :localStorage.getItem("梧州支队") || ""},
{name:"北海支队",id:5,result :localStorage.getItem("北海支队") || ""},
{name:"防城港支队",id:6,result :localStorage.getItem("防城港支队") || ""},
{name:"钦州支队",id:7,result :localStorage.getItem("钦州支队") || ""},
{name:"贵港支队",id:8,result :localStorage.getItem("贵港支队") || ""},
{name:"玉林支队",id:9,result :localStorage.getItem("玉林支队") || ""},
{name:"百色支队",id:10,result :localStorage.getItem("百色支队") || ""},
{name:"贺州支队",id:11,result :localStorage.getItem("贺州支队") || ""},
{name:"河池支队",id:12,result :localStorage.getItem("河池支队") || ""},
{name:"来宾支队",id:13,result :localStorage.getItem("来宾支队") || ""},
{name:"崇左支队",id:14,result :localStorage.getItem("崇左支队") || ""}
]
} }

Loading…
Cancel
Save