index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <div class="container">
  3. <div class="head-bg"/>
  4. <div class="head-body">
  5. <div class="user-info-body">
  6. <van-image
  7. width="46px"
  8. height="46px"
  9. fit="cover"
  10. round
  11. :src="walletStore.avatar"
  12. />
  13. <div class="user-info">
  14. <div class="user-info-name">{{ walletStore.username }}</div>
  15. <div class="user-info-key-body">
  16. <span>{{ formatAddress(walletStore.account) }}</span>
  17. <svg-icon style="width: 24px; height: 24px;" name="copy" />
  18. </div>
  19. </div>
  20. </div>
  21. <van-row justify="end" class="user-info-row">
  22. <van-col span="6" >
  23. <div class="user-bar-icon-box">
  24. <svg-icon class="user-bar-icon" name="address-book" @click="goToaPage('meAddressManagement')"/>
  25. <span class="user-info-text">地址薄</span>
  26. </div>
  27. </van-col>
  28. <van-col span="6">
  29. <div class="user-bar-icon-box">
  30. <svg-icon class="user-bar-icon" name="bar-url" @click="goToaPage('download')"/>
  31. <span class="user-info-text">下载链接</span>
  32. </div>
  33. </van-col>
  34. <van-col span="6">
  35. <div class="user-bar-icon-box" @click="goToaPage('walletManagement')">
  36. <svg-icon class="user-bar-icon" name="wallet"/>
  37. <span class="user-info-text">钱包管理</span>
  38. </div>
  39. </van-col>
  40. <van-col span="6">
  41. <div class="user-bar-icon-box" @click="goToaPage('personalInformation')">
  42. <svg-icon class="user-bar-icon" name="id-card"/>
  43. <span class="user-info-text">个人资料</span>
  44. </div>
  45. </van-col>
  46. </van-row>
  47. </div>
  48. <!-- 用户索引栏 -->
  49. <van-list class="user-bar-list">
  50. <van-cell
  51. v-for="(item, index) in filteredVanList"
  52. :key="index"
  53. :class="index == filteredVanList.length - 1 ? 'user-bar-list-last' : ''"
  54. :title="item.title"
  55. is-link
  56. @click="evGoPath(item.url)"
  57. >
  58. <template #icon>
  59. <svg-icon class="cell-icon" :name="item.icon" />
  60. </template>
  61. </van-cell>
  62. </van-list>
  63. </div>
  64. </template>
  65. <script setup>
  66. import { useSystemStore } from "@/stores/modules/systemStore"
  67. import { useWalletStore } from "@/stores/modules/walletStore";
  68. const systemStore = useSystemStore();
  69. const walletStore = useWalletStore();
  70. const router = useRouter();
  71. const vanListConfig = [
  72. { title: '元宝兑换', icon:"ingot", url: 'exchange',status:true },
  73. { title: '竞赛', icon:"competition", url: '/',status:true },
  74. { title: '节点分红', icon:"red-envelope", url: 'nodeDividend',status:systemStore.Administrator.is_white },
  75. // { title: '帮助中心', icon:"help", url: '/' },
  76. { title: $t('router.AboutUs'), icon:"me", url: 'aboutUs',status:true },
  77. { title: '系统设置', icon:"set", url: 'systemSettings',status:true },
  78. { title: '管理员设置', icon:"admin-set", url: 'administratorSettings',status:systemStore.Administrator.is_super },
  79. ]
  80. const filteredVanList = computed(() => {
  81. return vanListConfig.filter(item => item.status !== false);
  82. });
  83. const formatAddress = (address) => {
  84. if (!address) return '';
  85. return address.slice(0, 8) + '...' + address.slice(-6);
  86. };
  87. const evGoPath = (path)=>{
  88. router.push(path)
  89. }
  90. const goToaPage = (url) => {
  91. router.push(url)
  92. }
  93. </script>
  94. <style lang="less" scoped>
  95. .head-bg {
  96. .fn-head-bg()
  97. }
  98. .head-body {
  99. width: 100%;
  100. display: flex;
  101. flex-direction: column;
  102. .user-info-body {
  103. flex: 1;
  104. display: flex;
  105. padding: 44px 17px 0 17px;
  106. .user-info {
  107. margin-left: 17px;
  108. .user-info-name {
  109. font-size: 1.1rem;
  110. font-weight: 500;
  111. color: @theme-color1;
  112. }
  113. .user-info-key-body{
  114. display: flex;
  115. align-items: center;
  116. font-weight: 400;
  117. font-size: 12px;
  118. color: @font-color2;
  119. span {
  120. margin-top: 4px;
  121. margin-right: 4px;
  122. }
  123. }
  124. }
  125. }
  126. .user-info-row {
  127. margin: 27px 17px 0 17px;
  128. height: 78px;
  129. min-height: 78px;
  130. background: @bg-color1;
  131. box-shadow: 0px 4px 8px -2px rgba(25, 75, 137, 0.25);
  132. border-radius: 17px 17px 17px 17px;
  133. }
  134. .user-bar-icon-box{
  135. height: 100%;
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. justify-content: center;
  140. .user-bar-icon{
  141. width: 25px;
  142. height: 25px;
  143. }
  144. .user-info-text{
  145. font-weight: 400;
  146. font-size: 12px;
  147. color: #000000;
  148. margin-top: 5px;
  149. }
  150. }
  151. }
  152. .van-cell{
  153. height: 42px;
  154. background: @bg-color1;
  155. border-bottom: 1px solid @bg-color1;
  156. font-size: 15px ;
  157. &::after{
  158. border-bottom: 1px solid #F2F2F2;
  159. }
  160. }
  161. .user-bar-list-last::after{
  162. border-bottom: 0;
  163. }
  164. .user-bar-list{
  165. margin: 37px 17px 0 17px;
  166. border-radius: 12px 12px 12px 12px;
  167. overflow: hidden;
  168. .cell-icon{
  169. width: 21px;
  170. height: 21px;
  171. margin-right: 4px;
  172. }
  173. }
  174. </style>