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.
28 lines
640 B
28 lines
640 B
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
|