@ -25,7 +25,9 @@
< / view >
< / view >
< view class = "inputcon" >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; " placeholder = "Please enter the recipient address" class = "input1" v -model = " recipientAddress " / >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; "
placeholder = "Please enter the recipient address" class = "input1"
v - model = "recipientAddress" / >
< image src = "../../../../static/tongyonh/Frame330.png" mode = "aspectFit" class = "img1" > < / image >
< / view >
< / view >
@ -41,14 +43,16 @@
< view class = "textt" >
{ { addressInfo . type } }
< / view >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; " placeholder = "0.0000000" class = "input3" v -model = " transAmount " / >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; "
placeholder = "0.0000000" class = "input3" v - model = "transAmount" / >
< / view >
< text > ≈ < / text >
< view class = "inputc flex" >
< view class = "textt" >
USD
< / view >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; " placeholder = "0.0000000" class = "input3" / >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; "
placeholder = "0.0000000" class = "input3" / >
< / view >
< / view >
< view class = "top flex bottom" >
@ -69,7 +73,8 @@
< / view >
< view class = "inputcon" >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; " placeholder = "Please enter a note (off-chain)" class = "input1" / >
< input type = "text" value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; "
placeholder = "Please enter a note (off-chain)" class = "input1" / >
< / view >
< / view >
@ -81,7 +86,8 @@
< / view >
< view class = "inputcon" >
< input type = "text" v -model = " fee " value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; " placeholder = "Please enter a note (off-chain)" class = "input2" / >
< input type = "text" v -model = " fee " value = "" placeholder -style = " font -size : 30rpx ; color : # D0D0D2 ; "
placeholder = "Please enter a note (off-chain)" class = "input2" / >
< view class = "rig" >
< text class = "text1 ac" > { { addressInfo . type } } < / text > | < text class = "text2" > USDT < / text >
< / view >
@ -91,7 +97,7 @@
< / view >
< view class = "big_con" v-if ="showBottom" >
< view class = "tiao" @click ="show=false" >
< view class = "tiao" @click ="cancelAll" >
< / view >
< view class = "bigtitle" >
Transfer confirmation
@ -183,13 +189,13 @@
< view class = "bottom_con" >
< image src = "../../../../static/tongyonh/alert-circle.png" mode = "aspectFit" class = "img1" > < / image >
< view class = "text1 red" >
Fingerprint not recognized . < br > < text @ click = "" > Try again < / text > .
Fingerprint not recognized . < br > < text @click ="confirmTo('try')" > Try again < / text > .
< / view >
< view class = "flex con" >
< view class = "textt1" @click ="goPassword" >
Use Password
< / view >
< view class = "textt2" >
< view class = "textt2" @click ="cancelFail" >
Cancel
< / view >
< / view >
@ -259,9 +265,19 @@
}
} ,
methods : {
cancelAll ( ) {
this . show = false ;
this . showBottom = false ;
} ,
cancelFail ( ) {
this . $walletUtil . printCancel ( )
this . fingerFail = false
this . showBottom = true ;
this . showFinger = false ;
} ,
cancel ( ) {
this . show = false
this . showFinger = false
this . showBottom = true ;
this . $walletUtil . printCancel ( )
} ,
/ / 不 用 指 纹 去 密 码 页
@ -273,7 +289,10 @@
} )
} ,
/ / 唤 起 指 纹
confirmTo ( ) {
confirmTo ( type ) {
if ( type == 'try' ) {
this . fingerFail = false ;
}
this . show = true
this . showFinger = true
this . showBottom = false ;
@ -385,18 +404,129 @@
/ / # i f d e f A P P - P L U S
plus . fingerprint . authenticate ( function ( ) {
plus . nativeUI . closeWaiting ( ) ; / / 兼 容 A n d r o i d 平 台 关 闭 等 待 框
console . log ( that . transInfoPass , 5656 )
console . log ( that . addressInfo , 56556656 )
if ( that . addressInfo . type == 'TRX' ) {
console . log ( that . addressInfo . type , 11111 )
console . log ( that . transInfoPass , 2222 )
/ / i f ( ! t h i s . c o n t r a c t A d d r e s s ) {
/ / 指 纹 通 过 转 账 成 功
that . $TronUtil . sendTransaction ( that . transInfoPass . fromAddress , that . transInfoPass . privateKey , that . transInfoPass . toAddress , that . transInfoPass . amount )
. then ( ( res ) => {
console . log ( 2222211111 )
that . showFinger = false
that . showBottom = false ;
that . fingerSuccess = true ;
uni . showToast ( {
title : 'Transfer succeeded' ,
icon : 'none' ,
duration : 1500
} )
setTimeout ( ( ) => {
that . fingerSuccess = false ;
uni . reLaunch ( {
url : '/pages/menu/wallet/index'
} )
} , 1000 )
} ) . catch ( err => {
console . log ( err , 'cuowu' )
that . showFinger = false ;
that . showBottom = true ;
uni . showToast ( {
title : 'Transfer failed, please confirm the information is correct' ,
icon : 'none' ,
duration : 1500
} )
} )
/ / } e l s e {
/ / t h i s . $ T r o n U t i l . s e n d R a w T r a n s a c t i o n ( t h i s . i n f o . a d d r e s s , t h i s . i n f o . p r i v a t e K e y , t h i s . t o A d d r e s s , t h i s . t o V a l u e , ' ' , t h i s . c o n t r a c t A d d r e s s )
/ / . t h e n ( ( r e s ) = > {
/ / u n i . s h o w T o a s t ( {
/ / t i t l e : ' S u c c e s s f u l l y ' ,
/ / i c o n : ' s u c c e s s ' ,
/ / d u r a t i o n : 2 0 0 0
/ / } )
/ / t h i s . s h o w 2 = f a l s e ;
/ / u n i . r e L a u n c h ( {
/ / u r l : ' / p a g e s / m e n u / w a l l e t / i n d e x '
/ / } )
/ / } ) . c a t c h ( e r r = > {
/ / c o n s o l e . l o g ( e r r )
/ / u n i . s h o w T o a s t ( {
/ / t i t l e : ' F i n g e r p r i n t i d e n t i f i c a t i o n s u c c e e d e d ' ,
/ / t i t l e : e r r ,
/ / i c o n : ' n o n e ' ,
/ / d u r a t i o n : 1 5 0 0 ,
/ / d u r a t i o n : 2 0 0 0
/ / } )
/ / 存 储 设 置 里 开 启 指 纹 后 的 状 态 , 隐 藏 使 用 密 码
/ / } )
/ / }
}
/ / u n i . s e t S t o r a g e S y n c ( ' f i n g e r P a s s ' , t r u e )
if ( that . addressInfo . type == 'ETH' ) {
console . log ( that . addressInfo . type , 11111 )
console . log ( that . transInfoPass , 2222 )
/ / i f ( ! t h i s . c o n t r a c t A d d r e s s ) {
/ / 指 纹 通 过 转 账 成 功
that . $EthUtil . transaction ( that . transInfoPass . fromAddress , that . transInfoPass . privateKey , that . transInfoPass . toAddress , that . transInfoPass . amount )
. then ( ( res ) => {
console . log ( 2222211111 )
that . showFinger = false
that . showBottom = false ;
that . fingerSuccess = true ;
console . log ( that . fingerSuccess , 454545 )
uni . showToast ( {
title : 'Transfer succeeded' ,
icon : 'none' ,
duration : 1500
} )
setTimeout ( ( ) => {
that . fingerSuccess = false ;
uni . reLaunch ( {
url : '/pages/menu/wallet/index'
} )
} , 1000 )
} ) . catch ( err => {
console . log ( err , 'cuowu' )
that . showFinger = false ;
that . showBottom = true ;
uni . showToast ( {
title : 'Transfer failed, please confirm the information is correct' ,
icon : 'none' ,
duration : 1500
} )
} )
/ / } e l s e {
/ / t h i s . $ T r o n U t i l . s e n d R a w T r a n s a c t i o n ( t h i s . i n f o . a d d r e s s , t h i s . i n f o . p r i v a t e K e y , t h i s . t o A d d r e s s , t h i s . t o V a l u e , ' ' , t h i s . c o n t r a c t A d d r e s s )
/ / . t h e n ( ( r e s ) = > {
/ / u n i . s h o w T o a s t ( {
/ / t i t l e : ' S u c c e s s f u l l y ' ,
/ / i c o n : ' s u c c e s s ' ,
/ / d u r a t i o n : 2 0 0 0
/ / } )
/ / t h i s . s h o w 2 = f a l s e ;
/ / u n i . r e L a u n c h ( {
/ / u r l : ' / p a g e s / m e n u / w a l l e t / i n d e x '
/ / } )
/ / } ) . c a t c h ( e r r = > {
/ / c o n s o l e . l o g ( e r r )
/ / u n i . s h o w T o a s t ( {
/ / t i t l e : e r r ,
/ / i c o n : ' n o n e ' ,
/ / d u r a t i o n : 2 0 0 0
/ / } )
/ / } )
/ / }
}
} , function ( e ) {
switch ( e . code ) {
case e . AUTHENTICATE_MISMATCH :
@ -476,6 +606,7 @@
/ / 判 断 是 否 从 地 址 页 有 传 地 址 过 来
if ( uni . getStorageSync ( 'myTransAddress' ) ) {
this . recipientAddress = uni . getStorageSync ( 'myTransAddress' ) . address
uni . removeStorageSync ( 'myTransAddress' )
}
/ / 每 次 进 来 拿 缓 存 里 有 没 有 指 纹
if ( uni . getStorageSync ( 'fingerPass' ) ) {