Global

Methods

adapter(data, distkv)

数据转换器
Parameters:
Name Type Description
data object 需要转换的数据
distkv object 输出的键值对
Source:

antiShake(fn, wait)

防抖
Parameters:
Name Type Description
fn function 行为函数
wait number 防抖时长(ms)
Source:

Browser(uaStropt) → {object}

放置浏览器相关信息返回
Parameters:
Name Type Attributes Description
uaStr string <optional>
测试ua
Source:
Returns:
Type
object

concatClass() → {string}

react classname 拼接
Source:
Returns:
Type
string

countDown(endTimeStamp, options) → {string}

倒计时
Parameters:
Name Type Description
endTimeStamp number 倒计时结束时间戳
options Object 配置 showDouble,utils,info
Source:
Returns:
倒计时结果,小时:分:秒
Type
string

deleteCookie(name)

[deleteCookie 删除cookie]
Parameters:
Name Type Description
name string [name]
Source:

diffTime(label, isStar)

计算代码执行diff时间
Parameters:
Name Type Description
label * 日志标识
isStar * 开始执行时间标记
Source:

formatTimeStamp(str, format) → {string}

formatTimeStamp 时间格式化转换
Parameters:
Name Type Description
str number [时间戳]
format string [时间格式,[YY|YYYY]年 [mm|m]月 [dd|d]天 [hh|h]时 [ii|i]分 [ss|s]秒]
Source:
Returns:
[指定时间格式结果]
Type
string

getCookie(name) → {string}

[getCookie 获取cookie]
Parameters:
Name Type Description
name string [cookie name]
Source:
Returns:
[description]
Type
string

getQueryString(name) → {string}

[getQueryString 获取url请求参数]
Parameters:
Name Type Description
name string [参数名]
Source:
Returns:
Type
string

getRelesestage() → {string}

判断当前环境
Source:
Returns:
development || pre_product || localhost || product
Type
string

isEmtryObject(obj) → {Boolean}

[isEmtryObject 判断Object是否为空对象]
Parameters:
Name Type Description
obj object [obj]
Source:
Returns:
[返回结果布尔值]
Type
Boolean

objectAssign(obj1, obj2) → {object}

[objectAssign Object合并覆盖]
Parameters:
Name Type Description
obj1 Object [被覆盖对象]
obj2 Object [覆盖对象]
Source:
Returns:
[description]
Type
object

setCookie(name, value, day)

[setCookie 设置cookie]
Parameters:
Name Type Description
name string [cookie变量名]
value string [cokkie值]
day number [保存时间,单位:天,默认1天]
Source:

throttling(fn, wait)

节流
Parameters:
Name Type Description
fn function 行为函数
wait number 时间间隔(ms)
Source:

transformImageSize(size, imgsrc) → {string}

裁剪cdn图片
Parameters:
Name Type Description
size number 需要裁剪的尺寸
imgsrc string 需要裁剪的图片url
Source:
Returns:
url
Type
string