Commit 068c202f by amateur

1

1 parent c14133b9
export const NativeMethodNames = { export const NativeMethodNames = {
AppInfoApi: 'nativeAppInfo', AppInfoApi: 'nativeAppInfo',
AppShare: 'nativeAppShare', AppShare: 'nativeAppShare',
AppBottomMenu: 'nativeMenu'
} }
export const JsMethodNames = { export const JsMethodNames = {
...@@ -10,6 +11,18 @@ export const JsMethodNames = { ...@@ -10,6 +11,18 @@ export const JsMethodNames = {
export const JsInterfaces = objVal2Array(JsMethodNames) export const JsInterfaces = objVal2Array(JsMethodNames)
export const NativeMenuApi = {
nativeMenuStatus: (isShow) => {
const param = isShow && { type: '1' } || { type: '2' }
return $api.call(NativeMethodNames.AppBottomMenu, param, false)
},
nativeChangeMenu: (param) => {
const newParam = { ...param, type: '3' }
return $api.call(NativeMethodNames.AppBottomMenu, newParam, false)
}
}
export const NativeApi = { export const NativeApi = {
on: (jsMethodName, callback) => { on: (jsMethodName, callback) => {
$api.on(jsMethodName, callback) $api.on(jsMethodName, callback)
...@@ -30,7 +43,7 @@ export const NativeApi = { ...@@ -30,7 +43,7 @@ export const NativeApi = {
function objVal2Array(obj) { function objVal2Array (obj) {
const arrays = [] const arrays = []
for (const key in obj) { for (const key in obj) {
arrays.push(obj[key]) arrays.push(obj[key])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!