修复一个 ios 6.6.6 上的兼容性 bug

This commit is contained in:
CPPAlien 2018-07-16 15:59:18 +08:00
parent 83195e6cad
commit c17b06dcd4

View File

@ -63,10 +63,9 @@ Component({
return;
}
if (!getApp().painterScreenRatio) {
if (!(getApp().systemInfo && getApp().systemInfo.screenWidth)) {
try {
const systemInfo = wx.getSystemInfoSync();
getApp().painterScreenRatio = systemInfo.screenWidth / 750;
getApp().systemInfo = wx.getSystemInfoSync();
} catch (e) {
const error = `Painter get system info failed, ${JSON.stringify(e)}`;
that.triggerEvent('imgErr', { error: error });
@ -74,7 +73,7 @@ Component({
return;
}
}
screenK = getApp().painterScreenRatio;
screenK = getApp().systemInfo.screenWidth / 750;
this.downloadImages().then((palette) => {
const { width, height } = palette;