consumption.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div class="consump-layout">
  3. <div class="c-header">
  4. <ul class="tab-list">
  5. <li :class="{active:i===0}" v-for="(item,i) in tabList" :key="i">
  6. {{item.name}}
  7. </li>
  8. </ul>
  9. <div class="tab-select">
  10. 全部
  11. <ul>
  12. <li>全部</li>
  13. <li>子选项</li>
  14. </ul>
  15. </div>
  16. </div>
  17. <tableList :header='capacity' :data='data' class="table-list" >
  18. <div slot-scope="{data}" slot="header">
  19. {{data.name}}
  20. </div>
  21. <div slot-scope="{data}" slot="item">
  22. {{data}}
  23. </div>
  24. </tableList>
  25. <div class="paging" v-if="total">
  26. <vcenter>
  27. <Paging @clickHandle="pageChange" :current="currentPage" :total="total" :equable="pageSize" />
  28. </vcenter>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import tableList from '@/components/table'
  34. import {capacity} from './iconsumption'
  35. import Paging from '@/components/Paging'
  36. import vcenter from '@/components/vcenter'
  37. export default {
  38. components: {
  39. tableList,
  40. Paging,
  41. vcenter
  42. },
  43. data () {
  44. let tabList = [
  45. {
  46. name: '扩容记录'
  47. }, {
  48. name: '充值记录'
  49. }, {
  50. name: '增值发票'
  51. }
  52. ]
  53. let data = [{
  54. orderSn: 'KR180928ac',
  55. channel: '官方预售活动赠送',
  56. size: '100G',
  57. paytype: '支付宝',
  58. bill: '9800元',
  59. validity: '终生有效',
  60. status: '使用中',
  61. date: '2018-09-28 16:14:23'
  62. }, {
  63. orderSn: 'KR180928ac',
  64. channel: '官方预售活动赠送',
  65. size: '100G',
  66. paytype: '支付宝',
  67. bill: '9800元',
  68. validity: '终生有效',
  69. status: '使用中',
  70. date: '2018-09-28 16:14:23'
  71. }, {
  72. orderSn: 'KR180928ac',
  73. channel: '官方预售活动赠送',
  74. size: '100G',
  75. paytype: '支付宝',
  76. bill: '9800元',
  77. validity: '终生有效',
  78. status: '使用中',
  79. date: '2018-09-28 16:14:23'
  80. }, {
  81. orderSn: 'KR180928ac',
  82. channel: '官方预售活动赠送',
  83. size: '100G',
  84. paytype: '支付宝',
  85. bill: '9800元',
  86. validity: '终生有效',
  87. status: '使用中',
  88. date: '2018-09-28 16:14:23'
  89. }, {
  90. orderSn: 'KR180928ac',
  91. channel: '官方预售活动赠送',
  92. size: '100G',
  93. paytype: '支付宝',
  94. bill: '9800元',
  95. validity: '终生有效',
  96. status: '使用中',
  97. date: '2018-09-28 16:14:23'
  98. }, {
  99. orderSn: 'KR180928ac',
  100. channel: '官方预售活动赠送',
  101. size: '100G',
  102. paytype: '支付宝',
  103. bill: '9800元',
  104. validity: '终生有效',
  105. status: '使用中',
  106. date: '2018-09-28 16:14:23'
  107. }, {
  108. orderSn: 'KR180928ac',
  109. channel: '官方预售活动赠送',
  110. size: '100G',
  111. paytype: '支付宝',
  112. bill: '9800元',
  113. validity: '终生有效',
  114. status: '使用中',
  115. date: '2018-09-28 16:14:23'
  116. } ]
  117. return {
  118. data,
  119. tabList,
  120. capacity,
  121. total: 10,
  122. pageSize: 10,
  123. currentPage: 1
  124. }
  125. },
  126. methods: {
  127. pageChange (data) {
  128. this.currentPage = data
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. $theme-color: #1fe4dc;
  135. .consump-layout{
  136. margin: 30px 0 30px 40px;
  137. width: 90%;
  138. .c-header{
  139. .tab-list{
  140. display: inline-block;
  141. li{
  142. display: inline-block;
  143. margin-right: 40px;
  144. cursor: pointer;
  145. }
  146. .active{
  147. color: $theme-color;
  148. border-bottom: 2px solid $theme-color;
  149. font-weight: bold;
  150. }
  151. }
  152. .tab-select{
  153. float: right;
  154. position: relative;
  155. width: 200px;
  156. padding-left: 10px;
  157. border: 1px solid #ccc;
  158. border-radius: 5px;
  159. ul{
  160. position: absolute;
  161. // max-height: 0;
  162. left: 0;
  163. top: 24px;
  164. padding-left: 10px;
  165. background: #fff;
  166. overflow: hidden;
  167. width: 100%;
  168. box-shadow: 0 0 10px rgba($color: #000000, $alpha: 0.5);
  169. }
  170. }
  171. }
  172. .table-list{
  173. margin-top: 40px;
  174. }
  175. .paging {
  176. // border-left: #e5e5e5 1px solid;
  177. height: 100%;
  178. margin-bottom: 40px;
  179. & /deep/ .layout {
  180. text-align: center;
  181. margin-top: 10px;
  182. }
  183. & /deep/ .layout a:not(:last-child) {
  184. margin: 10px 8px;
  185. font-size: 16px;
  186. display: inline-block;
  187. font-weight: 500;
  188. cursor: pointer;
  189. user-select: none;
  190. color: #999;
  191. position: relative;
  192. transition: color 0.3s;
  193. }
  194. & /deep/ .layout a:last-child {
  195. position: relative;
  196. top: -5px;
  197. display: -ms-inline-flexbox;
  198. display: inline-flex;
  199. -ms-flex-align: center;
  200. align-items: center;
  201. height: 22px;
  202. padding: 0 9.6px;
  203. padding: 0 0.6rem;
  204. }
  205. & /deep/ .layout a:last-child::before,
  206. & /deep/ .layout a:last-child::after {
  207. content: "";
  208. display: inline-block;
  209. will-change: transform;
  210. transition: transform 0.3s;
  211. }
  212. & /deep/ .layout a:not(:last-child).active::after,
  213. & /deep/ .layout a:not(:last-child).active,
  214. & /deep/ .layout a:not(:last-child):hover,
  215. & /deep/ .layout a:not(:last-child):hover::after {
  216. color: #111111;
  217. transform: scaleX(1);
  218. }
  219. & /deep/ .layout a:not(:last-child)::after {
  220. content: "";
  221. height: 3px;
  222. width: 140%;
  223. background-color: #111;
  224. display: block;
  225. margin-left: -20%;
  226. margin-top: 3px;
  227. transform-origin: 50% 50%;
  228. transform: scaleX(0);
  229. will-change: transform;
  230. transition: transform 0.3s;
  231. }
  232. }
  233. }
  234. </style>