Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
10f756e4
authored
Jan 09, 2025
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换logo
parent
7da29c91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
public/static/js/sq.js
+12
-7
No files found.
public/static/js/sq.js
View file @
10f756e4
...
@@ -6,12 +6,7 @@ function replace_logo(){
...
@@ -6,12 +6,7 @@ function replace_logo(){
console
.
log
(
"Replace logo"
);
console
.
log
(
"Replace logo"
);
}
}
function
replaceQrCode
(){
function
replaceQrCode
(){
var
elements
=
document
.
querySelectorAll
(
'.store-qrcode'
);
var
element
=
document
.
querySelector
(
'.store-qrcode'
);
if
(
element
)
{
element
.
innerHTML
=
''
;}
// 遍历这些元素
elements
.
forEach
(
function
(
element
)
{
// 将每个元素的 HTML 内容替换为空字符串
element
.
innerHTML
=
''
;
});
}
}
function
replaceKeywords
(
keyword
,
replacement
)
{
function
replaceKeywords
(
keyword
,
replacement
)
{
// 获取整个文档的body元素
// 获取整个文档的body元素
...
@@ -39,8 +34,18 @@ function traverseNodes(node, keyword, replacement) {
...
@@ -39,8 +34,18 @@ function traverseNodes(node, keyword, replacement) {
}
}
}
}
}
}
function
replace_logo
(){
// 选择所有具有 'logo-icon' 类的元素
const
logoIcons
=
document
.
querySelectorAll
(
'.logo-icon'
);
// 遍历每个找到的元素,并更新其 background 样式
logoIcons
.
forEach
(
element
=>
{
// 替换背景图片的 URL 和位置等信息
element
.
style
.
background
=
"url('http://cloud-rx-prod-1324994225.tongzhitang.cn/static/images/logo.png') no-repeat 0px 0px / 1000px 1200px"
;
});
}
window
.
onload
=
function
()
{
window
.
onload
=
function
()
{
replaceQrCode
();
//
replaceQrCode();
replaceKeywords
(
'新橙科技'
,
'同知堂科技'
);
replaceKeywords
(
'新橙科技'
,
'同知堂科技'
);
replaceKeywords
(
'粤ICP备15024370号-7'
,
'苏ICP备2023017636号-1'
);
replaceKeywords
(
'粤ICP备15024370号-7'
,
'苏ICP备2023017636号-1'
);
};
};
...
...
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