my.confirm
This API designs the Confirm box.
Supported types of mini programs: DSL, H5+
Supported SDK versions:
- Android: 2.66.0
- iOS: 2.77.0
Sample code
my.confirm({
title: 'Tips',
content: 'Do you want to check the courier number: 1234567890?',
confirmButtonText: 'Inquire now',
cancelButtonText: 'Not needed',
success: (result) => {
my.alert({
title: `${result.confirm}`,
});
},
});Parameters
Property | Type | Required | Description |
title | String | No | Title of the confirm box. |
content | String | No | Content of the confirm box. |
confirmButtonText | String | No | OK button text, which is “OK” by default. |
cancelButtonText | String | No | OK button text, which is “Cancel” by default. |
success | Function | No | Callback function upon call success. |
fail | Function | No | Callback function upon call failure. |
complete | Function | No | Callback function upon call completion (to be executed upon either call success or failure). |
Success Callback Function
The incoming parameter is of the Object type with the following attributes:
Property | Type | Description |
confirm | Boolean | Click Confirm to return |
confirmColor | String | Indicates the Confirm button text color. Supports hexadecimal format such as "#108EE9". Default value: "#1677FF". |
Error codes
Error Code | Error Message | Further action |
3 | unknown error! | Miss the context. If you have any questions, please contact technical support for assistance. |