Skip to content

Commit

Permalink
feat: 为微信小程序添加 openOfficialAccountArticle 接口
Browse files Browse the repository at this point in the history
  • Loading branch information
CatSouta committed Sep 13, 2024
1 parent 213971f commit c8f7ee5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export default class Index extends React.Component {
id: 'openBusinessView',
func: null,
},
{
id: 'openOfficialAccountArticle',
func: null
},
{
id: 'openEmbeddedMiniProgram',
func: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@
"success": "void",
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
},
"openOfficialAccountArticle": {
"object": "*",
"success": "void",
"return": "Promise<Partial<CallbackResult> & Record<string, unknown> & CallbackResult>"
},
"openEmbeddedMiniProgram": {
"object": "*",
"success": "void",
Expand Down
1 change: 1 addition & 0 deletions packages/taro-h5/src/api/navigate/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { temporarilyNotSupport } from '../../utils'

// 跳转
export const openOfficialAccountArticle = /* @__PURE__ */ temporarilyNotSupport('openOfficialAccountArticle')
export const openEmbeddedMiniProgram = /* @__PURE__ */ temporarilyNotSupport('openEmbeddedMiniProgram')
export const navigateToMiniProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToMiniProgram')
export const navigateBackMiniProgram = /* @__PURE__ */ temporarilyNotSupport('navigateBackMiniProgram')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,7 @@
"openChannelsUserProfile": true,
"openCustomerServiceChat": false,
"openDocument": true,
"openOfficialAccountArticle": false,
"openEmbeddedMiniProgram": false,
"openLocation": {
"object": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,12 @@
* @canNotUse openCustomerServiceChat
*/

/**
* 通过小程序打开任意公众号文章
*
* @canNotUse openOfficialAccountArticle
*/

/**
* 打开半屏小程序
*
Expand Down
1 change: 1 addition & 0 deletions packages/taro-platform-harmony/src/apis/navigate/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { temporarilyNotSupport } from '../utils'

// 跳转
export const openOfficialAccountArticle = /* @__PURE__ */ temporarilyNotSupport('openOfficialAccountArticle')
export const openEmbeddedMiniProgram = /* @__PURE__ */ temporarilyNotSupport('openEmbeddedMiniProgram')
export const navigateToMiniProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToMiniProgram')
export const navigateBackMiniProgram = /* @__PURE__ */ temporarilyNotSupport('navigateBackMiniProgram')
Expand Down
13 changes: 13 additions & 0 deletions packages/taro/types/api/navigate/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import Taro from '../../index'

declare module '../../index' {
namespace openOfficialAccountArticle {
interface Option {
/** 需要打开的公众号地址 **/
url: string
/** 接口调用成功的回调函数 **/
success?: (res: TaroGeneral.CallbackResult) => void
/** 接口调用失败的回调函数 */
fail?: (res: TaroGeneral.CallbackResult) => void
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: (res: TaroGeneral.CallbackResult) => void
}
}

namespace openEmbeddedMiniProgram {
interface Option {
/** 要打开的小程序 appId */
Expand Down

0 comments on commit c8f7ee5

Please sign in to comment.