uniapp 登录页 样式效果

uniapp yekong 268℃

uniapp 登录页

<template>
    <view class="flex-col container">
        <view class="flex-col group">
            <view class="divider"> </view>
            <image src="/static/1024.png" class="image_1" />
            <div class=" form">
                <div class="formdata2">
                    <text>手机</text>
                </div>
                <div class="formdata">
                    <input type="text" placeholder="请输入用户名" v-model="userinfo">
                    <u-icon color="#6C6C6C" class="image_3" name="account" size="20"></u-icon>
                </div>
                <div class="formdata2">
                    <text>密码</text>
                </div>
                <div class="formdata">
                    <input v-if="!ispassword" type="password" placeholder="请输入密码" v-model="password">
                    <input v-else type="text" placeholder="请输入密码" v-model="password">
                    <u-icon v-if="ispassword" @click="ispassword=false" color="#6C6C6C" class="image_3" name="eye"
                        size="20"></u-icon>
                    <u-icon v-else @click="ispassword=true" color="#6C6C6C" class="image_3" name="eye-off" size="20">
                    </u-icon>
                </div>
            </div>
            <view class="flex-col group_4">
                <view @click="view_11OnClick" class="justify-center button">
                    <text>立即登录</text>
                </view>
                <view class="bottom-group flex-col items-center view">
                    <text @click="text_6OnClick">忘记密码?</text>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                password: '',
                userinfo: '',
                ispassword: false
            };
        },

        methods: {
            view_11OnClick() {
                uni.reLaunch({
                    url:'/pages/home/home'
                })
            },
            text_6OnClick() {
                uni.navigateTo({
                    url: '/pages/reg/reg'
                });
            },
            image_7OnClick() {
                uni.navigateTo({
                    url: '/pages/wxlogin/wxlogin',
                });
            },
        },
    };
</script>

<style scoped lang="scss">
    .container {
        background-color: rgb(255, 255, 255);
        width: 100vw;
        height: 100vh;
        overflow-y: auto;

        .group {
            // flex: 1 1 auto;
            // overflow-y: auto;

            .divider {
                // background-image: url('/static/local/16378476872364883134.png');
                background-size: 100% 100%;
                height: 2rpx;
            }

            .image_1 {
                margin-top: 50rpx;
                align-self: center;
                width: 200rpx;
                height: 200rpx;
            }

            .group_1 {
                margin-top: 100rpx;
                padding: 0 48rpx;
                color: rgb(0, 0, 0);
                font-size: 24rpx;
                line-height: 105rpx;
                height: 250rpx;
                position: relative;

                .group_2 {
                    width: 59rpx;
                    position: absolute;
                    left: 50rpx;
                    top: 0;

                    .text_1 {
                        opacity: 0.5;
                    }
                }

                .group_3 {
                    width: 249rpx;
                    position: absolute;
                    left: 48rpx;
                    top: 40rpx;

                    input {
                        height: 50rpx;
                        font-size: 24rpx;
                    }
                }
            }

            .group_4 {
                margin-top: 80rpx;
                padding: 0 50rpx;

                .button {
                    padding: 27rpx 51rpx 31rpx;
                    align-self: center;
                    color: rgb(255, 255, 255);
                    font-size: 24rpx;
                    line-height: 23rpx;
                    white-space: nowrap;
                    background-color: #3D9CFF;
                    border-radius: 40rpx;
                    width: 350rpx;
                    position: relative;

                    .icon {
                        position: absolute;
                        right: 51rpx;
                        top: 50%;
                        transform: translateY(-50%);
                        width: 9rpx;
                        height: 17rpx;
                    }
                }

                .view {
                    margin-top: 54rpx;
                    color: rgb(153, 153, 153);
                    font-size: 24rpx;
                    line-height: 23rpx;
                    white-space: nowrap;
                }
            }

            .group_5 {
                margin-top: 108rpx;
                color: rgb(153, 153, 153);
                font-size: 24rpx;
                line-height: 23rpx;
                white-space: nowrap;

                .image-wrapper_1 {
                    margin-top: 25rpx;
                    padding: 21rpx 0 356rpx;
                    // background-image: url('/static/remote/28d3170f4dfc3758fbefd31a08be2475.png');
                    background-size: 100% 100%;
                    background-repeat: no-repeat;

                    .icon_1 {
                        width: 48rpx;
                        height: 39rpx;
                    }
                }
            }

            .bottom-group {
                position: relative;

                .image_4 {
                    width: 650rpx;
                    height: 2rpx;
                    position: absolute;
                    left: 0;
                    right: 0;
                    top: 50%;
                    transform: translateY(-50%);
                }

                .image_5 {
                    width: 650rpx;
                    height: 2rpx;
                    position: absolute;
                    left: 50%;
                    top: 50%;
                    transform: translate(-50%, -50%);
                }
            }
        }
    }

    .form {
        width: 650rpx;
        margin: auto;

        .formdata2 {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            flex-wrap: nowrap;
            flex-direction: row;
            margin-top: 20rpx;

            text {
                font-size: 24rpx;
                font-family: PingFang;
                font-weight: 300;
                color: rgba(#000000, 0.5);
            }
        }

        .formdata {
            height: 60rpx;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: nowrap;
            flex-direction: row;
            line-height: 60rpx;
            width: 100%;
            position: relative;

            input {
                font-size: 24rpx;
                color: rgba(0, 0, 0, 1);
                border-bottom: 1rpx solid rgba(0, 0, 0, 0.08);
                width: 100%;
                height: 60rpx;
            }

            &:focus {
                border-color: red;
            }
        }
    }

    .image_2 {
        width: 25rpx;
        height: 24rpx;
        position: absolute;
        right: 0;
        top: 20rpx;
    }

    .image_3 {
        width: 25rpx;
        height: 19rpx;
        position: absolute;
        right: 10rpx;
        top: 20rpx;
    }
</style>

喜欢 (0)