vue实现移动端手机端问卷调查答题效果代码

代码语言:html

所属分类:表单美化

代码描述:vue实现移动端手机端问卷调查答题效果代码

代码标签: 手机 问卷调查 答题 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- 阻止放大缩小 -->
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/mintui.min.css">
    <style>
        .content {
            background-color: #a2c9d8;
        }
        .main-list {
            position: relative;
        }
        .problemList {
            float: left;
        }
        .subject {
            margin: 1rem  1.5rem;
            color: #fff;
        }
        .subject h3 {
            font-size: 0.8rem;
        }
        .subject p {
            font-size: 0.75rem;
            margin: 0.3rem 0.75rem;
            line-height: 1.2rem;
        }
        .option {
            margin: 0.3rem 0.5757rem;
        }
        .option li {
            margin: 0.3rem 1rem 0.5rem;
            width: 6.8rem;
            position: relative;
            display: inline-flex;
        }
        .option li.on {
            background-color: #44b1c9;
            color: #fff;
            border: 0.1rem solid #44b1c9;
        }
        .option li span {
            width: 6rem;
            text-align: center;
            border-radius: 0.5rem;
            border: 0.1rem solid #fff;
            color: #fff;
            font-size: 0.7rem;
            padding: 0.3rem;
            display: block;
        }
        .option li .on span {
            background-color: #44b1c9;
            color: #fff;
            border: 0.1rem solid #44b1c9;
        }
        .btn-groups {
            width: 100%;
            height: 3rem;
            position: fixed;
            bottom: 0;
            left: 0;
            background-color: rgba(162,201,216,.8);
        }
        .btn-groups-height {
            height: 3rem;
        }
        .submit {
            display: block;
            float: left;
            background-color: #44b1c9;
            color: #fff;
            width: 6rem;
            font-size: 0.7rem;
            padding: 0.5rem 0;
            text-align: center;
            border-radius: 0.15rem;
            margin: 0.5rem 2rem;
        }
        .submit:active {
            background: rgba(68,177,201,.5);
        }
        .btn-groups .prev {
            position: absolute;
            left: 0;
            bottom: 0;
        }
        .btn-groups .next,.btn-groups .save {
            position: absolute;
            right: 0;
            bottom: 0;
        }

        input[type='checkbox'] {
            width: 100%;
            height: 100%;
            -webkit-appearance: checkbox;
            position: absolute;
            opacity: 0;
            top: 0;
            left: 0;
        }
        input[type='radio'] {
            width: 100%;
            height: 100%;
            -webkit-appearance: radio;
            position: absolute;
            opacity: 0;
            top: 0;
            left: 0;
        }
        input[type='checkbox']:checked + span,input[type='radio']:checked + span {
            background-color: #44b1c9;
            color: #fff;
            border: 0.1rem solid #44b1c9;
        }

        /*动画*/
        .slide-enter,.slide_back-enter {
            position: absolute;
            width: 100%;
        }
        .slide-leave,.slide_back-leave {
            position: absolute;
            width: 100%;
        }
        .slide-enter-active,.slide_back-enter-active {
            transition: all 0.3s linear;
        }
        .slide-leave-active {
            position: absolute;
            transition: all 0.3s linear;
            transform: translate(-100%);
        }
        .slide-enter {
            transform: translateX(100%);
        }
        .slide_back-leave-active {
            position: absolute;
            transition: all 0.3s linear;
            transform: translate(100%);
        }
        .slide_back-enter {
            transform: translateX(-100%);
        }

        /*修改默认placeholder中的文字 颜色*/
