Skip to content

Commit

Permalink
Merge pull request #602 from kongxiaojun/f-fix-exit-kxj
Browse files Browse the repository at this point in the history
fix: [harmony-hybrid] exitMiniProgram api调用实现
  • Loading branch information
handsomeliuyang authored Jul 10, 2024
2 parents 1c05d86 + 00b646c commit 3c4a6ba
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
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({
}
})


0 comments on commit 3c4a6ba

Please sign in to comment.