avm-zy-captcha

介绍

图形验证码插件(暂时仅app可使用),比原生更好用的原生组件,样式美观,简单好用,非常方便集成。 type有10多种验证类型,请看插件源码里的注释

使用方式

import "../../components/avm-zy-captcha/avm-zy-captcha.stml";

代码示例

<view v-if="showzyCaptcha">
    <avm-zy-captcha :type="1" @event="zyCaptchaEvent"></avm-zy-captcha>
</view>

API

props 属性

参数 说明 类型 默认
type 类型 String

Events事件

事件名称 说明 回调参数
event 点击按键时触发 {"type":"cancel"}

案例

<view v-if="showzyCaptcha">
    <avm-zy-captcha :type="1" @event="zyCaptchaEvent"></avm-zy-captcha>
</view>
<script>
import "../../components/avm-zy-captcha/avm-zy-captcha.stml";
export default {
    name: "tpl",
    apiready() {
        try{
            api.setStatusBarStyle({ style: "light", color: "-" });
            api.removeLaunchView();
        }catch(e){
        }
    },
    watch:{
    },
    data() {
        return {
            //图形验证码所需参数
            showzyCaptcha:false,
        };
    },
    computed: {

    },
    methods: {
        //图形验证码监听方法-------------------
        zyCaptchaEvent(e){
            //{"detail":{"type":"success"}}  type有success(验证成功)、cancel(取消验证)
            console.log(JSON.stringify(e));
            this.showzyCaptcha = false;
        },
        setzyCaptcha(){
            this.showzyCaptcha = !this.showzyCaptcha;
        }
    }
};
</script>

帮助说明/联系方式

如需修改或修改样式请查看components下对应的stml,如需要更多自定义功能或反馈与BUG,可联系QQ:1161277121

是否仍需要帮助? 请保持联络!
最后更新于 2024/07/22