显示 loading 提示框
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
message | String | 否 | 要显示的内容 |
success(Object res) | Function | 否 | 成功回调 |
fail | Function | 否 | 接口调用失败的回调函数 |
complete | Function | 否 | 执行结束回调 |
属性 | 类型 | 说明 |
---|---|---|
cancel | boolean | 为 true 时,用户 back 键取消 loading 提示框 |
显示消息提示框
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
message | String | 是 | 提示的内容 |
duration | Number | 否 | 0 为短时,1 为长时,默认 0 |
icon(1090+) | String | 否 | 图标,默认为'success' |
image(1090+) | String | 否 | 定义图标的本地路径,image 的优先级高于 icon |
success(1090+) | function | 否 | 接口调用成功的回调函数 |
fail(1090+) | function | 否 | 接口调用失败的回调函数 |
complete(1090+) | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
属性 | 说明 |
---|---|
success | 显示成功图标,此时 message 文本最多显示 7 个汉字长度 |
loading | 显示加载图标,此时 message 文本最多显示 7 个汉字长度 |
none | 不显示图标,此时 message 文本最多可显示两行 |
显示模态对话框
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
success | Function(Object res) | 否 | 成功回调 |
complete | Function | 否 | 执行结束后的回调 |
content | String | 是 | 提示的内容 |
title | String | 否 | 标题 |
fail | Function | 否 | 接口调用失败的回调函数 |
showCancel | Boolean | 否 | 是否显示取消按钮,默认 true |
cancelText | String | 否 | 取消按钮的文字,最多 4 个字符,默认值为'取消' |
confirmText | String | 否 | 确认按钮的文字,最多 4 个字符,默认值为'确定' |
confirmColor | String | 否 | 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串,默认值为'#576B95' |
cancelColor | String | 否 | 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串默认为'#576B95' |
属性 | 类型 | 说明 |
---|---|---|
confirm | Boolean | 为 true 时,表示用户点击了确定按钮 |
cancel | Boolean | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |
隐藏 loading 提示框
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
success | Function | 否 | 接口调用成功的回调函数 |
fail | Function | 否 | 接口调用失败的回调函数 |
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
隐藏消息提示框
object
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
success | function | 否 | 接口调用成功的回调函数 |
fail | function | 否 | 接口调用失败的回调函数 |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
显示操作菜单
object
属性 | 类型 | 必填 | 说明 |
---|---|---|---|
itemList | Array[string] | 是 | 按钮的文字数组,数组长度最大为 6 |
itemColor | string | 否 | 按钮的文字颜色,默认为#000000 |
success | function | 否 | 接口调用成功的回调函数 |
fail | function | 否 | 接口调用失败的回调函数 |
complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
res
属性 | 类型 | 说明 |
---|---|---|
tapIndex | number | 用户点击的按钮序号,从上到下的顺序,从 0 开始 |
示例代码:
qg.showActionSheet({
itemList: ["A", "B", "C"],
success(res) {
console.log(res.tapIndex);
},
fail(res) {
console.log(res.errMsg);
}
});