<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>工作台</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" href="../../css/animate.css">
    <link rel="stylesheet" href="../../css/style.css">
    <style>
        body,
        html {
            background: rgba(243, 243, 243, 1)
        }

        .banner img {
            width: 100%;
        }
        /*天气*/
        /*.weather-wrap{
            padding: 21px 0;
        }*/
        /*nav*/

        .nav-itme {
            padding: 15px 20px 15px 15px;
            background: #fff;
            margin-bottom: 2px;
            position: relative;
        }

        .nav-itme:active {
            background: rgba(243, 243, 243, .9);
        }

        .nav-itme:last-child {
            margin-bottom: 0;
        }

        .title-wrap {
            color: #232627;
            font-size: 14px;
        }

        .title-wrap p {
            color: #7D7C7C;
            font-size: 12px;
        }
        /*.header-ico {
            width: 39px;
            height: 39px;
            display: block;
            background: url("../../icon/tzgg.png") center no-repeat;
            background-size: contain;
            margin-right: 15px;
        }*/

        .header-ico {
            width: 39px;
            height: 39px;
            display: block;
            margin-right: 15px;
        }
        /*.nav-itme:nth-child(2) .header-ico {
            background: url("../../icon/dbgz.png") center no-repeat;
            background-size: contain;
        }

        .nav-itme:nth-child(3) .header-ico {
            background: url("../../icon/zbxx.png") center no-repeat;
            background-size: contain;
        }

        .nav-itme:nth-child(4) .header-ico {
            background: url("../../icon/hyap.png") center no-repeat;
            background-size: contain;
        }

        .nav-itme:nth-child(5) .header-ico {
            background: url("../../icon/txl.png") center no-repeat;
            background-size: contain;
        }*/

        .more {
            width: 16px;
            height: 16px;
            display: block;
            background: url("../../image/more.png") center no-repeat;
            background-size: contain;
        }
        /*矿区服务*/

        .mine-service {
            margin: 5px 0;
            background: rgba(243, 243, 243, 1)
        }

        .mine-title {
            font-size: 16px;
        }

        .mine-titleIco {
            width: 25px;
            height: 25px;
            display: block;
            margin-right: 10px;
        }

        .mine-items {
            margin-top: 10px;
            flex-wrap: wrap;
        }

        .mine-item {
            width: 50%;
            margin: 12px 0;
            box-sizing: border-box;
        }

        .mine-item:nth-child(even) {
            padding-left: 20px;
            position: relative;
        }

        .mine-item:nth-child(even):after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 1px;
            height: 100%;
            background: #E8E8E8;
        }
        /*生活服务*/

        .life-service {
            margin: 0;
            margin-bottom: 20px;
        }
        /*工资密码*/

        .wages-layout {
            width: 100%;
            height: 100%;
            position: fixed;
            top: 0;
            left: 0;
            background: rgba(0, 0, 0, 0.5);
        }

        .wages {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 300px;
            height: 200px;
            margin: auto;
            background: #fff;
            border-radius: 5px;
            padding: 10px;
        }

        .wages-title {
            text-align: center;
            font-size: 18px;
        }

        .wages-wrap {
            padding: 15px 10px 0 10px;
            box-sizing: border-box;
        }

        .wages-wrap input {
            width: 100%;
            height: 35px;
            border: 1px solid #E8E8E8;
            border-radius: 5px;
            padding-left: 10px;
            box-sizing: border-box;
        }

        .btn-term {
            text-align: center;
            margin-top: 20px;
            position: absolute;
            bottom: 10px;
            left: 0;
            width: 100%;
            padding: 0 10px;
            box-sizing: border-box;
        }

        .btn-term button {
            width: 49%;
            padding: 10px 0;
            text-align: center;
            border-radius: 3px;
        }

        .btn-close {
            border: 1px solid #E8E8E8;
        }

        .btn-close:active {
            background: #E8E8E8;
        }

        .btn-confirm:active {
            background: rgba(0, 159, 232, .7);
            border: 1px solid rgba(0, 159, 232, .7);
        }

        .btn-confirm {
            margin-top: 10px;
            border: 1px solid #009fe8;
            background: #009fe8;
            color: #fff;
        }

        .Tips {
            color: #6C6F74;
            font-size: 12px;
            padding: 0 10px;
            margin-top: 20px;
        }
    </style>
</head>

<body>
    <div class="api_layout">
        <!--banner-->
        <!-- <div class="banner">
            <img src="../../icon/workBanner.jpeg" alt="">
        </div> -->
        <div id="worderbenList"></div>
        <div id="worderbenListNav"></div>
        <!-- 天气-->
        <div class="weather-wrap">

        </div>
    </div>
    <!--    工资密码-->
    <div class="wages-layout" id="wages-layout" style="display: none;">
        <div class="wages">
            <h3 class="wages-title">工资权限验证</h3>
            <div class="wages-wrap">
                <input type="password" placeholder="请输入登陆密码" class="password">
                <p class="Tips-p" style="color:red;font-size:12px;margin-top:5px;"></p>
            </div>
            <div class="Tips">
                <span>友情提示：该密码为用户登陆密码。</span>
            </div>
            <div class="btn-term">
                <button type="button" name="button" class="btn-close" onclick="closeWages()">取消</button>
                <button type="button" name="button" class="btn-confirm" onclick="wagesJurisdiction()">确认</button>
            </div>
        </div>
    </div>
