init
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
|
||||
package="io.dcloud.uni_modules.xwq_mlkit_scan_code">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<!-- Don't require camera, as this requires a rear camera. This allows it to work on the Nexus 7 -->
|
||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.front" android:required="false" />
|
||||
<!-- TODO replace above two with next line after Android 4.2 -->
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.wifi" android:required="false" />
|
||||
|
||||
<application>
|
||||
<!-- android:theme="@style/Theme.AppCompat.Light.NoActionBar" -->
|
||||
<activity android:name="uts.sdk.modules.xwqMlkitScanCode.MyMlkitScanActivity"></activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"minSdkVersion": "21",
|
||||
"dependencies": [
|
||||
"com.google.mlkit:barcode-scanning:17.3.0",
|
||||
"androidx.camera:camera-core:1.4.0",
|
||||
"androidx.camera:camera-camera2:1.4.0",
|
||||
"androidx.camera:camera-lifecycle:1.4.0",
|
||||
"androidx.camera:camera-view:1.4.0",
|
||||
"androidx.appcompat:appcompat:1.4.1"
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<!-- <SurfaceView android:id="@+id/camera_wrap" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" android:layout_gravity="center_vertical">
|
||||
</SurfaceView> -->
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="0dp" android:layout_weight="1" >
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:orientation="vertical" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="30dp" android:layout_height="30dp" android:src="@drawable/close"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="100dp"
|
||||
android:orientation="horizontal" android:background="#80000000" android:gravity="center_horizontal|top"
|
||||
android:id="@+id/bottom_content">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="15dp" android:layout_marginLeft="28dp"
|
||||
android:id="@+id/asml_wrap">
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/photo_open"></ImageView>
|
||||
<TextView android:paddingTop="20px" android:id="@+id/text_asml" android:layout_width="wrap_content" android:textAlignment="center" android:layout_height="wrap_content" android:gravity="center"
|
||||
android:textColor="#ffffff" android:text="相册" android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="wrap_content"
|
||||
android:paddingTop="60px" android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" />
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical|center_horizontal"
|
||||
android:layout_marginTop="15dp" android:layout_marginRight="28dp"
|
||||
android:id="@+id/flashlight_wrap">
|
||||
<ImageView android:id="@+id/flashlight" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/light_close"></ImageView>
|
||||
<TextView android:paddingTop="20px" android:id="@+id/text_flashlight" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center"
|
||||
android:textColor="#ffffff" android:text="灯光" android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.ScanOverlay android:id="@+id/overlay" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.ScanOverlay>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="0dp" android:layout_weight="1" >
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal" android:layout_marginTop="20dp">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:orientation="horizontal" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/close"></ImageView>
|
||||
<View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" />
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/photo_open"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal" android:layout_centerHorizontal="true">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="50dp"
|
||||
android:orientation="vertical" android:background="#80000000" android:gravity="center"
|
||||
android:id="@+id/bottom_content">
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/flashlight_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="150dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/flashlight"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/flashlight_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20px"
|
||||
android:text="轻触点亮"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.ScanOverlay android:id="@+id/overlay" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.ScanOverlay>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:background="#000000" android:layout_height="match_parent">
|
||||
|
||||
<androidx.camera.view.PreviewView android:id="@+id/camera_preview" android:layout_width="match_parent" android:layout_height="match_parent" >
|
||||
</androidx.camera.view.PreviewView>
|
||||
|
||||
<ImageView android:id="@+id/ivPic" android:layout_width="match_parent" android:layout_height="wrap_content" ></ImageView>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/senter_box" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:orientation="vertical" android:gravity="center_vertical"
|
||||
android:background="#50000000" android:id="@+id/senter_box_bg">
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout android:orientation="vertical" android:id="@+id/relative_layout" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"
|
||||
android:layout_gravity="top|bottom" android:orientation="vertical">
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="top" android:orientation="horizontal" android:layout_marginTop="20dp">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="60dp" android:paddingLeft="32dp"
|
||||
android:paddingRight="32dp"
|
||||
android:orientation="horizontal" android:gravity="center_vertical"
|
||||
android:background="@android:color/transparent" android:id="@+id/top_content">
|
||||
<ImageView android:id="@+id/header_back" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/close"></ImageView>
|
||||
<View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" />
|
||||
<ImageView android:id="@+id/footer_asml" android:layout_width="35dp" android:layout_height="35dp" android:src="@drawable/photo_open"></ImageView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"
|
||||
android:gravity="bottom" android:orientation="horizontal" android:layout_centerHorizontal="true">
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="50dp"
|
||||
android:orientation="vertical" android:background="#80000000" android:gravity="center"
|
||||
android:id="@+id/bottom_content">
|
||||
<TextView android:id="@+id/footer_recognition" android:textAlignment="center" android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
android:textColor="#fff" android:text="正在识别,请稍后..." android:textSize="14dp" android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/flashlight_wrap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="150dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/flashlight"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@drawable/flashlight_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_flashlight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingTop="20px"
|
||||
android:text="轻触点亮"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textSize="15dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<uts.sdk.modules.xwqMlkitScanCode.BoxView android:id="@+id/scan_box_wrap" android:layout_width="wrap_content" android:layout_height="wrap_content" >
|
||||
</uts.sdk.modules.xwqMlkitScanCode.BoxView>
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#6200EE</color>
|
||||
<color name="colorPrimaryDark">#3700B3</color>
|
||||
<color name="colorAccent">#03DAC5</color>
|
||||
<color name="colorHeader">#83818D</color>
|
||||
<color name="colorWhite">#ffffff</color>
|
||||
<color name="colorBlack">#000000</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"module": {
|
||||
"requestPermissions": [
|
||||
{
|
||||
"name": "ohos.permission.CAMERA",
|
||||
"reason": "$string:camera_reason"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"string": [
|
||||
{
|
||||
"name":"camera_reason",
|
||||
"value": "为了能正常使用相机扫码识别功能",
|
||||
"usedScene": {
|
||||
"abilities": ["EntryAbility"],
|
||||
"when": "inuse"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>我们需要您的同意来访问相册,以便您可以选择图片。</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>我们需要您的同意来使用相机扫描图像</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
After Width: | Height: | Size: 254 B |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 736 B |
|
After Width: | Height: | Size: 634 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 788 B |
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"deploymentTarget": "15.5",
|
||||
"dependencies-pods": [{
|
||||
"name": "GoogleMLKit",
|
||||
"version": "7.0.0"
|
||||
},
|
||||
{
|
||||
"name": "MLKitBarcodeScanning",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* 扫码支持的类型
|
||||
* 256:Barcode.FORMAT_QR_CODE
|
||||
* 128:Barcode.FORMAT_ITF)
|
||||
* 1:Barcode.FORMAT_CODE_128
|
||||
* 2:Barcode.FORMAT_CODE_39
|
||||
* 4:Barcode.FORMAT_CODE_93
|
||||
* 8:Barcode.FORMAT_CODABAR
|
||||
* 32:Barcode.FORMAT_EAN_13
|
||||
* 64:Barcode.FORMAT_EAN_8)
|
||||
* 512:Barcode.FORMAT_UPC_A
|
||||
* 1024:Barcode.FORMAT_UPC_E
|
||||
* 2048:Barcode.FORMAT_PDF417
|
||||
* 16:Barcode.FORMAT_DATA_MATRIX
|
||||
* 4096:Barcode.FORMAT_AZTEC
|
||||
*/
|
||||
|
||||
export type Formats='256'|'128'|'1'|'2'|'4'|'8'|'32'|'64'|'512'|'1024'|'2048'|'16'|'4096'|'0';
|
||||
|
||||
|
||||
/**
|
||||
* 回调函数参数类型
|
||||
*/
|
||||
|
||||
export type OptionType={
|
||||
textVal?:string,
|
||||
ssid?:string,
|
||||
password?:string,
|
||||
url?:string,
|
||||
phone?:string,
|
||||
proNumber?:string,
|
||||
emailAddress?:string
|
||||
type?:string,
|
||||
scanCodeType?:string
|
||||
}
|
||||
/**
|
||||
* type 二维码内容类型 例如文本text 链接url ....
|
||||
* scanCodeType 识别码为二维码/条形码 1- 二维码 2- 条形码 0- 未知
|
||||
* option 参数内容{
|
||||
textVal?:string, //文本值
|
||||
ssid?:string, //wifi账号
|
||||
password?:string, //wifi密码
|
||||
url?:string, //链接
|
||||
phone?:string, //手机号
|
||||
proNumber?:string //商品编号
|
||||
}
|
||||
* optionArr 当设置了返回所有值,该字段才有值
|
||||
*/
|
||||
export type CallbackValType={
|
||||
type:string,
|
||||
option:OptionType,
|
||||
optionArr?:Array<OptionType>,
|
||||
scanCodeType?:string|null
|
||||
}
|
||||
|
||||
export type ErrorCallbackValType={
|
||||
type:string,
|
||||
msg:string
|
||||
}
|
||||
|
||||
|
||||
type CallBackType=(val:CallbackValType)=>void
|
||||
type ErrorCallBackType=(val:ErrorCallbackValType)=>void
|
||||
type CancelType=()=>void
|
||||
|
||||
/**
|
||||
* 扫码参数配置
|
||||
* showToast 连续扫码场景,识别成功后提示
|
||||
* showToastText 自定义连续扫码场景toast文案
|
||||
* customFailToatText 自定义未识别到二维码提示内容
|
||||
* cameraType 摄像头类型 默认BACK后置摄像头,可选FRONT前置摄像头,如果摄像头只有一个,默认选择可用列表第一个
|
||||
* continuous 开启连续扫码,默认false不开启
|
||||
* continuousDelay 连续扫码间隔时间
|
||||
* autoZoom 开启相机自动缩放,默认不开启,只限非连续扫码模式下使用
|
||||
* showPhotoAlbum 是否显示相册,默认显示
|
||||
* showLamplight 是否显示灯光,默认显示
|
||||
* markeTitle 底部的提示标题
|
||||
* lightOnText 手电筒打开文案
|
||||
* lightOffText 手电筒关闭文案
|
||||
* photoText 相册底部文案
|
||||
* formatsVal 扫码支持的格式类型,默认支持全部(0)
|
||||
* styleFollowIos 页面样式是否跟随IOS端,默认false不跟随
|
||||
* moreQrCodeSelectText 多个二维码选择提示文案
|
||||
* moreQrCodeSelectTextColor 多个二维码选择提示文案颜色
|
||||
* moreQrCodeSelectTextSize 多个二维码选择提示文案大小
|
||||
* firstUseUltraWideCamera 针对IOS 15以上机型使用,优先使用超广角相机识别二维码(注意:非特殊场景一定需要近距离扫码不要配置此参数,以免影响扫码效率)
|
||||
* scanBox //条码扫码模式
|
||||
* scanBoxTitle //中间区域扫码模式标题,只有scanBox为true生效
|
||||
* scanBoxTitleColor //中间区域扫码模式标题颜色,只有scanBox为true生效
|
||||
* scanBoxTitleSize //中间区域扫码模式标题大小,只有scanBox为true生效
|
||||
* scanBoxHeight //中间区域扫码框的高度,只有scanBox为true生效
|
||||
* outputAllCodeData //开启后,直接返回扫码数据,获取返回值内容需要取optionArr字段,默认关闭(只针对全屏扫码且非连续扫码有效)
|
||||
* success 识别成功的回调
|
||||
* error 识别失败回调
|
||||
* cancel 取消回调
|
||||
* ....
|
||||
*/
|
||||
export type InitParamsType={
|
||||
showToast:boolean|null,
|
||||
showToastText:string|null,
|
||||
customFailToatText:string|null,
|
||||
cameraType:string|null,
|
||||
continuous:boolean|null,
|
||||
continuousDelay:number|null,
|
||||
autoZoom:boolean|null,
|
||||
showPhotoAlbum:boolean|null,
|
||||
showLamplight:boolean|null,
|
||||
markeTitle:string|null,
|
||||
lightOnText:string|null,
|
||||
lightOffText:string|null,
|
||||
photoText:string|null,
|
||||
formatsVal?:Formats,
|
||||
styleFollowIos:boolean|null,
|
||||
scanBox:boolean|null,
|
||||
scanBoxTitle:string|null,
|
||||
scanBoxTitleColor:string|null,
|
||||
scanBoxTitleSize:number|null,
|
||||
scanBoxHeight:number|null,
|
||||
success:CallBackType,
|
||||
error:ErrorCallBackType,
|
||||
cancel:CancelType|null,
|
||||
moreQrCodeSelectText:string|null,
|
||||
moreQrCodeSelectTextColor:string|null,
|
||||
moreQrCodeSelectTextSize:number|null,
|
||||
firstUseUltraWideCamera:boolean|null,
|
||||
outputAllCodeData:boolean|null,
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
export type Perssion={
|
||||
isPass:boolean,
|
||||
failList?:Array<string>,
|
||||
successList?:Array<string>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
|
||||
export function openCamera(paramas) {
|
||||
console.log('******************插件不支持WEB平台!********************')
|
||||
}
|
||||