Commit fc4f6656 authored by wildfirecode13's avatar wildfirecode13

1

parent 883e62bd
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
} }
html, html,
body { body {
font-size: 24px; font-size: 12px;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
...@@ -10,21 +10,29 @@ import { Countdown } from 'teddi' ...@@ -10,21 +10,29 @@ import { Countdown } from 'teddi'
class Pageindex extends Component { class Pageindex extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { resList: resList }; this.state = { resList: resList ,countdown1:{},countdown2:{}};
} }
componentDidMount() { componentDidMount() {
const countdown = new Countdown(86400 * 2 + 3600 * 1 + 60 * 1 + 1, 'ddhhmmss'); const countdown = new Countdown(86400 * 2 + 3600 * 1 + 60 * 1 + 1, 'ddhhmmss');
countdown.on('update', (data) => { countdown.on('update', (data) => {
const { dd, hh, mm, ss } = data; this.setState({countdown1:data})
console.log(data)
}, this); }, this);
countdown.start(); countdown.start();
const countdown2 = new Countdown(3600 * 1 + 60 * 1 + 1, 'hhmmss');
countdown2.on('update', (data) => {
this.setState({countdown2:data})
}, this);
countdown2.start();
} }
render() { render() {
const {countdown1,countdown2} = this.state;
return <div className="index "> return <div className="index ">
<div> </div> <div> {countdown1.dd}:{countdown1.hh}:{countdown1.mm}:{countdown1.ss} </div>
<div> {countdown1.dd}{countdown1.hh}小时{countdown1.mm}分钟{countdown1.ss}</div>
<div> {countdown2.hh}小时{countdown2.mm}分钟{countdown2.ss}</div>
</div>; </div>;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment