5 changed files with 82 additions and 18 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,28 @@ |
|||||
|
let BtcUtil = { |
||||
|
getBalance: function(address,success) { |
||||
|
let balance=0; |
||||
|
try{ |
||||
|
uni.request({ |
||||
|
url: 'http://scan.weirui0755.com/btc/api/address/balancetrend/btc/' + address, //请求接口
|
||||
|
header: { |
||||
|
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
|
||||
|
}, |
||||
|
success: (res) => { |
||||
|
|
||||
|
if (res.data.code === 1) { |
||||
|
if(res.data.data.length>0){ |
||||
|
var data=res.data.data[0]; |
||||
|
for(obj b in data){ |
||||
|
balance=data[b]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}catch(e){ |
||||
|
//TODO handle the exception
|
||||
|
} |
||||
|
success(balance); |
||||
|
} |
||||
|
} |
||||
|
export default BtcUtil |
Loading…
Reference in new issue