用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
## uni.showToast(OBJECT) 显示消息提示框。 **OBJECT参数说明** 参数 类型 必填 说明 ![](https://box.kancloud.cn/3e66046eb2ca43a94ebef7e0eea92a45_856x366.png) **icon 值说明** ![](https://box.kancloud.cn/dd3638abab85123468761aead96eb935_860x167.png) **示例** ``` uni.showToast({ title: '标题', duration: 2000 }); ``` ## uni.showLoading(OBJECT) 显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。 **OBJECT参数说明** ![](https://box.kancloud.cn/42eff0d5ae89f4d7c516cdcd3216ac97_867x246.png) **示例** ``` uni.showLoading({ title: '加载中' }); ``` **uni.hideToast()** 隐藏消息提示框。 **示例** ``` uni.hideToast(); uni.hideLoading() ``` 隐藏 loading 提示框。 **示例** ``` uni.showLoading({ title: '加载中' }); setTimeout(function () { uni.hideLoading(); }, 2000); ``` ## uni.showModal(OBJECT) 显示模态弹窗,类似于标准 html 的消息框:alert、confirm。 ![](https://box.kancloud.cn/1a562e0cb3febaf08a3d005a3044f6d3_859x441.png) **success返回参数说明** ![](https://box.kancloud.cn/1ff13fb4c2ea1b9b3116dccb05bee8de_858x125.png) ## 示例 uni.showModal({ title: '提示', content: '这是一个模态弹窗', success: function (res) { if (res.confirm) { console.log('用户点击确定'); } else if (res.cancel) { console.log('用户点击取消'); } } }); ## uni.showActionSheet(OBJECT) ​显示操作菜单 **OBJECT参数说明** ![](https://box.kancloud.cn/738ff74a283e5bd62cee43417cf5409f_857x243.png) **success返回参数说明** ![](https://box.kancloud.cn/3a3d0da1e273bbbb2fe4285908940487_866x93.png) **示例** uni.showActionSheet({ itemList: ['A', 'B', 'C'], success: function (res) { console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); }, fail: function (res) { console.log(res.errMsg); } });