diff --git a/src/core/service/api/ui/tab-bar.js b/src/core/service/api/ui/tab-bar.js new file mode 100644 index 0000000000000000000000000000000000000000..b7728006fbffb4c23be33172acfe8774e518a089 --- /dev/null +++ b/src/core/service/api/ui/tab-bar.js @@ -0,0 +1,23 @@ +import { + invokeMethod +} from '../../platform' + +export function removeTabBarBadge ({ + index +}) { + return invokeMethod('setTabBarBadge', { + index, + type: 'none' + }) +} + +export function showTabBarRedDot ({ + index +}) { + return invokeMethod('setTabBarBadge', { + index, + type: 'redDot' + }) +} + +export const hideTabBarRedDot = removeTabBarBadge diff --git a/src/platforms/app-plus/service/api/ui/tab-bar.js b/src/platforms/app-plus/service/api/ui/tab-bar.js index 0628507c685f7d7c502223e83ab5bee2ee078cf1..764036239288a919ed73a86ebc0921a6f50a1d3d 100644 --- a/src/platforms/app-plus/service/api/ui/tab-bar.js +++ b/src/platforms/app-plus/service/api/ui/tab-bar.js @@ -7,7 +7,7 @@ import tabBar from '../../framework/tab-bar' export function setTabBarBadge ({ index, text, - type + type = 'text' }) { tabBar.setTabBarBadge(type, index, text) return {