give-dialog-head.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="head">
  3. <div class="left">
  4. <!-- 关闭按钮 -->
  5. <div class="close-btn" @click="close">
  6. <template v-if="publishType == 'TOOL_BOX'">
  7. <img class="icon-close"
  8. :src="require('@/assets/svg/icon-close.svg')"
  9. v-if="toolBoxPageData.activePage == 'EDITOR'"/>
  10. <img class="icon-close"
  11. :src="require('@/assets/svg/icon-back.svg')"
  12. v-else/>
  13. </template>
  14. <template v-else>
  15. <img class="icon-close"
  16. :src="require('@/assets/svg/icon-close.svg')"
  17. v-if="showComType == 'default'"/>
  18. <img class="icon-close"
  19. :src="require('@/assets/svg/icon-back.svg')"
  20. v-else/>
  21. </template>
  22. </div>
  23. <!-- 标题 -->
  24. <div class="title">
  25. {{title}}
  26. </div>
  27. </div>
  28. <div class="right">
  29. <!-- 更多按钮 -->
  30. <img :src="require('@/assets/svg/icon-more-l.svg')"
  31. class="more"
  32. @click="showMoreOption = true">
  33. <div class="area-option"
  34. v-if="showMoreOption"
  35. @click="showMoreOption = false">
  36. <div class="option">
  37. <div class="item" @click="goTransactionsList()">
  38. <img :src="require('@/assets/svg/icon-menu.svg')">
  39. <span>Transaction History</span>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script setup>
  47. import { ref, defineEmits, defineProps } from "vue";
  48. const props = defineProps({
  49. publishType: {
  50. type: String,
  51. default: 'REDPACKET'
  52. },
  53. showComType: {
  54. type: String,
  55. default: 'default'
  56. },
  57. toolBoxPageData: {
  58. type: Object,
  59. default: () => {
  60. return {
  61. activePage: 'EDITOR' //PREVIEW
  62. }
  63. }
  64. },
  65. title: {
  66. type: String,
  67. default: 'DeNet'
  68. },
  69. })
  70. const emits = defineEmits(["close"]);
  71. // 展示更多按钮下的选项
  72. let showMoreOption = ref(false);
  73. const goTransactionsList = () => {
  74. window.open(`${chrome.runtime.getURL('/iframe/home.html#/transactions')}`)
  75. }
  76. const close = () => {
  77. emits('close', {})
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. .head {
  82. border-bottom: 1px solid #ececec;
  83. height: 48px;
  84. box-sizing: border-box;
  85. display: flex;
  86. align-items: center;
  87. justify-content: space-between;
  88. padding: 0 14px;
  89. .left {
  90. display: flex;
  91. align-items: center;
  92. .title {
  93. font-size: 16px;
  94. font-weight: 500;
  95. }
  96. .close-btn {
  97. display: flex;
  98. align-items: center;
  99. width: max-content;
  100. margin-right: 12px;
  101. cursor: pointer;
  102. }
  103. }
  104. .right {
  105. .more {
  106. cursor: pointer;
  107. }
  108. .area-option {
  109. width: 100%;
  110. height: 100%;
  111. position: absolute;
  112. top: 0;
  113. left: 0;
  114. z-index: 111;
  115. .option {
  116. position: absolute;
  117. top: 43px;
  118. right: 15px;
  119. background: #fff;
  120. filter: drop-shadow(0px 3px 20px rgba(0, 0, 0, 0.2));
  121. width: 240px;
  122. border-radius: 15px;
  123. overflow: hidden;
  124. .item {
  125. width: 100%;
  126. height: 50px;
  127. display: flex;
  128. align-items: center;
  129. cursor: pointer;
  130. border-top: 1px solid #E9E9E9;
  131. img {
  132. margin-left: 15px;
  133. width: 30px;
  134. height: 30px;
  135. margin-right: 6px;
  136. }
  137. span {
  138. font-weight: 500;
  139. font-size: 14px;
  140. }
  141. }
  142. .item:first-child {
  143. border-top: 0;
  144. }
  145. .item:hover {
  146. background: #F5F5F5;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. </style>