SDK相关的整理
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { IPlatformSDK } from "../core/IPlatformSDK";
|
||||
|
||||
export class WxPlatformSDK implements IPlatformSDK {
|
||||
init(cb?: Function): void {
|
||||
console.log("微信平台初始化");
|
||||
cb && cb();
|
||||
}
|
||||
|
||||
// 登录
|
||||
login(cb?: Function): void {
|
||||
console.log("调用微信登录");
|
||||
cb && cb({ code: "wx-code" });
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
getUserInfo(cb: (info: { nickName: string; avatarUrl: string }) => void): void {
|
||||
cb({ nickName: "小明", avatarUrl: "avatar.png" });
|
||||
}
|
||||
|
||||
// 检查平台权限
|
||||
checkPermission(scope: string, cb: (granted: boolean) => void): void {
|
||||
cb(true);
|
||||
}
|
||||
|
||||
// 复制文本到剪贴板
|
||||
copyToClipboard(text: string, cb?: Function): void {
|
||||
|
||||
}
|
||||
|
||||
// 客服功能是否可用
|
||||
kefuSupport(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 打开客服会话
|
||||
openKefu(): void {
|
||||
|
||||
}
|
||||
|
||||
// 获取设备分辨率
|
||||
getWindowSize(): { width: number, height: number } {
|
||||
return {width: 720, height: 1280};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "1cc51f5b-df3a-4ac7-b10e-52132843eb22",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user