:-moz-placeholder {
            color: #9e9e9e;
        }
        ::-moz-placeholder {
            color: #9e9e9e;
        }
        input:-ms-input-placeholder,textarea:-ms-input-placeholder {
            color: #9e9e9e;
        }
        input::-webkit-input-placeholder,textarea::-webkit-input-placeholder {
            color: #9e9e9e;
        }


        /*------- RESPONSIVE -------*/

        .el-menu-item.is-active {
            background: #f0f0f0;
        }
        .el-table__header th {
            background-color: #f5f7fa;
            color: #333;
            font-weight: bold;
        }

        /*app样式*/
        #app {
            /*background: url(./static/images/bg.png) no-repeat;
  background-size: 100% 100%; */
            background-color: #f5f5f5;
        }
        .content {
            min-height: 100%;
            overflow: hidden;
            height: 100vh;
        }
        .red {
            color: red!important;
            font-weight: bold;
        }

        .header .mint-header {
            background-color: #44b1c9;
            font-size: 0.9rem;
            height: 2rem;
        }
        .header .mint-header-title {
            line-height: 2rem;
        }
        .header .mint-header-button > a:active {
            background-color: #44b1c9!important;
        }
        .header .mint-header .mint-button {
            height: 2rem;
        }
        .header .mint-header .mintui {
            font-size: 0.7rem;
        }
        .header .mint-header .mint-button-text {
            font-size: 0.7rem;
        }
        .header .mint-header-height {
            height: 2rem;
        }
        .mint-popup .popup-ul {
            display: flex;
            border-top: 1px solid #ddd;
            border-bottom: 1px solid #ddd;
        }
        .mint-popup .popup-ul li:active {
            background-color: #ddd;
        }
        .picker-sure {
            flex: 1;
            width: 50%;
            text-align: center;
            line-height: 1rem;
            font-size: 0.8rem;
            padding: 0.5rem 0;
            background-color: #eee;
            color: #707274;
            border-right: 1px solid #ddd;
        }
        .picker-cancel {
            flex: 1;
            width: 50%;
            text-align: center;
            line-height: 1rem;
            font-size: 0.8rem;
            padding: 0.5rem 0;
            right: 0;
            background-color: #eee;
            color: #26a2ff;
        }

        .dataMore {
            text-align: center;
            font-size: 0.7rem;
            padding: 0.5rem 0 1rem;
            color: #1b1b1b;
        }
        .dataMore .conter {
            display: table;
            margin: 0 auto;
        }
        .dataMore .conter .icon {
            display: inline-block;
            vertical-align: middle;

        }
        .dataMore .conter .text {
            display: inline-block;
            margin-left: 5px;
            vertical-align: middle;
        }


        .details-popup .mint-popup {
            width: 100%;
        }

        .mint-footer-height {
            height: 55px;
        }
        .mint-loadmore-bottom {
            font-size: 14px;
        }



        .btn {
            position: relative;
            color: #fff;
            text-decoration: none;
            background-color: #2c65a8;
            font-family: "Microsoft YaHei", 微软雅黑, 宋体;
            font-weight: 700;
            font-size: 3em;
            display: block;
            padding: 4px;
            border-radius: 8px;
            /* let's use box shadows to make the button look more 3-dimensional */
            box-shadow: 0px 3px 0px rgba(44,101,185, 1), 0px 9px 15px rgba(0, 0, 0, .5);
            margin: 100px auto;
            width: 160px;
            text-align: center;
            -webkit-transition: all .1s ease;
            -moz-transition: all .1s ease;
            transition: all .1s ease;
        }
        .btn:active {
            box-shadow: 0px 3px 0px rgba(44,101,185, 0.5), 0px 3px 6px rgba(0, 0, 0, .9);
            position: relative;
            top: 1px;
        }
        .readonly {
            background-color: rgba(220,220,220,.5);
        }


    </style>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue@2.6.1.js"></script>
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/rem.js"></script>
</head>
<body>
    <div id="app">
        <div class="content">
            <div class="header">
                <header class="mint-header is-fixed">
                    <div class="mint-header-button is-left">
                        <a href="javascript:history.back(-1)" class="">
                            <button class="mint-button mint-button--default mint-button--normal">
                                <span class="mint-button-icon"><i class="mintui mintui-back"></i></span>
                                <label class="mint-button-text">返回</label>
                            </button>
                        </a>
                    </div>
                    <h1 class="mint-header-title">健康评估量表</h1>
                    <div class="mint-header-button is-right">
                        <button class="mint-button mint-button--default mint-button--normal">
                            <label class="mint-button-text">{{dataIndex+1}}/{{data.length}}</label>
                        </button>
                    </div>
                </header>
                <div class="mint-header-height"></div>
            </div>
            <div class="main">
                <form id="form1" runat="server">
                    <div class="main-list clearfix">
                        <transition-group :name="transitionName">
                            <div class="problemList" v-show="dataIndex === index" v-for="(item, index) in data" :key="index">
                                <div class="subject">
                                    <h3>{{index+1}}.{{item.subject.title}}</h3>
                                    <p>
                                        {{item.subject.describe}}
                                    </p>
                                </div>
                                <div class="option">
                                    <ul class="clearfix">
                                        <!-- 多选 -->
                  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0