Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦里逆天
uni-app
提交
4cfee9a0
U
uni-app
项目概览
梦里逆天
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
22
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4cfee9a0
编写于
3月 18, 2020
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dcloudio/uni-app into dev
上级
c343facc
e990e7a1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
304 addition
and
207 deletion
+304
-207
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+254
-195
packages/uni-app-plus/dist/service.runtime.esm.dev.js
packages/uni-app-plus/dist/service.runtime.esm.dev.js
+8
-2
packages/uni-app-plus/dist/service.runtime.esm.prod.js
packages/uni-app-plus/dist/service.runtime.esm.prod.js
+8
-2
src/platforms/app-plus/service/api/plugin/sub-nvue.js
src/platforms/app-plus/service/api/plugin/sub-nvue.js
+14
-3
src/platforms/app-plus/service/api/route/switch-tab.js
src/platforms/app-plus/service/api/route/switch-tab.js
+12
-5
src/platforms/app-plus/service/framework/plugins/vdom-sync.js
...platforms/app-plus/service/framework/plugins/vdom-sync.js
+7
-0
src/platforms/app-plus/service/framework/webview/parser/sub-nvue-parser.js
...-plus/service/framework/webview/parser/sub-nvue-parser.js
+1
-0
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
4cfee9a0
export
function
createServiceContext
(
Vue
,
weex
,
plus
,
UniServiceJSBridge
,
instanceContext
){
var
localStorage
=
plus
.
storage
var
setTimeout
=
instanceContext
.
setTimeout
var
clearTimeout
=
instanceContext
.
clearTimeout
var
setInterval
=
instanceContext
.
setInterval
...
...
@@ -3460,7 +3459,7 @@ var serviceContext = (function () {
if
(
!
id
||
!
elm
)
{
return
}
if
(
elm
.
attr
.
id
===
id
)
{
if
(
elm
.
attr
&&
elm
.
attr
.
id
===
id
)
{
return
elm
}
const
children
=
elm
.
children
;
...
...
@@ -7315,9 +7314,20 @@ var serviceContext = (function () {
if
(
webview
&&
!
webview
.
$processed
)
{
wrapper$1
(
webview
);
}
let
oldSetStyle
=
webview
.
setStyle
;
var
parentWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
);
webview
.
setStyle
=
function
(
style
)
{
if
(
style
&&
style
.
mask
)
{
parentWebview
.
setStyle
({
mask
:
style
.
mask
});
delete
style
.
mask
;
}
oldSetStyle
.
call
(
this
,
style
);
};
return
webview
}
}
function
getCurrentSubNVue
()
{
return
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
)
}
...
...
@@ -7755,6 +7765,7 @@ var serviceContext = (function () {
`UNIAPP[webview][
${
webview
.
id
}
]:create[
${
subNVue
.
id
}
]:
${
JSON
.
stringify
(
style
)}
`
);
}
delete
style
.
mask
;
const
subNVueWebview
=
plus
.
webview
.
create
(
''
,
subNVue
.
id
,
style
,
extras
);
if
(
isPopup
)
{
...
...
@@ -8409,10 +8420,12 @@ var serviceContext = (function () {
const
pages
=
getCurrentPages
();
const
len
=
pages
.
length
;
let
callOnHide
=
false
;
let
callOnShow
=
false
;
let
currentPage
;
if
(
len
>=
1
)
{
// 前一个页面是非 tabBar 页面
c
onst
c
urrentPage
=
pages
[
len
-
1
];
currentPage
=
pages
[
len
-
1
];
if
(
!
currentPage
.
$page
.
meta
.
isTabBar
)
{
// 前一个页面为非 tabBar 页面时,目标tabBar需要强制触发onShow
// 该情况下目标页tabBarPage的visible是不对的
...
...
@@ -8435,8 +8448,7 @@ var serviceContext = (function () {
}
},
100
);
}
else
{
// 前一个 tabBar 触发 onHide
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
);
callOnHide
=
true
;
}
}
...
...
@@ -8455,7 +8467,13 @@ var serviceContext = (function () {
}
}
});
// 相同tabBar页面
if
(
currentPage
===
tabBarPage
)
{
callOnHide
=
false
;
}
if
(
currentPage
&&
callOnHide
)
{
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
);
}
if
(
tabBarPage
)
{
tabBarPage
.
$getAppWebview
().
show
(
'
none
'
);
// 等visible状态都切换完之后,再触发onShow,否则开发者在onShow里边 getCurrentPages 会不准确
...
...
@@ -8495,6 +8513,198 @@ var serviceContext = (function () {
},
openType
===
'
appLaunch
'
);
}
const
STORAGE_DATA_TYPE
=
'
__TYPE
'
;
const
STORAGE_KEYS
=
'
uni-storage-keys
'
;
function
parseValue
(
value
)
{
const
types
=
[
'
object
'
,
'
string
'
,
'
number
'
,
'
boolean
'
,
'
undefined
'
];
try
{
const
object
=
typeof
value
===
'
string
'
?
JSON
.
parse
(
value
)
:
value
;
const
type
=
object
.
type
;
if
(
types
.
indexOf
(
type
)
>=
0
)
{
const
keys
=
Object
.
keys
(
object
);
// eslint-disable-next-line valid-typeof
if
(
keys
.
length
===
2
&&
'
data
'
in
object
&&
typeof
object
.
data
===
type
)
{
return
object
.
data
}
else
if
(
keys
.
length
===
1
)
{
return
''
}
}
}
catch
(
error
)
{}
}
function
setStorage$1
({
key
,
data
,
isSync
}
=
{},
callbackId
)
{
const
type
=
typeof
data
;
const
value
=
type
===
'
string
'
?
data
:
JSON
.
stringify
({
type
,
data
:
data
});
try
{
if
(
type
===
'
string
'
&&
parseValue
(
value
)
!==
undefined
)
{
plus
.
storage
.
setItemAsync
(
key
+
STORAGE_DATA_TYPE
,
type
);
}
else
{
plus
.
storage
.
removeItemAsync
(
key
+
STORAGE_DATA_TYPE
);
}
plus
.
storage
.
setItemAsync
(
key
,
value
,
function
()
{
invoke$1
(
callbackId
,
{
errMsg
:
'
setStorage:ok
'
});
},
function
(
err
)
{
invoke$1
(
callbackId
,
{
errMsg
:
`setStorage:fail
${
err
.
message
}
`
});
});
}
catch
(
error
)
{
invoke$1
(
callbackId
,
{
errMsg
:
`setStorage:fail
${
error
}
`
});
}
}
function
setStorageSync$1
(
key
,
data
)
{
const
type
=
typeof
data
;
const
value
=
type
===
'
string
'
?
data
:
JSON
.
stringify
({
type
,
data
:
data
});
try
{
if
(
type
===
'
string
'
&&
parseValue
(
value
)
!==
undefined
)
{
plus
.
storage
.
setItem
(
key
+
STORAGE_DATA_TYPE
,
type
);
}
else
{
plus
.
storage
.
removeItem
(
key
+
STORAGE_DATA_TYPE
);
}
plus
.
storage
.
setItem
(
key
,
value
);
}
catch
(
error
)
{
}
}
function
parseGetStorage
(
type
,
value
)
{
let
data
=
value
;
if
(
type
!==
'
string
'
||
(
type
===
'
string
'
&&
value
===
'
{"type":"undefined"}
'
))
{
try
{
// 兼容H5和V3初期历史格式
let
object
=
JSON
.
parse
(
value
);
const
result
=
parseValue
(
object
);
if
(
result
!==
undefined
)
{
data
=
result
;
}
else
if
(
type
)
{
// 兼容App端历史格式
data
=
object
;
if
(
typeof
object
===
'
string
'
)
{
object
=
JSON
.
parse
(
object
);
// eslint-disable-next-line valid-typeof
data
=
typeof
object
===
(
type
===
'
null
'
?
'
object
'
:
type
)
?
object
:
data
;
}
}
}
catch
(
error
)
{}
}
return
data
}
function
getStorage$1
({
key
}
=
{},
callbackId
)
{
plus
.
storage
.
getItemAsync
(
key
,
function
(
res
)
{
plus
.
storage
.
getItemAsync
(
key
+
STORAGE_DATA_TYPE
,
function
(
typeRes
)
{
const
typeOrigin
=
typeRes
.
data
||
''
;
const
type
=
typeOrigin
.
toLowerCase
();
invoke$1
(
callbackId
,
{
data
:
parseGetStorage
(
type
,
res
.
data
),
errMsg
:
'
getStorage:ok
'
});
},
function
()
{
const
type
=
''
;
invoke$1
(
callbackId
,
{
data
:
parseGetStorage
(
type
,
res
.
data
),
errMsg
:
'
getStorage:ok
'
});
});
},
function
(
err
)
{
invoke$1
(
callbackId
,
{
data
:
''
,
errMsg
:
`getStorage:fail
${
err
.
message
}
`
});
});
}
function
getStorageSync$1
(
key
)
{
const
value
=
plus
.
storage
.
getItem
(
key
);
const
typeOrigin
=
plus
.
storage
.
getItem
(
key
+
STORAGE_DATA_TYPE
)
||
''
;
const
type
=
typeOrigin
.
toLowerCase
();
if
(
typeof
value
!==
'
string
'
)
{
return
''
}
return
parseGetStorage
(
type
,
value
)
}
function
removeStorage$1
({
key
}
=
{},
callbackId
)
{
// 兼容App端历史格式
plus
.
storage
.
removeItemAsync
(
key
+
STORAGE_DATA_TYPE
);
plus
.
storage
.
removeItemAsync
(
key
,
function
(
res
)
{
invoke$1
(
callbackId
,
{
errMsg
:
'
removeStorage:ok
'
});
},
function
(
err
)
{
invoke$1
(
callbackId
,
{
errMsg
:
`removeStorage:fail
${
err
.
message
}
`
});
});
}
function
removeStorageSync$1
(
key
)
{
plus
.
storage
.
removeItem
(
key
+
STORAGE_DATA_TYPE
);
plus
.
storage
.
removeItem
(
key
);
}
function
clearStorage
(
args
,
callbackId
)
{
plus
.
storage
.
clearAsync
(
function
(
res
)
{
invoke$1
(
callbackId
,
{
errMsg
:
'
clearStorage:ok
'
});
},
function
(
err
)
{
invoke$1
(
callbackId
,
{
errMsg
:
`clearStorage:fail
${
err
.
message
}
`
});
});
}
function
clearStorageSync
()
{
plus
.
storage
.
clear
();
}
function
getStorageInfo
()
{
const
length
=
(
plus
.
storage
.
length
||
plus
.
storage
.
getLength
())
||
0
;
const
keys
=
[];
let
currentSize
=
0
;
for
(
let
index
=
0
;
index
<
length
;
index
++
)
{
const
key
=
plus
.
storage
.
key
(
index
);
if
(
key
!==
STORAGE_KEYS
&&
key
.
indexOf
(
STORAGE_DATA_TYPE
)
+
STORAGE_DATA_TYPE
.
length
!==
key
.
length
)
{
const
value
=
plus
.
storage
.
getItem
(
key
);
currentSize
+=
key
.
length
+
value
.
length
;
keys
.
push
(
key
);
}
}
return
{
keys
,
currentSize
:
Math
.
ceil
(
currentSize
*
2
/
1024
),
limitSize
:
Number
.
MAX_VALUE
,
errMsg
:
'
getStorageInfo:ok
'
}
}
function
getStorageInfoSync
()
{
const
res
=
getStorageInfo
();
delete
res
.
errMsg
;
return
res
}
function
showKeyboard
()
{
plus
.
key
.
showSoftKeybord
();
return
{
...
...
@@ -9221,6 +9431,16 @@ var serviceContext = (function () {
reLaunch
:
reLaunch$1
,
redirectTo
:
redirectTo$1
,
switchTab
:
switchTab$1
,
setStorage
:
setStorage$1
,
setStorageSync
:
setStorageSync$1
,
getStorage
:
getStorage$1
,
getStorageSync
:
getStorageSync$1
,
removeStorage
:
removeStorage$1
,
removeStorageSync
:
removeStorageSync$1
,
clearStorage
:
clearStorage
,
clearStorageSync
:
clearStorageSync
,
getStorageInfo
:
getStorageInfo
,
getStorageInfoSync
:
getStorageInfoSync
,
showKeyboard
:
showKeyboard
,
hideKeyboard
:
hideKeyboard
,
setNavigationBarTitle
:
setNavigationBarTitle$1
,
...
...
@@ -11363,173 +11583,6 @@ var serviceContext = (function () {
uploadFile
:
uploadFile$1
});
const
STORAGE_DATA_TYPE
=
'
__TYPE
'
;
const
STORAGE_KEYS
=
'
uni-storage-keys
'
;
function
parseValue
(
value
)
{
const
types
=
[
'
object
'
,
'
string
'
,
'
number
'
,
'
boolean
'
,
'
undefined
'
];
try
{
const
object
=
typeof
value
===
'
string
'
?
JSON
.
parse
(
value
)
:
value
;
const
type
=
object
.
type
;
if
(
types
.
indexOf
(
type
)
>=
0
)
{
const
keys
=
Object
.
keys
(
object
);
// eslint-disable-next-line valid-typeof
if
(
keys
.
length
===
2
&&
'
data
'
in
object
&&
typeof
object
.
data
===
type
)
{
return
object
.
data
}
else
if
(
keys
.
length
===
1
)
{
return
''
}
}
}
catch
(
error
)
{
}
}
function
setStorage$1
({
key
,
data
}
=
{})
{
const
type
=
typeof
data
;
const
value
=
type
===
'
string
'
?
data
:
JSON
.
stringify
({
type
,
data
:
data
});
try
{
if
(
type
===
'
string
'
&&
parseValue
(
value
)
!==
undefined
)
{
localStorage
.
setItem
(
key
+
STORAGE_DATA_TYPE
,
type
);
}
else
{
localStorage
.
removeItem
(
key
+
STORAGE_DATA_TYPE
);
}
localStorage
.
setItem
(
key
,
value
);
}
catch
(
error
)
{
return
{
errMsg
:
`setStorage:fail
${
error
}
`
}
}
return
{
errMsg
:
'
setStorage:ok
'
}
}
function
setStorageSync$1
(
key
,
data
)
{
setStorage$1
({
key
,
data
});
}
function
getStorage$1
({
key
}
=
{})
{
const
value
=
localStorage
&&
localStorage
.
getItem
(
key
);
if
(
typeof
value
!==
'
string
'
)
{
return
{
data
:
''
,
errMsg
:
'
getStorage:fail
'
}
}
let
data
=
value
;
const
typeOrigin
=
localStorage
.
getItem
(
key
+
STORAGE_DATA_TYPE
)
||
''
;
const
type
=
typeOrigin
.
toLowerCase
();
if
(
type
!==
'
string
'
||
(
typeOrigin
===
'
String
'
&&
value
===
'
{"type":"undefined"}
'
))
{
try
{
// 兼容H5和V3初期历史格式
let
object
=
JSON
.
parse
(
value
);
const
result
=
parseValue
(
object
);
if
(
result
!==
undefined
)
{
data
=
result
;
}
else
if
(
type
)
{
// 兼容App端历史格式
data
=
object
;
if
(
typeof
object
===
'
string
'
)
{
object
=
JSON
.
parse
(
object
);
// eslint-disable-next-line valid-typeof
data
=
typeof
object
===
(
type
===
'
null
'
?
'
object
'
:
type
)
?
object
:
data
;
}
}
}
catch
(
error
)
{
}
}
return
{
data
,
errMsg
:
'
getStorage:ok
'
}
}
function
getStorageSync$1
(
key
)
{
const
res
=
getStorage$1
({
key
});
return
res
.
data
}
function
removeStorage$1
({
key
}
=
{})
{
if
(
localStorage
)
{
// 兼容App端历史格式
localStorage
.
removeItem
(
key
+
STORAGE_DATA_TYPE
);
localStorage
.
removeItem
(
key
);
}
return
{
errMsg
:
'
removeStorage:ok
'
}
}
function
removeStorageSync$1
(
key
)
{
removeStorage$1
({
key
});
}
function
clearStorage
()
{
localStorage
&&
localStorage
.
clear
();
return
{
errMsg
:
'
clearStorage:ok
'
}
}
function
clearStorageSync
()
{
clearStorage
();
}
function
getStorageInfo
()
{
const
length
=
(
localStorage
&&
(
localStorage
.
length
||
localStorage
.
getLength
()))
||
0
;
const
keys
=
[];
let
currentSize
=
0
;
for
(
let
index
=
0
;
index
<
length
;
index
++
)
{
const
key
=
localStorage
.
key
(
index
);
if
(
key
!==
STORAGE_KEYS
&&
key
.
indexOf
(
STORAGE_DATA_TYPE
)
+
STORAGE_DATA_TYPE
.
length
!==
key
.
length
)
{
const
value
=
localStorage
.
getItem
(
key
);
currentSize
+=
key
.
length
+
value
.
length
;
keys
.
push
(
key
);
}
}
return
{
keys
,
currentSize
:
Math
.
ceil
(
currentSize
*
2
/
1024
),
limitSize
:
Number
.
MAX_VALUE
,
errMsg
:
'
getStorageInfo:ok
'
}
}
function
getStorageInfoSync
()
{
const
res
=
getStorageInfo
();
delete
res
.
errMsg
;
return
res
}
var
require_context_module_1_21
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
setStorage
:
setStorage$1
,
setStorageSync
:
setStorageSync$1
,
getStorage
:
getStorage$1
,
getStorageSync
:
getStorageSync$1
,
removeStorage
:
removeStorage$1
,
removeStorageSync
:
removeStorageSync$1
,
clearStorage
:
clearStorage
,
clearStorageSync
:
clearStorageSync
,
getStorageInfo
:
getStorageInfo
,
getStorageInfoSync
:
getStorageInfoSync
});
const
defaultOption
=
{
duration
:
400
,
timingFunction
:
'
linear
'
,
...
...
@@ -11608,7 +11661,7 @@ var serviceContext = (function () {
return
new
MPAnimation
(
option
)
}
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
1
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createAnimation
:
createAnimation
});
...
...
@@ -11673,7 +11726,7 @@ var serviceContext = (function () {
return
new
ServiceIntersectionObserver
(
getCurrentPageVm
(
'
createIntersectionObserver
'
),
options
)
}
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createIntersectionObserver
:
createIntersectionObserver
});
...
...
@@ -11814,7 +11867,7 @@ var serviceContext = (function () {
return
new
SelectorQuery
(
getCurrentPageVm
(
'
createSelectorQuery
'
))
}
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createSelectorQuery
:
createSelectorQuery
});
...
...
@@ -11831,7 +11884,7 @@ var serviceContext = (function () {
callbacks$b
.
push
(
callbackId
);
}
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
onKeyboardHeightChange
:
onKeyboardHeightChange
});
...
...
@@ -11856,7 +11909,7 @@ var serviceContext = (function () {
},
pageId
);
}
var
require_context_module_1_2
6
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
loadFontFace
:
loadFontFace$1
});
...
...
@@ -11869,7 +11922,7 @@ var serviceContext = (function () {
return
{}
}
var
require_context_module_1_2
7
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
6
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
pageScrollTo
:
pageScrollTo$1
});
...
...
@@ -11882,7 +11935,7 @@ var serviceContext = (function () {
return
{}
}
var
require_context_module_1_2
8
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
7
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
setPageMeta
:
setPageMeta
});
...
...
@@ -11919,7 +11972,7 @@ var serviceContext = (function () {
callbacks$c
.
push
(
callbackId
);
}
var
require_context_module_1_2
9
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
8
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
removeTabBarBadge
:
removeTabBarBadge$1
,
showTabBarRedDot
:
showTabBarRedDot$1
,
...
...
@@ -11945,7 +11998,7 @@ var serviceContext = (function () {
callbacks$d
.
splice
(
callbacks$d
.
indexOf
(
callbackId
),
1
);
}
var
require_context_module_1_
30
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
29
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
onWindowResize
:
onWindowResize
,
offWindowResize
:
offWindowResize
...
...
@@ -11977,16 +12030,15 @@ var serviceContext = (function () {
'
./network/request.js
'
:
require_context_module_1_18
,
'
./network/socket.js
'
:
require_context_module_1_19
,
'
./network/upload-file.js
'
:
require_context_module_1_20
,
'
./storage/storage.js
'
:
require_context_module_1_21
,
'
./ui/create-animation.js
'
:
require_context_module_1_22
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_23
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_24
,
'
./ui/keyboard.js
'
:
require_context_module_1_25
,
'
./ui/load-font-face.js
'
:
require_context_module_1_26
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_27
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_28
,
'
./ui/tab-bar.js
'
:
require_context_module_1_29
,
'
./ui/window.js
'
:
require_context_module_1_30
,
'
./ui/create-animation.js
'
:
require_context_module_1_21
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_22
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_23
,
'
./ui/keyboard.js
'
:
require_context_module_1_24
,
'
./ui/load-font-face.js
'
:
require_context_module_1_25
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_26
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_27
,
'
./ui/tab-bar.js
'
:
require_context_module_1_28
,
'
./ui/window.js
'
:
require_context_module_1_29
,
};
var
req
=
function
req
(
key
)
{
...
...
@@ -12956,6 +13008,13 @@ var serviceContext = (function () {
this
.
elements
.
splice
(
elmIndex
,
1
);
}
removeElementByCid
(
cid
)
{
if
(
!
cid
)
{
return
}
this
.
elements
=
this
.
elements
.
filter
(
elm
=>
elm
.
cid
!==
cid
);
}
push
(
type
,
cid
,
data
,
options
)
{
const
typeData
=
[
cid
,
data
];
if
(
options
)
{
...
...
packages/uni-app-plus/dist/service.runtime.esm.dev.js
浏览文件 @
4cfee9a0
...
...
@@ -5618,9 +5618,14 @@ function insertBefore() {
}
function
removeChild
(
node
,
child
)
{
if
(
child
&&
child
.
_$vd
)
{
child
.
_$vd
.
removeElement
(
child
);
if
(
!
child
)
{
return
}
if
(
child
.
__vue__
&&
child
.
__vue__
.
_$vd
)
{
// 根据组件cid删除所有相关element,后续应该建立一套完整的DOM逻辑
child
.
__vue__
.
_$vd
.
removeElementByCid
(
child
.
__vue__
.
_$id
);
}
child
.
_$vd
&&
child
.
_$vd
.
removeElement
(
child
);
}
function
appendChild
()
{
...
...
@@ -6084,6 +6089,7 @@ function createPatchFunction (backend) {
if
(
isDef
(
i
=
vnode
.
componentInstance
)
&&
isDef
(
i
=
i
.
_vnode
)
&&
isDef
(
i
.
data
))
{
removeAndInvokeRemoveHook
(
i
,
rm
);
}
else
if
(
isDef
(
children
=
vnode
.
children
))
{
// fixed by xxxxxx
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for
(
i
=
0
;
i
<
children
.
length
;
i
++
)
{
...
...
packages/uni-app-plus/dist/service.runtime.esm.prod.js
浏览文件 @
4cfee9a0
...
...
@@ -4874,9 +4874,14 @@ function insertBefore() {
}
function
removeChild
(
node
,
child
)
{
if
(
child
&&
child
.
_$vd
)
{
child
.
_$vd
.
removeElement
(
child
);
if
(
!
child
)
{
return
}
if
(
child
.
__vue__
&&
child
.
__vue__
.
_$vd
)
{
// 根据组件cid删除所有相关element,后续应该建立一套完整的DOM逻辑
child
.
__vue__
.
_$vd
.
removeElementByCid
(
child
.
__vue__
.
_$id
);
}
child
.
_$vd
&&
child
.
_$vd
.
removeElement
(
child
);
}
function
appendChild
()
{
...
...
@@ -5302,6 +5307,7 @@ function createPatchFunction (backend) {
if
(
isDef
(
i
=
vnode
.
componentInstance
)
&&
isDef
(
i
=
i
.
_vnode
)
&&
isDef
(
i
.
data
))
{
removeAndInvokeRemoveHook
(
i
,
rm
);
}
else
if
(
isDef
(
children
=
vnode
.
children
))
{
// fixed by xxxxxx
// app-plus service 层 elm 暂未实现父子关系维护,移除父 elm 时,导致子 elm 还存留(影响了事件查找)
// 暂时使用 vnode 的 children 递归 rm 掉子 elm
for
(
i
=
0
;
i
<
children
.
length
;
i
++
)
{
...
...
src/platforms/app-plus/service/api/plugin/sub-nvue.js
浏览文件 @
4cfee9a0
import
{
requireNativePlugin
}
from
'
./require-native-plugin
'
function
wrapper
(
webview
)
{
webview
.
$processed
=
true
...
...
@@ -66,9 +66,20 @@ export function getSubNVueById (id) {
if
(
webview
&&
!
webview
.
$processed
)
{
wrapper
(
webview
)
}
let
oldSetStyle
=
webview
.
setStyle
var
parentWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
webview
.
setStyle
=
function
(
style
)
{
if
(
style
&&
style
.
mask
)
{
parentWebview
.
setStyle
({
mask
:
style
.
mask
})
delete
style
.
mask
}
oldSetStyle
.
call
(
this
,
style
)
}
return
webview
}
}
export
function
getCurrentSubNVue
()
{
return
getSubNVueById
(
plus
.
webview
.
currentWebview
().
id
)
}
src/platforms/app-plus/service/api/route/switch-tab.js
浏览文件 @
4cfee9a0
...
...
@@ -32,10 +32,12 @@ function _switchTab ({
const
pages
=
getCurrentPages
()
const
len
=
pages
.
length
let
callOnHide
=
false
let
callOnShow
=
false
let
currentPage
if
(
len
>=
1
)
{
// 前一个页面是非 tabBar 页面
c
onst
c
urrentPage
=
pages
[
len
-
1
]
currentPage
=
pages
[
len
-
1
]
if
(
!
currentPage
.
$page
.
meta
.
isTabBar
)
{
// 前一个页面为非 tabBar 页面时,目标tabBar需要强制触发onShow
// 该情况下目标页tabBarPage的visible是不对的
...
...
@@ -58,8 +60,7 @@ function _switchTab ({
}
},
100
)
}
else
{
// 前一个 tabBar 触发 onHide
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
)
callOnHide
=
true
}
}
...
...
@@ -78,7 +79,13 @@ function _switchTab ({
}
}
})
// 相同tabBar页面
if
(
currentPage
===
tabBarPage
)
{
callOnHide
=
false
}
if
(
currentPage
&&
callOnHide
)
{
currentPage
.
$vm
.
__call_hook
(
'
onHide
'
)
}
if
(
tabBarPage
)
{
tabBarPage
.
$getAppWebview
().
show
(
'
none
'
)
// 等visible状态都切换完之后,再触发onShow,否则开发者在onShow里边 getCurrentPages 会不准确
...
...
src/platforms/app-plus/service/framework/plugins/vdom-sync.js
浏览文件 @
4cfee9a0
...
...
@@ -158,6 +158,13 @@ export class VDomSync {
this
.
elements
.
splice
(
elmIndex
,
1
)
}
removeElementByCid
(
cid
)
{
if
(
!
cid
)
{
return
}
this
.
elements
=
this
.
elements
.
filter
(
elm
=>
elm
.
cid
!==
cid
)
}
push
(
type
,
cid
,
data
,
options
)
{
const
typeData
=
[
cid
,
data
]
if
(
options
)
{
...
...
src/platforms/app-plus/service/framework/webview/parser/sub-nvue-parser.js
浏览文件 @
4cfee9a0
...
...
@@ -121,6 +121,7 @@ function initSubNVue (subNVue, routeOptions, webview) {
`UNIAPP[webview][
${
webview
.
id
}
]:create[
${
subNVue
.
id
}
]:
${
JSON
.
stringify
(
style
)}
`
)
}
delete
style
.
mask
const
subNVueWebview
=
plus
.
webview
.
create
(
''
,
subNVue
.
id
,
style
,
extras
)
if
(
isPopup
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录