tip.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div class="dialog">
  3. <div class="area-title">
  4. <img :src="require('@/assets/svg/icon-close.svg')" @click="clickClose" />
  5. <div class="title">Join Group</div>
  6. </div>
  7. <div class="area-content" v-show="state.show == 'tip'">
  8. <!-- -->
  9. <div class="logo">
  10. <img :src="require('@/assets/svg/icon-denet-logo.svg')" />
  11. </div>
  12. <div class="title">
  13. DeNet Core Member Group
  14. </div>
  15. <div class="tip">
  16. Join to Get Posting Permissions and Badges
  17. </div>
  18. <div class="tip2">
  19. <img :src="require('@/assets/svg/icon-line.svg')" />
  20. <span>Own this Group's NFT to Join</span>
  21. <img :src="require('@/assets/svg/icon-line.svg')" />
  22. </div>
  23. <div class="btn" v-if="state.type == 'buy' && state.buy_nft_status == 0" @click="clickBuy">
  24. Buy NFT to Join
  25. </div>
  26. <div class="btn" v-if="state.type == 'join'" @click="clickJoin">
  27. Join Now
  28. </div>
  29. </div>
  30. <div class="area-content success" v-show="state.show == 'success'">
  31. <!-- -->
  32. <div class="logo">
  33. <img :src="require('@/assets/svg/icon-group-success.svg')" />
  34. </div>
  35. <div class="title">
  36. Joined Successfully
  37. </div>
  38. <div class="btn" @click="clickFinish">
  39. Finish
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script setup>
  45. import { reactive, onMounted } from 'vue'
  46. import { useRouter } from 'vue-router'
  47. import { setGroupJoin } from '@/http/group.js'
  48. let state = reactive({
  49. show: 'tip',
  50. })
  51. const router = useRouter()
  52. const clickJoin = () => {
  53. // 请求接口
  54. setGroupJoin({
  55. params: {
  56. nftGroupId: state.nft_group_Id
  57. }
  58. }).then((res) => {
  59. if (res.code == 0) {
  60. state.show = 'success'
  61. }
  62. })
  63. }
  64. const clickBuy = () => {
  65. // 传输参数
  66. router.push(`/?nft_group_Id=${state.nft_group_Id}&buyNftProjectId=${state.buyNftProjectId}`)
  67. }
  68. const clickClose = () => {
  69. chrome.tabs.getCurrent((tab) => {
  70. chrome.tabs.sendMessage(tab.id, {
  71. actionType: "IFRAME_TWITTER_HIDE_BUY_NFT",
  72. }, (res) => { });
  73. })
  74. }
  75. const clickFinish = () => {
  76. clickClose()
  77. }
  78. onMounted(() => {
  79. state.type = router.currentRoute.value.query.type
  80. state.buy_nft_status = router.currentRoute.value.query.buy_nft_status
  81. state.nft_group_Id = router.currentRoute.value.query.nft_group_Id
  82. state.buyNftProjectId = router.currentRoute.value.query.buyNftProjectId
  83. })
  84. </script>
  85. <style lang="scss" scoped>
  86. .dialog {
  87. background: #fff;
  88. border-radius: 25px;
  89. width: 500px;
  90. height: 420px;
  91. z-index: 23;
  92. display: flex;
  93. flex-direction: column;
  94. .area-title {
  95. width: 100%;
  96. min-height: 48px;
  97. display: flex;
  98. align-items: center;
  99. border-bottom: 1px solid #D9D9D9;
  100. font-weight: 500;
  101. font-size: 16px;
  102. letter-spacing: 0.3px;
  103. color: #000000;
  104. img {
  105. width: 24p;
  106. height: 24px;
  107. margin-left: 14px;
  108. margin-right: 12px;
  109. cursor: pointer;
  110. }
  111. }
  112. .area-content {
  113. flex: 1;
  114. display: flex;
  115. justify-content: flex-start;
  116. flex-direction: column;
  117. align-items: center;
  118. .logo {
  119. width: 80px;
  120. height: 80px;
  121. border: 1px solid #D0BAA6;
  122. border-radius: 5px;
  123. display: flex;
  124. justify-content: center;
  125. align-items: center;
  126. margin-top: 33px;
  127. margin-bottom: 25px;
  128. img {
  129. width: 75px;
  130. height: 75px;
  131. }
  132. }
  133. .title {
  134. color: #000000;
  135. font-size: 18px;
  136. font-weight: 600;
  137. margin-bottom: 13px;
  138. }
  139. .tip {
  140. color: #9E9E9E;
  141. font-weight: 400;
  142. font-size: 16px;
  143. margin-bottom: 66px;
  144. }
  145. .tip2 {
  146. margin-bottom: 28px;
  147. display: flex;
  148. align-items: center;
  149. span {
  150. font-weight: 500;
  151. font-size: 14px;
  152. margin: 0 10px;
  153. }
  154. img {}
  155. }
  156. .btn {
  157. width: 470px;
  158. height: 46px;
  159. background: #1D9BF0;
  160. border-radius: 100px;
  161. text-align: center;
  162. line-height: 46px;
  163. font-weight: 600;
  164. font-size: 16px;
  165. color: #fff;
  166. cursor: pointer;
  167. }
  168. }
  169. .success {
  170. .logo {
  171. width: 120px;
  172. height: 120px;
  173. margin-bottom: 36px;
  174. margin-top: 61px;
  175. border: 0;
  176. img {
  177. width: 100%;
  178. height: 100%;
  179. }
  180. }
  181. .title {
  182. font-weight: 600;
  183. font-size: 22px;
  184. margin-bottom: 60px;
  185. }
  186. }
  187. }
  188. </style>