This API is used via wx.hideLoading(Object object).
Attribute | Type | Default value | Required | Description |
noConflict | boolean | false | No | Currently, toast and loading related interfaces can be confused with each other, this parameter can be used to disable the confusion feature. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
This API is used via wx.hideToast(Object object).
Attribute | Type | Default value | Required | Description |
noConflict | boolean | false | No | Currently, toast and loading related interfaces can be confused with each other, this parameter can be used to disable the confusion feature. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
This API is used via wx.showActionSheet(Object object).
Attribute | Type | Default value | Required | Description |
itemList | array.<string> | - | Yes | The array of button texts, with a maximum length of 6. |
itemColor | string | #000000 | No | The color of the button text. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attribute | Type | Description |
tapIndex | number | The button number clicked by the user, in descending order, starting from 0. |
wx.showActionSheet({itemList: ['A', 'B', 'C'],success (res) {console.log(res.tapIndex)},fail (res) {console.log(res.errMsg)}})
This API is used via wx.showLoading(Object object).
Attribute | Type | Default value | Required | Description |
title | string | - | Yes | The content of the prompt. |
mask | boolean | false | No | Whether to display a transparent mask layer to prevent touch penetration. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.showLoading({title: 'Loading',})setTimeout(function () {wx.hideLoading()}, 2000)
This API is used via wx.showModal(Object object).
Attribute | Type | Default value | Required | Description |
title | string | - | No | The title of the prompt. |
content | string | - | No | The content of the prompt. |
showCancel | boolean | true | No | Whether to display the "Cancel" button. |
cancelText | string | Cancel | No | Text for the "Cancel" button, up to a maximum of 4 characters. |
cancelColor | string | #000000 | No | Text color of the "Cancel" button, which must be a hexadecimal color string. |
confirmText | string | Confirm | No | Text for the "Confirm" button, limited to a maximum of 4 characters. |
confirmColor | string | #576B95 | No | Text color of the "Confirm" button, which must be a hexadecimal color string. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attribute | Type | Description |
confirm | boolean | When set to true, it indicates that the user has clicked the "Confirm" button. |
cancel | boolean | When set to true, it indicates that the user has clicked the "Cancel" button (used in the Android system to distinguish between clicking to close the mask layer or clicking the "Cancel" button to close). |
wx.showModal({title: 'Prompt',content: 'This is a modal dialog box',success (res) {if (res.confirm) {console.log(User clicked "Confirm")} else if (res.cancel) {console.log(User clicked "Cancel")}}})
This API is used via wx.showToast(Object object).
Attribute | Type | Default value | Required | Description |
title | string | - | Yes | The content of the prompt. |
icon | string | success | No | Icon, whose valid values are: success: Displays the failure icon, when the title text can display up to 7 Chinese characters in length. error: Displays the failure icon, when the title text can display up to 7 Chinese characters in length. loading: Displays the loading icon, when the title text can display up to 7 Chinese characters in length. none: Not to display icons, when the title text can display up to two lines. |
image | string | - | No | The local path of the custom icon, with the priority of the image higher than that of the icon. |
duration | number | 1500 | No | The delay duration of the prompt. |
mask | boolean | false | No | Whether to display a transparent mask layer to prevent touch penetration. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.showToast({title: 'Success',icon: 'success',duration: 2000})
This API is used via wx.enableAlertBeforeUnload(Object object).
Attribute | Type | Default value | Required | Description |
message | string | - | Yes | Content of the inquiry dialog box. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
This API is used via wx.disableAlertBeforeUnload(Object object).
Attribute | Type | Default value | Required | Description |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Was this page helpful?