mdq/yii2-instascan-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mdq/yii2-instascan-widget

Composer 安装命令:

composer require mdq/yii2-instascan-widget

包简介

Yii2 widget for reading qr code using instascan pluggin

README 文档

README

Yii2 widget for reading qr code using instascan pluggin https://github.com/schmich/instascan

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mdq/yii2-instascan-widget "*"

or add

"mdq/yii2-instascan-widget": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= QrReader::widget([
        'videoOptions' => ['class' => 'qr-reader-preview', 'style' => 'width: 300px; height: 188px; '];
        // When buttonLabel is "false", render camera immediately.
        'buttonLabel' => 'Scan';
        'buttonOptions' => ['class' => 'btn btn-default'];
        'options' = ['class' => 'qr-reader'];

        'successCallback' => 'function(data){console.log(data);}',
        'noCameraFoundCallback' => 'function(cameras){console.error('No cameras found.');}';
        'initErrorCallback' => 'function (e) {console.error(e);}';

        // Whether to scan continuously for QR codes. If false, use scanner.scan() to manually scan.
        // If true, the scanner emits the "scan" event when a QR code is scanned. Default true.
        'continuous' => true,

        // Whether to horizontally mirror the video preview. This is helpful when trying to
        // scan a QR code with a user-facing camera. Default true.
        'mirror' => true,

        // Whether to include the scanned image data as part of the scan result. See the "scan" event
        // for image format details. Default false.
        'captureImage' => false,

        // Only applies to continuous mode. Whether to actively scan when the tab is not active.
        // When false, this reduces CPU usage when the tab is not active. Default true.
        'backgroundScan' => false,

        // Only applies to continuous mode. The period, in milliseconds, before the same QR code
        // will be recognized in succession. Default 5000 (5 seconds).
        'refractoryPeriod' => 5000,

        // Only applies to continuous mode. The period, in rendered frames, between scans. A lower scan period
        // increases CPU usage but makes scan response faster. Default 1 (i.e. analyze every frame).
        'scanPeriod' => 10,

        'debug' => YII_DEBUG,
    ]); ?>```

统计信息

  • 总下载量: 2.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固