Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
8cf72d2c
U
uni-app
项目概览
anyefeiyu
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8cf72d2c
编写于
4月 29, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build uni runtime(app-plus add subNVue)
上级
c9a2c894
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
115 addition
and
10 deletion
+115
-10
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+65
-6
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-1
src/core/helpers/promise.js
src/core/helpers/promise.js
+1
-1
src/platforms/app-plus/service/api/index.js
src/platforms/app-plus/service/api/index.js
+4
-2
src/platforms/app-plus/service/api/sub-nvue.js
src/platforms/app-plus/service/api/sub-nvue.js
+44
-0
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
8cf72d2c
...
...
@@ -40,7 +40,7 @@ const camelize = cached((str) => {
return
str
.
replace
(
camelizeRE
,
(
_
,
c
)
=>
c
?
c
.
toUpperCase
()
:
''
)
});
const
SYNC_API_RE
=
/requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$/
;
const
SYNC_API_RE
=
/
subNVue|
requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
@@ -144,7 +144,9 @@ function upx2px (number, newDeviceWidth) {
return
number
<
0
?
-
result
:
result
}
var
protocols
=
{};
const
protocols
=
{};
const
todos
=
[];
const
canIUses
=
[];
const
CALLBACKS
=
[
'
success
'
,
'
fail
'
,
'
cancel
'
,
'
complete
'
];
...
...
@@ -248,6 +250,51 @@ TODOS.forEach(function (name) {
todoApis
[
name
]
=
createTodoApi
(
name
);
});
function
wrapper$1
(
webview
)
{
webview
.
$processed
=
true
;
if
(
!
webview
.
__uniapp_mask_id
)
{
return
}
const
maskColor
=
webview
.
__uniapp_mask
;
const
maskWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
);
const
oldShow
=
webview
.
show
;
const
oldHide
=
webview
.
hide
;
const
oldClose
=
webview
.
close
;
const
showMask
=
function
()
{
maskWebview
.
setStyle
({
mask
:
maskColor
});
};
const
closeMask
=
function
()
{
maskWebview
.
setStyle
({
mask
:
'
none
'
});
};
webview
.
show
=
function
(...
args
)
{
showMask
();
return
oldShow
.
apply
(
webview
,
args
)
};
webview
.
hide
=
function
(...
args
)
{
closeMask
();
return
oldHide
.
apply
(
webview
,
args
)
};
webview
.
close
=
function
(...
args
)
{
closeMask
();
return
oldClose
.
apply
(
webview
,
args
)
};
}
const
subNVue
=
{
getSubNVueById
(
id
)
{
const
webview
=
plus
.
webview
.
getWebviewById
(
id
);
if
(
webview
&&
!
webview
.
$processed
)
{
wrapper$1
(
webview
);
}
return
webview
}
};
function
requireNativePlugin
(
pluginName
)
{
/* eslint-disable no-undef */
if
(
typeof
weex
!==
'
undefined
'
)
{
...
...
@@ -258,7 +305,8 @@ function requireNativePlugin (pluginName) {
}
var
api
=
/*#__PURE__*/
Object
.
freeze
({
requireNativePlugin
:
requireNativePlugin
requireNativePlugin
:
requireNativePlugin
,
subNVue
:
subNVue
});
const
MPPage
=
Page
;
...
...
@@ -532,7 +580,7 @@ function getProperties (props, isBehavior = false, file = '') {
return
properties
}
function
wrapper$
1
(
event
)
{
function
wrapper$
2
(
event
)
{
// TODO 又得兼容 mpvue 的 mp 对象
try
{
event
.
mp
=
JSON
.
parse
(
JSON
.
stringify
(
event
));
...
...
@@ -683,7 +731,7 @@ const ONCE = '~';
const
CUSTOM
=
'
^
'
;
function
handleEvent
(
event
)
{
event
=
wrapper$
1
(
event
);
event
=
wrapper$
2
(
event
);
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const
eventOpts
=
(
event
.
currentTarget
||
event
.
target
).
dataset
.
eventOpts
;
...
...
@@ -975,6 +1023,17 @@ function createComponent (vueOptions) {
return
initComponent$1
(
componentOptions
,
vueOptions
)
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
canIUses
.
forEach
(
canIUseApi
=>
{
const
apiName
=
protocols
[
canIUseApi
]
&&
protocols
[
canIUseApi
].
name
?
protocols
[
canIUseApi
].
name
:
canIUseApi
;
if
(
!
wx
.
canIUse
(
apiName
))
{
protocols
[
canIUseApi
]
=
false
;
}
});
let
uni
=
{};
if
(
typeof
Proxy
!==
'
undefined
'
)
{
...
...
packages/uni-app-plus/package.json
浏览文件 @
8cf72d2c
{
"name"
:
"@dcloudio/uni-app-plus"
,
"version"
:
"0.0.23
0
"
,
"version"
:
"0.0.23
1
"
,
"description"
:
"uni-app app-plus"
,
"main"
:
"dist/index.js"
,
"scripts"
:
{
...
...
src/core/helpers/promise.js
浏览文件 @
8cf72d2c
...
...
@@ -2,7 +2,7 @@ import {
isFn
}
from
'
uni-shared
'
const
SYNC_API_RE
=
/requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$/
const
SYNC_API_RE
=
/
subNVue|
requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$/
const
CONTEXT_API_RE
=
/^create|Manager$/
...
...
src/platforms/app-plus/service/api/index.js
浏览文件 @
8cf72d2c
...
...
@@ -6,3 +6,5 @@ export function requireNativePlugin (pluginName) {
/* eslint-disable no-undef */
return
__requireNativePlugin__
(
pluginName
)
}
export
*
from
'
./sub-nvue
'
src/platforms/app-plus/service/api/sub-nvue.js
0 → 100644
浏览文件 @
8cf72d2c
function
wrapper
(
webview
)
{
webview
.
$processed
=
true
if
(
!
webview
.
__uniapp_mask_id
)
{
return
}
const
maskColor
=
webview
.
__uniapp_mask
const
maskWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
const
oldShow
=
webview
.
show
const
oldHide
=
webview
.
hide
const
oldClose
=
webview
.
close
const
showMask
=
function
()
{
maskWebview
.
setStyle
({
mask
:
maskColor
})
}
const
closeMask
=
function
()
{
maskWebview
.
setStyle
({
mask
:
'
none
'
})
}
webview
.
show
=
function
(...
args
)
{
showMask
()
return
oldShow
.
apply
(
webview
,
args
)
}
webview
.
hide
=
function
(...
args
)
{
closeMask
()
return
oldHide
.
apply
(
webview
,
args
)
}
webview
.
close
=
function
(...
args
)
{
closeMask
()
return
oldClose
.
apply
(
webview
,
args
)
}
}
export
const
subNVue
=
{
getSubNVueById
(
id
)
{
const
webview
=
plus
.
webview
.
getWebviewById
(
id
)
if
(
webview
&&
!
webview
.
$processed
)
{
wrapper
(
webview
)
}
return
webview
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录