</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script src="../../script/config.js" charset="utf-8"></script>
<script src="../../script/doT.min.js" charset="utf-8"></script>
<script type="text/template" id="templateWorkbench">
    <div class="banner">
        <img src="{{=it.header}}" alt="">
    </div>
    <div class="nav-wrap">
        <ul class="nav-itmes">
            {{ for(var i = 0; i
            < it.nav.length; i++ ) { }} <li class="flex-space nav-itme" onclick="openNewsList('{{=it.nav[i].link}}')">
                <div class="flex-start">
                    <!-- <span class="header-ico"></span> -->
                    <img class="header-ico" src="{{=it.nav[i].icon}}" alt="">
                    <div class="title-wrap">
                        <label>{{=it.nav[i].title}}</label>
                        <p>{{=it.nav[i].sub_title}}</p>
                    </div>
                </div>
                <i class="more"></i>
                </li>
                {{ } }}
        </ul>
    </div>
    <div class="mine-service life-service">
        {{ for(var k = 0; k
        < it.module.length; k++ ) { }} <div style="background: #fff; margin-top: 5px;padding: 10px 15px 0 15px">
            <div class="mine-title flex-start">
                <img class="mine-titleIco" src="{{=it.module[k].icon}}" alt="">
                <label>{{=it.module[k].title}}</label>
            </div>
            <ul class="flex-space mine-items">
                {{ for(var j = 0; j
                < it.module[k].children.length; j++ ) { }} <li class="mine-item life-item" onclick="openmineServiceItem('{{=it.module[k].children[j].link}}','{{=it.module[k].children[j].title}}')">
                    <div class="flex-start">
                        <img class="header-ico" src="{{=it.module[k].children[j].icon}}" alt="">
                        <div class="title-wrap">
                            <label>{{=it.module[k].children[j].title}}</label>
                            <p>{{=it.module[k].children[j].sub_title}}</p>
                        </div>
                    </div>
                    </li>
                    {{ } }}
            </ul>
    </div>
    {{ } }}
    </div>
</script>
<script type="text/javascript">
    var jobID = "";
    apiready = function() {
            var info = $api.getStorage('data');
            jobID = JSON.parse(info).data.user.staff_num;
            getWorkbenchList()
        }
        // 工资密码
    function openWages() {
        $('.password').val('');
        $('.Tips-p').html('');
        $('.wages-layout').show();
        $('.wages').addClass('animated bounceInDown');
        setTimeout(function() {
            $('.wages').removeClass('animated bounceInDown')
        }, 1000);
    }
    window.onclick = function(event) {
        if (event.target == document.getElementById('wages-layout')) {
            $('.wages-layout').hide();
        }
    }

    function closeWages() {
        $('.wages-layout').hide();
    };
    // 工资权限验证
    function wagesJurisdiction() {
        var param = {
            staff_num: jobID,
            password: $('.password').val()
        }
        $http.fnReuestDataNologing(UrlRouter.getPassword, '', 'post', param, function(ret, err) {
            if (ret.code === 0) {
                $('.wages-layout').hide();
                $('.Tips-p').html('');
                // wages('工资查询');
                $event.openTabLayout('wages', '../workBench/wages', '工资条', '');
            } else if (ret.code === 1) {
                $('.Tips-p').html(ret.message)
            }
        })
    }
    // 工作台UI列表接口
    function getWorkbenchList() {
        $http.fnReuestDataNologing(UrlRouter.getWorkbenchList, '', 'get', '', function(ret, err) {
            // console.log(JSON.stringify(ret));
            $apis.html(worderbenList, '#templateWorkbench', ret.data);
        })
    }
    // 第三方链接跳转
    function Jump(url, title) {
        $event.openWin('jumpURL', '../workBench/jumpURL', {
            url: url,
            title: title
        }, '');
    }
    //通讯录
    function organization(title) {
        $event.openWin('organization', '../mail/organization', '', '');
    }
    // //消息列表
    function openNewsList(link) {
        var appU = link.split('//');
        if (appU[2] == '../news/news_win') {
            // 通知公告
            $event.openWin('newsList', '../news/news_win', '', '');
        } else if (appU[2] == '../workBench/getDuty') {
            //值班信息
            $event.openWin('getDuty', '../workBench/getDuty', '', '');
        } else {
            api.alert({
                title: '提示',
                msg: '此功能暂未上线，敬请期待',
            });
        }
    }

    function openmineServiceItem(link, title) {
        var appU = link.split('//');
        if (appU[2] == '../workBench/wages') {
            $('.password').val('');
            $('.Tips-p').html('');
            $('.wages-layout').show();
            $('.wages').addClass('animated bounceInDown');
            setTimeout(function() {
                $('.wages').removeClass('animated bounceInDown')
            }, 1000);
            // 工资
            // $event.openTabLayout('wages', '../workBench/wages', title, '');
        } else if (appU[2] == '../workBench/invoice') {
            // 发票
            $event.openTabLayout('invoice', '../workBench/invoice', title, '');
        } else if (appU[2] == '../productionData/logging') {
            // 下井记录
            $event.openTabLayout('logging', '../productionData/logging', '', '');
        } else if (link == 'http://gjj.yinchuan.gov.cn/list_gjjcx.jsp?urltype=tree.TreeTempUrl&wbtreeid=1044') {
            Jump(link, title)
        } else if (link == 'http://m.ctrip.com/html5/?sid=155952&allianceid=4897&ouid=index') {
            Jump(link, title)
        } else if (link == 'https://h5.waimai.meituan.com/waimai/mindex/home') {
            Jump(link, title)
        } else if (link == 'http://i.meituan.com/?city=yinchuan') {
            Jump(link, title)
        } else {
            api.alert({
                title: '提示',
                msg: '此功能暂未上线，敬请期待',
            });
        }
    }
</script>
