<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <script src="assets/lib/vue/vue.min.js"></script>
    <link rel="stylesheet" href="assets/css/common.css" type="text/css"/>
    <link rel="stylesheet" href="assets/css/header.css" type="text/css"/>
    <link rel="stylesheet" href="assets/css/piece.css" type="text/css"/>
</head>
<body>
<div id="app" v-cloak>
    <div class="header">
        <div class="btn"></div>
        <div class="text">{{ lang.app_name }}</div>
        <div class="btn"></div>
    </div>
    <div class="content">
        <div class="settings">
            <div class="piece">
                <div class="piece-items">
                    <div class="piece-item" @click="onClickSetting">
                        <div class="piece-item-icon" style="background-color: #32CD32">
                            <img src="assets/icons/setting.svg">
                        </div>
                        <div class="piece-item-content">
                            <div class="piece-item-key">{{ lang.title_setting }}</div>
                            <div class="piece-item-val"></div>
                            <div class="piece-item-move"><img src="assets/icons/right.svg"/></div>
                        </div>
                    </div>
                    <div class="piece-item" @click="onClickParam">
                        <div class="piece-item-icon" style="background-color: #15679B">
                            <img src="assets/icons/phone.svg">
                        </div>
                        <div class="piece-item-content">
                            <div class="piece-item-key">{{ lang.title_parameter }}</div>
                            <div class="piece-item-val"></div>
                            <div class="piece-item-move"><img src="assets/icons/right.svg"/></div>
                        </div>
                    </div>
                    <div class="piece-item" @click="onClickUpdate">
                        <div class="piece-item-icon" style="background-color: #9932CC">
                            <img src="assets/icons/upgrade.svg">
                        </div>
                        <div class="piece-item-content">
                            <div class="piece-item-key">{{ lang.title_upgrade }}</div>
                            <div class="piece-item-val"></div>
                            <div class="piece-item-move"><img src="assets/icons/right.svg"/></div>
                        </div>
                    </div>
                    <div class="piece-item" @click="onClickAbout">
                        <div class="piece-item-icon" style="background-color: #708090">
                            <img src="assets/icons/about.svg">
                        </div>
                        <div class="piece-item-content">
                            <div class="piece-item-key">{{ lang.title_about }}</div>
                            <div class="piece-item-val"></div>
                            <div class="piece-item-move"><img src="assets/icons/right.svg"/></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

<script>
    var app = new Vue({
        "el": "#app",
        "data": {
            lang:{
                app_name            : "HCCast",
                title_setting       : "同屏设置",
                title_parameter     : "同屏参数",
                title_upgrade       : "固件升级",
                title_about         : "关于应用",
            }
        },
        "created": function(){
            if(typeof($android) !== "undefined"){
                this.lang = JSON.parse($android.onGetLang())
            }
        },
        "methods": {
            onClickSetting: function(){
                if(typeof($android) == "undefined"){
                    location.href = "setting.html";
                    return;
                }
                $android.onClickSetting();
            },
            onClickParam: function(){
                if(typeof($android) == "undefined"){
                    location.href = "param.html";
                    return;
                }
                $android.onClickParam();
            },
            onClickUpdate: function(){
                if(typeof($android) == "undefined"){
                    location.href = "update.html";
                    return;
                }
                $android.onClickUpdate();
            },
            onClickAbout: function(){
                if(typeof($android) == "undefined"){
                    location.href = "about.html";
                    return;
                }
                $android.onClickAbout();
            },
        }
    })
</script>