<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/template4/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                obj:{
                    logoUrl:`${serverUrl}LOGO.png`,
                    picUrl1:`${serverUrl}pic1.png`,
                    picUrl2:`${serverUrl}pic2.png`,
                    picUrl4:`${serverUrl}pic6.png`,
                    picUrl5:`${serverUrl}pic7.png`,
                    picUrl6:`${serverUrl}pic8.png`,
                    picUrl7:`${serverUrl}pic9.png`,
                    picUrl8:`${serverUrl}pic10.png`,
                    picUrl9:`${serverUrl}pic11.png`,
                    picUrl10:`${serverUrl}pic12.png`,
                    imageFile1:[`${serverUrl}pic3.png`,`${serverUrl}pic3.png`,`${serverUrl}pic3.png`,`${serverUrl}pic3.png`,`${serverUrl}pic3.png`,`${serverUrl}pic3.png`],
                    imageFile2:[`${serverUrl}pic8.png`,`${serverUrl}pic9.png`,`${serverUrl}pic10.png`],
                    imageFile3:[`${serverUrl}pic10.png`,`${serverUrl}pic11.png`,`${serverUrl}pic12.png`],
                    imageFile4:[`${serverUrl}pic11.png`,`${serverUrl}pic12.png`,`${serverUrl}pic10.png`],
                    imageFile5:[`${serverUrl}pic12.png`,`${serverUrl}pic11.png`,`${serverUrl}pic10.png`],
                    content1:'',
                    content2:'',
                    content3:'',
                    content4:'',
                    content5:'',
                    content6:'',
                    content7:'',
                    content8:'',
                    content9:'',
                    content10:'',
                    content11:'',
                    content12:'',
                    content13:'',
                    content14:'',
                    content15:'',
                    tip:['','','','','',''],
                }

            }
        },
        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
            // commTemplate
        }
    }
</script>

<style lang="scss" scoped>
  @import "./style.scss"
</style>
