Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
0d741ce1
Commit
0d741ce1
authored
Mar 03, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了字体,改为了本地
parent
c42bdc62
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
35 deletions
+29
-35
App.vue
App.vue
+19
-6
config.js
config.js
+4
-3
main.js
main.js
+1
-0
pages.json
pages.json
+0
-11
u-icon.vue
uni_modules/uview-ui/components/u-icon/u-icon.vue
+5
-15
No files found.
App.vue
View file @
0d741ce1
<
script
>
<
script
>
export
default
{
export
default
{
data
()
{
return
{
//字体url
fontUrl
:
this
.
$FONT_URL
}
},
onLaunch
:
function
(
option
)
{
onLaunch
:
function
(
option
)
{
console
.
log
(
"进入App.vue页面 "
+
option
.
path
)
console
.
log
(
"进入App.vue页面 "
+
option
.
path
)
uni
.
switchTab
({
uni
.
switchTab
({
...
@@ -18,6 +24,7 @@
...
@@ -18,6 +24,7 @@
}
}
};
};
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
/*每个页面公共css */
/*每个页面公共css */
@import
'@/uni_modules/uview-ui/index.scss'
;
@import
'@/uni_modules/uview-ui/index.scss'
;
...
@@ -25,32 +32,38 @@
...
@@ -25,32 +32,38 @@
@font-face
{
@font-face
{
font-family
:
'PingFang SC-Bold, PingFang SC'
;
font-family
:
'PingFang SC-Bold, PingFang SC'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Bold.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Bold.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/SourceHanSansCN-Bold.ttf')
format
(
'truetype'
);
}
}
@font-face
{
@font-face
{
font-family
:
'PingFang SC-Regular, PingFang SC'
;
font-family
:
'PingFang SC-Regular, PingFang SC'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Regular.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Regular.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/SourceHanSansCN-Regular.ttf')
format
(
'truetype'
);
}
}
@font-face
{
@font-face
{
font-family
:
'PingFang SC-Heavy, PingFang SC'
;
font-family
:
'PingFang SC-Heavy, PingFang SC'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Heavy.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Heavy.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/SourceHanSansCN-Heavy.ttf')
format
(
'truetype'
);
}
}
@font-face
{
@font-face
{
font-family
:
'SourceHanSerifCN-Heavy'
;
font-family
:
'SourceHanSerifCN-Heavy'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSerifCN-Heavy-4.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSerifCN-Heavy-4.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/SourceHanSerifCN-Heavy-4.ttf')
format
(
'truetype'
);
}
}
@font-face
{
@font-face
{
font-family
:
'Arial-Regular, Arial'
;
font-family
:
'Arial-Regular, Arial'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/arial.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/arial.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/arial.ttf')
format
(
'truetype'
);
}
}
@font-face
{
@font-face
{
font-family
:
'Source Han Sans CN-Regular, Source Han Sans CN'
;
font-family
:
'Source Han Sans CN-Regular, Source Han Sans CN'
;
src
:
url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Regular.ttf')
format
(
'truetype'
);
//src: url('https://www.wxmblog.com/wxmapi/ttf/SourceHanSansCN-Regular.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/SourceHanSansCN-Regular.ttf')
format
(
'truetype'
);
}
}
/*每个页面公共css */
/*每个页面公共css */
...
...
config.js
View file @
0d741ce1
// 应用全局配置
// 应用全局配置
module
.
exports
=
{
module
.
exports
=
{
// baseUrl: 'http://106.3.97.198:20162'
// baseUrl: 'http://106.3.97.198:20162'
baseUrl
:
'http://localhost:8092'
,
//接口URL
baseUrl
:
'http://192.168.1.8:8092'
,
//接口URL
imgUrl
:
'http://192.168.1.23/static/images'
,
//图片URL
imgUrl
:
'http://192.168.1.8/static/images'
,
//图片URL
webViewUrl
:
'http://192.168.1.23:8080'
//小程序跳转H5页面的URL
fontUrl
:
'http://192.168.1.8/static/font'
,
//字体URL
webViewUrl
:
'http://192.168.1.8:8080'
//小程序跳转H5页面的URL
}
}
// module.exports = {
// module.exports = {
...
...
main.js
View file @
0d741ce1
...
@@ -17,6 +17,7 @@ Vue.use(uView)
...
@@ -17,6 +17,7 @@ Vue.use(uView)
Vue
.
prototype
.
$myRequest
=
request
;
// 接口请求
Vue
.
prototype
.
$myRequest
=
request
;
// 接口请求
Vue
.
prototype
.
$BASE_URL
=
config
.
baseUrl
//接口地址
Vue
.
prototype
.
$BASE_URL
=
config
.
baseUrl
//接口地址
Vue
.
prototype
.
$IMG_URL
=
config
.
imgUrl
;
//图片地址
Vue
.
prototype
.
$IMG_URL
=
config
.
imgUrl
;
//图片地址
Vue
.
prototype
.
$FONT_URL
=
config
.
fontUrl
;
//图片地址
Vue
.
prototype
.
$WEBVIEW_URL
=
config
.
webViewUrl
;
//H5跳转地址
Vue
.
prototype
.
$WEBVIEW_URL
=
config
.
webViewUrl
;
//H5跳转地址
Vue
.
prototype
.
$store
=
store
;
//正式接口
Vue
.
prototype
.
$store
=
store
;
//正式接口
...
...
pages.json
View file @
0d741ce1
...
@@ -169,17 +169,6 @@
...
@@ -169,17 +169,6 @@
}
}
]
]
},
},
{
"root"
:
"pageslogin"
,
"pages"
:
[
{
"path"
:
"index"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
}
]
},
{
{
"root"
:
"pagesme"
,
"root"
:
"pagesme"
,
"pages"
:
[
"pages"
:
[
...
...
uni_modules/uview-ui/components/u-icon/u-icon.vue
View file @
0d741ce1
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
>
{{
icon
}}
</text>
>
{{
icon
}}
</text>
<!-- 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 -->
<!-- 这里进行空字符串判断,如果仅仅是v-if="label",可能会出现传递0的时候,结果也无法显示 -->
<text
<text
v-if=
"label !== ''"
v-if=
"label !== ''"
class=
"u-icon__label"
class=
"u-icon__label"
:style=
"
{
:style=
"
{
color: labelColor,
color: labelColor,
...
@@ -35,20 +35,9 @@
...
@@ -35,20 +35,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
// #ifdef APP-NVUE
// nvue通过weex的dom模块引入字体,相关文档地址如下:
// https://weex.apache.org/zh/docs/modules/dom.html#addrule
const
fontUrl
=
'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf'
const
domModule
=
weex
.
requireModule
(
'dom'
)
domModule
.
addRule
(
'fontFace'
,
{
'fontFamily'
:
"uicon-iconfont"
,
'src'
:
`url('
${
fontUrl
}
')`
})
// #endif
// 引入图标名称,已经对应的unicode
// 引入图标名称,已经对应的unicode
import
icons
from
'./icons'
import
icons
from
'./icons'
import
props
from
'./props.js'
;;
import
props
from
'./props.js'
;;
/**
/**
...
@@ -81,7 +70,7 @@
...
@@ -81,7 +70,7 @@
name
:
'u-icon'
,
name
:
'u-icon'
,
data
()
{
data
()
{
return
{
return
{
fontUrl
:
this
.
$FONT_URL
}
}
},
},
mixins
:
[
uni
.
$u
.
mpMixin
,
uni
.
$u
.
mixin
,
props
],
mixins
:
[
uni
.
$u
.
mpMixin
,
uni
.
$u
.
mixin
,
props
],
...
@@ -160,7 +149,8 @@
...
@@ -160,7 +149,8 @@
// 非nvue下加载字体
// 非nvue下加载字体
@font-face
{
@font-face
{
font-family
:
'uicon-iconfont'
;
font-family
:
'uicon-iconfont'
;
src
:
url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf')
format
(
'truetype'
);
//src: url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf') format('truetype');
src
:
url('http://192.168.1.8/static/font/font_2225171_8kdcwk4po24.ttf')
format
(
'truetype'
);
}
}
/* #endif */
/* #endif */
...
...
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