@ -7,12 +7,18 @@
<!-- < span class = "color-theme-1" > { { coin } } < / span > -- >
< / view >
< / template >
< template # right >
< v -link :to ="'/pages/assets/records?type='+type" >
< van -icon class = "fn-20 m-t-xs" name = "todo-list-o" / >
< / v - l i n k >
< / template >
< / v - h e a d e r >
< view class = "layout-main" >
< view class = "coin border-b p-x-lg p-md d-flex justify-between m-t-md" @click ="coinListShow=true" >
< view class = "fn-25 color-light" > { { coin } } < / view >
< view class = "fn-25 color-light" > { { coin } } < / view >
< view class = "d-flex align-center" >
{ { $t ( 'recharge.a0' ) } } < van -icon name = "arrow" / >
{ { $t ( 'recharge.a0' ) } }
< van -icon name = "arrow" / >
< / view >
< / view >
< view class = "bg-panel-3" style = "min-height: 100%; padding-bottom: 220rpx;" >
@ -32,19 +38,22 @@
size = "mini"
@ click = "changeRechargeType(2)"
: class = "rechargeType==2?'bor-active':'bg-panel-3 border'"
> ERC20 < / view >
> ERC20
< / view >
< view class = "rounded-xs p-x-lg p-y-ms m-r-md"
size = "mini"
@ click = "changeRechargeType(3)"
: class = "rechargeType==3?'bor-active':'bg-panel-3 border'"
> TRC20 < / view >
> TRC20
< / view >
< / view >
< / view >
< view class = "p-x-lg d-flex justify-between flex-wrap align-center p-y-xs" >
< view class = "color-light d-block w-max m-y-ms color-light fn-15" > { { $t ( "assets.b8" ) } } < / view >
< v -input v-model ="form.address" class="bg-form-panel-3 p-sm color-light w-max fn-13 rounded-xs" :placeholder="$t('assets.b9')" >
< v -input v -model = " form.address " class = "bg-form-panel-3 p-sm color-light w-max fn-13 rounded-xs"
: placeholder = "$t('assets.b9')" >
<!-- < template # right > -- >
<!-- & lt ; ! & ndash ; # ifdef H5 & ndash ; & gt ; -- >
<!-- < v -link tag = "span" : to = " { path : ' / pages / assets / address -list ' , query : { - - >
@ -59,7 +68,7 @@
<!-- < / template > -- >
< / v - i n p u t >
< view class = "color-sell fn-12 m-t-xs" >
{ { $t ( 'recharge.a5' ) } }
{ { $t ( 'recharge.a5' ) } }
< / view >
< / view >
< / view >
@ -70,15 +79,19 @@
{ { coin } } < / span >
< / view >
< view class = "d-flex align-end p-y-xs justify-between bg-form-panel-3 rounded-xs p-sm p-x-ms" >
< v -input type = "number" v-model ="form.amount" :min="withdrawFee.withdrawal_min" :max="withdrawFee.withdrawal_max" class=" w-8/12 color-light fn-13" :placeholder="$t('assets.c2')" > < / v-input >
< v -input type = "number" v -model = " form.amount " :min ="withdrawFee.withdrawal_min"
: max = "withdrawFee.withdrawal_max" class = " w-8/12 color-light fn-13"
: placeholder = "$t('assets.c2')" > < / v - i n p u t >
< view class = "d-flex align-end" >
< span class = "unit fn-16 flex-shrink" > { { coin } } < / span >
< view class = "all color-theme-1 m-l-md flex-shrink" @ click = "form.amount = withdrawFee.usable_balance" > { { $t ( "assets.c3" ) } } < / view >
< view class = "all color-theme-1 m-l-md flex-shrink" @ click = "form.amount = withdrawFee.usable_balance" >
{ { $t ( "assets.c3" ) } }
< / view >
< / view >
< / view >
< view class = "d-flex align-center p-y-xs justify-between fn-13" >
< span > { { $t ( 'common.c1' ) } } : < / span >
< span class = "color-light" > { { withdrawFee . withdrawal_min } } { { coin } } < / span >
< span > { { $t ( 'common.c1' ) } } : < / span >
< span class = "color-light" > { { withdrawFee . withdrawal_min } } { { coin } } < / span >
< / view >
< view class = "d-flex align-center p-y-xs m-t-ms justify-between color-light fn-15" >
< span > { { $t ( "assets.c4" ) } } : < / span >
@ -86,9 +99,10 @@
< / view >
< view class = "d-flex align-end p-y-xs justify-between bg-form-panel-3 rounded-xs p-y-sm" >
< v -input v-model ="coin=='USDT'&&rechargeType==3?withdrawFee.trc20:withdrawFee.withdrawal_fee" disabled class="p-x-ms color-light w-max fn-13 rounded-xs" :placeholder="$t('assets.b9')" >
< v -input v -model = " coin = = ' USDT ' & & rechargeType = = 3 ? withdrawFee.trc20 : withdrawFee.withdrawal_fee " disabled
class = "p-x-ms color-light w-max fn-13 rounded-xs" : placeholder = "$t('assets.b9')" >
< template # right >
{ { coin } }
{ { coin } }
< / template >
< / v - i n p u t >
< / view >
@ -100,6 +114,16 @@
< v -input type = "password" v-model ="form.password" class="p-x-ms color-light w-max fn-13 rounded-xs" :placeholder="$t('reg.a9')" >
< / v - i n p u t >
< / view >
< view class = "d-flex align-center p-y-xs m-t-ms justify-between color-light fn-15" >
< span > { { $t ( "reg.a8" ) } } : < / span >
<!-- < span class = "color-light" > { { withdrawFee . withdrawal_fee } } { { coin } } < / span > -- >
< / view >
< view class = "d-flex align-end p-y-xs justify-between bg-form-panel-3 rounded-xs p-y-sm" >
< v -input type = "password" v-model ="form.password" class="p-x-ms color-light w-max fn-13 rounded-xs" :placeholder="$t('reg.a9')" >
< / v - i n p u t >
< / view >
< / view >
@ -110,7 +134,7 @@
< li > · { { $t ( "assets.c7" ) } } 。 < / li >
< / ul >
< / view >
< view class = "rounded-md m-b-lg" v-if ="list.length" >
<!-- < view class = "rounded-md m-b-lg" v-if ="list.length" style="padding-bottom: 100px !important; " >
< view class = "title d-flex justify-between p-x-md p-y-xs align-center color-light" >
< span class = "fn-lg" > { { $t ( "assets.c8" ) } } < / span >
< / view >
@ -121,7 +145,7 @@
< th class = "p-b-md fn-left p-l-md" > { { $t ( "assets.c9" ) } } < / th >
< th class = "p-b-md fn-left" > { { $t ( "assets.d0" ) } } < / th >
< th class = "p-b-md fn-right p-r-md" > { { $t ( "assets.c0" ) } } < / th >
< th class = "p-b-md fn-right p-r-md" > { { $t ( 'exchange.g3' ) } } < / th >
< th class = "p-b-md fn-right p-r-md" > { { $t ( 'exchange.g3' ) } } < / th >
< / tr >
< / thead >
< tbody >
@ -130,14 +154,16 @@
{ { item . datetime | parseTime } }
< / td >
< td >
< view > { { item . status_text } } < / view >
< view > { { item . status_text } } < / view >
< / td >
< td >
{ { item . amount } }
< span class = "color-default" > ( { { item . coin_name } } ) < / span >
< / td >
< td class = "fn-right p-r-md rounded-tr-sm rounded-br-sm" >
< v -button size = "mini" v-if ="item.status==0" type="danger" @click="cancelWithdraw(item)" > {{ $ t ( ' exchange.g4 ' ) }} < / v-button >
< v -button size = "mini" v-if ="item.status==0" type="danger" @click="cancelWithdraw(item)" >
{ { $t ( 'exchange.g4' ) } }
< / v - b u t t o n >
< / td >
< / tr >
< tr v-if ="loadMore" >
@ -148,21 +174,27 @@
< / tbody >
< / table >
< / view >
< / view >
< / view > -- >
< view class = "bot w-max bg-panel-3 p-lg box-size" >
< v -button class = "w-max m-y-md rounded-xs" block type = "yellow" @click ="toDraw" ref = "btn" > { { $t ( "assets.b6" ) } } < / v - b u t t o n >
< v -button class = "w-max m-y-md rounded-xs" block type = "yellow" @click ="toDraw" ref = "btn" > { {
$t ( "assets.b6" )
} }
< / v - b u t t o n >
< / view >
< / view >
< / view >
< coin -list ref = "coinList" v -model = " coin " @ close = "coinListShow = false" v -show = " coinListShow " / >
< van -popup :show ="secondaryShow" @close ="secondaryShow=false" closeable close -on -popstate position = "bottom" custom -style = " height : 40 % " >
< coin -list ref = "coinList" v -model = " coin " @ close = "coinListShow = false" v -show = " coinListShow " / >
< van -popup :show ="secondaryShow" @close ="secondaryShow=false" closeable close -on -popstate position = "bottom"
custom - style = "height:40%" >
< van -tabs class = "m-t-lg p-t-lg" v-if ="secondaryShow" :sticky="false" :active="form.code_type" @change="changeTab" >
< van -tab title = "Google" v-if ="withdrawFee.google_status==1" :name ="3" >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')" v-model ="form.code" > < / v-input >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')"
v - model = "form.code" > < / v - i n p u t >
< / v a n - t a b >
< van -tab :title ="$t('login.a8')" v-if ="withdrawFee.phone_status==1" :name ="1" >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')" v-model ="form.code" >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')"
v - model = "form.code" >
< template # right >
< v -code type = "green-plain" url = "/user/getCode" :data ="{type:1}" ref = "mobileCode" > < / v - c o d e >
< / template >
@ -170,7 +202,8 @@
< / v a n - t a b >
< van -tab :title ="$t('login.a9')" v-if ="withdrawFee.email_status==1" :name ="2" >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')" v-model ="form.code" >
< v -input class = "border h-40 m-y-md m-x-lg p-x-md" type = "number" :placeholder ="$t('common.code')"
v - model = "form.code" >
< template # right >
< v -code type = "green-plain" url = "/user/getCode" :data ="{type:2}" ref = "emailCode" > < / v - c o d e >
< / template >
@ -179,16 +212,17 @@
< / v a n - t a b >
< / v a n - t a b s >
< view class = "m-md" >
< v -button type = "yellow" block class = "w-max rounded-md" @click ="draw" > {{ $ t ( ' common.confirm ' ) }} < / v-button >
< v -button type = "yellow" block class = "w-max rounded-md" @click ="draw" > {{ $ t ( ' common.confirm ' ) }} < / v-button >
< / view >
< / v a n - p o p u p >
< van -toast id = "van-toast" / >
< van -toast id = "van-toast" / >
< / v - p a g e >
< / template >
< script >
import coinList from "./coin-list" ;
import Wallet from "@/api/wallet" ;
import formData from "@/utils/class/date" ;
export default {
components : {
coinList ,
@ -201,6 +235,7 @@ export default {
form : {
coin_id : "" ,
amount : "" ,
password : "" ,
address : "" ,
addressType : "" ,
code_type : 1 ,
@ -211,7 +246,8 @@ export default {
list : [ ] ,
page : 1 ,
loadMore : true ,
secondaryShow : false
secondaryShow : false ,
type : 'draw'
} ;
} ,
computed : {
@ -228,7 +264,7 @@ export default {
this . form . address = "" ;
if ( this . coin != "USDT" ) {
this . rechargeType = 1 ;
} else {
} else {
this . rechargeType = 2 ;
}
this . withdrawalBalance ( ) ;
@ -246,10 +282,10 @@ export default {
} )
} ,
methods : {
saoma ( ) {
saoma ( ) {
let that = this ;
uni . scanCode ( {
success : function ( res ) {
success : function ( res ) {
that . form . address = res . result ;
}
} ) ;
@ -260,10 +296,10 @@ export default {
} ,
/ / 获 取 提 币 地 址
withdrawalBalance ( ) {
let address_type = 1
let address_type = 1
let data = {
coin_name : this . coin ,
address_type : this . rechargeType
address_type : this . rechargeType
} ;
Wallet . withdrawalBalance ( data ) . then ( ( res ) => {
/ / c o n s o l e . i n f o ( r e s )
@ -271,12 +307,12 @@ export default {
} ) ;
} ,
/ / 发 起 提 币
toDraw ( ) {
if ( ! this . form . address ) {
toDraw ( ) {
if ( ! this . form . address ) {
this . $toast ( this . $t ( 'assets.b9' ) )
return
}
if ( ! this . form . amount ) {
if ( ! this . form . amount ) {
this . $toast ( this . $t ( 'assets.c2' ) )
return
}
@ -307,18 +343,30 @@ export default {
draw ( ) {
this . form . addressType = this . rechargeType ;
this . form . coin_id = this . activeCoin . coin_id ;
Wallet . withdraw ( this . form , { btn : this . $refs . btn } )
Wallet . withdraw ( this . form , { btn : this . $refs . btn } )
. then ( ( res ) => {
this . secondaryShow = false
this . form . code = ''
if ( res . code = 4001 ) {
this . form . code = ''
if ( res . code == 4001 ) {
this . $toast ( res . message ) ;
} else {
} else {
this . $toast . success ( this . $t ( "assets.d5" ) + "!" ) ;
this . form . amount = ''
this . form . amount = ''
setTimeout ( ( ) => {
uni . navigateTo ( {
url : '/pages/assets/records?type=' + this . type
} )
} , 1500 )
/ / s e t T i m e o u t ( ( ) = > {
/ / t h i s . g e t W i t h d r a w R e c o r d s ( ) ;
/ / } , 2 0 0 0 )
/ / s e t T i m e o u t ( ( ) = > {
/ / t h i s . g e t W i t h d r a w R e c o r d s ( ) ;
/ / } , 3 0 0 0 )
}
} )
. catch ( ( ) => { } ) ;
. catch ( ( ) => {
} ) ;
} ,
reset ( ) {
this . loadMore = true ;
@ -336,13 +384,16 @@ export default {
} ;
Wallet . withdrawalRecord ( data ) . then ( ( res ) => {
if ( res . data . current_page == 1 ) this . list = [ ] ;
this . list = [ ... this . list , ... res . data . data ] ;
let list = [ ... this . list , ... res . data . data ] ; / / 无 法 响 应
this . list . splice ( 0 , this . list . length , ... list ) ;
/ / t h i s . l i s t . p u s h ( . . . l i s t ) ;
console . log ( 'length---------------' , this . list . length , '页数:' , res . data . current_page ) ;
if ( res . data . data . length < res . data . per_page ) this . loadMore = false ;
} ) ;
} ,
/ / 撤 销 订 单
cancelWithdraw ( item ) {
Wallet . cancelWithdraw ( { withdraw_id : item . id } ) . then ( ( ) => {
Wallet . cancelWithdraw ( { withdraw_id : item . id } ) . then ( ( ) => {
this . $toast ( this . $t ( 'exchange.g6' ) )
this . reset ( ) ;
} )
@ -360,30 +411,34 @@ export default {
. trChange : nth - child ( 2 n - 1 ) {
box - shadow : $shadow ;
border - radius : $border - radius - xs ;
td {
background : $panel - 3 ;
padding - top : $padding - sm ;
padding - bottom : $padding - sm ;
}
}
. bor - active {
. bor - active {
border : 1 px solid $theme - 1 ;
position : relative ;
overflow : hidden ;
color : $theme - 1 ;
}
. bor - active : : before {
. bor - active : : before {
content : '' ;
position : absolute ;
right : 0 ;
bottom : - 2 px ;
bottom : - 2 px ;
height : 0 ;
width : 0 ;
border : 10 px solid ;
border - color : transparent $theme - 1 $theme - 1 transparent ;
border - color : transparent $theme - 1 $theme - 1 transparent ;
text - align : center ;
}
. bor - active : : after {
. bor - active : : after {
content : '√' ;
position : absolute ;
right : - 4 px ;
@ -395,19 +450,24 @@ export default {
text - align : center ;
color : white ;
}
. border - b {
. border - b {
border - bottom : 5 px solid $panel - 3 ;
}
. autowidth {
. autowidth {
margin : 0 auto ;
}
. bg - lin {
background : linear - gradient ( to right , # f6c769 , # f3b644 ) ;
. bg - lin {
background : linear - gradient ( to right , # f6c769 , # f3b644 ) ;
}
. color - black {
. color - black {
color : black ;
}
. bot {
. bot {
position : fixed ;
bottom : 0 ;
}