<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->"/>
    <title>插件管理</title>
    <!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
</head>
<body>
<!--{include file="<!--{$cptplpath}-->lang_all.tpl"}-->
<!--{if $a eq "plugin_info"}-->
<div class="main-wrap">
    <div class="path"><p>当前位置：插件中心<span>&gt;&gt;</span>应用商城</p></div>
    <div class="main-cont" style="margin-top: -20px;">
        <h3 class="title">应用商城</h3>
        <div class="metappcontentbox">
            <link rel="stylesheet" href="<!--{$cppath}-->css/plugin.css"/>
            <link rel="stylesheet" href="<!--{$cppath}-->css/bootstrap.min.css"/>
            <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
            <script type="text/javascript" src="<!--{$cppath}-->js/layer/layer.js"></script>
            <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
            <div class="appbox_right">
                <div class="login-info">
                    <!--{if $check==1}-->
                    <div class="memberinfo" style="padding-left:10px;">
                        <ul>
                            <li><span class="user_id"><!--{$user['adminname']}--> </span></li>
                            <li class="mi">|</li>
                            <li><span class="money"><!--{$user['money']}--></span>元</li>
                            <li class="mi">|</li>
                            <li><a href="admincp.php?c=plugin&a=pay">充值</a></li>
                            <!--<li class="mi">|</li>
                            <li><a href="http://localhost/metinfo/admin/index.php?lang=zh-cn&anyid=65&n=appstore&c=member&a=dorecord">消费记录</a></li>-->
                            <li class="mi">|</li>
                            <li><a href="http://www.8cms.com/index.php?c=user&a=login" target="_blank">用户中心</a></li>
                            <li class="mi">|</li>
                            <li><a href="admincp.php?c=plugin&a=member_out" class="user-loginout">退出</a></li>
                        </ul>
                    </div>
                    <!--{else}-->
                    <div class="login" style="padding-left: 10px;">
                        <a href="admincp.php?c=plugin&a=login" class="ui-addlist">登录</a>
                        <a href="http://www.8cms.com/index.php?c=user&a=register" target="_blank"
                           class="ui-addlist">注册</a>
                    </div>
                    <!--{/if}-->
                </div>
            </div>
            <div class="appbox_left">
                <div class="appbox_left_box">
                    <input id="pluginid" type="hidden" value="<!--{$plugin.id}-->">
                    <div class="v52fmbx" data-type="app" data-info="10043" data-appid="" data-download="0" data-ver=""
                         data-cmsver="6.1.1 ">
                        <div class="paysuc" style="display:none">
                            <h3 class="v52fmbx_hr">支付成功</h3>
                            <dl>
                                <dt></dt>
                                <dd>
                                    <div>
                                        <span class="paysucjump"><a>支付成功后，请点击此链接跳转！！</a></span>
                                    </div>
                                </dd>
                            </dl>
                        </div>
                        <div class="appdetail">
                            <div class="appdetail_cont">
                                <div class="appdetail_cont_bodr">
                                    <dl class="appdetail_dl">
                                        <dt>
                                            <img src="<!--{$plugin.img}-->">
                                        </dt>
                                        <dd>
                                            <h3><span class="buyname"><!--{$plugin.pluginname}-->
                                                    <!--{$plugin.version}--></span></h3>
                                            <!--<div class="appdetail_grade">
                                                <span class="evaluation" data-score="2.5" title="regular"><img alt="1" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-on.png" title="regular">&nbsp;<img alt="2" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-on.png" title="regular">&nbsp;<img alt="3" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-half.png" title="regular">&nbsp;<img alt="4" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="regular">&nbsp;<img alt="5" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="regular"><input name="score" type="hidden" value="2.5" readonly=""></span>
                                                （共 <span class="evaluation_num">2</span> 人评价）
                                            </div>-->
                                            <div class="appdetail_buybox">
									<span class="buyprice">
                                                                                <!--{if $plugin.type==1}-->
                                                                                         <span class="free">免费</span>
                                        <!--{else}-->
                                                                                   <span class="free">  ￥
                                                                                       <!--{$plugin.price}--></span>
                                        <!--{/if}-->
                                                                                 <input type="hidden" id="price"
                                                                                        value="<!--{$plugin.price}-->"/>
                                                                                 <input type="hidden" id="money"
                                                                                        value="<!--{$user.money}-->"/>
                                                                                 <input type="hidden" id="userid"
                                                                                        value="<!--{$user.adminid}-->"/>
                                                                        </span>
                                                <h5 class="buybuttondiv none" style="display: block;">
                                                    <!--{if $existence eq ''}-->
                                                    <!--{if $plugin.type==2}-->
                                                    <!--{if $is_mai==0}-->
                                                    <button type="type" class="btn btn-success btn-sm" id="buy">购买
                                                    </button>
                                                    <!--{else}-->
                                                    <button type="type" class="btn btn-success btn-sm" id="install">安装
                                                    </button>
                                                    <!--{/if}-->
                                                    <!--{else}-->
                                                    <button type="type" class="btn btn-success btn-sm" id="install">安装
                                                    </button>
                                                    <!--{/if}-->
                                                    <!--{else}-->
                                                    <button type="type" class="btn btn-success btn-sm">已安装</button>
                                                    <!--{/if}-->
                                                </h5>
                                            </div>
                                        </dd>
                                    </dl>
                                    <ul class="appdetail-nav-tab nav nav-tabs">
                                        <li class="active col-xs-4"><a data-toggle="tab" href="#appdetail_de"
                                                                       aria-controls="appdetail_de">应用详情</a></li>
                                        <li class="col-xs-4"><a data-toggle="tab" href="#purchase-notice"
                                                                aria-controls="purchase-notice">购买须知</a></li>
                                        <li class="col-xs-4"><a data-toggle="tab" href="#appdetail_ev"
                                                                aria-controls="appdetail_ev">评论</a></li>
                                    </ul>
                                    <div class="tab-content">
                                        <div class="tab-pane active appdetail_de" id="appdetail_de">
                                            <h3 class="v52fmbx_hr">信息</h3>
                                            <dl>
                                                <dt>更新日期</dt>
                                                <dd class="ftype_input">
                                                    <div class="fbox">
                                                        <div class="updateime">
                                                            <!--{$plugin.addtime|date_format:'%Y-%m-%d'}--></div>
                                                    </div>
                                                </dd>
                                            </dl>
                                            <dl>
                                                <dt>版本</dt>
                                                <dd class="ftype_input">
                                                    <div class="fbox">
                                                        <span class="ver"><!--{$plugin.version}--></span>
                                                    </div>
                                                </dd>
                                            </dl>
                                            <dl>
                                                <dt>运行环境</dt>
                                                <dd class="ftype_input">
                                                    <div class="fbox">
                                                        <span class="sys_text"><!--{$plugin.run_huan}--></span>
                                                    </div>
                                                </dd>
                                            </dl>
                                            <div class="appdetail_info none" style="display: block;">
                                                <h3 class="v52fmbx_hr">介绍</h3>
                                                <dl>
                                                    <dd class="ftype_input">
                                                        <div class="fbox">
                                                            <div class="info"><p><!--{$plugin.pluginjie}--><br><br>
                                                                    详细介绍</p>
                                                                <p style="white-space: normal;">
                                                                    <!--{$plugin.plugincontent}-->     </p></div>
                                                        </div>
                                                    </dd>
                                                </dl>
                                            </div>
                                        </div>
                                        <div class="tab-pane" id="purchase-notice">
                                            <!--{$plugin.Must}-->
                                        </div>
                                        <div class="tab-pane appdetail_ev" id="appdetail_ev">
                                            <div class="evaluationinfo">
                                                <dl>
                                                    <dd>
                                                        <h5>暂无开放</h5></dd>
                                                </dl>
                                            </div>
                                            <!--<dl>
                                                <dd class="ftype_radio ftype_transverse">
                                                    <div class="fbox">
                                                        <span id="pageup" class="page" data-page-action="up" style="display:none"><a href="#">上页</a></span>
                                                        <span id="pagedown" class="page" data-page-action="down" style=""><a href="#">下页</a></span>
                                                        <input id="evaluation_page" type="hidden" value="1">
                                                        <input id="evaluation_page_click" type="hidden" value="0">
                                                    </div>
                                                </dd>
                                            </dl>
                                            <h3 class="v52fmbx_hr">我要评论</h3>
                                            <form method="POST" class="ui-from" name="myform" action="" target="_self">
                                                <dl>
                                                    <dt>评分</dt>
                                                    <dd class="ftype_radio ftype_transverse">
                                                        <div class="fbox my_evaluation_num_box" style="cursor: pointer;"><img alt="1" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="bad">&nbsp;<img alt="2" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="poor">&nbsp;<img alt="3" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="regular">&nbsp;<img alt="4" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="good">&nbsp;<img alt="5" src="http://localhost/metinfo/app/system/appstore/admin/templates/raty/images/star-off.png" title="gorgeous"><input name="score" type="hidden"></div>
                                                        <span class="tips">鼠标放到星形上点击评分</span>
                                                        <input name="my_evaluation_num" type="hidden" value="0">
                                                    </dd>
                                                </dl>
                                                <dl>
                                                    <dt>内容</dt>
                                                    <dd class="ftype_textarea">
                                                        <div class="fbox">
                                                            <textarea name="my_evaluation" placeholder="可不填"></textarea>
                                                        </div>
                                                    </dd>
                                                </dl>
                                                <dl class="noborder">
                                                    <dt> </dt>
                                                    <dd>
                                                        <input type="submit" data-click="1" name="evaluationsubmit" value="评论" class="submit evaluationsubmit">
                                                    </dd>
                                                </dl>
                                            </form>-->
                                        </div>
                                    </div>
                                </div>
                                <div class="appdetail_develp">
                                    <h3 class="v52fmbx_hr">开发者名称</h3>
                                    <!--
                                    <dl>
                                        <dt>头像</dt>
                                        <dd class="ftype_input">
                                            <div class="fbox">
                                                <div class="head"></div>
                                            </div>
                                        </dd>
                                    </dl>
                                    -->
                                    <dl>
                                        <dd class="ftype_input">
                                            <div class="fbox" style=" margin-left: 20px; color: #5C5C5C;">
                                                <div class="developer_id">  <!--{$plugin.openup}--> </div>
                                            </div>
                                        </dd>
                                    </dl>
                                    <h3 class="v52fmbx_hr">开发者简介</h3>
                                    <dl>
                                        <dd class="ftype_input">
                                            <div class="fbox" style=" margin-left: 20px; color: #5C5C5C;">
                                                <div>官方出品<br><span class="appdev">应用开发者(已认证)</span></div>
                                            </div>
                                        </dd>
                                    </dl>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal fade" id="purchase-notice-modal">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true">×</span>
                                </button>
                                <h4 class="modal-title">购买须知</h4>
                            </div>
                            <div class="modal-body">
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-danger btn-lg buybutton">购买</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal fade in" id="download-notice-modal" data-keyboard="false" data-backdrop="false"
                 aria-hidden="false" style="display: none;">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <!--{if $plugin.type==2}-->
                        <!--{if $is_mai==0}-->
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                            <h4 class="modal-title">购买提示</h4>
                        </div>
                        <div class="modal-body">
                            付费插件暂支持余额购买,余额不足请先充值,购买成功后可立即下载安装.
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-success btn-lg metcms_upload_download" id="buy_ok">购买
                            </button>
                        </div>
                        <!--{else}-->
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                            <h4 class="modal-title">安装提示</h4>
                        </div>
                        <div class="modal-body">
                            你可以在 <span class="red"><!--{$url}--></span>
                            测试安装应用，上线到正式网站后应用将自动绑定正式域名，且只能在此绑定域名的网站中使用，是否确认安装？
                        </div>
                        <div class="modal-footer">
                            <span class="download-noclick" style="display: none;">下载中...<span class="num" style="">0</span>(正在进行下载，请不要操作页面！)</span>
                            <button type="button" class="btn btn-success btn-lg metcms_upload_download" id="install_ok">
                                安装
                            </button>

                            <button type="button" class="btn btn-success btn-lg metcms_upload_download" name="close"
                                    id="install_okl" style="display: none; margin-left: 50px;">安装成功,请到我的应用中查看
                            </button>
                        </div>
                    </div>
                    <!--{/if}-->
                    <!--{else}-->
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">×</span>
                        </button>
                        <h4 class="modal-title">安装提示</h4>
                    </div>
                    <div class="modal-body">
                        你可以在 <span class="red"><!--{$url}--></span> 测试安装应用，上线到正式网站后应用将自动绑定正式域名，且只能在此绑定域名的网站中使用，是否确认安装？
                    </div>
                    <div class="modal-footer">
                        <span class="download-noclick" style="display: none;">下载中...<span class="num" style="">0</span> (正在进行下载，请不要操作页面！)</span>
                            <button type="button" class="btn btn-success btn-lg metcms_upload_download" id="install_ok">安装
                        </button>

                            <button type="button" class="btn btn-success btn-lg metcms_upload_download" name="close"
                                    id="install_okl" style="display: none; margin-left: 50px;">安装成功,请到我的应用中查看
                            </button>
                    </div>
                    <!--{/if}-->
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script>
    $(function () {
        $("#install").bind("click", function () { //提交
            $("#download-notice-modal").css("display", "block");
        });
        $("#buy").bind("click", function () { //提交
            $("#download-notice-modal").css("display", "block");
        });
        $(".close").bind("click", function () { //提交
            $("#download-notice-modal").css("display", "none");
        });
        $("[name=close]").bind("click", function () { //提交
            $("#download-notice-modal").css("display", "none");
            window.location.reload();
        });
        $("#install_ok").bind("click", function () { //提交
            $("#install_ok").css("display", "none");
            $(".download-noclick").css("display", "block");

            $pluginid = $("#pluginid").val();
            $.ajax({
                type: "POST",
                url: "admincp.php?c=plugin&a=install",
                cache: false,
                data: {plugin_id:$pluginid},
                dataType: "json",
                success: function (data) {
                    var json = eval(data);
                    var response = json.response;
                    var result = json.result;
                    if (response == '1') {
                       // $("#tiao").attr('href',result);
                    } else {
                        alert(result);
                    }
                    // $("#tiao").attr('href',result);
                    //   $("#tiao1").attr('href',result);
                }
            });
            setInterval(function () {
                var num = $(".num").html();
                if (num >= 100) {
                    $(".download-noclick").css("display", "none");
                    $("#install_okl").css("display", "block");
                //    window.location.reload();
                    return false;
                }
                num = Number(num) + Number(20);
                $(".num").html(num);
            }, 1000);
        });
        $("#buy_ok").bind("click", function () { //提交
            $check = '<!--{$check}-->';
            if($check != '1'){
                layer.alert('还未登陆，请登录', {
                    skin: 'layui-layer-molv' //样式类名  自定义样式
                    , closeBtn: 1    // 是否显示关闭按钮
                    , anim: 1 //动画类型
                    , icon: 6    // icon
                    , yes: function () {
                        window.location.href = "admincp.php?c=plugin&a=login";
                    }
                });
                return false;
            }
            $price = $("#price").val();
            $money = $("#money").val();
            if (parseFloat($price) > parseFloat($money)) {
                layer.alert('余额不足,请充值', {
                    skin: 'layui-layer-molv' //样式类名  自定义样式
                    , closeBtn: 1    // 是否显示关闭按钮
                    , anim: 1 //动画类型
                    , icon: 6    // icon
                    , yes: function () {
                        window.location.href = "admincp.php?c=plugin&a=pay";
                    }
                });
            } else {
                $pluginid = $("#pluginid").val();
                $userid = $("#userid").val();
                $.ajax({
                    type: "POST",
                    url: "admincp.php?c=plugin&a=buy",
                    cache: false,
                    data: {plugin_id:$pluginid,userid:$userid},
                    dataType: "json",
                    success: function (data) {
                        var json = eval(data);
                        var response = json.response;
                        var result = json.result;
                        if (response == '1') {
                            alert(result);
                            window.location.reload();
                        } else {
                            alert(result);
                        }
                    }
                });
            }
        });
    });
</script>
<!--{/if}-->
<!--{if $a eq "setting"}-->
<div class="main-wrap">
    <div class="path"><p>当前位置：插件中心<span>&gt;&gt;</span>插件管理<span>&gt;&gt;</span><!--{$plugin_name}--></p></div>
    <div class="main-cont">
        <!--{assign var='pluginmanage' value=XHook::doAction(<!--{$plugin_event}-->)}-->
    </div>
</div>
<!--{/if}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_footer')}-->
</body>
</html>
