Commit 5247b187 authored by wildfirecode13's avatar wildfirecode13

1

parent 2389e25e
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -8,8 +8,11 @@ ...@@ -8,8 +8,11 @@
"tb": "spark build --type taobao" "tb": "spark build --type taobao"
}, },
"dependencies": { "dependencies": {
"@spark/api-base": "^1.0.11",
"@spark/projectx": "^1.0.3",
"axios": "^0.19.2", "axios": "^0.19.2",
"css-loader": "^3.6.0", "css-loader": "^3.6.0",
"duiba-utils": "^1.0.2",
"fyge-tbmini": "^1.3.1", "fyge-tbmini": "^1.3.1",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"prettier": "^2.0.5", "prettier": "^2.0.5",
...@@ -19,11 +22,9 @@ ...@@ -19,11 +22,9 @@
"react-redux": "^5.0.7", "react-redux": "^5.0.7",
"redux": "^4.0.0", "redux": "^4.0.0",
"redux-thunk": "^2.3.0", "redux-thunk": "^2.3.0",
"style-loader": "^1.2.1",
"spark-utils": "^0.0.12", "spark-utils": "^0.0.12",
"duiba-utils": "^1.0.2", "style-loader": "^1.2.1",
"@spark/api-base": "^1.0.11", "teddi": "file:../../work/teddi"
"@spark/projectx": "^1.0.3"
}, },
"devDependencies": { "devDependencies": {
"mockjs": "^1.1.0" "mockjs": "^1.1.0"
......
...@@ -4,24 +4,37 @@ import React, { Component } from 'react'; ...@@ -4,24 +4,37 @@ import React, { Component } from 'react';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import './index.less'; import './index.less';
import { Timer } from 'teddi';
class Index extends Component { class Index extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
resList: resList, resList: resList,
progressStyle: { progress: 0,
width: '0rem',
},
}; };
} }
componentDidMount() { componentDidMount() {
setInterval(() => {}, 1000); this.timer = this.timer || new Timer(60 * 2, 1000 / 60);
this.timer.on('timer', this.onUpdate, this);
this.timer.on('complete', this.onComplete, this);
this.timer.start();
}
onUpdate() {
console.log(this.timer.currentCount);
this.setState({
progress: (5.63 * this.timer.currentCount) / this.timer.repeatCount,
});
}
onComplete() {
console.log('on complete');
} }
render() { render() {
const { progressStyle } = this.state; const { progress } = this.state;
return ( return (
<div className="index " uuid="8a4a4e6e-9823-43ee-ae40-a6308642d137"> <div className="index " uuid="8a4a4e6e-9823-43ee-ae40-a6308642d137">
<img <img
...@@ -47,7 +60,9 @@ class Index extends Component { ...@@ -47,7 +60,9 @@ class Index extends Component {
src={this.state.resList['3b371680-825c-40ff-9828-28f78f4c4e32'].url} src={this.state.resList['3b371680-825c-40ff-9828-28f78f4c4e32'].url}
/> />
<img <img
style={progressStyle} style={{
width: `${progress}rem`,
}}
className="progressfront" className="progressfront"
uuid="775c5ac9-6269-49aa-8db3-758d7f9d57a8" uuid="775c5ac9-6269-49aa-8db3-758d7f9d57a8"
src={this.state.resList['57c1fb2b-f495-43ff-a215-61cf5f06cc53'].url} src={this.state.resList['57c1fb2b-f495-43ff-a215-61cf5f06cc53'].url}
......
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