<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/template7/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                obj:{
                    logoUrl:`${serverUrl}LOGO2.png`,
                    picUrl1:`${serverUrl}pic1.png`,
                    picUrl2:`${serverUrl}pic2.png`,
                    picUrl3:`${serverUrl}bg3.png`,
                    picUrl4:`${serverUrl}bg4.png`,
                    picUrl5:`${serverUrl}bg5.png`,
                    picUrl6:`${serverUrl}bg6.png`,
                    picUrl7:`${serverUrl}pic8.png`,
                    imageFile1:[`${serverUrl}bg3.png`,`${serverUrl}bg4.png`,`${serverUrl}bg5.png`],
                    imageFile2:[`${serverUrl}bg6.png`,`${serverUrl}pic8.png`,`${serverUrl}bg3.png`],
                    title_left_1:'',
                    title_left_2:'',
                    title_right:'',
                    tip1:'',
                    tip2:'',
                    tip3:'',
                    tip4_1:'',
                    tip4_2:'',
                    tip5:'',
                    tip6:'',
                    tip7:'',
                    tip8_1:'',
                    tip8_2:'',
                }

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