address-act.vue 3.25 KB
<template>
    <div>
        <header-component header-text="地区选择" :show-btn="false">
        </header-component>
        <ul class="head-address-ul">
            <li class="head-address-li">请选择</li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
        <div class="address-container">
            <div class="address-content">
                <ul class="address-ul">
                    <li v-for="province in provinces">{{province.name}}</li>
                </ul>
            </div>
        </div>
    </div>
</template>
<style>
    body {
        margin: 0;
    }

    .head-address-ul {
        margin: 0;
        padding: 0;
        list-style: none;
        overflow: hidden;
        background-color: white;
        font-size: 24px;

        li {
            width: 25%;
            display: block;
            float: left;
            height: 80px;
            position: relative;
            line-height: 80px;
            text-align: center;
        }

        .head-address-li {
            color: #f23030;
        }

        .head-address-li:after {
            width: 60%;
            height: 1px;
            border-bottom: 2px solid #f23030;
            position: absolute;
            bottom: 1px;
            left: 50%;
            content: '';
            margin-left: -30%;
        }
    }

    .head-address-ul:after {
        content: '';
        width: 100%;
        height: 1px;
        position: absolute;
        border-bottom: 1px solid #e3e5e9;
        left: 0px;
        bottom: 0px;
        transform: scaleY(0.5);
        -webkit-transform: scaleY(0.5);
    }

    .address-container {
        margin: 0px;
        overflow: hidden;
        height: 100%;
        width: 100%;

        .address-content {
            transform: translate(0px, 0px) translateZ(0px);
            height: 960px;

            .address-ul {
                padding: 0;
                margin: 0;
                list-style: none;
                height: 100%;
                overflow: auto;
                font-size: 24px;
                color: #232326;

                li {
                    height: 80px;
                    line-height: 80px;
                    padding-left: 10px;
                    position: relative;
                    overflow: hidden;
                }

                li:after {
                    content: '';
                    width: 100%;
                    height: 1px;
                    position: absolute;
                    border-bottom: 1px solid #e3e5e9;
                    left: 0px;
                    bottom: 0px;
                    transform: scaleY(0.5);
                    -webkit-transform: scaleY(0.5);
                }
            }
        }
    }
</style>
<script>
    let headerComponent = require('common/header.vue');

    module.exports = {
        data() {
            return {
                provinces:[]
            };
        },
        components: {
            headerComponent
        },
        methods: {
            selectProvince() {
                $.get('/home/provinces.json', resultData => {
                    this.provinces = resultData.provinces;
                });
            }
        },
        created: function() {
            this.selectProvince();
        }
    };

</script>