Skip to content

Commit

Permalink
add setTimeout,setInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Jul 31, 2019
1 parent 5eb082c commit 0ae35ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
8 changes: 5 additions & 3 deletions build/rollup.config.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ if (process.env.UNI_SERVICE === 'legacy') {
output.format = 'iife'
output.name = 'serviceContext'
output.banner =
`export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge){
`export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge,instanceContext){
var localStorage = plus.storage
var setTimeout = global.setTimeout
var clearTimeout = global.clearTimeout
var setTimeout = instanceContext.setTimeout
var clearTimeout = instanceContext.clearTimeout
var setInterval = instanceContext.setInterval
var clearInterval = instanceContext.clearInterval
`
output.footer =
`
Expand Down
1 change: 0 additions & 1 deletion lib/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const media = [
'getImageInfo',
'saveImageToPhotosAlbum',
'compressImage',
'chooseMessageFile',
'getRecorderManager',
'getBackgroundAudioManager',
'createInnerAudioContext',
Expand Down
2 changes: 0 additions & 2 deletions src/platforms/app-plus-nvue/service/api/route/switch-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export function switchTab ({
currentPage.$getAppWebview().close('auto')
}
} else {
// TODO 客户端 Bug
currentPage.$getAppWebview().hide('none')
// 前一个 tabBar 触发 onHide
currentPage.$vm.__call_hook('onHide')
}
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/app-plus/service/framework/plus-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function consumePlusMessage (type, args) {
*/
export function registerPlusMessage (type, callback, keepAlive = true) {
if (callbacks[type]) {
throw new Error(`${type} 已注册:` + (callbacks[type].toString()))
return console.warn(`${type} 已注册:` + (callbacks[type].toString()))
}
callback.keepAlive = !!keepAlive
callbacks[type] = callback
Expand Down

0 comments on commit 0ae35ac

Please sign in to comment.