EEUI.APP
首页
文档
- 指南
- 组件
- 模块
插件
- 插件市场
- 开发文档
热更新
控制台
Editor
例子
社区
需要加载的模块
## # eeui.openScaner
const eeui = app.requireModule('eeui');
### # 预览效果二维码扫描页面
### # 示例代码
/*@param params 详细参数@param callback 回调事件/eeui.openScaner({params}, callback(result))
### # params 参数说明
<template><div class="app"><text class="button" @click="openScaner">打开二维码扫描</text></div></template><style>.app {flex: 1;justify-content: center;align-items: center;}.button {text-align: center;margin-top: 20px;padding-top: 20px;padding-bottom: 20px;padding-left: 30px;padding-right: 30px;color: #ffffff;background-color: #00B4FF;}</style><script>const eeui = app.requireModule('eeui');export default {methods: {openScaner() {eeui.openScaner({}, (res)=>{switch (res.status) {case "success":eeui.toast("识别成功:" + res.text);break;case "error":eeui.toast("识别失败");break;}});},}};</script>
| 属性名 | 类型 | 必须 | 描述 | 默认值 |
|---|---|---|---|---|
| title | String | - | 扫码页面标题 | - |
| desc | String | - | 扫码页面描述文字 | - |
| continuous | Boolean | - | 是否连续扫码 | false |
result说明
{pageName: '页面名称',status: 'create', //状态,详见:注①//status=successsource: 'photo', //扫码识别来源,photo:照片、camera:相机result: { … }, //扫码识别详细数据format: 'CODE_128', //扫码识别的类型text: 'http://...', //扫码识别内容//status=errorsource: 'photo', //扫码失败来源,photo:照片、camera:相机}
-注①:
create页面创建完毕
- destroy页面已销毁
- success扫码识别成功
- error扫码识别失败
- openLight打开闪光灯
- offLight关闭闪光灯
### # 简单示例
在 GitHub 上编辑此页
//示例①eeui.openScaner({}, function(result) {//……});//示例②eeui.openScaner({desc: '二维码/条码',desc: '对准中间就开始扫吧',}, function(result) {//……});
最后一次更新: 3/4/2020, 5:41:41 PM
← getImageSize share →
