<template>
  <div class="browser">
    <child-view>
      <div class="sub-page">
        <div class="mx-4 py-4 border-app-blue-1 border border-solid rounded-lg bg-app-blue-4">
          <div class="">
            <h4 class="px-4 text-xl text-white">选项卡简介</h4>
            <p class="mb-0 px-4 pb-3 text-xs leading-normal border-0 border-b border-app-blue-1 border-solid">内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍</p>
          </div>
          <div class="px-4 py-4">
            <div class="flex items-center justify-between mb-0 text-xs text-app-white">
              <div class="flex-shrink-0">
                地址
              </div>
              <div class="flex items-center">
                <span class="inline-block mr-2 tracking-tighter">1z9e1beb62e754ff3704d8ba...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>
          <p class="mb-0 px-4 text-app-white 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-1 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>个人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>
            <x-pagination :currentPage="currentPage" :totalPage="totalPage" @handleChange="handleChange" />
          </div>
        </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 {
      currentPage: 1,
      lists: [1,2,3,4,4,4,5,6,7,8,9],
      totalPage: 5
    }
  },
  methods: {
    handleChange(v: number) {
      this.currentPage = v
    },
    onCopy() {
      Toast('复制成功')
    },
    onError() {
      Toast('复制失败')
    },
  }
})
</script>
