Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tools
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
tools
Commits
cd40806f
Commit
cd40806f
authored
Feb 12, 2023
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
4a6c7ae9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletions
+26
-1
snow2east/js/index.js
+26
-1
No files found.
snow2east/js/index.js
View file @
cd40806f
var
host
=
"http://127.0.0.1:8045"
function
main
()
{
var
dom
=
$
(
"#app > div.container-lg.clearfix > div.container-sm.float-left.stock__main > div.stock-name"
);
var
stock
=
dom
.
text
();
//http://quote.eastmoney.com/sz002460.html?from=beta
if
(
stock
!==
""
)
{
var
matches
=
stock
.
match
(
/
\(\S
*
\)
/
);
if
(
matches
.
length
<=
0
)
{
...
...
@@ -17,8 +18,31 @@ function main() {
a
.
target
=
"_blank"
;
a
.
innerText
=
stock
;
$
(
dom
).
html
(
$
(
a
));
getInfo
(
search
,
function
(
res
)
{
var
dom2
=
$
(
"#app > div.container-lg.clearfix > div.container-sm.float-left.stock__main > div.stock-issues"
);
var
box
=
document
.
createElement
(
"div"
);
$
(
box
).
addClass
(
"stock-issue"
);
box
.
innerText
=
res
;
$
(
dom2
).
append
(
$
(
box
));
});
}
}
function
getInfo
(
code
,
callback
)
{
var
api
=
"/basic?code="
+
code
if
(
code
===
""
)
{
alert
(
"code error"
)
return
}
fetch
(
host
+
api
).
then
(
res
=>
{
return
res
.
text
();
}).
then
(
res
=>
{
var
data
=
JSON
.
parse
(
res
);
callback
(
data
.
data
.
market
)
}).
catch
(
e
=>
{
console
.
error
(
e
)
})
}
main
();
\ No newline at end of file
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