更新记录

1.0.6(2022-05-17)

1、插件发布


平台兼容性

Android Android CPU类型 iOS
适用版本区间:4.4 - 11.0 armeabi-v7a:支持,arm64-v8a:支持,x86:未测试 ×

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios

注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择


微信刷脸 SDK 的插件

官方文档如下:

一、所有函数文档 (https://pay.weixin.qq.com/wiki/doc/wxfacepay/develop/sdk-android.html)

二、刷脸支付文档 (https://pay.weixin.qq.com/wiki/doc/wxfacepay/develop/android/facepay.html)

三、人脸识别文档 (https://pay.weixin.qq.com/wiki/doc/wxfacepay/develop/android/faceuser.html)

使用方式:

const wechatfaceModule = uni.requireNativePlugin('bigrocs-wechatFace')

支持的方法:(方法名称入参和返回值与官方文档一直)

函数名称 入参 返回
version(插件版本) {version:'1.0.5',return_code:'SUCCESS'}
initPayFace 官方文档 官方文档
getWxpayfaceRawdata 官方文档 官方文档
getWxpayfaceUserInfo 官方文档 官方文档
getWxpayfaceCode 官方文档 官方文档
updateWxpayfacePayResult 官方文档 官方文档
stopWxpayface 官方文档 官方文档
clickReport 官方文档 官方文档
reportOrder 官方文档 官方文档
reportPaycode 官方文档 官方文档
startCodeScanner 官方文档 官方文档
stopCodeScanner 官方文档 官方文档
getWxpayAuth 官方文档 官方文档
getMpConfig 官方文档 官方文档
launchMp 官方文档 官方文档
releaseWxpayface 官方文档 官方文档
enableFirewall 官方文档 官方文档
disableFirewall 官方文档 官方文档

参考代码

<template>
    <view>
        <view class="content">
            <button type="default" class="but" @click="version">版本</button>
            <button type="default" class="but" @click="initPayFace">initPayFace</button>
            <button type="default" class="but" @click="launchMp">launchMp</button>
            <button type="default" class="but" @click="getWxpayfaceRawdata">getWxpayfaceRawdata</button>
            <button type="default" class="but" @click="getWxpayfaceUserInfo">getWxpayfaceUserInfo</button>
            <button type="default" class="but" @click="getWxpayfaceCode">getWxpayfaceCode</button>
            <button type="default" class="but" @click="updateWxpayfacePayResult">updateWxpayfacePayResult</button>
            <button type="default" class="but" @click="stopWxpayface">stopWxpayface</button>
            <button type="default" class="but" @click="reportInfo">reportInfo</button>
            <button type="default" class="but" @click="reportOrder">reportOrder</button>
            <button type="default" class="but" @click="reportPaycode">reportPaycode</button>
            <button type="default" class="but" @click="startCodeScanner">startCodeScanner</button>
            <button type="default" class="but" @click="stopCodeScanner">stopCodeScanner</button>
            <button type="default" class="but" @click="getWxpayAuth">getWxpayAuth</button>
            <button type="default" class="but" @click="getMpConfig">getMpConfig</button>
            <button type="default" class="but" @click="releaseWxpayface">releaseWxpayface</button>
            <button type="default" class="but" @click="enableFirewall">enableFirewall</button>
            <button type="default" class="but" @click="disableFirewall">disableFirewall</button>

        </view>
        <view class="text-area">
            <h1>回调</h1>
            {{msg}}
        </view>
        <view class="text-area">
            <h1>回调2</h1>
            {{msg2}}
        </view>
    </view>
</template>
<script>
    const wechatfaceModule = uni.requireNativePlugin('bigrocs-wechatFace')
    export default {
        data() {
            return {
                title: 'Hello',
                msg:'',
                msg2:''
            }
        },
        onLoad() {
        },
        methods: {
            version() {
                wechatfaceModule.version( e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            initPayFace() {
                wechatfaceModule.initPayFace({
                    "perform_mode":"NORMAL_PRFORM"
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            getWxpayfaceRawdata() {
                wechatfaceModule.getWxpayfaceRawdata(e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            getWxpayfaceUserInfo() {
                wechatfaceModule.getWxpayfaceUserInfo({
                    "appid":"填您的公众号",
                    "mch_id":"填您的商户号",
                    "sub_appid":"子商户公众账号ID(非服务商模式不填)",
                    "sub_mch_id":"子商户号(非服务商模式不填)",
                    "store_id":"门店编号,必填",
                    "face_authtype":"FACEID-ONCE",
                    "authinfo":"填您的调用凭证",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            getWxpayfaceCode() {
                wechatfaceModule.getWxpayfaceCode({
                    "appid":"填您的公众号",
                    "mch_id":"填您的商户号",
                    "sub_appid":"子商户公众账号ID(非服务商模式不填)",
                    "sub_mch_id":"子商户号(非服务商模式不填)",
                    "store_id":"门店编号,必填",
                    "telephone":"用户手机号",
                    "openid":"用户openid",
                    "out_trade_no":"填您的商户订单号",
                    "total_fee":"填订单的金额",
                    "face_authtype":"FACEPAY",
                    "ask_face_permit":"0",
                    "ask_ret_page":"1",
                }, e=> {
                    this.msg = JSON.stringify(e)
                }, e=> {
                    this.msg2 = JSON.stringify(e)
                })
            },
            updateWxpayfacePayResult() {
                wechatfaceModule.updateWxpayfacePayResult({
                    "appid":"填您的公众号",
                    "mch_id":"填您的商户号",
                    "store_id":"门店编号,必填",
                    "authinfo":"填您的调用凭证",
                    "payresult":"SUCCESS",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            stopWxpayface() {
                wechatfaceModule.stopWxpayface({
                    "authinfo":"填您的调用凭证",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            clickReport() {
                wechatfaceModule.clickReport({
                    "item":"face.mch.module.something.count",
                    "item_value": 1,
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            reportOrder() {
                wechatfaceModule.reportOrder({
                    "mch_id":"填您的商户号",
                    "sub_mch_id": "填您的子商户号",
                    "out_trade_no": "填您的商户订单号",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            reportPaycode() {
                wechatfaceModule.reportPaycode({
                    "auth_code":"填您的微信支付18位付款码",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            startCodeScanner() {
                wechatfaceModule.startCodeScanner(e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            stopCodeScanner() {
                wechatfaceModule.stopCodeScanner(e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            getWxpayAuth() {
                wechatfaceModule.getWxpayAuth({
                    "authinfo":"调用凭证",
                    "face_sid":"用户身份信息查询凭证",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            getMpConfig() {
                wechatfaceModule.getMpConfig(e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            launchMp() {
                wechatfaceModule.launchMp({
                    "miniprogram_key_cmd":"有效的小程序启动键值",
                    "appid":"商户号绑定的公众号/小程序 appid",
                    "sub_appid":"子商户绑定的公众号/小程序 appid(可不填)",
                    "mch_id ":"商户号",
                    "sub_mch_id ":"子商户绑定的公众号/小程序 appid(可不填)",
                    "store_id":"门店编号",
                    "authinfo":"调用凭证",
                }, e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            releaseWxpayface() {
                wechatfaceModule.releaseWxpayface(e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            enableFirewall() {
                wechatfaceModule.enableFirewall("mchId","subMchId", e=> {
                    this.msg = JSON.stringify(e)
                })
            },
            disableFirewall() {
                wechatfaceModule.disableFirewall( e=> {
                    this.msg = JSON.stringify(e)
                })
            },
        }
    }
</script>
<style>
    .content {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: flex-start;
    }
    .text-area {
        margin: 10px;
    }
    .but{
        height: 50px;
        margin: 5px;
    }
</style>

© 2022 GitHub, Inc. Terms Privacy Security

隐私、权限声明

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

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

插件微信刷脸支付功能使用微信刷脸支付SDK,参考其官方网站 https://pay.weixin.qq.com/wiki/doc/wxfacepay/develop/android/facepay.html 启动微信刷脸支付时拍摄人脸来识别和验证支付者身份。

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

许可协议

作者未提供license.md

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问