my_que.html 3.8 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <script src="../../assets/js/fontsize.js"></script>
    <link rel="stylesheet" href="../../assets/css/api.css"/>
    <link rel="stylesheet" href="../../assets/css/my_f.css"/>
    <link rel="stylesheet" href="../../assets/icon/iconfont.css">
    <title></title>
    <style>
        .que_box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 15px;
            color: #D8B25F;
            padding-bottom: 0.35rem;
        }

        .que_body {
            border-bottom: 1px solid #E4E4E4;
            padding: 0.32rem;
            height: 0.88rem;
            overflow: hidden;
        }

        .que_box .icon-wenhao1 {
            color: #D8B25F;
            margin-right: 0.16rem;

        }

        .que_box .icon-xiangyou {
            font-size: 15px;
            color: #d1d1d1;
        }

        .que_content {
            display: flex;
            font-size: 14px;
            color: #333333;
        }

        .que_content .icon-xiaoxiwei {
            color: #7A96E1;
            font-size: 14px;
            margin-right: 0.16rem;
        }

        .tans {
            transform: rotate(0deg);
            transition: 0.2s;
        }

        .tanss {
            transition: 0.2s;
            transform: rotate(90deg);
        }

        .que_show {
            height: auto;
        }
    </style>
</head>
<body>
<div id="app">
    <div :class="['que_body',ind==index?'':'que_show']" v-for="(item,index) in getQA_data">
        <div class="que_box" @click="transform_fn(index)">
            <div><span class="iconfont icon-wenhao1"></span><span>{{item.question}}</span></div>
            <div :class="['iconfont','icon-xiangyou',ind==index?'tans':'tanss']"></div>
        </div>
        <div class="que_content">
            <span class="iconfont icon-xiaoxiwei"></span>
            <p>{{item.answer}}</p>
        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
    new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            getQA_data: [],
            ind: -1
        },
        created: function () {
            apiready = function () {
                app.getQA()
            }
        },
        methods: {
            getQA: function () {
                var post = {};
                // var header = {
                //     'XX-Device-Type': getDevice(),
                //     'XX-Token': getToken()
                // };
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'user/index/getQA', post, header).then(function (res) {
                    if (res.data.code == 1) {
                        app.getQA_data = res.data.data;
                    }
                })
            },
            transform_fn: function (index) {
                if (app.ind == index) {
                    app.ind = -1
                } else {
                    app.ind = index
                }
            }
        }
    })
</script>