收藏
回答

插件可以再引用别的插件么?

问题类型 插件 AppID 插件版本号 AppID 微信版本 基础库版本
需求 wxd721e1971de3f697 1.0.0 wxd721e1971de3f697 7.0.3 2.6.x

- 需求的场景描述(希望解决的问题)


在开发有需要验证码的插件页面 (A) 时,避免用户恶意频繁操作,需要使用三方的验证插件(极验),我们有很多小程序,我们需要把 A 页面插件化


- 希望提供的能力

插件中申明使用插件

回答关注问题邀请回答
收藏

2 个回答

  • LastLeaf
    LastLeaf
    2019-03-11

    如果一个小程序同时使用插件 A 和插件 B ,那么插件 A 可以像小程序那样使用插件 B ,包括 requirePlugin 、组件、页面。

    2019-03-11
    有用
    回复 12
    • 侯全
      侯全
      2019-03-11

      好的,我测试下 ~


      2019-03-11
      回复
    • 侯全
      侯全
      2019-03-11
      VM6411:1 jsEnginScriptError
      Component is not found in path "plugin://captchaPlugin/captcha" (using by "plugin-private://wxd721e1971de3f697/pages/bindPhone/index");onAppRoute
      Error: Component is not found in path "plugin://captchaPlugin/captcha" (using by "plugin-private://wxd721e1971de3f697/pages/bindPhone/index")
          at e (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:844197)
          at e (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:844383)
          at http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:859578
          at Object.t.addView (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:860124)
          at Function.value (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:938528)
          at Ct (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:954268)
          at It (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:956388)
          at Function.<anonymous> (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:958295)
          at Nt.<anonymous> (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:931964)
          at Nt.emit (http://127.0.0.1:59656/appservice/__dev__/WAService.js:1:315230)


      app.json 中设置


      "plugins": {
          "paPlugin": {
            "version": "dev",
            "provider": "wxd721e1971de3f697"
          },
          "captchaPlugin": {
            "version": "1.1.1",
            "provider": "wxefa63d84fe9f64a2"
          }
        }


      paPlugin 中提供了一个 bindPhone 页面,在 bindPhone/index.json 配置如下:


      "usingComponents": {
          "captcha": "plugin://captchaPlugin/captcha"
        }


      2019-03-11
      回复
    • 侯全
      侯全
      2019-03-11

      事实表明并不能那么用 ~~ @LastLeaf

      2019-03-11
      回复
    • LastLeaf
      LastLeaf
      2019-03-11回复侯全

      查了下,plugin 协议有 bug ,麻烦改用 plugin-private 协议试试。

      2019-03-11
      回复
    • 侯全
      侯全
      2019-03-11回复LastLeaf

      依旧不行,错误和上面的一样


      跳转代码

      <navigator url="plugin-private://wxd721e1971de3f697/pages/bindPhone/index">跳转到 Plugin Demo Page</navigator>


      app.json 中配置

      "plugins": {
          "paPlugin": {
            "version": "dev",
            "provider": "wxd721e1971de3f697"
          },
          "captchaPlugin": {
            "version": "1.1.1",
            "provider": "wxefa63d84fe9f64a2"
          }
        }


      插件页面配置

      {
        "usingComponents": {
          "captcha": "plugin://captchaPlugin/captcha"
        }
      }


      错误:

      jsEnginScriptError
      Component is not found in path "plugin://captchaPlugin/captcha" (using by "plugin-private://wxd721e1971de3f697/pages/bindPhone/index");onAppRoute
      Error: Component is not found in path "plugin://captchaPlugin/captcha" (using by "plugin-private://wxd721e1971de3f697/pages/bindPhone/index")
          at e (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:844197)
          at e (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:844383)
          at http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:859578
          at Object.t.addView (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:860124)
          at Function.value (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:938528)
          at Ct (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:954268)
          at It (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:956388)
          at Function.<anonymous> (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:958295)
          at Nt.<anonymous> (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:931964)
          at Nt.emit (http://127.0.0.1:45303/appservice/__dev__/WAService.js:1:315230)


      2019-03-11
      回复
    查看更多(7)
  • 钰明
    钰明
    2019-05-05

    三方的验证插件(极验),我在官方文档看到极验支持web端,ios和安卓端,它也有小程序插件提供??如果有,费用如何计算?

    2019-05-05
    有用
    回复
登录 后发表内容