fix: 删除自定义字体改用系统字体,减少主包体积

This commit is contained in:
2026-07-30 13:18:51 +08:00
parent ed3e5f22ec
commit 14d2d1e4e2
7 changed files with 42 additions and 50 deletions

View File

@@ -371,7 +371,6 @@
@import 'static/css/base.css'; @import 'static/css/base.css';
@import 'static/iconfont/iconfont.css'; @import 'static/iconfont/iconfont.css';
@import 'static/css/unocss.css'; @import 'static/css/unocss.css';
@import 'static/fonts/font.scss';
view { view {
box-sizing: border-box; box-sizing: border-box;

View File

@@ -156,43 +156,44 @@ export default {
/** /**
* 太阳码 scene 解析:调 box_app /api/mp/apps 找 url,找到后注入到 option.url * 太阳码 scene 解析:调 box_app /api/mp/apps 找 url,找到后注入到 option.url
* 然后调用 _initWebView(option) 走标准 web_view 加载流程 * 然后调用 _initWebView(option) 走标准 web_view 加载流程
_resolveAppScene(identifier, option) { */
const appToken = store.state.app.token || ''; _resolveAppScene(identifier, option) {
uni.request({ const appToken = store.state.app.token || '';
url: 'https://mp.yizhezhe.com/api/mp/apps?identifier=' + encodeURIComponent(identifier) + '&isPublished=1&pageSize=1', uni.request({
method: 'GET', url: 'https://mp.yizhezhe.com/api/mp/apps?identifier=' + encodeURIComponent(identifier) + '&isPublished=1&pageSize=1',
header: appToken ? { 'Authorization': 'Bearer ' + appToken } : {}, method: 'GET',
success: (res) => { header: appToken ? { 'Authorization': 'Bearer ' + appToken } : {},
console.log('[web_view] 太阳码 scene 解析响应:', JSON.stringify(res.statusCode)); success: (res) => {
const items = res.data && res.data.result && res.data.result.items; console.log('[web_view] 太阳码 scene 解析响应:', JSON.stringify(res.statusCode));
if (res.statusCode === 200 && items && items.length > 0) { const items = res.data && res.data.result && res.data.result.items;
const app = items.find(it => it.identifier === identifier) || items[0]; if (res.statusCode === 200 && items && items.length > 0) {
if (app && app.url) { const app = items.find(it => it.identifier === identifier) || items[0];
const appUrl = app.url; if (app && app.url) {
let finalUrl = appUrl; const appUrl = app.url;
if (option._channel) { let finalUrl = appUrl;
const separator = finalUrl.includes('?') ? '&' : '?'; if (option._channel) {
finalUrl += separator + 'ch=' + option._channel; const separator = finalUrl.includes('?') ? '&' : '?';
} finalUrl += separator + 'ch=' + option._channel;
console.log('[web_view] 解析到 H5 url:', appUrl, option._channel ? ' ch=' + option._channel : ''); }
option.url = encodeURIComponent(finalUrl); console.log('[web_view] 解析到 H5 url:', appUrl, option._channel ? ' ch=' + option._channel : '');
} else { option.url = encodeURIComponent(finalUrl);
console.warn('[DEBUG 太阳码] 降级到 CRMEB 首页'); } else {
option.url = encodeURIComponent('https://shop.douba.top'); console.warn('[DEBUG 太阳码] 降级到 CRMEB 首页');
} option.url = encodeURIComponent('https://shop.douba.top');
} else { }
console.warn('[web_view] 太阳码 scene 解析响应异常,降级到 CRMEB 首页'); } else {
option.url = encodeURIComponent('https://shop.douba.top'); console.warn('[web_view] 太阳码 scene 解析响应异常,降级到 CRMEB 首页');
} option.url = encodeURIComponent('https://shop.douba.top');
this._initWebView(option); }
}, this._initWebView(option);
fail: (err) => { },
console.error('[web_view] 太阳码 scene 网络请求失败:', err); fail: (err) => {
option.url = encodeURIComponent('https://shop.douba.top'); console.error('[web_view] 太阳码 scene 网络请求失败:', err);
this._initWebView(option); option.url = encodeURIComponent('https://shop.douba.top');
} this._initWebView(option);
}); }
}, });
},
_initWebView(option) { _initWebView(option) {
try { try {

View File

@@ -437,11 +437,11 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
.coupon-list .item .money .num { .coupon-list .item .money .num {
font-size: 60rpx; font-size: 60rpx;
font-family: SemiBold; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; font-weight: 600;
} }
.num-fa-semi { .num-fa-semi {
font-family: SemiBold; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; font-weight: 600;
} }
.coupon-list .item .text { .coupon-list .item .text {

View File

@@ -2779,11 +2779,11 @@
} }
.Regular { .Regular {
font-family: Regular; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
} }
.SemiBold { .SemiBold {
font-family: SemiBold; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; font-weight: 600;
} }
.space-line { .space-line {

View File

@@ -1,8 +0,0 @@
@font-face {
font-family: SemiBold;
src: url('static/fonts/D-DIN-PRO-600-SemiBold.ttf');
}
@font-face {
font-family: Regular;
src: url('static/fonts/D-DIN-PRO-400-Regular.ttf');
}