1.0.4 • Published 6 years ago

pm-js-utils v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

仁仁医疗常用 Javascript 代码块

电梯

getHashParams(hash)

获取 hash 参数

  • 参数
ParamTypeDescriptionSample
hashstringurl上#/{path}后内容"#/?id=a&user=abc"
  • 返回

    TypeDescriptionSample
    Object--{id: 'a', user: 'abc'}

getUrlParams(search)

获取 url 参数

  • 参数
ParamTypeDescriptionSample
searchstringurl上/{path}后内容"?id=a&user=abc"
  • 返回

    TypeDescriptionSample
    Object--{id: 'a', user: 'abc'}

randomString(length)

生成随机字符串

  • 参数
ParamTypeDescriptionSample
lengthnumber生成字符串的长度10
  • 返回

    TypeDescriptionSample
    string--"k2pnnc01f8hun"

readableDate(dateString)

将日期转为中文年月日日期

  • 参数
ParamTypeDescriptionSample
dateStringstring标准日期字符串"2010-10-01"
  • 返回

    TypeDescriptionSample
    string中文格式化日期"2010年10月1日"

setStorage(params)

批量 localstorage.setItem()

  • 参数
ParamTypeDescriptionSample
{key/value}objectkey/value{openId: "wewe", userId: "3"}
  • 返回

isWechat()

判断是否在微信浏览器

  • 参数 无
  • 返回

    TypeDescriptionSample
    boolean是或否true
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago