<template>
    <Cn-page :loading='loading'>
        <view slot='body'>
            <view class='index'>
                <view class="content" :key="index">
                    <uni-forms>
                        <!-- <uni-forms-item label="类型">
                            <uni-data-select v-model="item.type" :localdata="range"></uni-data-select>
                        </uni-forms-item> -->
                        <uni-forms-item label="标题">
                            <uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要" />
                        </uni-forms-item>
                        <uni-forms-item label="描述">
                            <uni-easyinput type="textarea" v-model="formData.des" placeholder="请输入详细描述" />
                        </uni-forms-item>
                        <uni-forms-item label="图片">
                            <uni-file-picker :auto-upload="false" :fileList="formData.fileList" @change="fileChange" />
                        </uni-forms-item>
                    </uni-forms>
                </view>
                <view class="btn-wrap">
                    <view class="btn-wrap-item " @click="submit"> 提交 </view>
                </view>
            </view>
        </view>
    </Cn-page>
</template>
<script>
export default {
    data () {
        return {
            loading: false,
            formData: {
                title: '',
                des: '',
                fileList: []
            },
            range: [
                { value: 0, text: "DVR" },
                { value: 1, text: "APF" },
            ],

        }
    },
    methods: {
        add () {
            this.formData.push({
                type: '',
                address: '',
            })
        },
        submit () {
            console.log(this.formData)
            uni.navigateBack({ delta: 1 })
        },
    }
}
</script>
<style lang='scss'>
.index {
    padding: 20rpx;

    .content {
        margin-bottom: 20rpx;
        padding: 34rpx;
        background: $uni-theme-white;
        border-radius: 12rpx;
    }

    .btn-wrap {
        margin-top: 40rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .btn-wrap-item {
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 1;
            background: $uni-theme-blue;
            color: #fff;
            height: 80rpx;
            border-radius: 12rpx;
        }
    }
}
</style>