wrs-gesturelockview

2021-08-13  本文已影响0人  浪人残风

前言

手势密码控件,支持密码设置、密码修改、密码校验

功能

wrs-gesturelockview组件

    <wrs-gesturelockview :config="config" :style="'width:'+width+'px;height:'+height+'px;'" @onResult="onResult">
        </wrs-gesturelockview>

属性

事件

<template>
    <div>
        <wrs-gesturelockview :config="config" :style="'width:'+width+'px;height:'+height+'px;'" @onResult="onResult">
        </wrs-gesturelockview>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                config: {
                    type: "pwdSetting",
                    tintColor: "#128FEB", // 主题颜色
                    minDotCount: 4 // 至少输入几个点
                }
            }
        },
        onLoad() {
            // 设置播放器宽高,一般宽度铺满全屏,宽高比是16:9
            const {
                windowWidth,
                windowHeight
            } = uni.getSystemInfoSync();
            this.width = windowWidth;
            this.height = windowHeight;
        },
        methods: {
            onResult: function(resp) {
                var str = JSON.stringify(resp.detail);
                console.log("onResult:" + str);
                uni.navigateBack({
                    delta: 1
                });
            }
        }
    }
</script>

<style>

</style>

pwdUpdate.nvue

<template>
    <div>
        <wrs-gesturelockview :config="config" :style="'width:'+width+'px;height:'+height+'px;'" @onResult="onResult"></wrs-gesturelockview>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                config: {
                    type: "pwdUpdate",
                    tintColor: "#128FEB",
                    varifyPassword: "01258",
                    minDotCount: 4 // 至少输入几个点
                }
            }
        },
        onLoad() {
            // 设置播放器宽高,一般宽度铺满全屏,宽高比是16:9
            const {
                windowWidth,
                windowHeight
            } = uni.getSystemInfoSync();
            this.width = windowWidth;
            this.height = windowHeight;
        },
        methods:{
            onResult:function(resp){
                var str = JSON.stringify(resp.detail);
                console.log("onResult:" + str);
                uni.navigateBack({
                    delta: 1
                });
            }
        }
    }
</script>

<style>

</style>

pwdVarify.nvue

<template>
    <div>
        <wrs-gesturelockview :config="config" :style="'width:'+width+'px;height:'+height+'px;'" @onResult="onResult"></wrs-gesturelockview>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                config: {
                    type: "pwdVarify",
                    tintColor: "#128FEB",
                    varifyPassword: "01258",
                    minDotCount: 4 // 至少输入几个点
                }
                
            }
        },
        onLoad() {
            // 设置播放器宽高,一般宽度铺满全屏,宽高比是16:9
            const {
                windowWidth,
                windowHeight
            } = uni.getSystemInfoSync();
            this.width = windowWidth;
            this.height = windowHeight;
        },
        methods:{
            onResult:function(resp){
                var str = JSON.stringify(resp.detail);
                console.log("onResult:" + str);
                uni.navigateBack({
                    delta: 1
                });
            }
        }
    }
</script>

<style>

</style>

如果觉得可以就点个👍吧,欢迎粉丝收藏,土豪打赏,您的关注就是我们创作的动力!

上一篇下一篇

猜你喜欢

热点阅读