currency-detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div class="currency-detail-page">
  3. <div class="top">
  4. <img
  5. class="icon-currency"
  6. :src="routerParams.iconPath"
  7. />
  8. <div class="amount">
  9. {{routerParams.balance}} {{routerParams.currencyName}}
  10. <div class="final">${{routerParams.usdEstimateBalance}}</div>
  11. </div>
  12. </div>
  13. <div class="bottom">
  14. <div class="btn deposit-btn" @click="clickDeposit">Deposit</div>
  15. <div class="btn withdrawal-btn" @click="clickWithdraw">Withdrawal</div>
  16. </div>
  17. <div class="popup" v-if="showPopup" @click="clickPopup">
  18. <div class="content">
  19. <div class="item" v-for="(item, index) in listData" :key="index">
  20. <div class="chain">
  21. <img
  22. class="icon-chain"
  23. src="https://d1mcov78iir8kk.cloudfront.net/image/currency_icon/BSC_USDT.png"
  24. />
  25. {{ item.chain }}
  26. </div>
  27. <div class="currency">
  28. <div class="left">
  29. <img
  30. class="icon-currency"
  31. src="https://d1mcov78iir8kk.cloudfront.net/image/currency_icon/BSC_USDT.png"
  32. />
  33. <div class="info">
  34. <div class="unit">{{ item.currency }}</div>
  35. TetherUS
  36. </div>
  37. </div>
  38. <div class="right">
  39. {{ item.amount }}
  40. <div class="final">${{ item.amount }}</div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script setup>
  49. import { ref, onMounted, inject, reactive } from "vue";
  50. import router from "@/router/popup.js";
  51. import Report from "@/log-center/log";
  52. import { getStorage } from "@/uilts/help";
  53. let routerParams = ref({});
  54. let showPopup = ref(true);
  55. let listData = ref([
  56. {
  57. chain: "BNB Smart Chain (BEP20)",
  58. currency: "USDT",
  59. amount: "10",
  60. },
  61. {
  62. chain: "BNB Smart Chain (BEP20)",
  63. currency: "USDT",
  64. amount: "10",
  65. },
  66. ]);
  67. const clickPopup = () => {
  68. showPopup.value = false;
  69. };
  70. let withdraw_info = inject('withdraw_info')
  71. // 点击提现
  72. const clickWithdraw = () => {
  73. let _params = routerParams.value;
  74. Report.reportLog({
  75. pageSource: Report.pageSource.denetHomePage,
  76. businessType: Report.businessType.buttonClick,
  77. objectType: Report.objectType.withdrawButton
  78. });
  79. if (_params.currencyCode == 'USD') {
  80. withdraw_info.currency_code = _params.currencyCode
  81. router.push('/withdraw/paypal')
  82. } else {
  83. withdraw_info.source = 'home'
  84. withdraw_info.balance = _params.balance
  85. withdraw_info.token_symbol = _params.tokenSymbol || ''
  86. withdraw_info.currency_name = _params.currencyName || ''
  87. withdraw_info.token_chain = _params.tokenChain || 'BNB Chain'
  88. withdraw_info.currency_code = _params.currencyCode
  89. withdraw_info.icon_token = _params.iconPath || ''
  90. withdraw_info.icon_net = require('@/assets/svg/icon-BNB.svg')
  91. router.push('/withdraw/info')
  92. }
  93. }
  94. let top_up_info = reactive(getStorage('top_up_info')) || inject('top_up_info') || {};
  95. const clickDeposit = () => {
  96. let _params = routerParams.value;
  97. top_up_info.token = _params.currencyName || ''
  98. top_up_info.token_chain = _params.tokenChain
  99. top_up_info.token_symbol = _params.tokenSymbol || ''
  100. top_up_info.currency_code = _params.currencyCode
  101. top_up_info.icon_token = _params.iconPath || ''
  102. top_up_info.icon_net = require('@/assets/svg/icon-BNB.svg')
  103. Report.reportLog({
  104. pageSource: Report.pageSource.denetHomePage,
  105. businessType: Report.businessType.buttonClick,
  106. objectType: Report.objectType.topupButton
  107. });
  108. router.push('/top-up/info');
  109. }
  110. onMounted(() => {
  111. let {params = '{}'} = router.currentRoute.value.query;
  112. routerParams.value = JSON.parse(params);
  113. console.log(routerParams.value)
  114. })
  115. </script>
  116. <style lang='scss' scoped>
  117. .currency-detail-page {
  118. width: 100%;
  119. height: 100%;
  120. position: relative;
  121. .top {
  122. height: calc(100% - 163px);
  123. display: flex;
  124. flex-direction: column;
  125. align-items: center;
  126. justify-content: center;
  127. .icon-currency {
  128. width: 100px;
  129. margin-bottom: 30px;
  130. }
  131. .amount {
  132. font-weight: 700;
  133. font-size: 28px;
  134. .final {
  135. margin-top: 9px;
  136. font-weight: 500;
  137. font-size: 22px;
  138. color: #a2a2a2;
  139. text-align: center;
  140. }
  141. }
  142. }
  143. .bottom {
  144. height: 162px;
  145. padding: 0 20px;
  146. box-sizing: border-box;
  147. .btn {
  148. width: 100%;
  149. height: 57px;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. font-weight: 500;
  154. font-size: 17px;
  155. border-radius: 100px;
  156. cursor: pointer;
  157. }
  158. .deposit-btn {
  159. margin-bottom: 18px;
  160. background: #1d9bf0;
  161. color: #fff;
  162. }
  163. .withdrawal-btn {
  164. background: rgba(244, 244, 244, 0.01);
  165. border: 1px solid #d7e8f4;
  166. box-sizing: border-box;
  167. color: #1d9bf0;
  168. }
  169. }
  170. .popup {
  171. width: 100%;
  172. height: 100%;
  173. position: absolute;
  174. left: 0;
  175. top: 0;
  176. background: rgba(0, 0, 0, 0.6);
  177. cursor: pointer;
  178. .content {
  179. background: #f7f7f7;
  180. border-radius: 20px 20px 0px 0px;
  181. width: 100%;
  182. height: 230px;
  183. position: absolute;
  184. bottom: 0;
  185. left: 0;
  186. overflow-y: auto;
  187. cursor: default;
  188. .item {
  189. .chain {
  190. font-weight: 500;
  191. font-size: 14px;
  192. padding: 12px 14px;
  193. box-sizing: border-box;
  194. background: #f7f7f7;
  195. .icon-chain {
  196. width: 18px;
  197. height: 18px;
  198. margin-right: 8px;
  199. }
  200. }
  201. .currency {
  202. background: #fff;
  203. padding: 12px 20px;
  204. box-sizing: border-box;
  205. display: flex;
  206. justify-content: space-between;
  207. cursor: pointer;
  208. .left {
  209. display: flex;
  210. .icon-currency {
  211. width: 24px;
  212. height: 24px;
  213. margin-right: 12px;
  214. margin-top: 4px;
  215. }
  216. .info {
  217. font-weight: 400;
  218. font-size: 12px;
  219. color: #a2a2a2;
  220. .unit {
  221. font-weight: 500;
  222. font-size: 15px;
  223. color: #000;
  224. margin-bottom: 5px;
  225. }
  226. }
  227. }
  228. .right {
  229. font-weight: 500;
  230. font-size: 15px;
  231. .final {
  232. font-weight: 400;
  233. font-size: 12px;
  234. color: #A2A2A2;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. }
  242. </style>