index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. <template>
  2. <div class="container">
  3. <!-- <div class="bg-img"></div> -->
  4. <svg-icon name="wallet-bg" class="bg-img" />
  5. <div class="user-info-body">
  6. <div class="user-info-lf">
  7. <van-image
  8. width="28px"
  9. height="28px"
  10. round
  11. src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
  12. />
  13. <div class="user-info">
  14. <div class="user-info-name" @click="showWallet = true">
  15. <div>Wallet</div>
  16. <svg-icon style="width: 16px; height: 16px;margin-left: 3px;" name="down" />
  17. </div>
  18. <div class="user-info-key-body">
  19. <span class="user-info-key-body-text">0xF3fefE…EcaB</span>
  20. <svg-icon style="width: 16px; height: 16px;" name="copy" />
  21. </div>
  22. </div>
  23. </div>
  24. <div class="network">
  25. <svg-icon style="width: 20px; height: 20px;" name="acc" />
  26. <div class="network-name">ACC</div>
  27. </div>
  28. </div>
  29. <div class="amount">
  30. <div class="amount-item-box">
  31. <div>Total assets</div>
  32. <div class="amount-item">
  33. <div class="item-text">
  34. <svg-icon class="my" style="width: 28px; height: 28px;" name="my" />
  35. <div>{{isShow?'2,536.00':'****'}}</div>
  36. </div>
  37. <svg-icon style="width: 16px; height: 16px;" :name="isShow?'eyes':'seyes'" @click="isShow = !isShow"/>
  38. </div>
  39. </div>
  40. <svg-icon style="width: 24px; height: 24px; margin-right: 27px;" name="right" @click="goToPage('walletDetail')"/>
  41. </div>
  42. <div class="card-box">
  43. <div class="box-cont" @click="goToPage('exchange')">
  44. <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="1" />
  45. <div>元宝兑换</div>
  46. </div>
  47. <div class="box-cont" @click="goToPage('proceeds')">
  48. <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="2" />
  49. <div>收款</div>
  50. </div>
  51. <div class="box-cont" @click="goToPage('transferDetail')">
  52. <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="3" />
  53. <div>转账</div>
  54. </div>
  55. <div class="box-cont">
  56. <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="4" />
  57. <div>竞赛</div>
  58. </div>
  59. <div class="box-cont">
  60. <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="5" />
  61. <div>区块浏览器</div>
  62. </div>
  63. </div>
  64. <div class="list-box">
  65. <div class="list-title">
  66. <div>代币</div>
  67. <svg-icon style="width: 24px; height: 24px;" name="add" @click="changePop(1)"/>
  68. </div>
  69. <div class="list-ul">
  70. <div class="list-li" v-for="item in 10" @click="changePop(2)">
  71. <div class="list-li-lf">
  72. <svg-icon style="width: 30px; height: 30px;margin-right: 8px;" name="acc" />
  73. <div>ACC</div>
  74. </div>
  75. <div class="list-li-ri">
  76. <div>6.6476474848</div>
  77. <div class="list-li-ri-num">$6.6476474848</div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <van-popup v-model:show="showWallet" position="bottom" round>
  83. <div class="pop-content">
  84. <div class="pop-title">
  85. <svg-icon style="width: 24px; height: 24px;" name="left-arrow" @click="showWallet = false"/>
  86. <div class="title">选择钱包</div>
  87. </div>
  88. <div class="tree">
  89. <div class="tree-lf">
  90. <div class="tree-lf-icon" v-for="(item,i) in 10" :class="i == 0?'active-bg':''">
  91. <svg-icon style="width: 32px; height: 32px;" name="acc" />
  92. </div>
  93. </div>
  94. <div class="tree-ri">
  95. <div class="tree-ri-title">ACC</div>
  96. <div class="tree-ul">
  97. <div class="tree-li" v-for="(item,i) in 10" :class="i == 0?'tree-active':''">
  98. <van-image
  99. width="37px"
  100. height="37px"
  101. round
  102. src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg"
  103. />
  104. <div class="tree-li-cont">
  105. <div class="tree-li-text">名字</div>
  106. <div class="tree-li-address">
  107. <span>0xF3fefE…EcaB</span>
  108. <svg-icon style="width: 16px; height: 16px;margin-left: 2px;" name="copy" />
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="pop-btn" @click="addWallet">
  116. <van-button class="btn" type="primary" size="large" color="#4765DD">
  117. <svg-icon style="width: 24px; height: 24px;margin-right: 4px;" name="add1" />添加钱包
  118. </van-button>
  119. </div>
  120. </div>
  121. </van-popup>
  122. <van-popup v-model:show="showHistory" position="bottom" round style="height:500px">
  123. <div class="pop-content" style="height:500px">
  124. <div class="pop-title">
  125. <svg-icon style="width: 24px; height: 24px;" name="left-arrow" @click="showHistory = false"/>
  126. <div class="title">{{ type == 1?'添加代币':'历史记录' }}</div>
  127. </div>
  128. <!-- 1 -->
  129. <div class="pop-ul" v-if="type == 1">
  130. <div class="pop-li" v-for="(item,i) in 3">
  131. <div class="pop-li-lf">
  132. <svg-icon style="width: 32px; height: 32px;margin-right: 6px;" name="acc" />
  133. <div>
  134. <div>STT</div>
  135. <div class="pop-address">0x712f...7b27</div>
  136. </div>
  137. </div>
  138. <svg-icon style="width: 20px; height: 20px;" :name="i == 0?'add-icon':'del-icon'" />
  139. </div>
  140. </div>
  141. <!-- 2 -->
  142. <div class="pop-list" v-if="type == 2">
  143. <div class="pop-list-box" v-for="(item,i) in 10">
  144. <svg-icon style="width: 24px; height: 24px;color: #fff;" :name="i == 0?'fs':'js'" />
  145. <div class="pop-list-ul">
  146. <div class="pop-list-li">
  147. <div class="pop-list-li-title">{{i == 0?'发送':'接收'}}</div>
  148. <div class="pop-list-li-status">成功</div>
  149. </div>
  150. <div class="pop-list-li">
  151. <div>转账金额</div>
  152. <div>0ACC</div>
  153. </div>
  154. <div class="pop-list-li">
  155. <div>发送时间</div>
  156. <div>2025-06-06 19:08:17</div>
  157. </div>
  158. <div class="pop-list-li">
  159. <div>收款地址</div>
  160. <div>0x712f...7b27<svg-icon style="width: 16px; height: 16px;" name="copy" /></div>
  161. </div>
  162. <div class="pop-list-li">
  163. <div>hash</div>
  164. <div>0x712f...7b27<svg-icon style="width: 16px; height: 16px;" name="copy" /></div>
  165. </div>
  166. <div class="pop-list-li">
  167. <div>矿工费</div>
  168. <div>0.000378636ACC</div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </van-popup>
  175. </div>
  176. </template>
  177. <script setup>
  178. import { useRouter } from 'vue-router'
  179. import { useSystemStore } from "@/stores/modules/systemStore";
  180. import { useWalletStore } from "@/stores/modules/walletStore";
  181. const systemStore = useSystemStore();
  182. const router = useRouter();
  183. const walletStore = useWalletStore();
  184. const isShow = ref(true);
  185. const showWallet = ref(false);
  186. const showHistory = ref(false);
  187. const type = ref('');
  188. const goToPage = (url) => {
  189. router.push(url)
  190. }
  191. const changePop = (val) => {
  192. showHistory.value = true;
  193. type.value = val;
  194. }
  195. // 添加钱包
  196. const addWallet = () => {
  197. router.push({
  198. path: '/login',
  199. query:{
  200. isFirst:false
  201. }
  202. })
  203. }
  204. onMounted(async ()=>{
  205. // const aa = await walletStore.getBalance();
  206. // console.log("---",aa)
  207. })
  208. </script>
  209. <style lang="less" scoped>
  210. .container{
  211. position: relative;
  212. display: flex;
  213. flex-direction: column;
  214. height: calc(100vh - 50px);
  215. .bg-img{
  216. height: 286px;
  217. width: 100%;
  218. position: absolute;
  219. left: 0;
  220. z-index: -1;
  221. }
  222. .user-info-body{
  223. padding: 60px 17px 25px;
  224. display: flex;
  225. align-items: center;
  226. justify-content: space-between;
  227. .user-info-lf{
  228. display: flex;
  229. align-items: center;
  230. .user-info{
  231. margin-left: 11px;
  232. font-family: PingFang SC, PingFang SC;
  233. font-size: 10px;
  234. .user-info-name{
  235. font-weight: 500;
  236. color: #FFFFFF;
  237. display: flex;
  238. align-items: center;
  239. }
  240. .user-info-key-body{
  241. font-weight: 400;
  242. color: rgba(255,255,255,0.6);
  243. display: flex;
  244. align-items: center;
  245. .user-info-key-body-text{
  246. margin-right: 4px;
  247. }
  248. }
  249. }
  250. }
  251. .network{
  252. display: flex;
  253. align-items: center;
  254. border-radius: 27px;
  255. border: 1px solid rgba(255,255,255,0.6);
  256. padding: 0 5px;
  257. font-family: PingFang SC, PingFang SC;
  258. font-weight: 400;
  259. font-size: 15px;
  260. color: #FFFFFF;
  261. height: 25px;
  262. line-height: 25px;
  263. box-sizing: border-box;
  264. .network-name{
  265. margin-left: 5px;
  266. }
  267. }
  268. }
  269. .amount{
  270. height: 102px;
  271. background-color: rgba(242, 242, 242, 0.2);
  272. backdrop-filter: blur(3px);
  273. -webkit-backdrop-filter: blur(3px);
  274. border-radius: 15px;
  275. margin: 0 17px 23px;
  276. box-shadow:0 7px 10px #15277031;
  277. box-sizing: border-box;
  278. display: flex;
  279. align-items: center;
  280. justify-content: space-between;
  281. font-family: PingFang SC, PingFang SC;
  282. font-weight: 400;
  283. font-size: 15px;
  284. color: #FFFFFF;
  285. &:before {
  286. height: calc(100% - 4px);
  287. width: calc(100% - 4px);
  288. content: "";
  289. position: absolute;
  290. inset: 0;
  291. z-index: -1;
  292. padding: 2px; /* 边框宽度 */
  293. background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0.6) 100%);//linear-gradient(135deg, #ffffff64, #ffffff2e); /* 渐变方向可调 */
  294. -webkit-mask:
  295. linear-gradient(#fff 0 0) content-box,
  296. linear-gradient(#fff 0 0);
  297. -webkit-mask-composite: xor;
  298. mask-composite: exclude;
  299. border-radius: 15px; /* 必须和父元素一致 */
  300. pointer-events: none; /* 避免遮挡点击 */
  301. }
  302. .amount-item-box{
  303. margin: 21px 21px 27px 27px;
  304. }
  305. .amount-item{
  306. margin-top: 7px;
  307. font-weight: 600;
  308. font-size: 25px;
  309. display: flex;
  310. position: relative;
  311. .item-text{
  312. display: flex;
  313. align-items: center;
  314. margin-right: 2px;
  315. .my{
  316. position: relative;
  317. top:1px;
  318. }
  319. }
  320. }
  321. }
  322. .card-box{
  323. background: #FFFFFF;
  324. box-shadow: 0px 4px 8px -2px rgba(25,75,137,0.25);
  325. border-radius: 17px;
  326. height: 78px;
  327. margin: 0 17px;
  328. padding: 15px 10px;
  329. box-sizing: border-box;
  330. display: flex;
  331. align-items: center;
  332. font-family: PingFang SC, PingFang SC;
  333. font-weight: 400;
  334. font-size: 12px;
  335. color: #000000;
  336. .box-cont{
  337. width: calc(100% / 5);
  338. display: flex;
  339. flex-direction: column;
  340. align-items: center;
  341. .box-cont-icon{
  342. margin-bottom: 4px;
  343. color: #fff;
  344. }
  345. }
  346. }
  347. .list-box{
  348. background: #FFFFFF;
  349. border-radius: 12px;
  350. margin: 25px 17px;
  351. padding: 16px;
  352. box-sizing: border-box;
  353. display: flex;
  354. flex-direction: column;
  355. flex: 1;
  356. overflow: hidden;
  357. .list-title{
  358. display: flex;
  359. justify-content: space-between;
  360. align-items: center;
  361. font-family: PingFang SC, PingFang SC;
  362. font-weight: 500;
  363. font-size: 17px;
  364. color: #000000;
  365. margin-bottom: 23px;
  366. }
  367. .list-ul{
  368. flex: 1;
  369. display: flex;
  370. flex-direction: column;
  371. overflow: auto;
  372. .list-li{
  373. display: flex;
  374. align-items: center;
  375. justify-content: space-between;
  376. font-family: PingFang SC, PingFang SC;
  377. font-weight: 500;
  378. margin-bottom: 12px;
  379. .list-li-lf{
  380. display: flex;
  381. align-items: center;
  382. font-size: 15px;
  383. color: #000000;
  384. }
  385. .list-li-ri{
  386. font-size: 12px;
  387. color: @font-color2;
  388. text-align: right;
  389. .list-li-ri-num{
  390. font-weight: 400;
  391. font-size: 10px;
  392. color: #8D8D8D;
  393. }
  394. }
  395. }
  396. .list-li:last-child{
  397. margin-bottom: 0;
  398. }
  399. }
  400. .list-ul::-webkit-scrollbar{
  401. width: 0;
  402. }
  403. }
  404. .pop-content{
  405. display: flex;
  406. flex-direction: column;
  407. .pop-title{
  408. padding: 17px;
  409. border-bottom: 1px solid #F2F2F2;
  410. display: flex;
  411. align-items: center;
  412. font-family: PingFang SC, PingFang SC;
  413. font-weight: 500;
  414. font-size: 17px;
  415. color: #000000;
  416. .title{
  417. flex: 1;
  418. display: flex;
  419. justify-content: center;
  420. }
  421. }
  422. .tree{
  423. display: flex;
  424. height: 300px;
  425. overflow: hidden;
  426. .tree-lf{
  427. display: flex;
  428. flex-direction: column;
  429. width: 67px;
  430. overflow: auto;
  431. .tree-lf-icon{
  432. height: 67px;
  433. padding: 16px;
  434. box-sizing: border-box;
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. }
  439. .active-bg{
  440. background: #ECEFFC;
  441. }
  442. }
  443. .tree-lf::-webkit-scrollbar{
  444. width: 0;
  445. }
  446. .tree-ri{
  447. margin-left: 10px;
  448. margin-right: 17px;
  449. flex: 1;
  450. overflow: auto;
  451. .tree-ri-title{
  452. margin: 10px 0 4px;
  453. font-family: PingFang SC, PingFang SC;
  454. font-weight: 500;
  455. font-size: 15px;
  456. color: #000000;
  457. }
  458. .tree-ul{
  459. .tree-li{
  460. background: #F2F2F2;
  461. border-radius: 8px;
  462. border: 1px solid #F2F2F2;
  463. padding: 14px 16px;
  464. display: flex;
  465. align-items: center;
  466. margin-bottom: 12px;
  467. .tree-li-cont{
  468. margin-left: 12px;
  469. font-family: PingFang SC, PingFang SC;
  470. font-weight: 400;
  471. font-size: 12px;
  472. color: #8D8D8D;
  473. .tree-li-text{
  474. font-weight: 500;
  475. font-size: 15px;
  476. color: @theme-color1;
  477. }
  478. .tree-li-address{
  479. display: flex;
  480. align-items: center;
  481. }
  482. }
  483. }
  484. .tree-active{
  485. background: #FAFBFF;
  486. border: 1px solid @theme-color1;
  487. }
  488. }
  489. }
  490. .tree-ri::-webkit-scrollbar{
  491. width: 0;
  492. }
  493. }
  494. .pop-btn{
  495. margin: 17px;
  496. .btn{
  497. height: 40px;
  498. border-radius: 50px;
  499. font-family: PingFang SC, PingFang SC;
  500. font-weight: 500;
  501. font-size: 15px;
  502. color: #FFFFFF;
  503. }
  504. :deep(.van-button__text) {
  505. display: flex;
  506. align-items: center;
  507. }
  508. }
  509. .pop-list{
  510. flex: 1;
  511. display: flex;
  512. flex-direction: column;
  513. overflow: auto;
  514. .pop-list-box{
  515. display: flex;
  516. padding: 17px 17px 0;
  517. .pop-list-ul{
  518. padding-bottom: 12px;
  519. flex: 1;
  520. margin-left: 8px;
  521. border-bottom: 1px solid #F2F2F2;
  522. box-sizing: border-box;
  523. .pop-list-li{
  524. display: flex;
  525. align-items: center;
  526. justify-content: space-between;
  527. font-family: PingFang SC, PingFang SC;
  528. margin-bottom: 4px;
  529. font-weight: 400;
  530. font-size: 12px;
  531. color: @font-color2;
  532. .pop-list-li-title{
  533. font-weight: 500;
  534. font-size: 15px;
  535. color: #000000;
  536. }
  537. .pop-list-li-status{
  538. font-weight: 500;
  539. font-size: 15px;
  540. color: @theme-color1 !important;
  541. }
  542. }
  543. .pop-list-li div:last-child{
  544. color: #8D8D8D;
  545. }
  546. }
  547. }
  548. }
  549. .pop-list::-webkit-scrollbar{
  550. width: 0;
  551. }
  552. .pop-ul{
  553. flex: 1;
  554. display: flex;
  555. flex-direction: column;
  556. overflow: auto;
  557. margin: 16px 16px 0;
  558. .pop-li{
  559. display: flex;
  560. align-items: center;
  561. justify-content: space-between;
  562. margin-bottom: 16px;
  563. .pop-li-lf{
  564. display: flex;
  565. align-items: center;
  566. font-family: PingFang SC, PingFang SC;
  567. font-weight: 400;
  568. font-size: 15px;
  569. color: #4F4F4F;
  570. .pop-address{
  571. font-size: 12px;
  572. color: #8D8D8D;
  573. }
  574. }
  575. }
  576. }
  577. }
  578. }
  579. </style>