V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
cr4fun
V2EX  ›  分享创造

开发了一个区块链钱包,但是扫码无法掉起摄像头?

  •  
  •   cr4fun · 2019-04-17 13:09:29 +08:00 · 2297 次点击
    这是一个创建于 1807 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我做了一个区块链的钱包.使用 vue 和SDAG jssdk

    演示地址 https://the-fucking-monkeys.github.io/#/

    源码在 https://github.com/the-fucking-monkeys

    目前能收款能付款,但是摄像头不好使.

    使用的是 vue-qrcode-reader 这款 vue 库.

    涉及到调动摄像头的代码是:

    <template>
      <div class="scan">
        <h1>Scan</h1>
        <qrcode-stream @decode="onDecode"></qrcode-stream>
      </div>
    </template>
    <style scoped>
    </style>
    <script>
    import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from "vue-qrcode-reader";
    export default {
      components: {
        QrcodeStream,
        QrcodeDropZone,
        QrcodeCapture
      },
      methods: {
        onDecode(decodedString) {
          console.log(decodedString);
        }
      }
    };
    </script>
    

    谁知道为什么不能访问摄像头?

    9 条回复    2019-04-19 22:54:13 +08:00
    niubee1
        1
    niubee1  
       2019-04-17 13:13:18 +08:00
    跟钱包有什么关系? 现在币圈的能力越来越弱了
    cr4fun
        2
    cr4fun  
    OP
       2019-04-17 13:25:00 +08:00
    ios 的摄像头不好使,android 的可以.
    natforum
        3
    natforum  
       2019-04-17 13:55:37 +08:00
    你可以参考一下 https://github.com/consenlabs
    cr4fun
        4
    cr4fun  
    OP
       2019-04-17 15:09:45 +08:00
    @niubee1 钱包和币圈没关系.这款软件主要是做积分支付.
    zhangjinglongi
        5
    zhangjinglongi  
       2019-04-18 08:49:30 +08:00
    这跟区块链有半毛钱关系么?。。。
    good1uck
        6
    good1uck  
       2019-04-18 19:56:20 +08:00
    楼上们都说的对,和区块链没关系。顺便回答一下问题呗
    hurrytospring
        7
    hurrytospring  
       2019-04-19 14:08:15 +08:00
    排查问题要善于缩小问题,看你贴出来的这一段代码和描述,说明你完全不了解怎么去跟这个问题。
    这种明显是兼容性问题,基本上 browser 调摄像头肯定是通过 webrtc 之类的去调,这个接口的兼容性怎么样。你在安卓什么版本测的,用的什么浏览器,控制台有没有报错,caniuse 有没有查过。
    简单看了一下,依赖这个库 https://github.com/webrtcHacks/adapter,你直接起个简单的项目测一下这个库,确定一下具体问题。
    cr4fun
        8
    cr4fun  
    OP
       2019-04-19 22:53:31 +08:00
    @good1uck 都说了是区块链钱包了,为什么和区块链没关系?
    cr4fun
        9
    cr4fun  
    OP
       2019-04-19 22:54:13 +08:00
    @hurrytospring 目前扫码已经 ok 了,把 http 换成 https 就可以了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1137 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:52 · PVG 06:52 · LAX 15:52 · JFK 18:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.