#
whycq
2023-10-08 75252c6ad38784d0d753344dba37057e852df189
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
<template>
    <view class="my-input">
        <uni-icons class="title-icon" :type="titleIcon" size="20" color="#707070" ></uni-icons>
        <view class="box-text">{{title}}:</view>
        <input class="input" :type="inputType"  :placeholder="placeholder">
        <uni-icons class="opt-icon" :type="optIcon" size="20" color="#707070" v-show="optIconShow"></uni-icons>
    </view>
</template>
 
<script>
    export default{
        name: 'My-input',
        components: {
            
        },
        props: {
            titleIcon: {
                type: String,
                default: 'person'
            },
            title: {
                type: String,
                default: '账号'
            },
            placeholder: {
                type: String,
                default: ''
            },
            inputType: {
                type: String,
                default: 'text'
            },
            optIcon: {
                type: String,
                default: 'eye'
            },
            optIconShow: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {
            }
        }
        
    }
</script>
 
<style lang="scss">
    .my-input {
        width: 100%;
        height: 45px;
        display: flex;
        color: #606164;
        align-items: center;
        background-color:  #ECF0F1;
        border-radius: 7px;
        box-shadow: inset 4px 4px 4px rgba(0,0,0,.3),
                    inset -4px -4px 4px rgba(255,255,255,.7),
                    -4px -4px 5px rgba(0,0,0,.4);
    }
    .title-icon {
        margin: 0 8px 0 8px;
    }
    .box-text {
        line-height: 1;
    }
    .input {
        flex:1;
        margin-left: 8px;
        margin-right:8px;
    }
    .opt-icon {
        margin-left: auto;
        margin-right: 8px;
    }
</style>