Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
poster
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘续中
poster
Commits
efd7f4d6
Commit
efd7f4d6
authored
Jun 22, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update aonweb
parent
a21fc467
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
13 deletions
+67
-13
package-lock.json
package-lock.json
+22
-7
package.json
package.json
+1
-1
Header.vue
src/components/Header.vue
+26
-1
eventBus.js
src/eventBus.js
+3
-0
Index.vue
src/views/Index.vue
+4
-1
User.vue
src/views/User.vue
+11
-3
No files found.
package-lock.json
View file @
efd7f4d6
...
...
@@ -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-5
1J0Q+my960ZFSyFf0gnjH1ayQxuqc6mBXYHvQWMAKiFvPoWRVgy38Q2gibO2o7er9TEawV54X8kuw1AsMxTfw
=="
,
"version"
:
"
1.0.0
"
,
"resolved"
:
"https://registry.npmjs.org/aonweb/-/aonweb-
1.0.0
.tgz"
,
"integrity"
:
"sha512-5
BEDJb15A1cRu3/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-5
1J0Q+my960ZFSyFf0gnjH1ayQxuqc6mBXYHvQWMAKiFvPoWRVgy38Q2gibO2o7er9TEawV54X8kuw1AsMxTfw
=="
,
"version"
:
"
1.0.0
"
,
"resolved"
:
"https://registry.npmjs.org/aonweb/-/aonweb-
1.0.0
.tgz"
,
"integrity"
:
"sha512-5
BEDJb15A1cRu3/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"
,
...
...
package.json
View file @
efd7f4d6
...
...
@@ -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
"
,
...
...
src/components/Header.vue
View file @
efd7f4d6
...
...
@@ -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
>
...
...
src/eventBus.js
0 → 100644
View file @
efd7f4d6
import
{
createApp
}
from
'
vue
'
;
const
eventBus
=
createApp
({});
export
default
eventBus
;
\ No newline at end of file
src/views/Index.vue
View file @
efd7f4d6
...
...
@@ -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
...
...
src/views/User.vue
View file @
efd7f4d6
...
...
@@ -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 的使用方法
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment