<template>
  <div class="browser">
    <child-view>
      <div class="sub-page">
        <div class="mx-4 py-4 border-app-blue-3 border border-solid rounded-lg bg-app-blue-4">
          <div class="px-4 pb-4 border-b">
            <div class="flex items-center mb-0 text-xs">
              <span class="inline-block mr-2 tracking-tight">ID:1z9e1beb62e754ff3704d8ba626d6e29f761a1c5a0</span>
              <app-icon customize size="16px" color="#FFBB00" type='icon-fuzhi'></app-icon>
            </div>
          </div>
          <p class="mt-4 mb-0 px-4 opacity-60 text-xs flex items-center justify-between">
            <span>当前总票数</span>
            <span>123464654票</span>
          </p>
        </div>
        <div class="mx-4 mt-5">
          <p class="mb-3 text-sm font-medium">投票详情</p>
          <div class="border border-app-blue-3 border-solid rounded-lg overflow-hidden">
            <div class="h-9 leading-9 flex items-center justify-between text-sm bg-app-blue-4 px-3">
              <div>个人ID</div>
              <div>票数</div>
              <div>投票HASH</div>
            </div>
            <ul class="hash-list mb-0">
              <li
                v-for="(item, index) in lists"
                :key="index"
                class="leading-9 px-3 text-xs flex items-center justify-between">
                <div class="text-yellow-400">1NyER8tS...KDcL</div>
                <div>3000票</div>
                <div class="text-yellow-400">1NyER8tS...KDcL</div>
              </li>
            </ul>
          </div>
        </div>
        <div>
          <x-pagination :currentPage="currentPage" :totalPage="totalPage" @handleChange="handleChange" />
        </div>
      </div>
    </child-view>
  </div>
</template>

<script lang="ts">
import childView from '@/layouts/childView.vue'
import Vue from 'vue'
import AppIcon from '@/components/common/Icon.vue'
import XPagination from '@/components/common/Pagination.vue'
import { Icon } from 'vant';
Vue.use(Icon)
export default Vue.extend({
  components: { childView, AppIcon, XPagination },
  data() {
    return {
      currentPage: 1,
      lists: [1,2,3,4],
      totalPage: 5
    }
  },
  methods: {
    handleChange(v: number) {
      this.currentPage = v
    }
  }
})
</script>

<style scoped>
  .border-b {
    border-bottom: 1px solid #666EED;
  }
  .hash-list li:nth-of-type(2n) {
    background: #240080;
  }
  .hash-list li:nth-of-type(2n + 1) {
    background: #0A002E;
  }
</style>