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