Commit fd123c1b by amateur

1

1 parent 5e972467
export const NativeMethodNames = { export const NativeMethodNames = {
AppInfoApi: 'nativeAppInfo', AppInfoApi: 'nativeAppInfo',
AppShare: 'nativeAppShare', AppShare: 'nativeAppShare',
AppBottomMenu: 'nativeMenu' AppBottomMenu: 'nativeMenu',
nativeTextZoom: 'nativeTextZoom',
} }
export const JsMethodNames = { export const JsMethodNames = {
...@@ -12,12 +13,12 @@ export const JsInterfaces = objVal2Array(JsMethodNames) ...@@ -12,12 +13,12 @@ export const JsInterfaces = objVal2Array(JsMethodNames)
export const NativeMenuApi = { export const NativeMenuApi = {
nativeMenuStatus: (isShow) => { nativeMenuShow: (param = {}) => {
const param = isShow && { type: '1' } || { type: '2' } const newParam = { ...param, type: '1' }
return $api.call(NativeMethodNames.AppBottomMenu, param, false) return $api.call(NativeMethodNames.AppBottomMenu, newParam, false)
}, },
nativeChangeMenu: (param) => { nativeMenuHide: (param = {}) => {
const newParam = { ...param, type: '3' } const newParam = { ...param, type: '2' }
return $api.call(NativeMethodNames.AppBottomMenu, newParam, false) return $api.call(NativeMethodNames.AppBottomMenu, newParam, false)
} }
} }
...@@ -38,6 +39,22 @@ export const NativeApi = { ...@@ -38,6 +39,22 @@ export const NativeApi = {
nativeAppShare: (param) => { nativeAppShare: (param) => {
return $api.call(NativeMethodNames.AppShare, param, true) return $api.call(NativeMethodNames.AppShare, param, true)
},
// {type: '1'-显示/'2'-隐藏, moduleName: '切换模块名称', routeName: '路由名称', routePath: '路由地址', url:'完整url'}
nativeMenuStatus: (param) => {
if (!param.type) {
Object.assign(param, { type: '1' })
}
return $api.call(NativeMethodNames.AppBottomMenu, param, false)
},
// {value: 100}
nativeTextZoom: (param) => {
if (!param.value) {
Object.assign(param, { value: 100 })
}
return $api.call(NativeMethodNames.nativeTextZoom, param, false)
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!