This API is called using wx.hideLoading(Object object).
Property | Type | Default value | Required | Description |
noConflict | boolean | false | False | Currently, toast and loading related APIs can be used interchangeably. This parameter can be used to cancel this feature. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.hideToast(Object object).
Property | Type | Default value | Required | Description |
noConflict | boolean | false | False | Currently, toast and loading related APIs can be used interchangeably. This parameter can be used to cancel this feature. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.showActionSheet(Object object).
Property | Type | Default value | Required | Description |
itemList | array.<string> | - | True | Array of button text, with a maximum length of 6. |
itemColor | string | #000000 | False | Button text color. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
Property | Type | Description |
tapIndex | number | The index of the button tapped by the user, starting from 0. |
wx.showActionSheet({itemList: ['A', 'B', 'C'],success (res) {console.log(res.tapIndex)},fail (res) {console.log(res.errMsg)}})
This API is called using wx.showLoading(Object object).
Property | Type | Default value | Required | Description |
title | string | - | True | The content of the prompt. |
mask | boolean | false | False | Whether to show a transparent mask to prevent touch penetration. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
wx.showLoading({title: 'Loading',})setTimeout(function () {wx.hideLoading()}, 2000)
This API is called using is wx.showModal(Object object).
Property | Type | Default value | Required | Description |
title | string | - | False | The title of the prompt. |
content | string | - | False | The content of the prompt. |
showCancel | boolean | true | False | Whether to show the Cancel button. |
cancelText | string | Cancel | False | The text of the Cancel button, which can contain up to four characters. |
cancelColor | string | #000000 | False | The color of the Cancel button text, must be a hexadecimal color string. |
confirmText | string | OK | False | The text of the OK button, which can contain up to four characters. |
confirmColor | string | #576B95 | False | The color of the OK button text, must be a hexadecimal color string. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
Property | Type | Description |
confirm | boolean | true if the user tapped the OK button. |
cancel | boolean | true if the user tapped the Cancel button (used to distinguish between tapping the mask to close or tapping the Cancel button on Android). |
wx.showModal({title: 'Prompt',content: 'This is a modal pop-up',success (res) {if (res.confirm) {console.log('The user taps OK')} else if (res.cancel) {console.log('The user taps Cancel')}}})
This API is called using wx.showToast(Object object).
Property | Type | Default value | Required | Description |
title | string | - | True | The content of the prompt. |
icon | string | success | False | Icon. Valid values: success: Shows a success icon, with a maximum of seven characters for the title. error: Shows a failure icon, with a maximum of seven characters for the title. loading: Shows a loading icon, with a maximum of seven characters for the title. none: No icon is displayed, and the title can display up to two lines. |
image | string | - | False | The local path to a custom icon. The image has a higher priority than icon. |
duration | number | 1500 | False | The duration of the prompt in milliseconds. |
mask | boolean | false | False | Whether to show a transparent mask to prevent touch penetration. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
wx.showToast({title: 'Success',icon: 'success',duration: 2000})
This API is called using wx.enableAlertBeforeUnload(Object object).
Property | Type | Default value | Required | Description |
message | string | - | True | The content of the confirmation dialog. |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |
This API is called using wx.disableAlertBeforeUnload(Object object).
Property | Type | Default value | Required | Description |
success | function | - | False | Callback function for successful API calls. |
fail | function | - | False | Callback function for failed API calls. |
complete | function | - | False | Callback function executed after API call ends (regardless of success or failure). |