更新记录

1.0.1(2026-01-16) 下载此版本

增加ocr

1.0.0(2026-01-16) 下载此版本

安卓tencent-face


平台兼容性

uni-app(4.87)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - -

uni-app x(4.87)

Chrome Safari Android iOS 鸿蒙 微信小程序
× × 7.0 × × ×

tencent-face

开发文档

UTS 语法 UTS API插件 UTS uni-app兼容模式组件 UTS 标准模式组件 Hello UTS

import { initSdk, InputDataObj } from "@/uni_modules/tencent-face";
export default {
    data() {
        return {

        }
    },
    methods: {
        button_click() {
            //
                    let p : InputDataObj = {
                        faceId: resdata?.getString("faceId","") as string,
                        orderNo: resdata?.getString("orderNo","") as string,
                        appId: resdata?.getString("appId","") as string,
                        nonce: resdata?.getString("nonce","") as string,
                        userId: resdata?.getString("userId","") as string,
                        sign: resdata?.getString("sign","") as string,
                        licence: resdata?.getString("keyLicence","") as string,
                    };
                    this.startsdk(p)

        },
        startsdk(p:InputDataObj){
            initSdk({
                param: p,
                success(res) {
                    console.log(res)

                },
                fail(res) {
                    uni.showToast({
                        title: '' + res,
                        icon: 'none'
                    });
                }
            })
        },

    }
}

ocr 参数

    import { ocrInitSdk,OCRInputDataObj} from "@/uni_modules/tencent-face";
                        let p : OCRInputDataObj = {
    orderNo: resdata?.getString("orderNo","") as string,
    appId: resdata?.getString("appId","") as string,
    nonce: resdata?.getString("nonce","") as string,
    userId: resdata?.getString("userId","") as string,
    sign: resdata?.getString("sign","") as string,
    side: 2 as number//身份证 1正面 2-反面 3-连续
};

this.startocr(p)
startocr(p:OCRInputDataObj){
    ocrInitSdk({
        param: p,
        success(res) {
            console.log(res)

        },
        fail(res) {
            uni.showToast({
                title: '' + res,
                icon: 'none'
            });
        }
    })
}

隐私、权限声明

1. 本插件需要申请的系统权限列表:

摄像头

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。