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

</template>

<script>
    import util from "@/utils/util";
    import imgInput from "../img_input.vue";
    import footTemplate from '../footTemplate.vue';

    // import commTemplate from '@/components/commTemplate.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/template25/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                obj:{
                    pic1:`${serverUrl}pic1.png`,
                    logoUrl:`${serverUrl}LOGO.png`,
                    pic4:`${serverUrl}pic4.png`,
                    pic2:`${serverUrl}pic2.png`,
                    pic3:`${serverUrl}pic3.png`,
                    pic5:`${serverUrl}pic5.png`,
                    pic6:`${serverUrl}pic6.png`,
                    pic7:`${serverUrl}pic7.png`,
                    pic9:`${serverUrl}pic9.png`,
                    pic8:`${serverUrl}pic8.png`,
                    pic10:`${serverUrl}pic10.png`,
                    pic11:`${serverUrl}pic11.png`,
                    pic12:`${serverUrl}pic12.png`,
                    pic13:`${serverUrl}pic13.png`,
                    pic14:`${serverUrl}pic14.png`,
                    text1:"",
                    text2:"",
                    text3:"",
                    text4:"",
                    text5:"",
                    text6:"",
                    text7:"",
                    text8:"",
                    text9:"",
                    text10:"",
                    text11:"",
                    text12:"",
                    text13:"",
                    text14:"",
                    text15:"",
                    text16:"",
                }

            }
        },
        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>
