You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
632 B
26 lines
632 B
let BtcUtil = {
|
|
getBalance:async function(address,success) {
|
|
let balance=0;
|
|
try{
|
|
let res= await uni.request({
|
|
url: 'http://scan.weirui0755.com/btc/api/address/balancetrend/btc/' + address, //请求接口
|
|
header: {
|
|
'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
|
|
}
|
|
});
|
|
if (res.data.code === 1) {
|
|
if(res.data.data.length>0){
|
|
var data=res.data.data[0];
|
|
console.log(data,11111)
|
|
for(let b in data){
|
|
balance=data[b];
|
|
}
|
|
}
|
|
}
|
|
}catch(e){
|
|
//TODO handle the exception
|
|
}
|
|
return balance;
|
|
}
|
|
}
|
|
export default BtcUtil
|