Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
aa4adcd0
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aa4adcd0
编写于
6月 01, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
f3fb42ce
8104efa8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
18 deletion
+14
-18
packages/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js
...lugin-uni-optimize/packages/babel-plugin-uni-api/index.js
+0
-13
packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/api.js
...ugin-uni-optimize/packages/webpack-optimize-plugin/api.js
+12
-3
src/platforms/h5/service/api/device/get-system-info.js
src/platforms/h5/service/api/device/get-system-info.js
+2
-2
未找到文件。
packages/vue-cli-plugin-uni-optimize/packages/babel-plugin-uni-api/index.js
浏览文件 @
aa4adcd0
const
path
=
require
(
'
path
'
)
const
{
normalizePath
}
=
require
(
'
@dcloudio/uni-cli-shared
'
)
process
.
UNI_APIS
=
new
Set
()
const
sourcePath
=
normalizePath
(
path
.
join
(
require
.
resolve
(
'
@dcloudio/uni-h5
'
),
'
../../
'
))
module
.
exports
=
function
({
types
:
t
})
{
...
...
@@ -21,10 +12,6 @@ module.exports = function ({
path
.
node
.
object
.
name
===
'
wx
'
)
)
{
if
(
normalizePath
(
state
.
file
.
opts
.
filename
).
indexOf
(
sourcePath
)
===
0
)
{
path
.
stop
()
return
}
process
.
UNI_APIS
.
add
(
path
.
node
.
property
.
name
||
path
.
node
.
property
.
value
)
}
}
...
...
packages/vue-cli-plugin-uni-optimize/packages/webpack-optimize-plugin/api.js
浏览文件 @
aa4adcd0
...
...
@@ -118,7 +118,7 @@ const isApiSubscribe = filepath => {
return
filepath
.
indexOf
(
'
/core/view/bridge/subscribe/api
'
)
===
0
}
function
parseDeps
(
apis
,
manifest
)
{
function
parseDeps
(
apis
,
manifest
)
{
const
apiPaths
=
Object
.
create
(
null
)
const
apiProtocolPaths
=
Object
.
create
(
null
)
const
invokeApiPaths
=
Object
.
create
(
null
)
...
...
@@ -196,7 +196,7 @@ function parseDeps (apis, manifest) {
}
}
module
.
exports
=
function
updateApis
(
apis
=
new
Set
(),
userApis
=
new
Set
())
{
module
.
exports
=
function
updateApis
(
apis
=
new
Set
(),
userApis
=
new
Set
())
{
if
(
!
fs
.
existsSync
(
tmpDir
))
{
fs
.
mkdirSync
(
tmpDir
)
}
...
...
@@ -211,6 +211,15 @@ module.exports = function updateApis (apis = new Set(), userApis = new Set()) {
apis
=
new
Set
([...
apis
,
...
userApis
])
if
(
process
.
UNI_TAGS
)
{
// TODO 临时硬编码
if
(
process
.
UNI_TAGS
.
has
(
'
map
'
))
{
apis
.
add
(
'
getLocation
'
)
apis
.
add
(
'
stopCompass
'
)
apis
.
add
(
'
onCompassChange
'
)
}
}
const
{
apiPaths
,
apiProtocolPaths
,
...
...
@@ -232,4 +241,4 @@ module.exports = function updateApis (apis = new Set(), userApis = new Set()) {
updateCoreComponents
(
coreComponentsPaths
)
updateAppMixins
(
appMixinsPaths
)
updateSystemRoutes
(
systemRoutesPaths
)
}
}
src/platforms/h5/service/api/device/get-system-info.js
浏览文件 @
aa4adcd0
...
...
@@ -18,8 +18,8 @@ export function getSystemInfoSync () {
var
pixelRatio
=
window
.
devicePixelRatio
// 横屏时 iOS 获取的屏幕宽高颠倒,进行纠正
var
landscape
=
Math
.
abs
(
window
.
orientation
)
===
90
var
screenWidth
=
Math
[
landscape
?
'
max
'
:
'
min
'
](
screen
.
width
,
screen
.
height
)
var
screenHeight
=
Math
[
landscape
?
'
min
'
:
'
max
'
](
screen
.
height
,
screen
.
width
)
var
screenWidth
=
typeof
window
.
orientation
===
'
number
'
?
Math
[
landscape
?
'
max
'
:
'
min
'
](
screen
.
width
,
screen
.
height
)
:
screen
.
width
var
screenHeight
=
typeof
window
.
orientation
===
'
number
'
?
Math
[
landscape
?
'
min
'
:
'
max
'
](
screen
.
height
,
screen
.
width
)
:
screen
.
height
var
windowWidth
=
Math
.
min
(
window
.
innerWidth
,
document
.
documentElement
.
clientWidth
,
screenWidth
)
var
windowHeight
=
window
.
innerHeight
var
language
=
navigator
.
language
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录