{include file="$template_path/html/header.html"}
{include file="$template_path/js/space.html"}
{include file="$template_path/html/jstemplate.html"}
<script src="/mbthemes/scripts/canvas/animation.js"></script>
</head>
<body>
<div class="app" id="app">
  {include file="$template_path/html/mobile-nav.html"}
  <!-- content -->
  <div id="content" class="app-content box-shadow-z4" role="main">
    <div ui-view class="app-body" id="view">
      <!-- ############ PAGE START-->
      {include file="$template_path/html/user-top.html"}
      <div class="clearfix white">
        <div class="container">
          {$errorMessage}
          <div class="row-col">
            <div class="col-sm b-r b-l">
              <div class="box edit pos-rlt m-b-0">
                <div class="p-a-md">
                  {if $qnews_data}
                  <h3 class="h4 h3-xs m-b-md">快讯</h3>
                  <div class="clearfix p-b-md">
                    {foreach from=$qnews_data item=i}
                    <a class="fastmsgimg pull-left m-r-md"{if $i.url} href="{$i.url}"{/if} title="{$i.name}">
                    <img class="img-responsive" src="/{$i.thumb}" alt="{$i.name}" title="{$i.name}" />
                    </a>
                    <div class="clear">
                      <h3 class="m-t-none"><a{if $i.url} href="{$i.url}"{/if} title="{$i.name}">{$i.name}</a></h3>
                      <p>{$i.description}</p>
                    </div>
                    {/foreach}
                  </div>
                  {/if}
                  <div class="line line-dashed b-b line-lg pull-in p-t-md"></div>
                  <h3 class="h4 h3-xs m-t-md m-b-md">资金明细</h3>
                  <table class="table table-striped table-hover" cellpadding="0" cellspacing="0">
                    <thead>
                    <tr class="blue lt">
                      <th width="120">日期</th>
                      <th width="100">类型</th>
                      <th width="100">数额</th>
                      <th>详情</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if $statement}
                    {foreach from=$statement item=s}
                    <tr style="text-transform:capitalize">
                      <td>{$s.time|date_format:"%Y-%m-%d"}</td>
                      <td><strong>{$s.type}</strong></td>
                      <td>{$s.value}</td>
                      <td>{$s.info}</td>
                    </tr>
                    {/foreach}
                    {else}
                    <tr>
                      <td colspan="4">暂无记录</td>
                    </tr>
                    {/if}
                    </tbody>
                  </table>
                  <div class="line line-dashed b-b line-lg pull-in"></div>
                  <div class="salesnum">
                    <h3 class="h4 h3-xs m-t-md m-b-md">销量</h3>
                    <div class="general_table_border">
                      <table id="sales_table" class="table table-striped table-hover" cellspacing="0" cellpadding="0">
                        <thead>
                        <tr class="skin lt">
                          <th>{$lang.month}</th>
                          <th>{$lang.sales}</th>
                          <th>{$lang.earnings}</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach from=$sales item=r key=year}
                        {foreach from=$r item=rr key=month}
                        <tr id="month_{$month}_{$year}" class="{$year}">
                          <td id="month_{$month}_{$year}_show"><a href="#" id="link_{$month}_{$year}" {literal}onclick="$.ajax({complete:function(request){ hideLoading(); jQuery(&quot;#ajax-feedback&quot;).animate({&quot;height&quot;: &quot;toggle&quot;, &quot;opacity&quot;: &quot;toggle&quot;}, &quot;slow&quot;); }, beforeStart: function() { showLoading(); }, data:'ajax=ok', dataType:'script', type:'post', url:'/{/literal}{$languageURL}users/earnings/{$month}/{$year}{literal}'}); jQuery(&quot;#ajax-feedback&quot;).hide(); jQuery(&quot;#ajax-feedback&quot;).animate({&quot;height&quot;: &quot;toggle&quot;, &quot;opacity&quot;: &quot;toggle&quot;}, &quot;slow&quot;);; return false;"{/literal}>{$lang.monthArr[$month]} {$year}</a></td>
                          <td id="month_{$month}_{$year}_hide" style="display: none;"><a href="#" onclick="$('#month_{$month}_{$year}_details').empty(); $('#month_{$month}_{$year}_hide').hide(); $('#month_{$month}_{$year}_show').show(); return false;">{$lang.monthArr[$month]} {$year}</a></td>
                          <td>{$rr.buy} {$lang.sales}</td>
                          <td class="earningsVal">{$currency.symbol}{$rr.total|string_format:"%.2f"}</td>
                        </tr>
                        <tbody id="month_{$month}_{$year}_details">
                        </tbody>
                        {/foreach}
                        {/foreach}
                        </tbody>
                        <tfoot>
                        <tr>
                          <td>{$lang.total_sales}</td>
                          <td>{$earnings.sales} {$lang.sales}</td>
                          <td class="earningsTotal">{$currency.symbol}{$earnings.sales_earning|string_format:"%.2f"}</td>
                        </tr>
                        </tfoot>
                      </table>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in p-t-md"></div>
                    <h3 class="h4 h3-xs m-t-md m-b-md">{$lang.sales_graph}</h3>
                    <div id="sales_graph" class="graph">
                      {foreach from=$sales item=r key=year}
                      {foreach from=$r item=rr key=month}
                      <div class="bar 2010">
                        <p class="m-b-sm">{$lang.monthArr[$month]} {$year}</p>
                      </div>
                      <div class="progress progress-striped">
                        <div class="progress-bar danger" style="width:{math equation="x * y" x=$saleIndex y=$rr.buy}px;">{$rr.buy} {$lang.sales}</div>
                    </div>
                    {/foreach}
                    {/foreach}
                  </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in p-t-md"></div>
                <h3 class="h4 h3-xs m-t-md m-b-md">{$lang.earnings_graph}</h3>
                <div id="earnings_graph" class="graph p-b">
                  {foreach from=$earningArr item=r key=year}
                  {foreach from=$r item=rr key=month}
                  <div class="bar 2010">
                    <p class="m-b-sm">{$lang.monthArr[$month]} {$year}</p>
                  </div>
                  <div class="progress">
                    <div class="progress-bar skin" style="width:{math equation="x * y" x=$earningIndex y=$rr}px;">{$currency.symbol}{$rr|string_format:"%.2f"}</div>
                </div>
                {/foreach}
                {/foreach}
              </div>
            </div>
          </div>
        </div>
        <div class="col-sm w-xxl b-r">
          <div class="box edit pos-rlt m-b-0">
            <div class="">
              <form class="p-a b-b" id="begin-upload" action="/{$languageURL}" method="get" >
                <fieldset class="vertical-form">
                  <div class="form-group">
                    <div class="inputs">
                      <select class="form-control" id="category" name="category">
                        {if $mainCategories}
                        {foreach from=$mainCategories item=c}
                        <option value="{$c.id}">{$c.name}</option>
                        {/foreach}
                        {/if}
                      </select>
                    </div>
                  </div>
                  <div>
                    <a onclick="window.location='/{$languageURL}upload/form/?category=' + document.getElementById('category').options[document.getElementById('category').selectedIndex].value;" class="btn skin btn-sm">下一步</a>
                    <a href="/{$languageURL}help/upload/" class="btn btn-link fs-14 btn-sm" target="_blank">帮助</a>
                  </div>
                </fieldset>
              </form>
              <div class="row no-gutter b-b text-skin-hover">
                <div class="col-xs-6 b-r">
                  <a class="p-a block text-center">
                    <span class="h5 price _800 m-v-sm inline">{$user.total|string_format:"%.2f"}</span>
                    <span class="block">账户余额</span>
                  </a>
                </div>
                <!--<div class="col-xs-4 b-r">
                  <a class="p-a block text-center">
                    <span class="text-lg price _800 m-v-sm inline">{$user.deposit|string_format:"%.2f"}</span>
                    <span class="block">充值余额</span>
                  </a>
                </div>-->
                <div class="col-xs-6">
                  <a class="p-a block text-center">
                    <span class="h5 price _800 m-v-sm inline">{$user.earning|string_format:"%.2f"}</span>
                    <span class="block">收入余额</span>
                  </a>
                </div>
              </div>
              <div class="p-a b-b">
                <h5 class="bordertit">本周统计</h5>
                <div class="borderbg">
                  <p class="m-b-0">获得收入<strong class="text-lg price p-x-sm">{$weekStats.earning|string_format:"%.2f"}</strong>元<br />售出作品<strong class="text-lg price p-x-sm">{$weekStats.sold}</strong>次</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- ############ PAGE END-->
{include file="$template_path/html/footer.html"}
</div>
{include file="$template_path/html/backtop.html"}
{include file="$template_path/html/mb-settings.html"}
<!-- ############ LAYOUT END-->
</div>
{literal}
<style>
  .line-dashed{border-bottom-style: dotted}
</style>
{/literal}
{literal}
<script type="text/javascript">
  seajs.use(["jq"], function($){
    $("textarea").on("keyup keydown",function(){
      var h=$(this);
      h.height(20).height(h[0].scrollHeight);
    });
  });
</script>
{/literal}
</body>
