wenzheng.yang
2023-04-27 31e64e0e144815e6176c1b6b81eae8dc68688570
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!-- 密码表单组件 -->
<template>
    <view class="m-form">
        <view class="m-form-head"><u-icon name="close-circle" color="#fff" size="40" @click="cancel"></u-icon></view>
        <!-- 输入密码 -->
        <view class="m-form-label">
            <u--form labelPosition="left" labelAlign="right" :model="model" :rules="rules" ref="form" labelWidth="100" :labelStyle="{'color':'rgb(129, 129, 129)'}">
                <u-form-item label="密码" prop="password" borderBottom ref="item">
                    <u--input :customStyle="{ 'background-color': 'rgb(233, 233, 233)','box-shadow':'inset 2px 1.464px 5px 0px #ccccc4, 1.464px 1.464px 5px 0px rgba(255, 255, 255, 0.75)'}" placeholderStyle="color:#000" color="#000" v-model="model.password" border="none"></u--input>
                </u-form-item>
            </u--form>
        </view>
        <view class="m-form-button-list">
            <u-button type="primary" text="确定" @click="save"></u-button>
        </view>
    </view>
</template>
 
<script>
export default {
    props: {
    },
    data() {
        return {
            model: {
                password:''
            },
            rules: {
                
            },
        };
    },
    methods: {
        //保存
        save() {
            //默认密码8848
            if(this.model.password=='8848'){
                this.$emit('submitPasswordForm');
            }else{
                uni.$u.toast('密码错误,请重新输入')
            }
        },
        //取消
        cancel() {
            this.$emit('cancelPasswordForm');
        },
    },
    mounted() {
    }
};
</script>
 
<style lang="scss" scoped>
.m-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(233, 233, 233,0.8);
    width: 60%;
    display: flex;
    flex-direction: column;
    z-index: 99999;
}
.m-form-head {
    width: 100%;
    border-bottom: 1px solid #fff;
}
.m-form-head .u-icon {
    float: right;
}
/deep/ .u-form-item__body__left__content__label {
    color: #fff;
}
.m-form-label {
    width: 80%;
    margin: 0 auto;
    margin-bottom: 0.5em;
    .m-form-label-text{
        color: red;
    }
}
input{
    width: 50px;
}
.m-form-button-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1em;
}
.m-form-button-list .u-button {
    width: 5em;
}
.m-form-button-list .u-button:nth-child(2),
.m-form-button-list .u-button:nth-child(3),
.m-form-button-list .u-button:nth-child(4) {
    margin-top: 2em;
}
</style>