首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >js之Vue样式集(11)注册页面样式,全部代码附效果图

js之Vue样式集(11)注册页面样式,全部代码附效果图

原创
作者头像
IT工作者
发布2022-05-16 18:25:29
发布2022-05-16 18:25:29
2.1K0
举报
文章被收录于专栏:程序技术知识程序技术知识
代码语言:javascript
复制
<template>
    <view class="page">
        <view class="top">
            新用户注册
        </view>
        <image :src="sanjiao" mode="widthFix" class="sanjiao"></image>
        <!-- <image style="width: 100vw;" :src="bolang" mode="widthFix"></image> -->
        <view class="centent">
            <view class="p_r">
                <view class="left">
                    姓&#12288;&#12288;名
                </view>
                <input class="input w100" type="number" placeholder-class="placeholderClass"
                    placeholder="请输入姓名"></input>
            </view>
            <view class="p_r">
                <view class="left">
                    手机号码
                </view>
                <input class="input w100" type="number" placeholder-class="placeholderClass"
                    placeholder="11位手机号码"></input>
                <view class="getCode">
                    获取验证码
                </view>
            </view>
            <view class="p_r">
                <view class="left " style="letter-spacing: 16rpx;">
                    验证码
                </view>
                <input class="input w100" type="text" placeholder-class="placeholderClass" placeholder="请输入验证码"></input>
            </view>
            <view class="p_r">
                <view class="left">
                    医&#12288;&#12288;院
                </view>
 
                <picker mode="multiSelector" :value="multiIndex" range-key="name" :range="multiArray"
                    @columnchange="MultiPickerColumnChange" @change="MultiPickerChange">
 
                    <input class="input" type="text" placeholder-class="placeholderClass" placeholder="请输入您的医院"></input>
 
                </picker>
            </view>
            <view class="p_r">
                <view class="left">
                    科&#12288;&#12288;室
                </view>
                <input class="input" type="text" placeholder-class="placeholderClass" placeholder="请输入您的科室"></input>
            </view>
            <view class="p_r">
                <view class="left">
                    职&#12288;&#12288;务
                </view>
                <input class="input" type="text" placeholder-class="placeholderClass" placeholder="请输入您的职务"></input>
            </view>
            <view class="p_r">
                <view class="left">
                    性&#12288;&#12288;别
                </view>
                <input class="input" type="text" placeholder-class="placeholderClass" placeholder="请输入您的性别"></input>
            </view>
        </view>
        <view class="xxx">
 
        </view>
        <view class="btn" @click="goIndex">
            提 交
        </view>
    </view>
</template>
 
<script>
    var that;
    import {
        city,
        province
    } from '@/util/city.js'
    export default {
        data() {
            return {
                sanjiao: this.$config.cdn_url + 'sanjiao.png',
                bolang: this.$config.cdn_url + 'bolang.png',
                multiArray: [province, []],
                multiIndex: [0, 0],
                pid: '',
                cid: '',
                pname: '',
                cname: '',
            }
        },
        onLoad(option) {
            this.$common.Init.call(this);
            that = this;
            console.log('option', option)
            console.log('city', city)
 
            city.forEach(item => {
                if (item.pid == province[0].pid) this.multiArray[1].push(item)
                // if(item.pid==this.multiArray[0][this.multiIndex[0]].pid)
            })
        },
        onShow() {
 
        },
        onHide() {},
        methods: {
            MultiPickerColumnChange(e) {
                console.log('MultiPickerColumnChange', e)
                console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
                var column = e.detail.column;
                var value = e.detail.value;
                switch (e.detail.column) {
                    case 0:
                        this.multiArray[1] = []
                        city.forEach(item => {
                            if (item.pid == province[value].pid) this.multiArray[1].push(item)
                        })
                        break;
                    case 1:
                        break;
                }
 
            },
            MultiPickerChange(e) {
                console.log('MultiPickerChange', e)
 
                var value = e.detail.value;
                this.pname = this.multiArray[0][value[0]].name;
                this.cname = this.multiArray[1][value[1]].name;
 
                this.pid = this.multiArray[0][value[0]].pid;
                this.cid = this.multiArray[1][value[1]].cid;
                console.log('pid', this.pid,this.pname)
                console.log('cid', this.cid,this.cname)
 
            },
            goIndex() {
                let url = '/pages/index/index'
                this.goOtherPages(url)
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .page {
        top: 0;
        height: 100vh;
    }
 
    .sanjiao {
        width: 38rpx;
        position: absolute;
        right: 50rpx;
        top: 180rpx;
    }
 
    .btn {
        background: #D7000F;
        width: 320rpx;
        margin-left: -160rpx;
        transform: translateX(50vw);
        position: absolute;
        height: 80rpx;
        font-size: 36rpx;
        font-weight: 600;
        line-height: 80rpx;
        border-radius: 50rpx;
        margin-top: 134rpx;
        text-align: center;
        color: #fff;
    }
 
    .top {
        background: #D7000F;
        text-align: center;
        width: 100vw;
        height: 180rpx;
        line-height: 180rpx;
        color: #fff;
        font-weight: 600;
        font-size: 40rpx;
 
    }
 
    .centent {
        margin-top: 60rpx;
        width: 85%;
        margin-left: 10%;
 
        .p_r {
            margin-bottom: 40rpx;
            height: 60rpx;
            line-height: 60rpx;
        }
 
        .left {
            width: 150rpx;
        }
 
        .input {
            border: 1px solid #d0d0d0;
            height: 60rpx;
            border-radius: 8rpx;
            padding-left: 12rpx;
            width: 450rpx;
            font-size: 28rpx;
        }
 
        .placeholderClass {
            font-size: 28rpx;
        }
 
        .w100 {
            width: 260rpx;
        }
 
        .getCode {
            background: $red;
            width: 170rpx;
            height: 60rpx;
            line-height: 60rpx;
            border-radius: 8rpx;
            text-align: center;
            margin-left: 16rpx;
            font-size: 26rpx;
            color: #fff;
 
        }
    }
</style>

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档