Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
b84b42ce
U
uni-app
项目概览
wzj-java
/
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,发现更多精彩内容 >>
提交
b84b42ce
编写于
8月 25, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build runtime
上级
b3f72d76
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
738 addition
and
740 deletion
+738
-740
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+418
-418
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+1
-1
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+1
-1
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+1
-1
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+312
-314
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+1
-1
packages/uni-quickapp-native/dist/vue.dev.js
packages/uni-quickapp-native/dist/vue.dev.js
+1
-1
packages/uni-quickapp-native/dist/vue.prod.js
packages/uni-quickapp-native/dist/vue.prod.js
+1
-1
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+1
-1
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
b84b42ce
此差异已折叠。
点击以展开。
packages/uni-mp-baidu/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
b84b42ce
import
Vue
from
'
vue
'
;
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
atob
(
str
).
split
(
''
).
map
(
function
(
c
)
{
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
)
}).
join
(
''
))
}
function
getCurrentUserInfo
()
{
const
token
=
(
tt
).
getStorageSync
(
'
uni_id_token
'
)
||
''
;
const
tokenArr
=
token
.
split
(
'
.
'
);
if
(
!
token
||
tokenArr
.
length
!==
3
)
{
return
{
uid
:
null
,
role
:
[],
permission
:
[],
tokenExpired
:
0
}
}
let
userInfo
;
try
{
userInfo
=
JSON
.
parse
(
b64DecodeUnicode
(
tokenArr
[
1
]));
}
catch
(
error
)
{
throw
new
Error
(
'
获取当前用户信息出错,详细错误信息为:
'
+
error
.
message
)
}
userInfo
.
tokenExpired
=
userInfo
.
exp
*
1000
;
delete
userInfo
.
exp
;
delete
userInfo
.
iat
;
return
userInfo
}
function
uniIdMixin
(
Vue
)
{
Vue
.
prototype
.
uniIDHasRole
=
function
(
roleId
)
{
const
{
role
}
=
getCurrentUserInfo
();
return
role
.
indexOf
(
roleId
)
>
-
1
};
Vue
.
prototype
.
uniIDHasPermission
=
function
(
permissionId
)
{
const
{
permission
}
=
getCurrentUserInfo
();
return
this
.
uniIDHasRole
(
'
admin
'
)
||
permission
.
indexOf
(
permissionId
)
>
-
1
};
Vue
.
prototype
.
uniIDTokenValid
=
function
()
{
const
{
tokenExpired
}
=
getCurrentUserInfo
();
return
tokenExpired
>
Date
.
now
()
};
}
import
Vue
from
'
vue
'
;
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
atob
(
str
).
split
(
''
).
map
(
function
(
c
)
{
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
)
}).
join
(
''
))
}
function
getCurrentUserInfo
()
{
const
token
=
(
tt
).
getStorageSync
(
'
uni_id_token
'
)
||
''
;
const
tokenArr
=
token
.
split
(
'
.
'
);
if
(
!
token
||
tokenArr
.
length
!==
3
)
{
return
{
uid
:
null
,
role
:
[],
permission
:
[],
tokenExpired
:
0
}
}
let
userInfo
;
try
{
userInfo
=
JSON
.
parse
(
b64DecodeUnicode
(
tokenArr
[
1
]));
}
catch
(
error
)
{
throw
new
Error
(
'
获取当前用户信息出错,详细错误信息为:
'
+
error
.
message
)
}
userInfo
.
tokenExpired
=
userInfo
.
exp
*
1000
;
delete
userInfo
.
exp
;
delete
userInfo
.
iat
;
return
userInfo
}
function
uniIdMixin
(
Vue
)
{
Vue
.
prototype
.
uniIDHasRole
=
function
(
roleId
)
{
const
{
role
}
=
getCurrentUserInfo
();
return
role
.
indexOf
(
roleId
)
>
-
1
};
Vue
.
prototype
.
uniIDHasPermission
=
function
(
permissionId
)
{
const
{
permission
}
=
getCurrentUserInfo
();
return
this
.
uniIDHasRole
(
'
admin
'
)
||
permission
.
indexOf
(
permissionId
)
>
-
1
};
Vue
.
prototype
.
uniIDTokenValid
=
function
()
{
const
{
tokenExpired
}
=
getCurrentUserInfo
();
return
tokenExpired
>
Date
.
now
()
};
}
const
_toString
=
Object
.
prototype
.
toString
;
const
hasOwnProperty
=
Object
.
prototype
.
hasOwnProperty
;
...
...
@@ -88,8 +88,8 @@ function cached (fn) {
const
camelizeRE
=
/-
(\w)
/g
;
const
camelize
=
cached
((
str
)
=>
{
return
str
.
replace
(
camelizeRE
,
(
_
,
c
)
=>
c
?
c
.
toUpperCase
()
:
''
)
});
});
const
HOOKS
=
[
'
invoke
'
,
'
success
'
,
...
...
@@ -282,10 +282,10 @@ const promiseInterceptor = {
});
})
}
};
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
@@ -354,8 +354,8 @@ function promisify (name, api) {
}),
...
params
);
})))
}
}
}
const
EPS
=
1
e
-
4
;
const
BASE_DEVICE_WIDTH
=
750
;
let
isIOS
=
false
;
...
...
@@ -396,20 +396,20 @@ function upx2px (number, newDeviceWidth) {
}
}
return
number
<
0
?
-
result
:
result
}
}
const
interceptors
=
{
promiseInterceptor
};
var
baseApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
upx2px
:
upx2px
,
addInterceptor
:
addInterceptor
,
removeInterceptor
:
removeInterceptor
,
interceptors
:
interceptors
});
};
var
baseApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
upx2px
:
upx2px
,
addInterceptor
:
addInterceptor
,
removeInterceptor
:
removeInterceptor
,
interceptors
:
interceptors
});
class
EventChannel
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
...
...
@@ -476,8 +476,8 @@ class EventChannel {
type
});
}
}
}
const
eventChannels
=
{};
const
eventChannelStack
=
[];
...
...
@@ -513,8 +513,8 @@ var navigateTo = {
returnValue
(
fromRes
,
toRes
)
{
fromRes
.
eventChannel
=
getEventChannel
();
}
};
};
function
findExistsPageIndex
(
url
)
{
const
pages
=
getCurrentPages
();
let
len
=
pages
.
length
;
...
...
@@ -525,8 +525,8 @@ function findExistsPageIndex (url) {
}
}
return
-
1
}
}
var
redirectTo
=
{
name
(
fromArgs
)
{
if
(
fromArgs
.
exists
===
'
back
'
&&
fromArgs
.
delta
)
{
...
...
@@ -545,8 +545,8 @@ var redirectTo = {
}
}
}
};
};
var
previewImage
=
{
args
(
fromArgs
)
{
let
currentIndex
=
parseInt
(
fromArgs
.
current
);
...
...
@@ -579,48 +579,48 @@ var previewImage = {
loop
:
false
}
}
};
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
function
addUuid
(
result
)
{
deviceId
=
deviceId
||
tt
.
getStorageSync
(
UUID_KEY
);
if
(
!
deviceId
)
{
deviceId
=
Date
.
now
()
+
''
+
Math
.
floor
(
Math
.
random
()
*
1
e7
);
tt
.
setStorage
({
key
:
UUID_KEY
,
data
:
deviceId
});
}
result
.
deviceId
=
deviceId
;
}
function
addSafeAreaInsets
(
result
)
{
if
(
result
.
safeArea
)
{
const
safeArea
=
result
.
safeArea
;
result
.
safeAreaInsets
=
{
top
:
safeArea
.
top
,
left
:
safeArea
.
left
,
right
:
result
.
windowWidth
-
safeArea
.
right
,
bottom
:
result
.
windowHeight
-
safeArea
.
bottom
};
}
}
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
addUuid
(
result
);
addSafeAreaInsets
(
result
);
}
};
const
oName
=
'
getUserInfo
'
;
const
nName
=
'
getUserProfile
'
;
var
getUserProfile
=
{
name
:
tt
.
canIUse
(
nName
)
?
nName
:
oName
};
};
const
UUID_KEY
=
'
__DC_STAT_UUID
'
;
let
deviceId
;
function
addUuid
(
result
)
{
deviceId
=
deviceId
||
tt
.
getStorageSync
(
UUID_KEY
);
if
(
!
deviceId
)
{
deviceId
=
Date
.
now
()
+
''
+
Math
.
floor
(
Math
.
random
()
*
1
e7
);
tt
.
setStorage
({
key
:
UUID_KEY
,
data
:
deviceId
});
}
result
.
deviceId
=
deviceId
;
}
function
addSafeAreaInsets
(
result
)
{
if
(
result
.
safeArea
)
{
const
safeArea
=
result
.
safeArea
;
result
.
safeAreaInsets
=
{
top
:
safeArea
.
top
,
left
:
safeArea
.
left
,
right
:
result
.
windowWidth
-
safeArea
.
right
,
bottom
:
result
.
windowHeight
-
safeArea
.
bottom
};
}
}
var
getSystemInfo
=
{
returnValue
:
function
(
result
)
{
addUuid
(
result
);
addSafeAreaInsets
(
result
);
}
};
const
oName
=
'
getUserInfo
'
;
const
nName
=
'
getUserProfile
'
;
var
getUserProfile
=
{
name
:
tt
.
canIUse
(
nName
)
?
nName
:
oName
};
// 不支持的 API 列表
const
todos
=
[
'
preloadPage
'
,
...
...
@@ -792,8 +792,8 @@ const protocols = {
digestAlgorithm
:
false
}
}
};
};
const
CALLBACKS
=
[
'
success
'
,
'
fail
'
,
'
cancel
'
,
'
complete
'
];
function
processCallback
(
methodName
,
method
,
returnValue
)
{
...
...
@@ -878,8 +878,8 @@ function wrapper (methodName, method) {
}
}
return
method
}
}
const
todoApis
=
Object
.
create
(
null
);
const
TODOS
=
[
...
...
@@ -906,15 +906,15 @@ function createTodoApi (name) {
TODOS
.
forEach
(
function
(
name
)
{
todoApis
[
name
]
=
createTodoApi
(
name
);
});
});
var
providers
=
{
oauth
:
[
'
toutiao
'
],
share
:
[
'
toutiao
'
],
payment
:
[
'
toutiao
'
],
push
:
[
'
toutiao
'
]
};
};
function
getProvider
({
service
,
success
,
...
...
@@ -936,18 +936,18 @@ function getProvider ({
isFn
(
fail
)
&&
fail
(
res
);
}
isFn
(
complete
)
&&
complete
(
res
);
}
var
extraApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getProvider
:
getProvider
});
}
var
extraApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getProvider
:
getProvider
});
const
getEmitter
=
(
function
()
{
let
Emitter
;
return
function
getUniEmitter
()
{
if
(
!
Emitter
)
{
Emitter
=
new
Vue
();
return
function
getUniEmitter
()
{
if
(
!
Emitter
)
{
Emitter
=
new
Vue
();
}
return
Emitter
}
...
...
@@ -968,113 +968,113 @@ function $once () {
}
function
$emit
()
{
return
apply
(
getEmitter
(),
'
$emit
'
,
[...
arguments
])
}
var
eventApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
$on
:
$on
,
$off
:
$off
,
$once
:
$once
,
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
tt
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
true
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
});
}
var
eventApi
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
$on
:
$on
,
$off
:
$off
,
$once
:
$once
,
$emit
:
$emit
});
function
createMediaQueryObserver
()
{
const
mediaQueryObserver
=
{};
const
{
windowWidth
,
windowHeight
}
=
tt
.
getSystemInfoSync
();
const
orientation
=
windowWidth
<
windowHeight
?
'
portrait
'
:
'
landscape
'
;
mediaQueryObserver
.
observe
=
(
options
,
callback
)
=>
{
let
matches
=
true
;
for
(
const
item
in
options
)
{
const
itemValue
=
item
===
'
orientation
'
?
options
[
item
]
:
Number
(
options
[
item
]);
if
(
options
[
item
]
!==
''
)
{
if
(
item
===
'
width
'
)
{
if
(
itemValue
===
windowWidth
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minWidth
'
)
{
if
(
windowWidth
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxWidth
'
)
{
if
(
windowWidth
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
height
'
)
{
if
(
itemValue
===
windowHeight
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
minHeight
'
)
{
if
(
windowHeight
>=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
maxHeight
'
)
{
if
(
windowHeight
<=
itemValue
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
if
(
item
===
'
orientation
'
)
{
if
(
options
[
item
]
===
orientation
)
{
matches
=
true
;
}
else
{
matches
=
false
;
callback
(
matches
);
return
matches
}
}
}
}
callback
(
matches
);
return
matches
};
mediaQueryObserver
.
disconnect
=
()
=>
{
};
return
mediaQueryObserver
}
var
api
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
createMediaQueryObserver
:
createMediaQueryObserver
});
const
MPPage
=
Page
;
const
MPComponent
=
Component
;
...
...
@@ -1091,9 +1091,7 @@ function initTriggerEvent (mpInstance) {
};
}
function
initHook
(
name
,
options
,
isComponent
)
{
// fix by Lxh 字节自定义组件Component构造器文档上写有created,但是实测只触发了lifetimes上的created
isComponent
&&
(
options
=
options
.
lifetimes
)
function
initHook
(
name
,
options
)
{
const
oldHook
=
options
[
name
];
if
(
!
oldHook
)
{
options
[
name
]
=
function
()
{
...
...
@@ -1115,11 +1113,11 @@ if (!MPPage.__$wrappered) {
Page
.
after
=
MPPage
.
after
;
Component
=
function
(
options
=
{})
{
initHook
(
'
created
'
,
options
,
true
);
initHook
(
'
created
'
,
options
);
return
MPComponent
(
options
)
};
}
}
const
PAGE_EVENT_HOOKS
=
[
'
onPullDownRefresh
'
,
'
onReachBottom
'
,
...
...
@@ -1661,8 +1659,8 @@ function handleEvent (event) {
)
{
return
ret
[
0
]
}
}
}
const
hooks
=
[
'
onShow
'
,
'
onHide
'
,
...
...
@@ -1822,8 +1820,8 @@ function parseBaseApp (vm, {
initHooks
(
appOptions
,
hooks
);
return
appOptions
}
}
function
findVmByVueId
(
vm
,
vuePid
)
{
const
$children
=
vm
.
$children
;
// 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
...
...
@@ -1864,8 +1862,8 @@ function handleLink (event) {
}
vueOptions
.
parent
=
parentVm
;
}
}
const
mocks
=
[
'
__route__
'
,
'
__webviewId__
'
,
'
__nodeid__
'
,
'
__nodeId__
'
];
function
isPage
()
{
...
...
@@ -1965,8 +1963,8 @@ function handleLink$1 ({
vm
.
_isMounted
=
true
;
vm
.
__call_hook
(
'
mounted
'
);
vm
.
__call_hook
(
'
onReady
'
);
}
}
function
parseApp
(
vm
)
{
Vue
.
prototype
.
_$fallback
=
true
;
// 降级(调整原 vue 的部分生命周期,如 created,beforeMount,inject,provide)
...
...
@@ -1993,13 +1991,13 @@ function parseApp (vm) {
mocks
,
initRefs
:
function
()
{}
// attached 时,可能查询不到
})
}
}
function
createApp
(
vm
)
{
App
(
parseApp
(
vm
));
return
vm
}
}
const
encodeReserveRE
=
/
[
!'()*
]
/g
;
const
encodeReserveReplacer
=
c
=>
'
%
'
+
c
.
charCodeAt
(
0
).
toString
(
16
);
const
commaRE
=
/%2C/g
;
...
...
@@ -2041,8 +2039,8 @@ function stringifyQuery (obj, encodeStr = encode) {
return
encodeStr
(
key
)
+
'
=
'
+
encodeStr
(
val
)
}).
filter
(
x
=>
x
.
length
>
0
).
join
(
'
&
'
)
:
null
;
return
res
?
`?
${
res
}
`
:
''
}
}
function
parseBaseComponent
(
vueComponentOptions
,
{
isPage
,
initRelation
...
...
@@ -2133,8 +2131,8 @@ function parseBaseComponent (vueComponentOptions, {
return
componentOptions
}
return
[
componentOptions
,
VueComponent
]
}
}
const
components
=
[];
function
parseComponent
(
vueOptions
)
{
...
...
@@ -2187,8 +2185,8 @@ function parseComponent (vueOptions) {
componentOptions
.
methods
.
__l
=
handleLink$1
;
return
componentOptions
}
}
const
hooks$1
=
[
'
onShow
'
,
'
onHide
'
,
...
...
@@ -2217,8 +2215,8 @@ function parseBasePage (vuePageOptions, {
};
return
pageOptions
}
}
function
parsePage
(
vuePageOptions
)
{
const
pageOptions
=
parseBasePage
(
vuePageOptions
,
{
isPage
,
...
...
@@ -2235,34 +2233,34 @@ function parsePage (vuePageOptions) {
}
else
{
this
.
is
&&
console
.
warn
(
this
.
is
+
'
is not ready
'
);
}
};
pageOptions
.
lifetimes
.
detached
=
function
detached
()
{
this
.
$vm
&&
this
.
$vm
.
$destroy
();
// 清理
const
webviewId
=
this
.
__webviewId__
;
webviewId
&&
Object
.
keys
(
instances
).
forEach
(
key
=>
{
if
(
key
.
indexOf
(
webviewId
+
'
_
'
)
===
0
)
{
delete
instances
[
key
];
}
});
};
pageOptions
.
lifetimes
.
detached
=
function
detached
()
{
this
.
$vm
&&
this
.
$vm
.
$destroy
();
// 清理
const
webviewId
=
this
.
__webviewId__
;
webviewId
&&
Object
.
keys
(
instances
).
forEach
(
key
=>
{
if
(
key
.
indexOf
(
webviewId
+
'
_
'
)
===
0
)
{
delete
instances
[
key
];
}
});
};
return
pageOptions
}
}
function
createPage
(
vuePageOptions
)
{
{
return
Component
(
parsePage
(
vuePageOptions
))
}
}
}
function
createComponent
(
vueOptions
)
{
{
return
Component
(
parseComponent
(
vueOptions
))
}
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
...
...
@@ -2297,27 +2295,27 @@ function createSubpackageApp (vm) {
vm
.
__call_hook
(
'
onLaunch
'
,
args
);
}
return
vm
}
function
createPlugin
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
if
(
isFn
(
appOptions
.
onShow
)
&&
tt
.
onAppShow
)
{
tt
.
onAppShow
((...
args
)
=>
{
appOptions
.
onShow
.
apply
(
vm
,
args
);
});
}
if
(
isFn
(
appOptions
.
onHide
)
&&
tt
.
onAppHide
)
{
tt
.
onAppHide
((...
args
)
=>
{
appOptions
.
onHide
.
apply
(
vm
,
args
);
});
}
if
(
isFn
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
.
call
(
vm
,
args
);
}
return
vm
}
}
function
createPlugin
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
if
(
isFn
(
appOptions
.
onShow
)
&&
tt
.
onAppShow
)
{
tt
.
onAppShow
((...
args
)
=>
{
appOptions
.
onShow
.
apply
(
vm
,
args
);
});
}
if
(
isFn
(
appOptions
.
onHide
)
&&
tt
.
onAppHide
)
{
tt
.
onAppHide
((...
args
)
=>
{
appOptions
.
onHide
.
apply
(
vm
,
args
);
});
}
if
(
isFn
(
appOptions
.
onLaunch
))
{
const
args
=
tt
.
getLaunchOptionsSync
&&
tt
.
getLaunchOptionsSync
();
appOptions
.
onLaunch
.
call
(
vm
,
args
);
}
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -2400,7 +2398,7 @@ tt.createComponent = createComponent;
tt
.
createSubpackageApp
=
createSubpackageApp
;
tt
.
createPlugin
=
createPlugin
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
,
createPlugin
,
createSubpackageApp
};
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
,
createPlugin
,
createSubpackageApp
};
packages/uni-mp-weixin/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
packages/uni-quickapp-native/dist/vue.dev.js
浏览文件 @
b84b42ce
此差异已折叠。
点击以展开。
packages/uni-quickapp-native/dist/vue.prod.js
浏览文件 @
b84b42ce
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
b84b42ce
...
...
@@ -285,7 +285,7 @@ const promiseInterceptor = {
};
const
SYNC_API_RE
=
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/
;
/^
\$
|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64
|getLanguage|setLanguage
/
;
const
CONTEXT_API_RE
=
/^create|Manager$/
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录