/**
* v_deviceList.js
* Version: 0.1
* User: wy
* Date: 2017-11-03
* Copyright(c)  2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 产品型号页面
*/

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

iot.ready(init);
function init() {
    //通用 list、dialog、loading组件
    uPublic.componentsInit(['u-list','u-dialog','u-loading']);
    const app = new Vue({
        data:{            
            //配置组件
            componentsConfig: initComponentsConfig()     
        },
        mounted(){           
        },
        methods:{
            //tap <
            onBackTap(){
                backTap();
            },
            onDeviceListRowTap(){
                deviceListRowTap();
            }                  
        }   
    }).$mount('#app');
}

//配置组件参数
function initComponentsConfig() {
    let model = Vue.t('deviceList.model');
    return {
        deviceList:{   
            initParam: {
                class: 'custom-device-list',
                list: [
                    {leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
                    {leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
                    {leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'},
                    {leftImage: '../../resources/image/deviceImg.png', title:'智能门锁', subtitle: model + 'ABCDEFG',rightIcon: '&#xe6a7;'}
                ],
                tip: ''
            }
        },
        dialog: {
            initParam: {
                class: 'custom-dialog'
            }
        },
        loading: {
            initParam: {
                class: 'custom-loading'
            }
        }              
    }
}

//tap <
function backTap(){
    iot.navigator.back();
}

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