Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dapp-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhanglian
dapp-web
Commits
381a2c62
提交
381a2c62
authored
2月 14, 2022
作者:
路兰欣
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
+ 链接弹窗
上级
19a7b1ae
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
125 行增加
和
11 行删除
+125
-11
MConnectWallet.vue
src/components/MConnectWallet.vue
+95
-0
en.js
src/i18n/locale/en.js
+2
-0
ja.js
src/i18n/locale/ja.js
+3
-0
ko.js
src/i18n/locale/ko.js
+3
-0
zh.js
src/i18n/locale/zh.js
+2
-0
wallet.js
src/store/modules/wallet.js
+13
-8
thinkiumBridge.vue
src/views/thinkiumBridge/thinkiumBridge.vue
+7
-3
没有找到文件。
src/components/MConnectWallet.vue
0 → 100644
浏览文件 @
381a2c62
<
template
>
<div
class=
"connect-wallet"
v-if=
"showConnectWalletModal"
@
click
.
self=
"handleClose"
>
<div
class=
"dialog"
:show-close=
"false"
>
<div
class=
"content"
>
<div
class=
"title"
>
{{
$t
(
'connectWallet'
)
}}
</div>
<ul
class=
"wallet-list"
>
<li
class=
"wallet-item pointer"
@
click=
"connectMetaMask"
>
{{
checkEnvironment
()
?
$t
(
'connectMetamask'
)
:
$t
(
'installMetamask'
)
}}
</li>
</ul>
</div>
</div>
</div>
</
template
>
<
script
>
import
{
createNamespacedHelpers
}
from
'vuex'
;
import
{
connectWallet
}
from
'@/service/loginService'
;
import
{
checkEnvironment
}
from
'@/api/demoMETAMASK'
const
{
mapState
,
mapMutations
}
=
createNamespacedHelpers
(
'wallet'
)
export
default
{
name
:
'MConnectWallet'
,
components
:
{
},
data
()
{
return
{
checkEnvironment
,
}
},
computed
:
{
...
mapState
([
'showConnectWalletModal'
]),
},
methods
:
{
...
mapMutations
([
'CHANGE_CONNECT_WALLET_MODAL_STATUS'
]),
handleClose
()
{
this
.
CHANGE_CONNECT_WALLET_MODAL_STATUS
(
false
)
},
connectMetaMask
()
{
if
(
checkEnvironment
())
{
connectWallet
();
}
else
{
window
.
open
(
'https://metamask.io/'
)
}
this
.
CHANGE_CONNECT_WALLET_MODAL_STATUS
(
false
)
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.connect-wallet
{
position
:
fixed
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
background-color
:
rgba
(
$color
:
#000000
,
$alpha
:
0
.7
);
z-index
:
100
;
color
:
#333
;
.content
{
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
15vh
;
margin
:
0
auto
;
width
:
6
.6rem
;
height
:
6rem
;
background
:
#FFF
;
padding
:
.39rem
.32rem
.78rem
;
.title
{
font-size
:
.3rem
;
font-weight
:
500
;
color
:
#333
;
margin-bottom
:
.38rem
;
}
.wallet-list
{
padding
:
.2rem
;
.wallet-item
{
height
:
1rem
;
border
:
1px
solid
#eee
;
border-radius
:
.1rem
;
font-size
:
.3rem
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
&
:hover
{
border-color
:
$themeColor
;
}
}
}
}
}
</
style
>
src/i18n/locale/en.js
浏览文件 @
381a2c62
...
@@ -16,5 +16,7 @@ export default {
...
@@ -16,5 +16,7 @@ export default {
chooseToken
:
'Choose Token'
,
chooseToken
:
'Choose Token'
,
pleaseLinkTheWallet
:
'Please link the wallet'
,
pleaseLinkTheWallet
:
'Please link the wallet'
,
OK
:
'OK'
,
OK
:
'OK'
,
connectMetamask
:
"Connect Metamask"
,
installMetamask
:
"Install Metamask"
,
}
}
src/i18n/locale/ja.js
浏览文件 @
381a2c62
...
@@ -16,4 +16,6 @@ export default {
...
@@ -16,4 +16,6 @@ export default {
chooseToken
:
'選ぶToken'
,
chooseToken
:
'選ぶToken'
,
pleaseLinkTheWallet
:
'ウォレットをリンクしてください'
,
pleaseLinkTheWallet
:
'ウォレットをリンクしてください'
,
OK
:
'わかった'
,
OK
:
'わかった'
,
connectMetamask
:
"メタマスクを接続する"
,
installMetamask
:
"Metamaskをインストールする"
,
}
}
\ No newline at end of file
src/i18n/locale/ko.js
浏览文件 @
381a2c62
...
@@ -16,5 +16,7 @@ export default {
...
@@ -16,5 +16,7 @@ export default {
chooseToken
:
'선택하다Token'
,
chooseToken
:
'선택하다Token'
,
pleaseLinkTheWallet
:
'지갑을 연결해주세요'
,
pleaseLinkTheWallet
:
'지갑을 연결해주세요'
,
OK
:
'확인'
,
OK
:
'확인'
,
connectMetamask
:
"메타마스크 연결"
,
installMetamask
:
"메타마스크 설치"
,
}
}
\ No newline at end of file
src/i18n/locale/zh.js
浏览文件 @
381a2c62
...
@@ -16,4 +16,6 @@ export default {
...
@@ -16,4 +16,6 @@ export default {
chooseToken
:
'选择Token'
,
chooseToken
:
'选择Token'
,
pleaseLinkTheWallet
:
'请链接钱包'
,
pleaseLinkTheWallet
:
'请链接钱包'
,
OK
:
'好的'
,
OK
:
'好的'
,
connectMetamask
:
'连接Metamask'
,
installMetamask
:
'安装Metamask'
,
}
}
src/store/modules/wallet.js
浏览文件 @
381a2c62
...
@@ -5,20 +5,25 @@ const state = {
...
@@ -5,20 +5,25 @@ const state = {
currentWalletAddress
:
''
,
currentWalletAddress
:
''
,
interfaceSignature
:
''
,
interfaceSignature
:
''
,
expireTime
:
''
,
expireTime
:
''
,
showConnectWalletModal
:
false
,
};
};
const
mutations
=
{
const
mutations
=
{
SET_CURRENT_WALLET_ADDRESS
:
(
state
,
address
)
=>
{
SET_CURRENT_WALLET_ADDRESS
:
(
state
,
address
)
=>
{
state
.
currentWalletAddress
=
address
;
state
.
currentWalletAddress
=
address
;
},
},
SET_INTERFACE_SIGNATURE
:
(
state
,
signature
)
=>
{
SET_INTERFACE_SIGNATURE
:
(
state
,
signature
)
=>
{
state
.
interfaceSignature
=
signature
;
state
.
interfaceSignature
=
signature
;
},
},
SET_EXPIRE_TIME
:
(
state
,
expireTime
)
=>
{
SET_EXPIRE_TIME
:
(
state
,
expireTime
)
=>
{
state
.
expireTime
=
expireTime
;
state
.
expireTime
=
expireTime
;
}
},
CHANGE_CONNECT_WALLET_MODAL_STATUS
:
(
state
,
status
)
=>
{
console
.
log
(
'--status'
,
status
);
state
.
showConnectWalletModal
=
status
;
},
}
}
...
...
src/views/thinkiumBridge/thinkiumBridge.vue
浏览文件 @
381a2c62
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
</li>
</li>
</ul>
</ul>
</EDialog>
</EDialog>
<MConnectWallet/>
<van-loading
class=
"loading-bg"
type=
"spinner"
color=
"#303030"
size=
"24px"
v-show=
"pageLoading"
/>
<van-loading
class=
"loading-bg"
type=
"spinner"
color=
"#303030"
size=
"24px"
v-show=
"pageLoading"
/>
</div>
</div>
...
@@ -70,8 +71,9 @@ import EDialog from '@/components/EDialog.vue';
...
@@ -70,8 +71,9 @@ import EDialog from '@/components/EDialog.vue';
import
{
createNamespacedHelpers
}
from
'vuex'
;
import
{
createNamespacedHelpers
}
from
'vuex'
;
import
{
getTokenList
}
from
'@/utils/data/tokenList'
import
{
getTokenList
}
from
'@/utils/data/tokenList'
import
{
connectWallet
}
from
'@/service/loginService'
import
{
connectWallet
}
from
'@/service/loginService'
import
MConnectWallet
from
'@/components/MConnectWallet.vue'
const
{
mapState
:
mapStateWallet
}
=
createNamespacedHelpers
(
'wallet'
);
const
{
mapState
:
mapStateWallet
,
mapMutations
:
mapMutationsWallet
}
=
createNamespacedHelpers
(
'wallet'
);
const
{
mapState
:
mapStateNetwork
}
=
createNamespacedHelpers
(
'network'
);
const
{
mapState
:
mapStateNetwork
}
=
createNamespacedHelpers
(
'network'
);
const
erc20Abi
=
require
(
'../../abi/ERC20.json'
);
const
erc20Abi
=
require
(
'../../abi/ERC20.json'
);
...
@@ -140,9 +142,11 @@ export default {
...
@@ -140,9 +142,11 @@ export default {
}
}
},
},
components
:
{
components
:
{
EDialog
EDialog
,
MConnectWallet
},
},
methods
:
{
methods
:
{
...
mapMutationsWallet
([
'CHANGE_CONNECT_WALLET_MODAL_STATUS'
]),
async
init
()
{
async
init
()
{
this
.
tokenListOrigin
=
getTokenList
(
this
.
chainId
);
this
.
tokenListOrigin
=
getTokenList
(
this
.
chainId
);
this
.
tokenListTKM
=
this
.
getTokensByChainName
(
'thk'
)
||
[];
this
.
tokenListTKM
=
this
.
getTokensByChainName
(
'thk'
)
||
[];
...
@@ -366,7 +370,7 @@ export default {
...
@@ -366,7 +370,7 @@ export default {
},
},
toCannectWallet
()
{
toCannectWallet
()
{
connectWallet
()
this
.
CHANGE_CONNECT_WALLET_MODAL_STATUS
(
true
);
}
}
},
},
directives
:
{
directives
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论