<template src="./template.html">

</template>

<script>
    import util from "@/utils/util";
    import imgInput from "../img_input.vue";
    // import commTemplate from '@/components/commTemplate.vue';
    import footTemplate from '../footTemplate.vue';
    import { loginService } from "@/services";
    import { Toast } from "mint-ui";
    export default {
        props:{
            switchOn:Boolean,
            perviewOn:Boolean,
            updateData:String,
        },
        data() {
            var serverUrl = 'http://skyforest.static.elab-plus.com/temp/template20/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                obj:{
                    logoUrl:`${serverUrl}LOGO.png`,
                    banner1:`${serverUrl}bg1.png`,
                    title_logo:'',
                    title_big:'',
                    title_tip:'',
                    title1:'',
                    title2:'',
                    title3:'',
                    title4:'',
                    title5:'',
                    title6:'',
                    title7:'',
                    title8:'',
                    tel:'',
                    tel_title:'',
                    bg_title:'',
                    bg_title2:'',
                    bg_title3:'',
                    bg_title4:'',
                    imageFile1:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile2:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile3:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                    imageFile4:[`${serverUrl}pic1.png`,`${serverUrl}pic2.png`,`${serverUrl}pic4.png`],
                }

            }
        },
        mounted() {

            console.log(this.updateData,'123465789');
            if(this.updateData){
                // console.log('1111');
                // console.log(val);
                this.obj=JSON.parse(this.updateData);
            }
        },
        watch:{
            switchOn(val){
                if(val){
                    // console.log('1111111',this.headerTitle1)
                    // console.log('2222222222',this.obj)
                    this.$emit('com',this.obj)
                }
            },
            perviewOn(val){
                // if(val){
                    // console.log(val);
                    this.disabled=val;
                    this.isshow=!val;
                // }
            },
            // perviewOff(val){
            //     if(val){
            //         // console.log(val);
            //         this.disabled=false;
            //         this.isshow=true;
            //         // console.log(this.isshow);
            //     }
            // },
            updateData(val){
                console.log(val,'123465789');
                if(val){
                    // console.log('1111');
                    // console.log(val);
                    val=JSON.parse(val);
                    this.obj = val;
                }
            }


        },
        methods: {},
        components:{
            imgInput,
            footTemplate
        }
    }
</script>

<style lang="scss" scoped>
  @import "./style.scss"
</style>
<style>
   .template20 button.el-carousel__button{
        width: 25px ;
    }
</style>
