|
31 | 31 | {{.me.Copper}} <img src="/static/img/copper_48.png" alt="" width="16px">
|
32 | 32 | </div>
|
33 | 33 | </div>
|
| 34 | + {{if gt .total .cmt_per_num}} |
| 35 | + <div class="cell balance-page"> |
| 36 | + <table cellpadding="0" cellspacing="0" border="0" width="100%"> |
| 37 | + <tbody> |
| 38 | + <tr> |
| 39 | + {{with $pageMax := divide .total .cmt_per_num}} |
| 40 | + <td width="92%" align="left"> |
| 41 | + {{range $i, $v := genList $.total $.cmt_per_num}} |
| 42 | + <a href="/balance?p={{$v}}" class="{{if eq $v $.cur_p}}page_current{{else}}page_normal{{end}}">{{$v}}</a> |
| 43 | + {{end}} |
| 44 | + <input type="number" class="page_input" autocomplete="off" value="{{$.cur_p}}" min="1" max="{{$pageMax}}"> |
| 45 | + </td> |
| 46 | + <td width="8%" align="right"> |
| 47 | + <table cellpadding="0" cellspacing="0" border="0" width="100%"> |
| 48 | + <tbody> |
| 49 | + <tr data-cur="{{$.cur_p}}" data-max="{{$pageMax}}"> |
| 50 | + <td width="50%" align="center" class="super normal button nav-page prev-page {{if eq $.cur_p 1}}disable_now{{end}}" style="border-right: none;" title="上一页">❮</td> |
| 51 | + <td width="50%" align="center" class="super normal_page_right button nav-page next-page {{if eq $.cur_p $pageMax}}disable_now{{end}}" title="下一页">❯</td> |
| 52 | + </tr> |
| 53 | + </tbody> |
| 54 | + </table> |
| 55 | + </td> |
| 56 | + {{end}} |
| 57 | + </tr> |
| 58 | + </tbody> |
| 59 | + </table> |
| 60 | + </div> |
| 61 | + {{end}} |
34 | 62 | <div>
|
35 | 63 | <table cellpadding="5" cellspacing="0" border="0" width="100%" class="data table-hover">
|
36 | 64 | <tr>
|
@@ -94,9 +122,54 @@ <h2>获得初始资本</h2>
|
94 | 122 | {{define "css"}}
|
95 | 123 | <link rel="stylesheet" type="text/css" href="{{.static_domain}}/static/dist/css/table_data.min.css">
|
96 | 124 | <style type="text/css">
|
| 125 | +.balance-page { background-image: url('/static/img/shadow_light.png'); background-size: 20px 20px; background-repeat: repeat-x; } |
97 | 126 | .positive { color: #0aa31c; }
|
98 | 127 | .negative { color: #ff3c00; }
|
| 128 | +.nav-page { border-top-right-radius: 0px; border-bottom-right-radius: 0px; } |
99 | 129 | </style>
|
100 | 130 | {{end}}
|
101 | 131 | {{define "js"}}
|
| 132 | +<script> |
| 133 | +$(function(){ |
| 134 | + $('.prev-page').on('click', function() { |
| 135 | + let curPage = $(this).parent().data('cur'); |
| 136 | + if (curPage > 1) { |
| 137 | + location.href='/balance?p='+(curPage-1); |
| 138 | + } |
| 139 | + }); |
| 140 | + |
| 141 | + $('.next-page').on('click', function() { |
| 142 | + let curPage = $(this).parent().data('cur'), |
| 143 | + pageMax = $(this).parent().data('max'); |
| 144 | + if (curPage < pageMax) { |
| 145 | + location.href='/balance?p='+(curPage+1); |
| 146 | + } |
| 147 | + }); |
| 148 | + |
| 149 | + $('.nav-page').on('mouseover', function() { |
| 150 | + if (!$(this).hasClass('disable_now')) { |
| 151 | + $(this).addClass('hover_now'); |
| 152 | + } |
| 153 | + }); |
| 154 | + |
| 155 | + $('.nav-page').on('mouseleave', function() { |
| 156 | + if (!$(this).hasClass('disable_now')) { |
| 157 | + $(this).removeClass('hover_now'); |
| 158 | + $(this).removeClass('active_now') |
| 159 | + } |
| 160 | + }); |
| 161 | + |
| 162 | + $('.nav-page').on('mousedown', function() { |
| 163 | + if (!$(this).hasClass('disable_now')) { |
| 164 | + $(this).addClass('active_now'); |
| 165 | + } |
| 166 | + }); |
| 167 | + |
| 168 | + $('.page_input').on('keydown', function() { |
| 169 | + if (event.keyCode == 13) { |
| 170 | + location.href = '/balance?p=' + this.value |
| 171 | + } |
| 172 | + }); |
| 173 | +}); |
| 174 | +</script> |
102 | 175 | {{end}}
|
0 commit comments