|
|
@@ -2,19 +2,44 @@
|
|
|
import homeIndex from "@/views/home/home-index.vue";
|
|
|
import myIndex from "@/views/my/my-index.vue";
|
|
|
import convertIndex from "@/views/convert/convert-index.vue";
|
|
|
+import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
|
|
|
// import tokenpocketBnb from "@/common/wallet/tokenpocket-wallet/tokenpocket-bnb";
|
|
|
export default {
|
|
|
components: { homeIndex, myIndex, convertIndex },
|
|
|
data() {
|
|
|
return {
|
|
|
- tab_index: 1
|
|
|
+ tab_index: 1,
|
|
|
+ address:''
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getMyData()
|
|
|
+ this.getAccount()
|
|
|
// this.handlerDateDurationCurrent()
|
|
|
},
|
|
|
methods: {
|
|
|
+ abbreviateString(str ){
|
|
|
+ let startLength=4;
|
|
|
+ let endLength=4;
|
|
|
+ if (str.length <= startLength + endLength + 1) {
|
|
|
+ return str; // 如果字符串长度不足以被截断,则返回原字符串
|
|
|
+ }
|
|
|
+ return str.slice(0, startLength) + '...' + str.slice(-endLength);
|
|
|
+ },
|
|
|
+ async getAccount(){
|
|
|
+ console.log('---------------------------------',tokenpocketBnb)
|
|
|
+ tokenpocketBnb.getAccounts().then(async (Address) => {
|
|
|
+ console.log(Address)
|
|
|
+ if (Address) {
|
|
|
+ this.address=Address
|
|
|
+ } else {
|
|
|
+ this.$message.error("获取信息失败")
|
|
|
+ }
|
|
|
+ }).catch((e)=>{
|
|
|
+ console.log(e)
|
|
|
+ // tools.goToError(2)
|
|
|
+ })
|
|
|
+ },
|
|
|
getMyData() {
|
|
|
// let token = uni.getStorageSync('token')
|
|
|
// if (token) {
|
|
|
@@ -51,13 +76,13 @@ export default {
|
|
|
:src="require('@/assets/img/logo/logo.png')"
|
|
|
fit=""></el-image>
|
|
|
<div class="fs-15">
|
|
|
- sdfsdfsfsd222
|
|
|
+ {{abbreviateString(address)}}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="content-b p-20 box-sizing-border">
|
|
|
<div class="scroll-view-css">
|
|
|
<homeIndex v-if="tab_index === 1"></homeIndex>
|
|
|
- <convertIndex v-if="tab_index === 2"></convertIndex>
|
|
|
+ <convertIndex v-else-if="tab_index === 2"></convertIndex>
|
|
|
<myIndex v-else></myIndex>
|
|
|
</div>
|
|
|
<div class="tab-b align-items-center flex-justify-space b-rad-10 bgc-f">
|