Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
20岁爱吃必胜客
uni-app
提交
87b9e5b6
U
uni-app
项目概览
20岁爱吃必胜客
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
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,发现更多精彩内容 >>
提交
87b9e5b6
编写于
11月 06, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(v3): $nextTick,$mp
上级
330654c8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
294 addition
and
49 deletion
+294
-49
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+290
-47
src/platforms/app-plus/service/framework/plugins/index.js
src/platforms/app-plus/service/framework/plugins/index.js
+4
-2
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
87b9e5b6
...
...
@@ -123,7 +123,10 @@ var serviceContext = (function () {
'
onBeaconUpdate
'
,
'
getBeacons
'
,
'
startBeaconDiscovery
'
,
'
stopBeaconDiscovery
'
'
stopBeaconDiscovery
'
,
'
checkIsSupportSoterAuthentication
'
,
'
checkIsSoterEnrolledInDevice
'
,
'
startSoterAuthentication
'
];
const
keyboard
=
[
...
...
@@ -553,7 +556,7 @@ var serviceContext = (function () {
}
function
isCallbackApi
(
name
)
{
return
CALLBACK_API_RE
.
test
(
name
)
return
CALLBACK_API_RE
.
test
(
name
)
&&
name
!==
'
onPush
'
}
function
isTaskApi
(
name
)
{
...
...
@@ -2477,6 +2480,35 @@ var serviceContext = (function () {
upx2px
:
upx2px$1
});
const
Emitter
=
new
Vue
();
function
apply
(
ctx
,
method
,
args
)
{
return
ctx
[
method
].
apply
(
ctx
,
args
)
}
function
$on$1
()
{
return
apply
(
Emitter
,
'
$on
'
,
[...
arguments
])
}
function
$off$1
()
{
return
apply
(
Emitter
,
'
$off
'
,
[...
arguments
])
}
function
$once$1
()
{
return
apply
(
Emitter
,
'
$once
'
,
[...
arguments
])
}
function
$emit$1
()
{
return
apply
(
Emitter
,
'
$emit
'
,
[...
arguments
])
}
var
eventApis
=
/*#__PURE__*/
Object
.
freeze
({
$on
:
$on$1
,
$off
:
$off$1
,
$once
:
$once$1
,
$emit
:
$emit$1
});
function
unpack
(
args
)
{
return
args
}
...
...
@@ -4103,6 +4135,227 @@ var serviceContext = (function () {
},
false
);
}
function
checkIsSupportFaceID
()
{
const
platform
=
plus
.
os
.
name
.
toLowerCase
();
if
(
platform
!==
'
ios
'
)
{
return
false
}
const
faceID
=
requireNativePlugin
(
'
faceID
'
);
return
!!
(
faceID
&&
faceID
.
isSupport
())
}
function
checkIsSupportFingerPrint
()
{
return
!!
(
plus
.
fingerprint
&&
plus
.
fingerprint
.
isSupport
())
}
function
checkIsSupportSoterAuthentication
()
{
let
supportMode
=
[];
if
(
checkIsSupportFingerPrint
())
{
supportMode
.
push
(
'
fingerPrint
'
);
}
if
(
checkIsSupportFaceID
())
{
supportMode
.
push
(
'
facial
'
);
}
return
{
supportMode
,
errMsg
:
'
checkIsSupportSoterAuthentication:ok
'
}
}
function
checkIsSoterEnrolledInDevice
({
checkAuthMode
}
=
{})
{
if
(
checkAuthMode
===
'
fingerPrint
'
)
{
if
(
checkIsSupportFingerPrint
())
{
const
isEnrolled
=
plus
.
fingerprint
.
isKeyguardSecure
()
&&
plus
.
fingerprint
.
isEnrolledFingerprints
();
if
(
isEnrolled
)
{
return
{
isEnrolled
,
errMsg
:
'
checkIsSoterEnrolledInDevice:ok
'
}
}
else
{
return
{
isEnrolled
,
errMsg
:
'
checkIsSoterEnrolledInDevice:ok
'
}
}
}
else
{
return
{
isEnrolled
:
false
,
errMsg
:
'
checkIsSoterEnrolledInDevice:fail not support
'
}
}
}
else
if
(
checkAuthMode
===
'
facial
'
)
{
if
(
checkIsSupportFaceID
())
{
const
faceID
=
requireNativePlugin
(
'
faceID
'
);
const
isEnrolled
=
faceID
&&
faceID
.
isKeyguardSecure
()
&&
faceID
.
isEnrolledFaceID
();
if
(
isEnrolled
)
{
return
{
isEnrolled
,
errMsg
:
'
checkIsSoterEnrolledInDevice:ok
'
}
}
else
{
return
{
isEnrolled
,
errMsg
:
'
checkIsSoterEnrolledInDevice:ok
'
}
}
}
else
{
return
{
isEnrolled
:
false
,
errMsg
:
'
checkIsSoterEnrolledInDevice:fail not support
'
}
}
}
else
{
return
{
isEnrolled
:
false
,
errMsg
:
'
checkIsSoterEnrolledInDevice:fail not support
'
}
}
}
function
startSoterAuthentication
({
requestAuthModes
,
challenge
=
false
,
authContent
}
=
{},
callbackId
)
{
const
supportMode
=
checkIsSupportSoterAuthentication
().
supportMode
;
if
(
supportMode
.
length
===
0
)
{
return
{
authMode
:
supportMode
[
0
]
||
'
fingerPrint
'
,
errCode
:
90001
,
errMsg
:
'
startSoterAuthentication:fail
'
}
}
let
supportRequestAuthMode
=
[];
requestAuthModes
.
map
((
item
,
index
)
=>
{
if
(
supportMode
.
indexOf
(
item
)
>
-
1
)
{
supportRequestAuthMode
.
push
(
item
);
}
});
if
(
supportRequestAuthMode
.
length
===
0
)
{
return
{
authMode
:
supportRequestAuthMode
[
0
]
||
'
fingerPrint
'
,
errCode
:
90003
,
errMsg
:
'
startSoterAuthentication:fail no corresponding mode
'
}
}
let
enrolledRequestAuthMode
=
[];
supportRequestAuthMode
.
map
((
item
,
index
)
=>
{
const
checked
=
checkIsSoterEnrolledInDevice
({
checkAuthMode
:
item
}).
isEnrolled
;
if
(
checked
)
{
enrolledRequestAuthMode
.
push
(
item
);
}
});
if
(
enrolledRequestAuthMode
.
length
===
0
)
{
return
{
authMode
:
supportRequestAuthMode
[
0
],
errCode
:
90011
,
errMsg
:
`startSoterAuthentication:fail no
${
supportRequestAuthMode
[
0
]}
enrolled`
}
}
const
realAuthMode
=
enrolledRequestAuthMode
[
0
];
if
(
realAuthMode
===
'
fingerPrint
'
)
{
if
(
plus
.
os
.
name
.
toLowerCase
()
===
'
android
'
)
{
plus
.
nativeUI
.
showWaiting
(
authContent
||
'
指纹识别中...
'
).
onclose
=
function
()
{
plus
.
fingerprint
.
cancel
();
};
}
plus
.
fingerprint
.
authenticate
(()
=>
{
plus
.
nativeUI
.
closeWaiting
();
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
0
,
errMsg
:
'
startSoterAuthentication:ok
'
});
},
(
e
)
=>
{
switch
(
e
.
code
)
{
case
e
.
AUTHENTICATE_MISMATCH
:
// 微信小程序没有这个回调,如果要实现此处回调需要多次触发需要用事件publish实现
// invoke(callbackId, {
// authMode: realAuthMode,
// errCode: 90009,
// errMsg: 'startSoterAuthentication:fail'
// })
break
case
e
.
AUTHENTICATE_OVERLIMIT
:
// 微信小程序在第一次重试次数超限时安卓IOS返回不一致,安卓端会返回次数超过限制(errCode: 90010),IOS端会返回认证失败(errCode: 90009)。APP-IOS实际运行时不会次数超限,超过指定次数之后会弹出输入密码的界面
plus
.
nativeUI
.
closeWaiting
();
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90010
,
errMsg
:
'
startSoterAuthentication:fail authenticate freeze. please try again later
'
});
break
case
e
.
CANCEL
:
plus
.
nativeUI
.
closeWaiting
();
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90008
,
errMsg
:
'
startSoterAuthentication:fail cancel
'
});
break
default
:
plus
.
nativeUI
.
closeWaiting
();
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90007
,
errMsg
:
'
startSoterAuthentication:fail
'
});
break
}
},
{
message
:
authContent
});
}
else
if
(
realAuthMode
===
'
facial
'
)
{
const
faceID
=
requireNativePlugin
(
'
faceID
'
);
faceID
.
authenticate
({
message
:
authContent
},
(
e
)
=>
{
if
(
e
.
type
===
'
success
'
&&
e
.
code
===
1
)
{
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
0
,
errMsg
:
'
startSoterAuthentication:ok
'
});
}
else
{
switch
(
e
.
code
)
{
case
4
:
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90009
,
errMsg
:
'
startSoterAuthentication:fail
'
});
break
case
5
:
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90010
,
errMsg
:
'
startSoterAuthentication:fail authenticate freeze. please try again later
'
});
break
case
6
:
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90008
,
errMsg
:
'
startSoterAuthentication:fail cancel
'
});
break
default
:
invoke
(
callbackId
,
{
authMode
:
realAuthMode
,
errCode
:
90007
,
errMsg
:
'
startSoterAuthentication:fail
'
});
break
}
}
});
}
}
const
TABBAR_HEIGHT
=
50
;
let
config
;
...
...
@@ -7885,12 +8138,16 @@ var serviceContext = (function () {
var
api
=
/*#__PURE__*/
Object
.
freeze
({
startPullDownRefresh
:
startPullDownRefresh
,
stopPullDownRefresh
:
stopPullDownRefresh
,
getImageInfo
:
getImageInfo$1
,
createAudioInstance
:
createAudioInstance
,
destroyAudioInstance
:
destroyAudioInstance
,
setAudioState
:
setAudioState
,
getAudioState
:
getAudioState
,
operateAudio
:
operateAudio
,
compressImage
:
compressImage
,
$on
:
$on$1
,
$off
:
$off$1
,
$once
:
$once$1
,
$emit
:
$emit$1
,
getMusicPlayerState
:
getMusicPlayerState
,
operateMusicPlayer
:
operateMusicPlayer
,
setBackgroundAudioState
:
setBackgroundAudioState
,
operateBackgroundAudio
:
operateBackgroundAudio
,
getBackgroundAudioState
:
getBackgroundAudioState
,
base64ToTempFilePath
:
base64ToTempFilePath
,
operateMapPlayer
:
operateMapPlayer$2
,
operateVideoPlayer
:
operateVideoPlayer$2
,
...
...
@@ -7927,6 +8184,9 @@ var serviceContext = (function () {
SCAN_ID
:
SCAN_ID
,
SCAN_PATH
:
SCAN_PATH
,
scanCode
:
scanCode
,
checkIsSupportSoterAuthentication
:
checkIsSupportSoterAuthentication
,
checkIsSoterEnrolledInDevice
:
checkIsSoterEnrolledInDevice
,
startSoterAuthentication
:
startSoterAuthentication
,
getSystemInfoSync
:
getSystemInfoSync
,
getSystemInfo
:
getSystemInfo
,
vibrateLong
:
vibrateLong
,
...
...
@@ -7947,12 +8207,12 @@ var serviceContext = (function () {
stopVoice
:
stopVoice
,
chooseImage
:
chooseImage$1
,
chooseVideo
:
chooseVideo$1
,
c
ompressImage
:
compressImag
e
,
getMusicPlayerState
:
getMusicPlayerStat
e
,
operateMusicPlayer
:
operateMusicPlayer
,
setBackgroundAudioState
:
setBackground
AudioState
,
operate
BackgroundAudio
:
operateBackground
Audio
,
get
BackgroundAudioState
:
getBackgroundAudioState
,
c
reateAudioInstance
:
createAudioInstanc
e
,
destroyAudioInstance
:
destroyAudioInstanc
e
,
setAudioState
:
setAudioState
,
getAudioState
:
get
AudioState
,
operate
Audio
:
operate
Audio
,
get
ImageInfo
:
getImageInfo$1
,
previewImage
:
previewImage$1
,
operateRecorder
:
operateRecorder
,
saveImageToPhotosAlbum
:
saveImageToPhotosAlbum
,
...
...
@@ -8006,35 +8266,6 @@ var serviceContext = (function () {
requestComponentInfo
:
requestComponentInfo$2
});
const
Emitter
=
new
Vue
();
function
apply
(
ctx
,
method
,
args
)
{
return
ctx
[
method
].
apply
(
ctx
,
args
)
}
function
$on$1
()
{
return
apply
(
Emitter
,
'
$on
'
,
[...
arguments
])
}
function
$off$1
()
{
return
apply
(
Emitter
,
'
$off
'
,
[...
arguments
])
}
function
$once$1
()
{
return
apply
(
Emitter
,
'
$once
'
,
[...
arguments
])
}
function
$emit$1
()
{
return
apply
(
Emitter
,
'
$emit
'
,
[...
arguments
])
}
var
eventApis
=
/*#__PURE__*/
Object
.
freeze
({
$on
:
$on$1
,
$off
:
$off$1
,
$once
:
$once$1
,
$emit
:
$emit$1
});
var
platformApi
=
Object
.
assign
(
Object
.
create
(
null
),
api
,
eventApis
);
/**
...
...
@@ -10534,16 +10765,17 @@ var serviceContext = (function () {
}
function
callHook
(
vm
,
hook
,
params
)
{
return
(
vm
.
$vm
||
vm
).
__call_hook
(
hook
,
params
)
vm
=
vm
.
$vm
||
vm
;
return
vm
.
__call_hook
&&
vm
.
__call_hook
(
hook
,
params
)
}
function
callAppHook
(
vm
,
hook
,
params
)
{
if
(
hook
!==
'
onError
'
)
{
console
.
debug
(
`App:
${
hook
}
have been invoked`
+
(
params
?
`
${
JSON
.
stringify
(
params
)}
`
:
''
));
}
return
(
vm
.
$vm
||
vm
).
__call_hook
(
hook
,
params
)
vm
=
vm
.
$vm
||
vm
;
return
vm
.
__call_hook
&&
vm
.
__call_hook
(
hook
,
params
)
}
function
callPageHook
(
vm
,
hook
,
params
)
{
if
(
hook
!==
'
onPageScroll
'
)
{
console
.
debug
(
`
${
vm
.
$page
.
route
}
[
${
vm
.
$page
.
id
}
]:
${
hook
}
have been invoked`
);
...
...
@@ -11557,6 +11789,14 @@ var serviceContext = (function () {
return
this
.
$root
.
$scope
.
$page
}
});
// 兼容旧版本
Object
.
defineProperty
(
Vue
.
prototype
,
'
$mp
'
,
{
get
()
{
return
{
page
:
this
.
$root
.
$scope
}
}
});
const
oldMount
=
Vue
.
prototype
.
$mount
;
Vue
.
prototype
.
$mount
=
function
mount
(
el
,
hydrating
)
{
...
...
@@ -11575,7 +11815,10 @@ var serviceContext = (function () {
)
{
vdSyncCallbacks
.
push
(
cb
);
}
else
{
Vue
.
nextTick
(
cb
);
// $nextTick bind vm context
Vue
.
nextTick
(()
=>
{
cb
.
call
(
this
);
});
}
};
}
...
...
src/platforms/app-plus/service/framework/plugins/index.js
浏览文件 @
87b9e5b6
...
...
@@ -32,7 +32,7 @@ export default {
Object
.
defineProperty
(
Vue
.
prototype
,
'
$mp
'
,
{
get
()
{
return
{
page
:
this
.
$root
.
$scope
.
$page
page
:
this
.
$root
.
$scope
}
}
})
...
...
@@ -55,7 +55,9 @@ export default {
vdSyncCallbacks
.
push
(
cb
)
}
else
{
// $nextTick bind vm context
Vue
.
nextTick
.
call
(
this
,
cb
)
Vue
.
nextTick
(()
=>
{
cb
.
call
(
this
)
})
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录