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

2019-04-17 13:09:29 +08:00
 cr4fun

我做了一个区块链的钱包.使用 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>

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

2338 次点击
所在节点    分享创造
9 条回复
niubee1
2019-04-17 13:13:18 +08:00
跟钱包有什么关系? 现在币圈的能力越来越弱了
cr4fun
2019-04-17 13:25:00 +08:00
ios 的摄像头不好使,android 的可以.
natforum
2019-04-17 13:55:37 +08:00
你可以参考一下 https://github.com/consenlabs
cr4fun
2019-04-17 15:09:45 +08:00
@niubee1 钱包和币圈没关系.这款软件主要是做积分支付.
zhangjinglongi
2019-04-18 08:49:30 +08:00
这跟区块链有半毛钱关系么?。。。
good1uck
2019-04-18 19:56:20 +08:00
楼上们都说的对,和区块链没关系。顺便回答一下问题呗
hurrytospring
2019-04-19 14:08:15 +08:00
排查问题要善于缩小问题,看你贴出来的这一段代码和描述,说明你完全不了解怎么去跟这个问题。
这种明显是兼容性问题,基本上 browser 调摄像头肯定是通过 webrtc 之类的去调,这个接口的兼容性怎么样。你在安卓什么版本测的,用的什么浏览器,控制台有没有报错,caniuse 有没有查过。
简单看了一下,依赖这个库 https://github.com/webrtcHacks/adapter,你直接起个简单的项目测一下这个库,确定一下具体问题。
cr4fun
2019-04-19 22:53:31 +08:00
@good1uck 都说了是区块链钱包了,为什么和区块链没关系?
cr4fun
2019-04-19 22:54:13 +08:00
@hurrytospring 目前扫码已经 ok 了,把 http 换成 https 就可以了。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/556005

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX