dlt.changeNavigationBarProgress
Introduction
Update the progress of the navigation bar progress bar.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
startProgress | number | 0 | No | The starting value of the navigation bar progress bar. |
endProgress | number | 0 | Yes | The target value of the navigation bar progress bar. |
duration | number | 200 | No | The time it takes to complete the progress bar from startProgress to endProgress, range: 0~60000 ms |
success | function | No | Callback function for a successful API call. | |
fail | function | No | Callback function for a failed API call. | |
complete | function | No | Callback function that will be executed when the API call ends (both success and failure). |
object.success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | true-Set successfully. |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
errMsg | string | 1. The number of startProgress should be between 1 and 100! 2. The number of endProgress should be between 1 and 100, with startProgress must be less than endProgress! 3. The duration must be in the range 0 to 60000 milliseconds! |
success | string | false-Set failed. |
Sample Code
// pages/index/index.js
Page({
changeNavigationBarProgress() {
dlt.changeNavigationBarProgress({
startProgress: 10, // The starting value of the navigation bar progress bar.
endProgress: 100, // The target value of the navigation bar progress bar.
duration: 1000, // The time it takes to complete the progress bar refresh.
});
},
});