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

</template>

<script>
    import util from "@/utils/util";
    import imgInput from "../img_input.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/template3/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                placeholder:'壮年岁月，不可挽回的进入人生的分水岭',
                obj:{
                    text1:'',
                    text2:'',
                    text3:'',
                    text4:'',
                    text5:'',
                    text6:'',
                    text7:'',
                    text8:'',
                    text9:'',
                    text10:'',
                    logoUrl:`${serverUrl}LOGO.png`,
                    picUrl1:[`${serverUrl}pic1.png`,`${serverUrl}pic1.png`,`${serverUrl}pic1.png`,`${serverUrl}pic1.png`,`${serverUrl}pic1.png`,`${serverUrl}pic1.png`],
                    picUrl2:`${serverUrl}pic2.png`,
                    picUrl3:`${serverUrl}pic3.png`,
                    picUrl4:`${serverUrl}pic4.png`,
                    picUrl5:`${serverUrl}pic5.png`,
                    picUrl6:[`${serverUrl}pic6.png`,`${serverUrl}pic6.png`,`${serverUrl}pic6.png`,`${serverUrl}pic6.png`,`${serverUrl}pic6.png`,`${serverUrl}pic6.png`],
                    picUrl7:`${serverUrl}pic7.png`,
                    picUrl8:`${serverUrl}pic8.png`,
                    picUrl9:[`${serverUrl}pic9.png`,`${serverUrl}pic9.png`,`${serverUrl}pic9.png`,`${serverUrl}pic9.png`,`${serverUrl}pic9.png`,`${serverUrl}pic9.png`],
                }
            }
        },
        mounted() {
            if(this.updateData){
                this.obj=JSON.parse(this.updateData);
            }
        },
        methods: {},
        watch:{
            switchOn(val){
                if(val){
                    this.$emit('com',this.obj)
                }
            },
            perviewOn(val){
                this.disabled=val;
                this.isshow=!val;
            },
            updateData(val){
                if(val){
                    val=JSON.parse(val);
                    this.obj = val;
                }
            }
        },
        components:{
            imgInput,
            footTemplate
        }
    }
</script>

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