|
@@ -111,11 +111,21 @@ Vue.prototype.showConfirmDialog = function(message, title) {
|
|
|
}
|
|
|
|
|
|
Vue.prototype.loadFontFace = function(fontFamily) {
|
|
|
- let fontUrl = ''
|
|
|
+ const fontUrls = {
|
|
|
+ 'Poppins': 'https://oss.starify.cn/test/Poppins-Regular.ttf'
|
|
|
+ }
|
|
|
if (fontFamily === 'Poppins') {
|
|
|
- fontUrl = 'https://oss.starify.cn/test/Poppins-SemiBold.ttf'
|
|
|
+ // 开发者工具没有该字体
|
|
|
+ wx.getSystemInfo({
|
|
|
+ success(res) {
|
|
|
+ if (res.platform === 'devtools') {
|
|
|
+ loadCloudFontFace(fontUrls[fontFamily], fontFamily + '.ttf', fontFamily)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ loadCloudFontFace(fontUrls[fontFamily], fontFamily + '.ttf', fontFamily)
|
|
|
}
|
|
|
- loadCloudFontFace(fontUrl, fontFamily + '.ttf', fontFamily)
|
|
|
}
|
|
|
|
|
|
App.mpType = 'app'
|