<template>
  <div>
    <child-view>
      <div class="sub-page">
        <div class="mx-4 mb-5 py-3 px-2 text-xs border-app-blue-3 border border-solid rounded-lg bg-app-blue-4 text-app-white">
          <div class="flex items-center justify-between leading-9">
            <div class="flex-shrink-0">哈希</div>
            <div class="flex items-center justify-between text-xs">
              <span class="inline-block mr-2 tracking-tighter">1z9e1beb62e754ff3704d8ba626d...c5a0</span>
              <div
                v-clipboard:copy="'hahahhahahahhaid'"
                v-clipboard:success="onCopy"
                v-clipboard:error="onError">
                <app-icon customize size="16px" color="#FFBB00" type='icon-fuzhi'></app-icon>
              </div>
            </div>
          </div>
          <div class="flex items-center justify-between leading-9">
            <div class="">区块高度</div>
            <div>88925</div>
          </div>
          <div class="flex items-center justify-between leading-9">
            <div class="">投票数</div>
            <div>88925票</div>
          </div>
          <div class="flex items-center justify-between leading-9">
            <div class="">投票时间</div>
            <div>88925</div>
          </div>
          <div class="flex items-center justify-between leading-9">
            <div class="">手续费</div>
            <div>88925BTY</div>
          </div>
        </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-xs bg-app-blue-4 px-3">
              <div>投票HASH</div>
              <div>票数</div>
              <div>参与项目ID</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 VueClipboard from 'vue-clipboard2'
import { Toast } from 'vant'
Vue.use(VueClipboard)
export default Vue.extend({
  components: { childView, AppIcon, XPagination },
  data() {
    return {
      lists: [1,4,5,6,7,8,9,0],
      currentPage: 1,
      totalPage: 10
    }
  },
  methods: {
    handleChange() {

    },
    onCopy() {
      Toast('复制成功')
    },
    onError() {
      Toast('复制失败')
    },
  }
})
</script>
