publish-tips.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div class="tips-wrapper">
  3. <div class="top">
  4. <img src="@/assets/svg/icon-bells.svg" class="icon-bells">
  5. <div class="text-wrapper">
  6. <div>
  7. Do not delete the
  8. </div>
  9. <div>
  10. <span>#DeNet</span>and<span> Giveaway link</span>
  11. otherwise the giveaway will not be available
  12. </div>
  13. </div>
  14. </div>
  15. <div class="copy-btn"
  16. :data-clipboard-text="strContent"
  17. @click="copyToken">Copy giveaways link</div>
  18. </div>
  19. </template>
  20. <script setup>
  21. /* eslint-disable */
  22. import { onMounted, ref } from "vue";
  23. import { ElMessage } from 'element-plus'
  24. import { getChromeStorage } from '@/uilts/chromeExtension.js'
  25. let ClipboardJS = require('clipboard');
  26. let strContent = ref('');
  27. const copyToken = async () => {
  28. let publishData = await getChromeStorage('publishData');
  29. strContent.value = publishData.srcContent;
  30. var clipboard = new ClipboardJS('.copy-btn');
  31. clipboard.on('success', function (e) {
  32. // ElMessage({
  33. // message: 'copy success',
  34. // grouping: true,
  35. // type: 'success',
  36. // offset: -16,
  37. // appendTo: document.body
  38. // })
  39. console.info('Action:', e.action);
  40. console.info('Text:', e.text);
  41. console.info('Trigger:', e.trigger);
  42. e.clearSelection();
  43. });
  44. clipboard.on('error', function (e) {
  45. // ElMessage({
  46. // message: 'copy error',
  47. // grouping: true,
  48. // type: 'error',
  49. // offset: -16
  50. // })
  51. console.error('Action:', e.action);
  52. console.error('Trigger:', e.trigger);
  53. });
  54. }
  55. onMounted(() => {
  56. })
  57. </script>
  58. <style scoped lang="scss">
  59. .tips-wrapper {
  60. width: 100%;
  61. height: 100%;
  62. box-sizing: border-box;
  63. background: #FFFFFF;
  64. border-radius: 12px;
  65. padding: 15px;
  66. .top {
  67. display: flex;
  68. .icon-bells {
  69. width: 30px;
  70. height: 30px;
  71. margin-right: 8px;
  72. }
  73. .text-wrapper {
  74. font-weight: 500;
  75. font-size: 14px;
  76. span {
  77. color: red;
  78. }
  79. }
  80. }
  81. .copy-btn {
  82. margin-top: 20px;
  83. background: rgba(56, 154, 255, 0.01);
  84. border: 1px solid #000000;
  85. border-radius: 100px;
  86. font-weight: 500;
  87. font-size: 14px;
  88. display: flex;
  89. align-items: center;
  90. justify-content: center;
  91. height: 33px;
  92. cursor: pointer;
  93. }
  94. }
  95. </style>