icity-community-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

icity-community-sdk

NPM version NPM downloads

Install

npm i icity-community-sdk
OR
yarn add icity-community-sdk

Use

useUserInfoByLevel(context)

参数

context 必填,当前 React 上下文,配合ReactContext
ContextProps为icp.getUserInfo()返回值

返回值

ParamsProps {
userType: number; // 当前账号级别 市 10 区县 0 街镇 1 社区村 2
status: number; // 当前账号级别 市 0 区县 1 街镇 2 社区村 3
cityCode?: string;
areaCode?: string;
streetCode?: string;
communityCode?: string;
}
useScroll(id,speed)

参数

id 必填,DomId
speed 非必填,滚动速度
ValidatePhone
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidatePhone
  value="178******96"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
ValidateIdCard
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidateIdCard
  value="3**************1"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
ValidateName
  • value 值
  • onShow ()=>Promise<string> 解除脱敏函数,由外部传入,返回一个明文的值(Promise)
<ValidateName
  value="*三"
  onShow={async () => {
    const auth = Auth();
    const info = getInfo({ auth /*q剩余参数*/ });
    /*需为string*/
    return info;
  }}
/>
AES
// 加密
aesEncrypt(val, key);
// 解密
aesDecrypt(val, key);
数据脱敏
encryptName(name); // *三
encryptIdCard(idCard); // 1*****************1
encryptPhone(phone); // 178******12

LICENSE

MIT

Readme

Keywords

Package Sidebar

Install

npm i icity-community-sdk

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

143 kB

Total Files

22

Last publish

Collaborators

  • lidemin