Commit a9627295 authored by wenglk's avatar wenglk

地址转小写

parent bdbe3b53
This diff is collapsed.
This diff is collapsed.
......@@ -3,92 +3,98 @@ import QRCode from "qrcode";
import { getAddressTxCount } from "@/service/api";
import Rpc from "@/utils/Rpc";
export default Vue.extend({
data() {
return {
txCount: 0,
receive: 0,
send: 0,
value: 0,
};
},
watch: {
"$route.query.address"() {
this.getAddrOverview();
this.init();
getAddressTxCount(this.$route.query.address as string).then((ret) => {
if (ret.error === null) {
this.txCount = ret.result;
}
});
data() {
return {
txCount: 0,
receive: 0,
send: 0,
value: 0,
};
},
},
mounted() {
this.getAddrOverview();
this.init();
getAddressTxCount(this.$route.query.address as string).then((ret) => {
if (ret.error === null) {
this.txCount = ret.result;
}
});
},
computed: {
tradeInTotalList(): { name: string; value: number }[] {
return [
// {
// name: this.$t("lang.address.totalReception") as string,
// value: this.receive,
// },
// {
// name: this.$t("lang.address.totalSent") as string,
// value: this.send,
// },
{
name: this.$t("lang.address.totalValue") as string,
value: this.value,
watch: {
"$route.query.address"() {
this.getAddrOverview();
this.init();
getAddressTxCount(
(this.$route.query.address as string).toLowerCase()
).then((ret) => {
if (ret.error === null) {
this.txCount = ret.result;
}
});
},
{
name: this.$t("lang.block.txCount") as string,
value: this.txCount,
},
mounted() {
this.getAddrOverview();
this.init();
getAddressTxCount(
(this.$route.query.address as string).toLowerCase()
).then((ret) => {
if (ret.error === null) {
this.txCount = ret.result;
}
});
},
computed: {
tradeInTotalList(): { name: string; value: number }[] {
return [
// {
// name: this.$t("lang.address.totalReception") as string,
// value: this.receive,
// },
// {
// name: this.$t("lang.address.totalSent") as string,
// value: this.send,
// },
{
name: this.$t("lang.address.totalValue") as string,
value: this.value,
},
{
name: this.$t("lang.block.txCount") as string,
value: this.txCount,
},
];
},
];
},
},
methods: {
getAddrOverview() {
Rpc.getAddrOverview(this.$route.query.address as string).then((res) => {
if (res.error === null) {
const balance = res.result.balance;
const receiver = res.result.reciver;
this.receive = receiver;
this.send = receiver - balance;
methods: {
getAddrOverview() {
Rpc.getAddrOverview(
(this.$route.query.address as string).toLowerCase()
).then((res) => {
if (res.error === null) {
const balance = res.result.balance;
const receiver = res.result.reciver;
this.receive = receiver;
this.send = receiver - balance;
fetch("/market")
.then((ret) => ret.json())
.then((ret) => {
if (ret.msg === "succeed") {
const data = ret.data.data.USDT.YCC;
this.value = data.last * balance;
}
fetch("/market")
.then((ret) => ret.json())
.then((ret) => {
if (ret.msg === "succeed") {
const data = ret.data.data.USDT.YCC;
this.value = data.last * balance;
}
});
}
});
}
});
},
init() {
QRCode.toCanvas(
document.getElementById("qrcode"),
this.$route.query.address as string,
{
color: {
dark: "#1F3470",
light: "#0000",
},
width: 130,
margin: 0,
},
function (error) {
if (error) console.error(error);
}
);
init() {
QRCode.toCanvas(
document.getElementById("qrcode"),
(this.$route.query.address as string).toLowerCase(),
{
color: {
dark: "#1F3470",
light: "#0000",
},
width: 130,
margin: 0,
},
function(error) {
if (error) console.error(error);
}
);
},
},
},
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment