<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<style type="text/css">
    /* Border styles */
    #table-1 thead, #table-1 tr {
        border-top-width: 1px;
        border-top-style: solid;
        border-top-color: rgb(230, 189, 189);
    }

    #table-1 {
        border-bottom-width: 1px;
        border-bottom-style: solid;
        border-bottom-color: rgb(230, 189, 189);
    }

    /* Padding and font style */
    #table-1 td, #table-1 th {
        padding: 5px 10px;
        font-size: 12px;
        font-family: Verdana;
        color: rgb(177, 106, 104);
    }

    /* Alternating background colors */
    #table-1 tr:nth-child(even) {
        background: rgb(238, 211, 210)
    }

    #table-1 tr:nth-child(odd) {
        background: #FFF
    }
</style>
<div>
    <input type="button" value="图文" id="news" class="button" onclick="toUrl('news');"/>
    <input type="button" value="图片" id="image" class="button" onclick="toUrl('image');"/>
    <input type="button" value="视频" id="video" class="button" onclick="toUrl('video');"/>
    <input type="button" value="语音" id="voice" class="button" onclick="toUrl('voice');"/>
<!--    <input type="button" value="查看配置" id="voice" class="button"-->
<!--           onclick="window.location.href = '/module/wxInterface/showConfig'"/>-->
    <input type="button" value="清除缓存" class="button" onclick="clearCache();"/>
</div>
<input type="hidden" id="hidden" value="<?php echo $this->params['type']; ?>"/>
<table id="table-1" style="width: 100%;text-align: left;">
    <tr>
        <th style="width: 500px;text-align: center;">ID</th>
        <th>标题</th>
    </tr>
    <?php
    $list = $this->params['list'];
    foreach ($list as $val) {
        ?>
        <tr>
            <td><?php echo $val['media_id']; ?></td>
            <td><?php echo $val['name']; ?></td>
        </tr>
        <?php
    }
    ?>
</table>
<div style="margin-top: 25px;">
    设置链接地址
    <input type="text" id="urlButton" value="" style="width: 300px;"/>
    <input type="button" value="生成加密地址" onclick="setUrl();">
</div>
<div id="urlText"></div>
<script type="text/javascript">
    var type = document.getElementById('hidden').value;
    var obj = document.getElementById(type).style.color = 'green';
    function toUrl(type) {
        window.location.href = '/fx/?r=weChat/we-chat/get-media&type=' + type;
    }
    function clearCache() {
        window.location.href = '/fx/?r=weChat/we-chat/get-media&clear=clear'
    }
    function setUrl() {
        $url = document.getElementById('urlButton').value;
        document.getElementById('urlText').innerHTML = 'http://yybs.njyunyoutong.com/module/wxInterface/setLogin?redirect='+encodeURIComponent($url);
    }
</script>
</body>
</html>