|
|
@@ -26,7 +26,14 @@
|
|
|
// uni.$TUIKit.on(uni.$TUIKitEvent.ERROR, this.onTIMError);
|
|
|
// uni.$TUIKit.on(uni.$TUIKitEvent.NET_STATE_CHANGE, this.onNetStateChange);
|
|
|
// uni.$TUIKit.on(uni.$TUIKitEvent.SDK_RELOAD, this.onSDKReload);
|
|
|
+ const systemInfo = uni.getSystemInfoSync();
|
|
|
+ const baseFontSize = 14; // 标准字体大小(你可以自定义)
|
|
|
+ const userFontSize = systemInfo.fontSizeSetting || baseFontSize;
|
|
|
|
|
|
+ // 计算比例
|
|
|
+ const scale = userFontSize / baseFontSize;
|
|
|
+ // 存储到全局变量或 Vuex
|
|
|
+ uni.setStorageSync('fontScale', scale);
|
|
|
console.log('IM')
|
|
|
},
|
|
|
onShow: function () {
|