import {tpl}from './tpl';
import BaseFormControl from "../../baseFormControl";
import './style.scss';
import JDImageWH from "../../formType/imageWH/imageWH";
class ArTryOn extends BaseFormControl{
    constructor(config){
        super(config);
        this.render();
    }
    render(){
        this.appendFormControl(tpl);
        this.bannerInstance = new JDImageWH({
                domData: {
                    node: this.element.find('.J_banner'),
                    name: 'image',
                    title: '',
                    dateType: 'J_NEW_IMAGE_WH',
                    formType: {
                        type: 'imageWH',
                    },
                },
                defaultImage: this.config.moduleData && this.config.moduleData.image ? this.config.moduleData.image: {},
                format: '1125-1125,210-1440',
            });
    }
    getData() {
        const { name } = this.config.domData;
        const data = {};
        data[name] = {
            banner:this.bannerInstance.getData().image.value,
            ...this.bannerInstance.getData()
        };
        return data;
    }
}
export default ArTryOn;