/**
* v_index.js
* Version: 0.1
* User: wy
* Date: 2017-09-06
* Copyright(c)  2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 引导页面
*/

import {iot, uPublic, uComponents} from '../../public/public.js';

iot.ready(init);
function init() {
    //通用 按钮、dialog、loading组件
    uPublic.componentsInit(['u-button','u-dialog','u-loading']);
    const app = new Vue({
        data:{          
            //配置组件
            componentsConfig: initComponentsConfig()   
        },
        mounted(){       
        },
        methods:{
            //tap 账号/密码登录
            onLoginButtonTap(){
                loginButtonTap();
            }            
        }   
    }).$mount('#app');
}

//配置组件参数
function initComponentsConfig() {
    return {
        //登录 button 参数
        loginButton: {   
            initParam: {
                class: 'custom-guide-button',
                text: Vue.t('btn.guideLogin')
            }
        },        
        dialog: {
            initParam: {
                class: 'custom-dialog'
            }
        },
        loading: {
            initParam: {
                class: 'custom-loading'
            }
        }             
    }
}

function loginButtonTap(){
    iot.navigator.openWindow({
        url: './login.html',
        id: 'login'
    }); 
}