HashCode.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <van-collapse-item name="hashCode" class="goods-info">
  3. <template #title>
  4. <div class="page-title"><img src="../../assets/icon-lianshangxinxi(3).png" alt="" />链上信息</div>
  5. </template>
  6. <div class="page-text" v-if="info.txHash">
  7. <div class="text-info">
  8. <span class="text1">Hash地址:</span>
  9. <span class="flex1"></span>
  10. <img @click="copy(info.txHash)" src="../../assets/svgs/copy_icon.svg" alt="" />
  11. <span class="van-ellipsis" style="direction: rtl; text-align: left">{{ info.txHash }}</span>
  12. </div>
  13. <div class="text-info">
  14. <span class="text1">区块高度: </span>
  15. <span class="flex1"></span>
  16. <span>{{ info.blockNumber }}</span>
  17. </div>
  18. <div class="text-info">
  19. <span class="text1">令牌ID: </span>
  20. <span class="flex1"></span>
  21. <img @click="copy(info.tokenId)" src="../../assets/svgs/copy_icon.svg" alt="" />
  22. <span class="van-ellipsis" style="direction: rtl; text-align: left">{{ info.tokenId }}</span>
  23. </div>
  24. </div>
  25. <div v-else class="textName">铸造者未设置</div>
  26. </van-collapse-item>
  27. </template>
  28. <script>
  29. export default {
  30. props: {
  31. info: {
  32. type: Object,
  33. default: () => {
  34. return {};
  35. }
  36. }
  37. },
  38. methods: {
  39. copy(text) {
  40. this.$copyText(text).then(
  41. e => {
  42. this.$toast.success('复制成功');
  43. console.log(e);
  44. },
  45. e => {
  46. this.$toast('复制失败');
  47. console.log(e);
  48. }
  49. );
  50. }
  51. }
  52. };
  53. </script>
  54. <style lang="less" scoped>
  55. /deep/.goods-info {
  56. .van-cell {
  57. // padding: 0 0;
  58. &::after {
  59. content: none;
  60. }
  61. }
  62. }
  63. .page-title {
  64. // padding: 0 16px;
  65. font-size: @font2;
  66. font-weight: bold;
  67. color: #ffffff;
  68. line-height: 28px;
  69. span {
  70. color: @text3;
  71. font-size: @font1;
  72. }
  73. }
  74. .page-title {
  75. font-size: @font2;
  76. font-weight: bold;
  77. color: #ffffff;
  78. line-height: 24px;
  79. display: flex;
  80. align-items: center;
  81. &:not(:first-child) {
  82. padding-top: 16px;
  83. }
  84. img {
  85. width: 18px;
  86. height: 18px;
  87. margin-right: 6px;
  88. }
  89. }
  90. .page-text {
  91. font-size: @font2;
  92. color: @text3;
  93. line-height: 28px;
  94. word-break: break-all;
  95. // margin-top: 10px;
  96. // p {
  97. // font-size: @font2;
  98. // color: #ffffff;
  99. // line-height: 28px;
  100. // // margin-top: 10px;
  101. // word-break: break-all;
  102. // }
  103. .text-info {
  104. .flex();
  105. .text1 {
  106. min-width: 80px;
  107. }
  108. .van-ellipsis {
  109. width: 200px;
  110. }
  111. img {
  112. width: 18px;
  113. height: 18px;
  114. flex-shrink: 0;
  115. margin-right: 6px;
  116. }
  117. }
  118. }
  119. </style>