Commit af9b61b3 authored by wildfirecode13's avatar wildfirecode13

1

parent 3c8f904f
......@@ -30,8 +30,7 @@
"redux-thunk": "^2.3.0",
"spark-utils": "^0.0.12",
"style-loader": "^1.2.1",
"svgaplayerweb": "^2.3.1",
"teddi": "git+ssh://git@gitlab2.dui88.com:wildfirecode13/teddi.git"
"svgaplayerweb": "^2.3.1"
},
"devDependencies": {
"mockjs": "^1.1.0"
......
......@@ -4,7 +4,7 @@ import { Toast } from '@spark/ui';
import React, { Component } from 'react';
import dataCenter, { getAPIdata, getHomeInfo, netErrMsg, Role, Store } from '../../dataCenter';
import resList from '../../resconfig/resList'; //import API from '../../api';
import { debounce, Countdown } from "teddi";
import { debounce } from '../../ui';
import './select.less';
const startselidx = 1;
......
......@@ -6,8 +6,8 @@ import API from '../../api';
import { getHomeInfo } from '../../dataCenter';
import { Aup } from '../../pop';
import resList from '../../resconfig/resList'; //import API from '../../api';
import { debounce } from '../../ui';
import './sign.less';
import { debounce, Countdown } from "teddi";
class Sign extends Component {
constructor(props) {
......
......@@ -5,8 +5,8 @@ import React, { Component } from 'react';
import API from '../../api';
import { getHomeInfo } from '../../dataCenter';
import resList from '../../resconfig/resList';
import { debounce } from '../../ui';
import './userinfo.less';
import { debounce, Countdown } from "teddi";
class Userinfo extends Component {
constructor(props) {
super(props);
......
'use strict';
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';
......
/**
* 防连点
* @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