Browse Source

[修改]页面加载js修改

master
chenjingyu 4 years ago
parent
commit
6900f546e6
  1. 4
      src/app/ui/luck-draw/luck-draw.component.html
  2. 33
      src/app/ui/luck-draw/luck-draw.component.ts
  3. 7
      src/assets/js/zhuanpan.js

4
src/app/ui/luck-draw/luck-draw.component.html

@ -4,12 +4,12 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-25 08:48:50 * @Date: 2020-09-25 08:48:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2020-10-18 14:09:42 * @LastEditTime: 2020-10-18 14:51:07
--> -->
<html> <html>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<body> <body >
<div class="head"> <div class="head">
<img src="../../../assets/images/head.png"> <img src="../../../assets/images/head.png">
<!-- <span>指挥员能力考评抽签</span> --> <!-- <span>指挥员能力考评抽签</span> -->

33
src/app/ui/luck-draw/luck-draw.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-25 08:48:50 * @Date: 2020-09-25 08:48:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2020-10-18 11:06:41 * @LastEditTime: 2020-10-18 14:40:06
*/ */
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { from } from 'rxjs'; import { from } from 'rxjs';
@ -29,24 +29,25 @@ export class LuckDrawComponent implements OnInit {
window.setTimeout(()=>{ window.setTimeout(()=>{
//window.location.reload() //window.location.reload()
},0) },0)
console.log(this.weekArray)
} }
weekArray = JSON.parse(localStorage.getItem('arr'));
//支队数据和是否抽奖 //支队数据和是否抽奖
choujiang=[ choujiang=[
{name:"南宁支队(5)",idnum:1}, {name:`南宁支队(${this.weekArray[0]})`,idnum:1},
{name:"柳州支队(10)",idnum:2}, {name:`柳州支队(${this.weekArray[1]})`,idnum:2},
{name:"桂林支队(14)",idnum:3}, {name:`桂林支队(${this.weekArray[2]})`,idnum:3},
{name:"梧州支队(3)",idnum:4}, {name:`梧州支队(${this.weekArray[3]})`,idnum:4},
{name:"北海支队(8)",idnum:5}, {name:`北海支队(${this.weekArray[4]})`,idnum:5},
{name:"防城港支队(13)",idnum:6}, {name:`防城港支队(${this.weekArray[5]})`,idnum:6},
{name:"钦州支队(6)",idnum:7}, {name:`钦州支队(${this.weekArray[6]})`,idnum:7},
{name:"贵港支队(1)",idnum:8}, {name:`贵港支队(${this.weekArray[7]})`,idnum:8},
{name:"玉林支队(7)",idnum:9}, {name:`玉林支队(${this.weekArray[8]})`,idnum:9},
{name:"百色支队(12)",idnum:10}, {name:`百色支队(${this.weekArray[9]})`,idnum:10},
{name:"贺州支队(2)",idnum:11}, {name:`贺州支队(${this.weekArray[10]})`,idnum:11},
{name:"河池支队(4)",idnum:12}, {name:`河池支队(${this.weekArray[11]})`,idnum:12},
{name:"来宾支队(9)",idnum:13}, {name:`来宾支队(${this.weekArray[12]})`,idnum:13},
{name:"崇左支队(11)",idnum:14} {name:`崇左支队(${this.weekArray[13]})`,idnum:14}
] ]
//选中支队 //选中支队
chooseid=-1 chooseid=-1

7
src/assets/js/zhuanpan.js

@ -8,7 +8,7 @@ var turnplate={
startAngle:0, //开始角度 startAngle:0, //开始角度
bRotate:false //false:停止;ture:旋转 bRotate:false //false:停止;ture:旋转
}; };
var url=(window.location.href).substring(22.26) var url=(window.location.href).split("/")[(window.location.href).split("/").length - 1]
var num=-1 var num=-1
function chongzhi(){ function chongzhi(){
@ -16,17 +16,16 @@ function chongzhi(){
} }
$(document).ready(function(){ $(document).ready(function(){
console.log(url)
if(url=="twoStep"||url=="Reset"){ if(url=="twoStep"||url=="Reset"){
//$('.chongzhi').addClass("stop") //$('.chongzhi').addClass("stop")
$("#Reset").on("click",function(){ $("#Reset").on("contextmenu",function(){
drawRouletteWheel() drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png") $("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
localStorage.clear(); localStorage.clear();
localStorage.setItem("Luckdraw","succed") localStorage.setItem("Luckdraw","succed")
$('.pointer').removeClass("stop") $('.pointer').removeClass("stop")
}) })
$("#Reset").on("contextmenu",function(){ $("#Reset").on("click",function(){
drawRouletteWheel() drawRouletteWheel()
$("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png") $("#clickButton").attr("src", "../../../assets/images/turnplate-pointer.png")
localStorage.clear(); localStorage.clear();

Loading…
Cancel
Save