diff --git a/src/platforms/mp-weixin/helpers/enhance-system-info.js b/src/platforms/mp-weixin/helpers/enhance-system-info.js index 4f5f7ab6b60213e3748f1b98b5704910092183bc..8fb388ac18a770e3a4d23378f56fe0f454713540 100644 --- a/src/platforms/mp-weixin/helpers/enhance-system-info.js +++ b/src/platforms/mp-weixin/helpers/enhance-system-info.js @@ -1,4 +1,4 @@ -function _getDeviceBrand(model) { +function _getDeviceBrand (model) { if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' } if (/windows/gi.test(model)) { return 'microsoft' } return '' @@ -6,7 +6,7 @@ function _getDeviceBrand(model) { const UUID_KEY = '__DC_STAT_UUID' let deviceId -export function useDeviceId(result) { +export function useDeviceId (result) { deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY) if (!deviceId) { deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7) @@ -18,7 +18,7 @@ export function useDeviceId(result) { result.deviceId = deviceId } -export function addSafeAreaInsets(result) { +export function addSafeAreaInsets (result) { if (result.safeArea) { const safeArea = result.safeArea result.safeAreaInsets = { @@ -30,7 +30,7 @@ export function addSafeAreaInsets(result) { } } -export function populateParameters(result) { +export function populateParameters (result) { const { brand = '', model = '', system = '', language = '', theme, version, @@ -60,10 +60,10 @@ export function populateParameters(result) { } // deviceType - let deviceType = getGetDeviceType(result, model) + const deviceType = getGetDeviceType(result, model) // deviceModel - let deviceBrand = getDeviceBrand(brand, model, isQuickApp) + const deviceBrand = getDeviceBrand(brand, model, isQuickApp) // hostName let _hostName = hostName || __PLATFORM__.split('-')[1] // mp-jd @@ -128,7 +128,7 @@ export function populateParameters(result) { Object.assign(result, parameters) } -export function getGetDeviceType(result, model) { +export function getGetDeviceType (result, model) { let deviceType = result.deviceType || 'phone' if (__PLATFORM__ !== 'mp-baidu') { const deviceTypeMaps = { @@ -149,7 +149,7 @@ export function getGetDeviceType(result, model) { return deviceType } -export function getDeviceBrand( +export function getDeviceBrand ( brand, model, isQuickApp = false @@ -165,4 +165,4 @@ export function getDeviceBrand( deviceBrand = _getDeviceBrand(deviceBrand) } return deviceBrand -} \ No newline at end of file +} diff --git a/src/platforms/mp-weixin/helpers/get-app-base-info.js b/src/platforms/mp-weixin/helpers/get-app-base-info.js index da507ed5b37669d70273499e9718d9ff0662bb8b..cc3abbdec9c2f345f5da4ec393138c975beb30d8 100644 --- a/src/platforms/mp-weixin/helpers/get-app-base-info.js +++ b/src/platforms/mp-weixin/helpers/get-app-base-info.js @@ -18,7 +18,7 @@ export default { appId: process.env.UNI_APP_ID, appName: process.env.UNI_APP_NAME, appVersion: process.env.UNI_APP_VERSION_NAME, - appVersionCode: process.env.UNI_APP_VERSION_CODE, + appVersionCode: process.env.UNI_APP_VERSION_CODE }) } } diff --git a/src/platforms/mp-weixin/helpers/get-device-info.js b/src/platforms/mp-weixin/helpers/get-device-info.js index efdc5f70e75a18ecce348f60e3e7d2baca7fb953..96ee3b92bf48b9623af6efd3a1576b1be1d86c95 100644 --- a/src/platforms/mp-weixin/helpers/get-device-info.js +++ b/src/platforms/mp-weixin/helpers/get-device-info.js @@ -1,16 +1,16 @@ -import { useDeviceId, getGetDeviceType, getDeviceBrand } from './enhance-system-info'; +import { useDeviceId, getGetDeviceType, getDeviceBrand } from './enhance-system-info' export default { returnValue: function (result) { const { brand, model } = result - let deviceType = getGetDeviceType(result, model) - let deviceBrand = getDeviceBrand(brand, model) + const deviceType = getGetDeviceType(result, model) + const deviceBrand = getDeviceBrand(brand, model) useDeviceId(result) Object.assign(result, { deviceType, deviceBrand, - deviceModel: model, + deviceModel: model }) } } diff --git a/src/platforms/mp-weixin/helpers/get-window-info.js b/src/platforms/mp-weixin/helpers/get-window-info.js index 9c850d1761dd64ee84e912432187861852efba96..bda0ccb1c1515212598f59f689dbedbc91c5ad58 100644 --- a/src/platforms/mp-weixin/helpers/get-window-info.js +++ b/src/platforms/mp-weixin/helpers/get-window-info.js @@ -1,4 +1,4 @@ -import { addSafeAreaInsets } from './enhance-system-info'; +import { addSafeAreaInsets } from './enhance-system-info' export default { returnValue: function (result) { @@ -6,7 +6,7 @@ export default { Object.assign(result, { windowTop: 0, - windowBottom: 0, + windowBottom: 0 }) } }