Commit af9b61b3 authored by wildfirecode13's avatar wildfirecode13

1

parent 3c8f904f
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
"redux-thunk": "^2.3.0", "redux-thunk": "^2.3.0",
"spark-utils": "^0.0.12", "spark-utils": "^0.0.12",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",
"svgaplayerweb": "^2.3.1", "svgaplayerweb": "^2.3.1"
"teddi": "git+ssh://git@gitlab2.dui88.com:wildfirecode13/teddi.git"
}, },
"devDependencies": { "devDependencies": {
"mockjs": "^1.1.0" "mockjs": "^1.1.0"
......
...@@ -4,7 +4,7 @@ import { Toast } from '@spark/ui'; ...@@ -4,7 +4,7 @@ import { Toast } from '@spark/ui';
import React, { Component } from 'react'; import React, { Component } from 'react';
import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../../dataCenter'; import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../../dataCenter';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import { debounce, Countdown } from "teddi"; import { debounce } from '../../ui';
import './select.less'; import './select.less';
const startselidx = 1; const startselidx = 1;
......
...@@ -6,8 +6,8 @@ import API from '../../api'; ...@@ -6,8 +6,8 @@ import API from '../../api';
import { getHomeInfo } from '../../dataCenter'; import { getHomeInfo } from '../../dataCenter';
import { Aup } from '../../pop'; import { Aup } from '../../pop';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import { debounce } from '../../ui';
import './sign.less'; import './sign.less';
import { debounce, Countdown } from "teddi";
class Sign extends Component { class Sign extends Component {
constructor(props) { constructor(props) {
......
...@@ -5,8 +5,8 @@ import React, { Component } from 'react'; ...@@ -5,8 +5,8 @@ import React, { Component } from 'react';
import API from '../../api'; import API from '../../api';
import { getHomeInfo } from '../../dataCenter'; import { getHomeInfo } from '../../dataCenter';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
import { debounce } from '../../ui';
import './userinfo.less'; import './userinfo.less';
import { debounce, Countdown } from "teddi";
class Userinfo extends Component { class Userinfo extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
......
'use strict'; 'use strict';
import { appID } from 'duiba-utils'; import { appID } from 'duiba-utils';
import React, { Component } from 'react'; // import { Timer } from 'teddi'; import React, { Component } from 'react';
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
......
/**
* 防连点
* @param fn 点击处理方法
* @param wait 等待时间,单位毫秒,默认2000
*/
export const debounce = (fn, wait=2000, immediate = true) => {
let timer;
return function () {
if (timer) clearTimeout(timer)
if (immediate) {
// 如果已经执行过,不再执行
var callNow = !timer
timer = setTimeout(() => {
timer = null
}, wait)
if (callNow) {
fn()
}
} else {
timer = setTimeout(() => {
fn()
}, wait)
}
}
}
\ No newline at end of file
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