give-dialog-head.vue 4.2 KB

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