# 系统能力

# Api域:

const native = kreator.native;

# native.getLoanMoreCommonParams(options)

获取设备基础通用信息

参数名 类型 描述
options NativeApiBaseRequest 基础入参类型

# 返回值

object 设备通用基础信息

native.getLoanMoreCommonParams().then((res) => {
    console.log(res);
});

# native.setTextToClipboard(options)

复制文本到剪贴板。

参数名 类型 描述
options ScreenBrightInterface 调用入参

# SetTextToClipboardInterface类型:

参数名 类型 描述
content string 复制文本内容
toast string 复制成功弹窗的提示文案
hideToast boolean 是否不显示弹窗,若false则显示toast文字

# 返回值

string 复制成功的文本

native.setTextToClipboard({
    content: '喵咪~',
    toast: '复制好了',
    hideToast: '1',
}).then((res) => {
    console.log(res);
});

# native.vibrateShort(options)

触发一段短时间的手机震动。

参数名 类型 描述
options NativeApiBaseRequest 入参类型

# 返回值

native.vibrateShort();

# native.vibrateLong(options)

触发一段长时间(400ms)的手机震动,目前仅Android支持

参数名 类型 描述
options NativeApiBaseRequest 入参类型

# 返回值

native.vibrateLong();

# native.makePhoneCall(options)

拨打电话。
Api不会校验电话格式,请在业务中自行校验检测。

参数名 类型 描述
options MakePhoneCallRequestInterface 入参类型

# MakePhoneCallRequestInterface类型:

参数名 类型 描述
phoneNumber number 小程序原始ID

# 返回值

native.makePhoneCall({
    phoneNumber: 15201669519,
});