wx.showToast(OBJECT)
Display message prompt box
OBJECT parameter description:
[tr] Parameter type required description[/tr]
title | String | is the content of | prompt |
icon | String | No | icon, only supports "success" and "loading" |
duration | Number | No | The prompt delay time, in milliseconds, default: 1500, the maximum is 10000 |
success | Function | No | Callback function for successful interface call |
fail | Function | No | Callback function for failed interface call |
complete | Function | No | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
Sample code:
wx.showToast({ title: '成功'icon: 'success', duration: 2000 }) wx.hideToast()
Hide message prompt box
wx.showToast({ title: '加载中', icon: 'loading', duration: 10000 }) setTimeout(function() { wx.hideToast() }, 2000) wx.showModal(OBJECT)
##Show Modal pop-up window
OBJECT parameter description:[tr]Parameter type required description[/tr]
String | is the title of | prompt | |
String | Yes | Prompt content | |
Boolean | No | Whether to display the cancel button, the default is true | |
String | No | The text of the cancel button, the default is "Cancel" | |
HexColor | No | The text color of the cancel button, the default is "#000000" | |
String | No | The text of the confirmation button, the default is "OK" | |
HexColor | No | Determine the text color of the button, the default is "#3CC51F" | |
Function | No | The interface calls the callback function successfully. When res.confirm==1 is returned, it means the user clicked the OK button | |
Function | No | Callback function for failed interface call | |
Function | No | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
wx.showModal({ title: '提示', content: '这是一个模态弹窗', success: function(res) { if (res.confirm) { console.log('用户点击确定') } } }) wx.showActionSheet(OBJECT)
Display operation menu
OBJECT parameter description:
[tr]Required description of parameter type[/tr]
String Array | is the text array of the | button. The maximum length of the array is 6 | |
HexColor | No | The text color of the button, the default is "#000000" | |
Function | No | The interface calls the callback function successfully, please see the return parameter description for details | |
Function | No | Callback function for failed interface call | |
Function | No | The callback function at the end of the interface call (will be executed if the call is successful or failed) |
[tr]Parameter type description[/tr]
Boolean | Whether the user cancels the selection | |
Number | The buttons clicked by the user, in order from top to bottom, starting from 0 |
wx.showActionSheet({ itemList: ['A', 'B', 'C'], success: function(res) { if (!res.cancel) { console.log(res.tapIndex) } } })
More WeChat mini programs: Interactive Feedback API instructions Please pay attention to the PHP Chinese website for related articles!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment
