Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [harmony-hybrid] exitMiniProgram api调用实现 #602

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import { View } from '@tarojs/components'
import ButtonList from '@/components/buttonList'
import './index.scss'
import Taro from '@tarojs/taro'

/**
* 跳转
Expand Down Expand Up @@ -29,7 +30,9 @@ export default class Index extends React.Component {
},
{
id: 'exitMiniProgram',
func: null,
func: () => {
Taro.exitMiniProgram()
},
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,12 @@
"TARO_ENV": true,
"USER_DATA_PATH": true
},
"exitMiniProgram": false,
"exitMiniProgram": {
"object": {
"url": true,
"events": true
}
},
"exitVoIPChat": false,
"faceDetect": false,
"faceVerifyForPay": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ export class NativeApi {
return option
}

@(asyncAndRelease)
exitMiniProgram (option?: any): any {
return option
}

@(asyncAndNotRelease)
onNativeNavigate (_options: any): void {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,6 @@
* @canNotUse editImage
*/

/**
* 退出当前小程序
*
* @canNotUse exitMiniProgram
*/

/**
* 退出(销毁)实时语音通话
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export function navigateTo (option: Taro.navigateTo.Option) {
return navigateToH5(option)
}

/**
* 退出当前小程序。必须有点击行为才能调用成功。
*
* @canUse exitMiniProgram
* @__object [url, events]
*/
export function exitMiniProgram (option?: any) {
native.exitMiniProgram(option)
}

/**
* 关闭当前页面,返回上一页面或多级页面。
*
Expand Down Expand Up @@ -78,4 +88,3 @@ native.onNativeNavigate({
}
})