Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wychl
uni-app
提交
5c7766a3
U
uni-app
项目概览
wychl
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c7766a3
编写于
1月 02, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: upx2px 内调用不到 uni.getSystemInfoSync 的问题
上级
b292e96a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
87 addition
and
37 deletion
+87
-37
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+23
-11
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+1
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+11
-11
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+11
-11
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-1
src/core/runtime/index.js
src/core/runtime/index.js
+1
-1
src/core/runtime/upx2px.js
src/core/runtime/upx2px.js
+38
-0
未找到文件。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
5c7766a3
...
...
@@ -89,14 +89,14 @@ function checkDeviceWidth () {
platform
,
pixelRatio
,
windowWidth
}
=
uni
.
getSystemInfoSync
();
}
=
my
.
getSystemInfoSync
();
// runtime 编译目标是 uni 对象,内部不允许直接使用 uni
deviceWidth
=
windowWidth
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
}
function
upx2px
(
number
,
newDeviceWidth
)
{
function
upx2px
(
number
,
newDeviceWidth
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
}
...
...
@@ -406,6 +406,18 @@ const protocols = { // 需要做转换的 API 列表
args
:
{
orderInfo
:
'
orderStr
'
}
},
getBLEDeviceServices
:
{
returnValue
(
result
)
{
result
.
services
.
forEach
((
item
)
=>
{
item
.
uuid
=
item
.
serviceId
;
});
}
},
makePhoneCall
:
{
args
:
{
phoneNumber
:
'
number
'
}
}
};
...
...
@@ -578,10 +590,10 @@ var api = /*#__PURE__*/Object.freeze({
removeStorageSync
:
removeStorageSync
});
let
uni
$1
=
{};
let
uni
=
{};
if
(
typeof
Proxy
!==
'
undefined
'
)
{
uni
$1
=
new
Proxy
({},
{
uni
=
new
Proxy
({},
{
get
(
target
,
name
)
{
if
(
name
===
'
upx2px
'
)
{
return
upx2px
...
...
@@ -602,27 +614,27 @@ if (typeof Proxy !== 'undefined') {
}
});
}
else
{
uni
$1
.
upx2px
=
upx2px
;
uni
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
Object
.
keys
(
my
).
forEach
(
name
=>
{
if
(
hasOwn
(
my
,
name
)
||
hasOwn
(
protocols
,
name
))
{
uni
$1
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
my
[
name
]));
uni
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
my
[
name
]));
}
});
}
var
uni$
2
=
uni$1
;
var
uni$
1
=
uni
;
export
default
uni$
2
;
export
default
uni$
1
;
packages/uni-mp-alipay/package.json
浏览文件 @
5c7766a3
{
"name"
:
"@dcloudio/uni-mp-alipay"
,
"version"
:
"0.0.
5
"
,
"version"
:
"0.0.
6
"
,
"description"
:
"uni-app mp-alipay"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
5c7766a3
...
...
@@ -89,14 +89,14 @@ function checkDeviceWidth () {
platform
,
pixelRatio
,
windowWidth
}
=
uni
.
getSystemInfoSync
();
}
=
swan
.
getSystemInfoSync
();
// uni=>swan runtime 编译目标是 uni 对象,内部不允许直接使用 uni
deviceWidth
=
windowWidth
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
}
function
upx2px
(
number
,
newDeviceWidth
)
{
function
upx2px
(
number
,
newDeviceWidth
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
}
...
...
@@ -332,10 +332,10 @@ var api = /*#__PURE__*/Object.freeze({
requestPayment
:
requestPayment
});
let
uni
$1
=
{};
let
uni
=
{};
if
(
typeof
Proxy
!==
'
undefined
'
)
{
uni
$1
=
new
Proxy
({},
{
uni
=
new
Proxy
({},
{
get
(
target
,
name
)
{
if
(
name
===
'
upx2px
'
)
{
return
upx2px
...
...
@@ -356,27 +356,27 @@ if (typeof Proxy !== 'undefined') {
}
});
}
else
{
uni
$1
.
upx2px
=
upx2px
;
uni
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
Object
.
keys
(
swan
).
forEach
(
name
=>
{
if
(
hasOwn
(
swan
,
name
)
||
hasOwn
(
protocols
,
name
))
{
uni
$1
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
swan
[
name
]));
uni
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
swan
[
name
]));
}
});
}
var
uni$
2
=
uni$1
;
var
uni$
1
=
uni
;
export
default
uni$
2
;
export
default
uni$
1
;
packages/uni-mp-baidu/package.json
浏览文件 @
5c7766a3
{
"name"
:
"@dcloudio/uni-mp-baidu"
,
"version"
:
"0.0.
4
"
,
"version"
:
"0.0.
5
"
,
"description"
:
"uni-app mp-baidu"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
5c7766a3
...
...
@@ -89,14 +89,14 @@ function checkDeviceWidth () {
platform
,
pixelRatio
,
windowWidth
}
=
uni
.
getSystemInfoSync
();
}
=
wx
.
getSystemInfoSync
();
// uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
deviceWidth
=
windowWidth
;
deviceDPR
=
pixelRatio
;
isIOS
=
platform
===
'
ios
'
;
}
function
upx2px
(
number
,
newDeviceWidth
)
{
function
upx2px
(
number
,
newDeviceWidth
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
();
}
...
...
@@ -261,10 +261,10 @@ var api = /*#__PURE__*/Object.freeze({
});
let
uni
$1
=
{};
let
uni
=
{};
if
(
typeof
Proxy
!==
'
undefined
'
)
{
uni
$1
=
new
Proxy
({},
{
uni
=
new
Proxy
({},
{
get
(
target
,
name
)
{
if
(
name
===
'
upx2px
'
)
{
return
upx2px
...
...
@@ -285,27 +285,27 @@ if (typeof Proxy !== 'undefined') {
}
});
}
else
{
uni
$1
.
upx2px
=
upx2px
;
uni
.
upx2px
=
upx2px
;
Object
.
keys
(
todoApis
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
extraApi
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
uni
[
name
]
=
promisify
(
name
,
todoApis
[
name
]);
});
Object
.
keys
(
api
).
forEach
(
name
=>
{
uni
$1
[
name
]
=
promisify
(
name
,
api
[
name
]);
uni
[
name
]
=
promisify
(
name
,
api
[
name
]);
});
Object
.
keys
(
wx
).
forEach
(
name
=>
{
if
(
hasOwn
(
wx
,
name
)
||
hasOwn
(
protocols
,
name
))
{
uni
$1
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
wx
[
name
]));
uni
[
name
]
=
promisify
(
name
,
wrapper
(
name
,
wx
[
name
]));
}
});
}
var
uni$
2
=
uni$1
;
var
uni$
1
=
uni
;
export
default
uni$
2
;
export
default
uni$
1
;
packages/uni-mp-weixin/package.json
浏览文件 @
5c7766a3
{
"name"
:
"@dcloudio/uni-mp-weixin"
,
"version"
:
"0.0.
3
"
,
"version"
:
"0.0.
4
"
,
"description"
:
"uni-app mp-weixin"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
src/core/runtime/index.js
浏览文件 @
5c7766a3
...
...
@@ -8,7 +8,7 @@ import {
import
{
upx2px
}
from
'
.
./service/api
/upx2px
'
}
from
'
./upx2px
'
import
wrapper
from
'
./wrapper
'
...
...
src/core/runtime/upx2px.js
0 → 100644
浏览文件 @
5c7766a3
const
EPS
=
1
e
-
4
const
BASE_DEVICE_WIDTH
=
750
let
isIOS
=
false
let
deviceWidth
=
0
let
deviceDPR
=
0
export
function
checkDeviceWidth
()
{
const
{
platform
,
pixelRatio
,
windowWidth
}
=
__GLOBAL__
.
getSystemInfoSync
()
// uni=>__GLOBAL__ runtime 编译目标是 uni 对象,内部不允许直接使用 uni
deviceWidth
=
windowWidth
deviceDPR
=
pixelRatio
isIOS
=
platform
===
'
ios
'
}
export
function
upx2px
(
number
,
newDeviceWidth
)
{
if
(
deviceWidth
===
0
)
{
checkDeviceWidth
()
}
number
=
Number
(
number
)
if
(
number
===
0
)
{
return
0
}
number
=
(
number
/
BASE_DEVICE_WIDTH
)
*
(
newDeviceWidth
||
deviceWidth
)
number
=
Math
.
floor
(
number
+
EPS
)
if
(
number
===
0
)
{
if
(
deviceDPR
===
1
||
!
isIOS
)
{
return
1
}
else
{
return
0.5
}
}
return
number
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录