From 1e1ec8346a318ccd88fc9acb34f2b4d9d291bdf8 Mon Sep 17 00:00:00 2001 From: dongzhihan Date: Tue, 30 Jul 2024 09:59:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#IA50OS]=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9react-native-qr-decode-image-camera=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/react-native-qr-decode-image-camera.md | 299 +++++++++---------- 1 file changed, 138 insertions(+), 161 deletions(-) diff --git a/zh-cn/react-native-qr-decode-image-camera.md b/zh-cn/react-native-qr-decode-image-camera.md index ac8efb04..906554d9 100644 --- a/zh-cn/react-native-qr-decode-image-camera.md +++ b/zh-cn/react-native-qr-decode-image-camera.md @@ -1,4 +1,3 @@ - > 模板版本:v0.2.2

@@ -43,137 +42,109 @@ yarn add @react-native-oh-tpl/react-native-qr-decode-image-camera@file:# 下面的代码展示了这个库的基本使用场景: > [!WARNING] 使用时 import 的库名不变。 -> 示例中:launchImageLibrary 方法需引入Harmony OS 的react-native-image-picker库,跳转 [react-native-image-picker](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-image-picker.md)查看使用方法。 +> 示例中:launchImageLibrary 方法需引入 Harmony OS 的 react-native-image-picker 库,跳转 [react-native-image-picker](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-image-picker.md)查看使用方法。 ```js -import React, {useState} from 'react'; -import {View, Text, Button} from 'react-native'; -import {QRreader, QRscanner} from 'react-native-qr-decode-image-camera'; -import {TestSuite, TestCase, Tester} from '@rnoh/testerino'; -import { launchImageLibrary } from 'react-native-image-picker'; +import React, { useState } from "react"; +import { View, Text, Button, ScrollView } from "react-native"; +import { QRreader, QRscanner } from "react-native-qr-decode-image-camera"; +import { launchImageLibrary } from "react-native-image-picker"; export const QRreaderExp = () => { - const [reader, setReader] = useState(''); - const [scanned, setScanned] = useState(false); - const [flashMode, setFlashMode] = useState(null); //初始值必须为null; - const [textInfo, setTextInfo] = useState(''); - - return ( - - - { - return ( - -