<?php defined('KX_ROOT') || exit('Permission denied');?><!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作家资料 - 原创专区 - <?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></title>
    <link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/css/style.css"/>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico"/>
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width"/>
    <meta name="applicable-device" content="pc">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <link rel="canonical" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "pcurl");?><?php echo $_SERVER['REQUEST_URI'];?>"/>
    <style>
        .container {
            padding: 20px;
        }

        .body ul.label {
            height: 54px;
        }

        .body ul.label li {
            float: left;
            width: 130px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background: #E5E5E5;
            margin-top: 4px;
        }

        .body ul.label li.active {
            background-color: #fff;
            color: #323237;
            border-top: 4px solid #f55;
            margin-top: 0;
        }

        .body .container li {
            height: 655px;
            display: none;
        }

        .body .container li.active {
            display: block;
        }
    </style>
</head>
<body>
<div class="header">
    <div>
        <a href="/">
            <div class="logo"><span>原创专区</span></div>
        </a>
    </div>
</div>
<div class="body">
    <div class="left bg-white">
    <style>
        .icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 10px;
        }

        .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home.png");
        }

        li.active .icon-home {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-home-active.png");
        }

        .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel.png");
        }

        li.active .icon-novel {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-novel-active.png");
        }

        .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat.png");
        }

        li.active .icon-stat {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-stat-active.png");
        }

        .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money.png");
        }

        li.active .icon-money {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-money-active.png");
        }

        .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo.png");
        }

        li.active .icon-userinfo {
            background: url("<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/images/icon-userinfo-active.png");
        }
        .add_novel:before{
            content: '+';
            width: 20px;
            height: 20px;
            display: inline-block;
            left: 60px;
            position: relative;
            margin-left: -20px;
            font-weight: 700;
        }
        .add_novel a{
            color: #929292 !important;
        }
    </style>
    <ul class="nav">
        <li class="<?php echo $pagesign == 'home'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.index",[],"");?>">
                <i class="icon icon-home"></i>专区首页
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['novel','chapter'])?'active':'';?>">
            <?php if(in_array($pagesign, ['novel','chapter'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <ul class="sub-nav">
                <?php if(is_array($novels)): foreach($novels as $key =>$loop):?>
                <li class="<?php echo $_GET['novelid']==$loop['id']?'active':'';?>" style="width: 165px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                    <a href="<?php echo \Kuxin\Helper\Url::build("author.chapter.index",['novelid'=>$loop['id']],"");?>" title="<?php echo $loop['name'];?>"><?php echo $loop['name'];?></a>
                </li>
                <?php endforeach; endif;?>
                <li class="add_novel"><a href="<?php echo \Kuxin\Helper\Url::build("author.novel.add",[],"");?>">创建作品</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.novel.index",[],"");?>">
                <i class="icon icon-novel"></i>作品管理
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'stat'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.stat.index",[],"");?>">
                <i class="icon icon-stat"></i>数据统计
            </a>
        </li>
        <li class="<?php echo in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])?'active':'';?>">
            <?php if(in_array($pagesign, ['incomeindex','incomerecord','incomemanage','incomeguarantee'])):?>
            <a href="javascript:void(0);">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <ul class="sub-nav">
                <li class="<?php echo $pagesign=='incomerecord'?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">收入明细</a></li>
                <li class="<?php echo in_array($pagesign, ['incomemanage','incomeguarantee'])?'active':'';?>"><a href="<?php echo \Kuxin\Helper\Url::build("author.income.manage",[],"");?>">提现管理</a></li>
            </ul>
            <?php else:?>
            <a href="<?php echo \Kuxin\Helper\Url::build("author.income.record",[],"");?>">
                <i class="icon icon-money"></i>稿酬收入
            </a>
            <?php endif;?>
        </li>
        <li class="<?php echo $pagesign == 'authorinfo'?'active':'';?>">
            <a href="<?php echo \Kuxin\Helper\Url::build("author.author.info",[],"");?>">
                <i class="icon icon-userinfo"></i>作家资料
            </a>
        </li>
    </ul>
</div>
    <div class="right">
        <ul class="label">
            <li data-type="base" class="active">基本资料</li>
            <li data-type="details">详细资料</li>
        </ul>
        <ul class="container bg-white h100">
            <li class="base active">
                <input type="file" id="file_cover" style="display: none" name="file">
                <form method="post">
                    <div class="h100 fl" style="width: 600px;">
                        <div class="form-item">
                            <label class="form-label" for="field_name">笔名</label>
                            <div class="form-input-block">
                                <input type="text" name="name" id="field_name" value="<?php echo $authorinfo['name'];?>">
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_mobile">电话</label>
                            <div class="form-input-block">
                                <input type="text" name="mobile" id="field_mobile" value="<?php echo $authorinfo['data']['mobile'];?>">
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_qq">QQ</label>
                            <div class="form-input-block">
                                <input type="text" name="qq" id="field_qq" value="<?php echo $authorinfo['data']['qq'];?>">
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_email">邮箱</label>
                            <div class="form-input-block">
                                <input type="email" name="email" id="field_email" value="<?php echo $authorinfo['data']['email'];?>">
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_intro">简介</label>
                            <div class="form-input-block">
                                <textarea name="intro" id="field_intro" cols="30"
                                          rows="10"><?php echo $authorinfo['intro'];?></textarea>
                            </div>
                            <div class="form-tips">50-200字</div>
                        </div>
                        <div class="form-item">
                            <label class="form-label"></label>
                            <div class="form-input-block">
                                <button class="bg-red color1 plr40 ptb5">保存</button>
                            </div>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                </form>
            </li>
            <li class="details">
                <form method="post" class="form-details">
                    <input type="hidden" name="type" value="details">
                    <input type="hidden" name="password" value="">
                    <div class="h100 fl" style="width: 600px;">
                        <div class="form-item">
                            <label class="form-label" for="field_truename">真实姓名</label>
                            <div class="form-input-block">
                                <input type="text" name="truename" id="field_truename"
                                       value="<?php echo $authorinfo['data']['truename'];?>" disabled>
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_idcard">身份证号</label>
                            <div class="form-input-block">
                                <input type="text" name="idcard" id="field_idcard"
                                       value="<?php if($authorinfo['data']['idcard']):?><?php echo substr($authorinfo['data']['idcard'],0,4);?>**********<?php echo substr($authorinfo['data']['idcard'],-4);?><?php endif;?>"
                                       disabled>
                            </div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_alipay">支付宝账户</label>
                            <div class="form-input-block">
                                <input type="text" name="alipay" id="field_alipay"
                                       value="<?php if($authorinfo['data']['alipay']):?><?php echo substr($authorinfo['data']['alipay'],0,4);?>****<?php echo substr($authorinfo['data']['alipay'],-4);?><?php endif;?>">
                            </div>
                            <div class="form-tips">用作稿酬输入提现使用</div>
                        </div>
                        <div class="form-item">
                            <label class="form-label" for="field_repeat_alipay">确认支付宝账户</label>
                            <div class="form-input-block">
                                <input type="text" id="field_repeat_alipay"
                                       value="<?php if($authorinfo['data']['alipay']):?><?php echo substr($authorinfo['data']['alipay'],0,4);?>****<?php echo substr($authorinfo['data']['alipay'],-4);?><?php endif;?>">
                            </div>
                            <div class="form-tips">用作稿酬输入提现使用</div>
                        </div>
                        <div class="form-item">
                            <label class="form-label"></label>
                            <div class="form-input-block">
                                <button type="button" class="bg-red color1 plr40 ptb5 btn-submit">保存</button>
                            </div>
                        </div>
                    </div>
                </form>
                <div style="clear: both"></div>
            </li>
        </ul>
    </div>
</div>
<div class="footer text-center">
    <?php $list=\Kuxin\Block::show('page.list', []);?>
    <span class="aboutlink">
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <a href="<?php echo \Kuxin\Helper\Url::build("page.detail",['pageid'=>$loop['id'],'key'=>$loop['key']],"");?>" title="<?php echo $loop['name'];?>"> <?php echo $loop['name'];?> </a>
        <?php endforeach; endif;?>
    </span>
    <span class="inline-block ml40">Copyright © 2009 - 2019 <a href="<?php echo $pt['config']['siteurl'];?>" target="_blank"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a>. All Rights Reserved . 版权所有<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></span>
</div>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/jquery-3.3.1.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/layer/layer.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/common.js"></script>
<script>
    $('.label li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $('.container li.' + $(this).data('type')).addClass('active').siblings().removeClass('active');
    });
    $('.form-details .btn-submit').click(function () {
        var othis = $('.form-details');
        if (!othis.find('#field_alipay').val()) {
            layer.msg('支付宝账户不能为空');
            return false;
        }
        if (othis.find('#field_alipay').val() !== othis.find('#field_repeat_alipay').val()) {
            layer.msg('两次支付宝账户输入不一致');
            return false;
        }
        layer.prompt({title: '请输入管理密码，并确认', formType: 1}, function (pass) {
            layer.load(1, {shade: [0.1, '#000']});
            console.log(othis.find('input[name=password]').val(pass));
            othis.find('input[name=password]').val(pass);
            othis.submit();
        });
    });
</script>
</body>
</html>