uni-app编译小程序官方插件组件问题

uni-app编译小程序官方插件组件问题

产品分类

uniapp/小程序/微信

PC开发环境操作系统

Windows

PC开发环境操作系统版本号

win10

第三方开发者工具版本号

Stable 1.05.2110110

基础库版本号

2.24.0

项目创建方式

CLI

CLI版本号

4.5.3

App下载地址或H5网址

https://mp.weixin.qq.com/wxopen/plugindevdoc?appid=wxee969de81bba9a45&token=1991571028&lang=zh_CN

示例代码

{
    "path": "bindHCard/index",
    "style": {
        "navigationBarTitleText": "电子健康卡",
        "mp-weixin": {
            "usingComponents": {
                "health-card-login": "plugin://healthCardPlugins/healthCardLogin"
            }
        }
    }
}
"plugins": {
    "healthCardPlugins": {
        "version": "3.1.9",
        "provider": "wxee969de81bba9a45"
    }
}

操作步骤

  • 接入微信电子健康卡后, 点击授权无回调

预期结果

  • 接入微信电子健康卡后, 点击授权进入授权页面,授权获取微信授权码

实际结果

  • 接入微信电子健康卡后, 点击授权无回调

bug描述

按流程接入微信电子健康卡插件后, 点击授权无反应,没有回调,编译的页面正常的图例:


更多关于uni-app编译小程序官方插件组件问题的实战教程也可以访问 https://www.itying.com/category-93-b0.html

8 回复

楼主,问题解决了吗

更多关于uni-app编译小程序官方插件组件问题的实战教程也可以访问 https://www.itying.com/category-93-b0.html


请问楼主,问题解决了吗

已解决,参考https://uniapp.dcloud.net.cn/tutorial/mp-weixin-plugin.html#page-import-mp-plugin

可以给个示例吗,按官方文档,试了好多次都不行

回复 2***@qq.com: bind:authFail=“authFail” bind:authSucess=“authSuccess” bind:authCancel="authCancel"现在遇到的是这些回调不起作用

回复 风风2宝宝: 留个邮箱,有时间给个回复,谢谢,xuesky#qq.com

回复 风风2宝宝: 用wxcomponents自定义组件实现

在使用 uni-app 开发小程序时,可能会遇到需要使用官方插件或组件的情况。以下是一些常见的问题及其解决方案:

1. 如何引入和使用官方插件?

  • 步骤:

    1. manifest.json 文件中配置插件。
    2. 在页面或组件中引入插件并使用。
  • 示例:

    // manifest.json
    {
      "mp-weixin": {
        "plugins": {
          "myPlugin": {
            "version": "1.0.0",
            "provider": "wxidxxxxxxxxxxxxxx"
          }
        }
      }
    }
    
    // 页面或组件中
    const myPlugin = requirePlugin('myPlugin');
    myPlugin.someMethod();
    

2. 如何引入和使用官方组件?

  • 步骤:

    1. pages.json 中配置组件。
    2. 在页面或组件中使用。
  • 示例:

    // pages.json
    {
      "pages": [
        {
          "path": "pages/index/index",
          "style": {
            "navigationBarTitleText": "首页"
          }
        }
      ],
      "usingComponents": {
        "my-component": "/components/my-component/my-component"
      }
    }
    
    <!-- 页面或组件中 -->
    <my-component></my-component>
回到顶部