functional-page-navigator

functional-page-navigator

基础库 2.1.0 开始支持,低版本需做兼容处理

微信 Windows 版:支持

微信 Mac 版:支持

微信 鸿蒙 OS 版:支持

渲染框架支持情况:WebView

功能描述

仅在插件中有效,用于跳转到插件功能页。

通用属性

属性 类型 默认值 必填 说明 最低版本
version string release 跳转到的小程序版本,线上版本必须设置为 release 2.1.0
合法值说明develop开发版trial体验版release正式版
name string 要跳转到的功能页 2.1.0
合法值说明最低版本loginAndGetUserInfo用户信息功能页2.1.0requestPayment支付功能页2.1.0chooseAddress收货地址功能页2.4.0chooseInvoice获取发票功能页2.14.1chooseInvoiceTitle获取发票抬头功能页2.14.1
args object 功能页参数,参数格式与具体功能页相关 2.1.0
bindsuccess eventhandler 功能页返回,且操作成功时触发, detail 格式与具体功能页相关 2.1.0
bindfail eventhandler 功能页返回,且操作失败时触发, detail 格式与具体功能页相关 2.1.0
bindcancel eventhandler 因用户操作从功能页返回时触发 2.4.1

Bug & Tip

  1. tip: 功能页是插件所有者小程序中的一个特殊页面,开发者不能自定义这个页面的外观。
  2. tip: 在功能页展示时,一些与界面展示相关的接口将被禁用(接口调用返回 fail )。
  3. tip: 这个组件本身可以在开发者工具中使用,但功能页的跳转目前不支持在开发者工具中调试,请在真机上测试。

示例代码

<!-- sample.wxml -->
<functional-page-navigator name="loginAndGetUserInfo" bind:success="loginSuccess">
  <button>登录到插件</button>
</functional-page-navigator>
// redirect.js navigator.js
Component({
  methods: {
    loginSuccess: function(e) {
      console.log(e.detail.code) // wx.login 的 code
      console.log(e.detail.userInfo) // wx.getUserInfo 的 userInfo
    }
  }
})
posted on 2024-12-29 18:05  AtlasLapetos  阅读(42)  评论(0)    收藏  举报