Commit efd7f4d6 authored by brent's avatar brent

update aonweb

parent a21fc467
......@@ -8,7 +8,7 @@
"name": "AONET",
"version": "0.0.0",
"dependencies": {
"aonweb": "^0.0.7",
"aonweb": "^1.0.0",
"aos": "^2.3.4",
"axios": "^1.6.8",
"element-plus": "^2.7.5",
......@@ -1853,11 +1853,12 @@
}
},
"node_modules/aonweb": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/aonweb/-/aonweb-0.0.7.tgz",
"integrity": "sha512-51J0Q+my960ZFSyFf0gnjH1ayQxuqc6mBXYHvQWMAKiFvPoWRVgy38Q2gibO2o7er9TEawV54X8kuw1AsMxTfw==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/aonweb/-/aonweb-1.0.0.tgz",
"integrity": "sha512-5BEDJb15A1cRu3/uAm4YIbGhmXiuyM9mrO3X0TvQIGcFkb3zeO30G0vNHLGAgwS9DAKNWFkFol0POuVp4dawXA==",
"dependencies": {
"@fingerprintjs/fingerprintjs": "^4.4.0",
"bignumber.js": "^9.1.2",
"uuid": "^9.0.1",
"web3": "^4.8.0",
"web3-eth-accounts": "^4.1.2"
......@@ -1913,6 +1914,14 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"node_modules/bignumber.js": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
"integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
"engines": {
"node": "*"
}
},
"node_modules/birpc": {
"version": "0.2.17",
"resolved": "https://registry.npmjs.org/birpc/-/birpc-0.2.17.tgz",
......@@ -5612,11 +5621,12 @@
}
},
"aonweb": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/aonweb/-/aonweb-0.0.7.tgz",
"integrity": "sha512-51J0Q+my960ZFSyFf0gnjH1ayQxuqc6mBXYHvQWMAKiFvPoWRVgy38Q2gibO2o7er9TEawV54X8kuw1AsMxTfw==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/aonweb/-/aonweb-1.0.0.tgz",
"integrity": "sha512-5BEDJb15A1cRu3/uAm4YIbGhmXiuyM9mrO3X0TvQIGcFkb3zeO30G0vNHLGAgwS9DAKNWFkFol0POuVp4dawXA==",
"requires": {
"@fingerprintjs/fingerprintjs": "^4.4.0",
"bignumber.js": "^9.1.2",
"uuid": "^9.0.1",
"web3": "^4.8.0",
"web3-eth-accounts": "^4.1.2"
......@@ -5666,6 +5676,11 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"bignumber.js": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
"integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug=="
},
"birpc": {
"version": "0.2.17",
"resolved": "https://registry.npmjs.org/birpc/-/birpc-0.2.17.tgz",
......
......@@ -11,7 +11,7 @@
"type-check": "vue-tsc --build --force"
},
"dependencies": {
"aonweb": "^0.0.7",
"aonweb": "^1.0.0",
"aos": "^2.3.4",
"axios": "^1.6.8",
"element-plus": "^2.7.5",
......
......@@ -6,7 +6,7 @@
<div class="right">
<div class="right_count">
<img src="../assets/icons/money.png" class="moneyIcon"></img>
<span class="count">120</span>
<span class="count">{{balanceValue}}</span>
</div>
<img src="../assets/icons/user.png" v-if="!isUserPage" class="userIcon" @click="goUser"></img>
</div>
......@@ -21,11 +21,16 @@ import {
computed
} from 'vue';
import { useRouter,useRoute } from 'vue-router'
// import { User } from 'aonweb'
// import eventBus from '../eventBus.js';
const router = useRouter()
const route = useRoute()
const isUserPage = ref(false);
const balanceValue = ref(0);
const props = defineProps({
title: {
......@@ -46,13 +51,33 @@ const goIndex = () => {
const goUser = () => {
router.push('/user')
};
// const balance = async () => {
// let user = new User()
// let result = await user.balance()
// if (result && result._balances && result._balances.length) {
// balanceValue = result._balances[0]
// balanceValue = balanceValue / 1000000000000000000n
// }
// };
// const handleBalance = (message) => {
// console.log("handleBalance",message)
// balance()
// }
const checkIfUserPage = () => {
isUserPage.value = route.path === '/user'
};
onMounted(() => {
checkIfUserPage();
// eventBus.config.globalProperties.$on('balance', (data) => {
// handleBalance()
// });
});
</script>
<style scoped>
......
import { createApp } from 'vue';
const eventBus = createApp({});
export default eventBus;
\ No newline at end of file
......@@ -165,7 +165,7 @@ const formSubmit = async () => {
try {
// AI 使用方法
const ai_options = new AIOptions({
appId :'test'
appId :'k3ebyfaSz8b87xJb_VyEGXx_AJ0MM8ngqU7Ym3AKeW8A'
})
const aonet = new AI(ai_options)
......@@ -191,6 +191,9 @@ const formSubmit = async () => {
let price = 10
let response = await aonet.prediction("/predictions/ai/pulid", data,price)
console.log("test", response)
if (response && response.code == 200 && response.data) {
response = response.data
}
if (response.task.exec_code == 200 && response.task.is_success) {
showLoading.value = false
......
......@@ -43,6 +43,8 @@ import { Options, User } from 'aonweb'
import { showToast } from 'vant';
import Header from '../components/Header.vue';
// import eventBus from '../eventBus.js';
......@@ -76,9 +78,15 @@ async function getAccount() {
//User 的使用方法
let user = new User()
let addr = await user.login()
console.log("getWeb3 account", addr)
account.value = addr[0]
await user.login((acc,userId,error) => {
console.log("getWeb3 account",account)
console.log("getWeb3 userId",userId)
console.log("getWeb3 error",error)
account.value = acc
// eventBus.config.globalProperties.$emit('balance');
})
// console.log("getWeb3 account", addr)
// account.value = addr[0]
// //detectEthereumProvider 的使用方法
......
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