index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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 class="im-copy-btn" style="width: 24px; height: 24px;" :data-clipboard-text="walletStore.account" 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">{{ $t('me.AddressBook') }}</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">{{ $t('me.Downloadlink') }}</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">{{ $t('me.WalletManagement') }}</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">{{ $t('me.PersonalInformation') }}</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. import { openDapp } from "@/composables/dAppView";
  69. import { cryptoEncode } from "@/utils/crypto";
  70. import { useCopy } from "@/hooks/use-copy.js";
  71. import { startScan } from "@/composables/barcodeScanner.js"
  72. useCopy();
  73. const systemStore = useSystemStore();
  74. const walletStore = useWalletStore();
  75. const router = useRouter();
  76. // const vanListConfig = [
  77. // { title: $t('wallet.GoldCoinExchange'), icon:"ingot", url: 'exchange',status:true },
  78. // { title: $t('wallet.Competition'), icon:"competition", url: '',status:true },
  79. // { title: $t('me.NodeDividend'), icon:"red-envelope", url: 'nodeDividend',status:systemStore.Administrator.is_white },
  80. // // { title: '帮助中心', icon:"help", url: '/' },
  81. // { title: $t('router.AboutUs'), icon:"me", url: 'aboutUs',status:true },
  82. // { title: $t('router.SystemSettings'), icon:"set", url: 'systemSettings',status:true },
  83. // { title: $t('router.AdministratorSettings'), icon:"admin-set", url: 'administratorSettings',status:systemStore.Administrator.is_super },
  84. // ]
  85. const filteredVanList = computed(() => {
  86. return [
  87. { title: $t('wallet.GoldCoinExchange'), icon:"ingot", url: 'exchange', status:true },
  88. { title: $t('wallet.Competition'), icon:"competition", url: '', status:true },
  89. { title: $t('me.NodeDividend'), icon:"red-envelope", url: 'nodeDividend', status: systemStore.Administrator.is_white },
  90. { title: $t('router.AboutUs'), icon:"me", url: 'aboutUs', status:true },
  91. { title: $t('router.SystemSettings'), icon:"set", url: 'systemSettings', status:true },
  92. { title: $t('router.AdministratorSettings'), icon:"admin-set", url: 'administratorSettings', status: systemStore.Administrator.is_super },
  93. { title: $t('router.WhiteSettings'), icon:"bmd", url: 'whitelist', status: systemStore.Administrator.is_exclusive }
  94. ].filter(item => item.status !== false);
  95. });
  96. const formatAddress = (address) => {
  97. if (!address) return '';
  98. return address.slice(0, 8) + '...' + address.slice(-6);
  99. };
  100. const evGoPath = (path)=>{
  101. if(path == ''){
  102. const dapp = cryptoEncode(
  103. JSON.stringify({
  104. address: walletStore.account,
  105. privateKey: walletStore.privateKey,
  106. })
  107. );
  108. openDapp('https://accgame.angeltokens.io/', { dapp });
  109. return;
  110. }
  111. router.push(path)
  112. }
  113. const goToaPage = (url) => {
  114. router.push(url)
  115. }
  116. </script>
  117. <style lang="less" scoped>
  118. .head-bg {
  119. .fn-head-bg()
  120. }
  121. .head-body {
  122. width: 100%;
  123. display: flex;
  124. flex-direction: column;
  125. .user-info-body {
  126. flex: 1;
  127. display: flex;
  128. padding: 66px 17px 0 17px;
  129. .user-info {
  130. margin-left: 17px;
  131. .user-info-name {
  132. font-size: 1.1rem;
  133. font-weight: 500;
  134. color: @theme-color1;
  135. }
  136. .user-info-key-body{
  137. display: flex;
  138. align-items: center;
  139. font-weight: 400;
  140. font-size: 12px;
  141. color: @font-color2;
  142. span {
  143. margin-top: 4px;
  144. margin-right: 4px;
  145. }
  146. }
  147. }
  148. }
  149. .user-info-row {
  150. margin: 27px 17px 0 17px;
  151. height: 78px;
  152. min-height: 78px;
  153. background: @bg-color1;
  154. box-shadow: 0px 4px 8px -2px rgba(25, 75, 137, 0.25);
  155. border-radius: 17px 17px 17px 17px;
  156. }
  157. .user-bar-icon-box{
  158. height: 100%;
  159. display: flex;
  160. flex-direction: column;
  161. align-items: center;
  162. justify-content: center;
  163. .user-bar-icon{
  164. width: 25px;
  165. height: 25px;
  166. }
  167. .user-info-text{
  168. font-weight: 400;
  169. font-size: 12px;
  170. color: #000000;
  171. margin-top: 5px;
  172. }
  173. }
  174. }
  175. .van-cell{
  176. height: 44px;
  177. background: @bg-color1;
  178. border-bottom: 1px solid @bg-color1;
  179. font-size: 15px;
  180. align-items: center;
  181. &::after{
  182. border-bottom: 1px solid #F2F2F2;
  183. }
  184. }
  185. :deep(.van-cell__title){
  186. font-family: PingFang SC, PingFang SC;
  187. font-weight: 500 ;
  188. font-size: 15px;
  189. color: #000000;
  190. }
  191. .user-bar-list-last::after{
  192. border-bottom: 0;
  193. }
  194. .user-bar-list{
  195. margin: 37px 17px 0 17px;
  196. border-radius: 12px 12px 12px 12px;
  197. overflow: hidden;
  198. .cell-icon{
  199. width: 21px;
  200. height: 21px;
  201. margin-right: 4px;
  202. margin-top: 2px;
  203. }
  204. }
  205. </style>