提交 dbb1884c 编写于 作者: d-u-a's avatar d-u-a

update: screenOrientation 兼容微信小程序 pages globalStyle 配置

上级 5f55624e
......@@ -18,7 +18,13 @@ const {
} = require('../../util')
const definePages = require('./define-pages')
const appConfigService = require('./app-config-service')
const appConfigService = require('./app-config-service')
const wxPageOrientationMapping = {
auto: ["portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"],
portrait: ["portrait-primary", "portrait-secondary"],
landscape: ["landscape-primary", "landscape-secondary"]
}
function parseConfig (appJson) {
return {
......@@ -128,9 +134,14 @@ module.exports = function (pagesJson, userManifestJson) {
}
// 屏幕启动方向
if (manifestJson.plus.screenOrientation) {
if (manifestJson.plus.screenOrientation) {// app平台优先使用 manifest 配置
manifestJson.screenOrientation = manifestJson.plus.screenOrientation
delete manifestJson.plus.screenOrientation
} else if (appJson.window && appJson.window.pageOrientation) {// 兼容微信小程序
const pageOrientationValue = wxPageOrientationMapping[appJson.window.pageOrientation]
if (pageOrientationValue) {
manifestJson.screenOrientation = pageOrientationValue
}
}
// 地图坐标系
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册