1.1.2 • Published 7 years ago

weex-xc-scanner v1.1.2

Weekly downloads
53
License
-
Repository
-
Last release
7 years ago

weex-xc-scanner(Test)

一款二维码扫码weex插件,当前版本支持组件基础及模块集成。

快速开始

使用方法

//install
npm install weex-xc-scanner
weexpack plugin add ./node_modules/weex-xc-scanner
//uninstall
weexpack plugin remove weex-xc-scanner

编辑你的weex文件

<template>
    <weex-scanner class="scanner-page" borderColor="#FbF" cornerColor="#FbF" ></weex-scanner>
</template>
<style>
    .scanner-page{
        height: 1200px;
        width: 750px;
    }
</style>

API

weex-scanner 属性

属性类型Demo描述
borderColorstring#FFF0边框颜色
cornerColorstring#FFF0边角颜色
cornerWidthfloat3.5px边角宽度
backgroundAlphafloat0.5扫描区周边透明度

weex-scanner 事件

DidFinishScan 扫描完成后触发该事件 事件格式

{
    status:"success",result:"HTTPS://QR.ALIPAY.COM/FKX01107IZ4BXSODGROX3A"
}

weex-xc-scanner 模块

openFlashlight
  • 打开闪光灯
closeFlashlight
  • 关闭闪光灯
使用 weex-xc-scanner 模块
<template>
    <div>
            <text @click="openFlash">打开闪光灯</text>
            <text @click="closeFlash">关闭闪光灯</text>
    </div>
</template>
<script>
    const scanner = weex.requireModule("weex-xc-scanner");
    export default {
        methods:{
            openFlash(){
                scanner.openFlashlight();
            },
            closeFlash(){
                scanner.closeFlashlight();
            }
        }
    }
</script>
1.1.2

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago