Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
ebc4358c
U
uni-app
项目概览
DCloud
/
uni-app
2 个月 前同步成功
通知
717
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ebc4358c
编写于
6月 10, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/dcloudio/uni-app
into alpha
上级
bc559cdd
7e47cc02
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
211 addition
and
144 deletion
+211
-144
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+109
-91
packages/uni-app-plus/template/common/__uniapppicker.js
packages/uni-app-plus/template/common/__uniapppicker.js
+1
-1
packages/uni-cli-shared/lib/plugin.js
packages/uni-cli-shared/lib/plugin.js
+10
-0
packages/uni-cli-shared/lib/preprocess.js
packages/uni-cli-shared/lib/preprocess.js
+10
-0
packages/uni-cli-shared/template/common/__uniapppicker.js
packages/uni-cli-shared/template/common/__uniapppicker.js
+1
-1
packages/uni-quickapp-webview/lib/uni.config.js
packages/uni-quickapp-webview/lib/uni.config.js
+14
-13
packages/webpack-uni-pages-loader/lib/platforms/app-plus/app-config-service.js
...pages-loader/lib/platforms/app-plus/app-config-service.js
+4
-2
packages/webpack-uni-pages-loader/lib/platforms/quickapp-webview/index.js
...-uni-pages-loader/lib/platforms/quickapp-webview/index.js
+13
-9
src/platforms/app-plus/service/api/plugin/load-sub-package.js
...platforms/app-plus/service/api/plugin/load-sub-package.js
+20
-2
src/platforms/app-plus/service/api/plugin/restore-global.js
src/platforms/app-plus/service/api/plugin/restore-global.js
+4
-3
src/platforms/app-plus/service/framework/load-sub-package.js
src/platforms/app-plus/service/framework/load-sub-package.js
+25
-22
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
ebc4358c
...
...
@@ -7414,7 +7414,7 @@ var serviceContext = (function () {
console
.
log
(
`[restoreGlobal][
${
Date
.
now
()}
]`
);
}
weex
=
newWeex
;
plus
=
newPlus
;
plus
=
newPlus
;
plus
.
navigator
.
setStatusBarStyle
=
newSetStatusBarStyle
;
/* eslint-disable no-global-assign */
setTimeout
=
newSetTimeout
;
...
...
@@ -7422,6 +7422,7 @@ var serviceContext = (function () {
setInterval
=
newSetInterval
;
clearInterval
=
newClearInterval
;
}
__uniConfig
.
serviceReady
=
true
;
}
function
wrapper$1
(
webview
)
{
...
...
@@ -7523,17 +7524,119 @@ var serviceContext = (function () {
return
weex
.
requireModule
(
'
plus
'
).
sendNativeEvent
(
event
,
data
,
callback
)
}
const
loadedSubPackages
=
[];
/**
* 指定路由 ready 后,检查是否触发分包预加载
* @param {Object} route
*/
function
preloadSubPackages
(
route
)
{
if
(
!
__uniConfig
.
preloadRule
)
{
return
}
const
options
=
__uniConfig
.
preloadRule
[
route
];
if
(
!
options
||
!
Array
.
isArray
(
options
.
packages
))
{
return
}
const
packages
=
options
.
packages
.
filter
(
root
=>
loadedSubPackages
.
indexOf
(
root
)
===
-
1
);
if
(
!
packages
.
length
)
{
return
}
loadSubPackages
(
options
.
packages
);
// 暂不需要网络下载
// const network = options.network || 'wifi'
// if (network === 'wifi') {
// uni.getNetworkType({
// success (res) {
// if (process.env.NODE_ENV !== 'production') {
// console.log('UNIAPP[preloadRule]:' + res.networkType + ':' + JSON.stringify(options))
// }
// if (res.networkType === 'wifi') {
// loadSubPackages(options.packages)
// }
// }
// })
// } else {
// if (process.env.NODE_ENV !== 'production') {
// console.log('UNIAPP[preloadRule]:' + JSON.stringify(options))
// }
// loadSubPackages(options.packages)
// }
}
function
loadPage
(
route
,
callback
)
{
let
isInSubPackage
=
false
;
const
subPackages
=
__uniConfig
.
subPackages
;
if
(
Array
.
isArray
(
subPackages
))
{
const
subPackage
=
subPackages
.
find
(
subPackage
=>
route
.
indexOf
(
subPackage
.
root
)
===
0
);
if
(
subPackage
)
{
isInSubPackage
=
true
;
loadSubPackage$1
(
subPackage
.
root
,
callback
);
}
}
if
(
!
isInSubPackage
)
{
callback
();
}
}
function
loadSubPackage$1
(
root
,
callback
)
{
if
(
loadedSubPackages
.
indexOf
(
root
)
!==
-
1
)
{
return
callback
()
}
loadSubPackages
([
root
],
()
=>
{
callback
();
});
}
const
SUB_FILENAME
=
'
app-sub-service.js
'
;
function
evaluateScriptFiles
(
files
,
callback
)
{
__uniConfig
.
onServiceReady
(()
=>
{
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
(
files
,
callback
);
});
}
function
loadSubPackages
(
packages
,
callback
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackages]:
'
+
JSON
.
stringify
(
packages
));
}
const
startTime
=
Date
.
now
();
evaluateScriptFiles
(
packages
.
map
(
root
=>
{
loadedSubPackages
.
push
(
root
);
return
root
+
'
/
'
+
SUB_FILENAME
}),
res
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackages]:耗时(
'
+
(
Date
.
now
()
-
startTime
)
+
'
)
'
);
}
callback
&&
callback
(
true
);
});
}
const
SUB_FILENAME$1
=
'
app-sub-service.js
'
;
function
evaluateScriptFile
(
file
,
callback
)
{
// TODO 有可能当前 instance 是非 app-service
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
([
file
],
callback
);
__uniConfig
.
onServiceReady
(()
=>
{
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
([
file
],
callback
);
});
}
function
loadSubPackage$
1
({
function
loadSubPackage$
2
({
root
},
callbackId
)
{
evaluateScriptFile
(
root
+
'
/
'
+
SUB_FILENAME
,
res
=>
{
if
(
loadedSubPackages
.
indexOf
(
root
)
!==
-
1
)
{
return
{
errMsg
:
'
loadSubPackage:ok
'
}
}
loadedSubPackages
.
push
(
root
);
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackage]:
'
+
root
);
}
const
startTime
=
Date
.
now
();
evaluateScriptFile
(
root
+
'
/
'
+
SUB_FILENAME$1
,
res
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackage]:耗时(
'
+
(
Date
.
now
()
-
startTime
)
+
'
)
'
);
}
invoke$1
(
callbackId
,
{
errMsg
:
'
loadSubPackage:ok
'
});
...
...
@@ -8430,91 +8533,6 @@ var serviceContext = (function () {
return
pageVm
}
const
loadedSubPackages
=
[];
/**
* 指定路由 ready 后,检查是否触发分包预加载
* @param {Object} route
*/
function
preloadSubPackages
(
route
)
{
if
(
!
__uniConfig
.
preloadRule
)
{
return
}
const
options
=
__uniConfig
.
preloadRule
[
route
];
if
(
!
options
||
!
Array
.
isArray
(
options
.
packages
))
{
return
}
const
packages
=
options
.
packages
.
filter
(
root
=>
loadedSubPackages
.
indexOf
(
root
)
===
-
1
);
if
(
!
packages
.
length
)
{
return
}
const
network
=
options
.
network
||
'
wifi
'
;
if
(
network
===
'
wifi
'
)
{
uni
.
getNetworkType
({
success
(
res
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[preloadRule]:
'
+
res
.
networkType
+
'
:
'
+
JSON
.
stringify
(
options
));
}
if
(
res
.
networkType
===
'
wifi
'
)
{
loadSubPackages
(
options
.
packages
);
}
}
});
}
else
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[preloadRule]:
'
+
JSON
.
stringify
(
options
));
}
loadSubPackages
(
options
.
packages
);
}
}
function
loadPage
(
route
,
callback
)
{
let
isInSubPackage
=
false
;
const
subPackages
=
__uniConfig
.
subPackages
;
if
(
Array
.
isArray
(
subPackages
))
{
const
subPackage
=
subPackages
.
find
(
subPackage
=>
route
.
indexOf
(
subPackage
.
root
)
===
0
);
if
(
subPackage
)
{
isInSubPackage
=
true
;
loadSubPackage$2
(
subPackage
.
root
,
callback
);
}
}
if
(
!
isInSubPackage
)
{
callback
();
}
}
function
loadSubPackage$2
(
root
,
callback
)
{
if
(
loadedSubPackages
.
indexOf
(
root
)
!==
-
1
)
{
return
callback
()
}
loadSubPackages
([
root
],
()
=>
{
callback
();
});
}
const
SUB_FILENAME$1
=
'
app-sub-service.js
'
;
function
evaluateScriptFiles
(
files
,
callback
)
{
// TODO 有可能当前 instance 是非 app-service
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
(
files
,
callback
);
}
function
loadSubPackages
(
packages
,
callback
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackages]:
'
+
JSON
.
stringify
(
packages
));
}
const
startTime
=
Date
.
now
();
evaluateScriptFiles
(
packages
.
map
(
root
=>
{
loadedSubPackages
.
push
(
root
);
return
root
+
'
/
'
+
SUB_FILENAME$1
}),
res
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackages]:
'
+
(
Date
.
now
()
-
startTime
));
}
callback
&&
callback
(
true
);
});
}
const
pages
=
[];
function
getCurrentPages$1
(
returnAll
)
{
...
...
@@ -9933,7 +9951,7 @@ var serviceContext = (function () {
getCurrentSubNVue
:
getCurrentSubNVue
,
onNativeEventReceive
:
onNativeEventReceive
,
sendNativeEvent
:
sendNativeEvent
,
loadSubPackage
:
loadSubPackage$
1
,
loadSubPackage
:
loadSubPackage$
2
,
navigateBack
:
navigateBack$1
,
navigateTo
:
navigateTo$1
,
reLaunch
:
reLaunch$1
,
...
...
packages/uni-app-plus/template/common/__uniapppicker.js
浏览文件 @
ebc4358c
此差异已折叠。
点击以展开。
packages/uni-cli-shared/lib/plugin.js
浏览文件 @
ebc4358c
...
...
@@ -89,6 +89,16 @@ module.exports = {
init
()
{
// compatible with vue-cli-service lint
process
.
env
.
UNI_PLATFORM
=
process
.
env
.
UNI_PLATFORM
||
'
h5
'
// hack
if
(
process
.
env
.
UNI_PLATFORM
===
'
quickapp-webview-huawei
'
||
process
.
env
.
UNI_PLATFORM
===
'
quickapp-webview-union
'
)
{
process
.
env
.
UNI_SUB_PLATFORM
=
process
.
env
.
UNI_PLATFORM
process
.
env
.
UNI_PLATFORM
=
'
quickapp-webview
'
}
const
plugins
=
resolvePlugins
()
const
plugin
=
plugins
.
find
(
plugin
=>
plugin
.
name
===
process
.
env
.
UNI_PLATFORM
)
if
(
!
plugin
)
{
...
...
packages/uni-cli-shared/lib/preprocess.js
浏览文件 @
ebc4358c
...
...
@@ -43,6 +43,16 @@ module.exports = function initPreprocess (name, platforms, userDefines = {}) {
vueContext
.
APP
=
true
}
if
(
name
===
'
quickapp-webview
'
)
{
vueContext
.
QUICKAPP_WEBVIEW_HUAWEI
=
true
vueContext
.
QUICKAPP_WEBVIEW_UNION
=
true
if
(
process
.
env
.
UNI_SUB_PLATFORM
===
'
quickapp-webview-huawei
'
)
{
vueContext
.
QUICKAPP_WEBVIEW_UNION
=
false
}
else
if
(
process
.
env
.
UNI_SUB_PLATFORM
===
'
quickapp-webview-union
'
)
{
vueContext
.
QUICKAPP_WEBVIEW_HUAWEI
=
false
}
}
userDefineKeys
.
forEach
(
name
=>
{
if
(
userDefines
[
name
])
{
const
key
=
normalize
(
name
)
...
...
packages/uni-cli-shared/template/common/__uniapppicker.js
浏览文件 @
ebc4358c
此差异已折叠。
点击以展开。
packages/uni-quickapp-webview/lib/uni.config.js
浏览文件 @
ebc4358c
...
...
@@ -30,6 +30,7 @@ module.exports = {
filterTag
:
'
qjs
'
},
validate
(
platformOptions
,
manifestJson
)
{
Object
.
assign
(
platformOptions
,
manifestJson
[
'
quickapp-webview
'
]
||
{},
platformOptions
)
if
(
!
platformOptions
.
package
)
{
console
.
warn
(
'
manifest.json->quickapp-webview 缺少 package 配置
'
)
}
...
...
@@ -38,18 +39,18 @@ module.exports = {
}
},
copyWebpackOptions
(
platformOptions
,
vueOptions
)
{
const
copyOptions
=
[]
let
jsConfigPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
jsconfig.json
'
)
if
(
!
fs
.
existsSync
(
jsConfigPath
))
{
jsConfigPath
=
path
.
resolve
(
__dirname
,
'
assets/jsconfig.json
'
)
}
copyOptions
.
push
(
jsConfigPath
)
const
signCopyOption
=
getSignCopyOption
()
if
(
signCopyOption
)
{
copyOptions
.
push
(
signCopyOption
)
}
const
copyOptions
=
[]
let
jsConfigPath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
'
jsconfig.json
'
)
if
(
!
fs
.
existsSync
(
jsConfigPath
))
{
jsConfigPath
=
path
.
resolve
(
__dirname
,
'
assets/jsconfig.json
'
)
}
copyOptions
.
push
(
jsConfigPath
)
const
signCopyOption
=
getSignCopyOption
()
if
(
signCopyOption
)
{
copyOptions
.
push
(
signCopyOption
)
}
return
copyOptions
}
}
}
packages/webpack-uni-pages-loader/lib/platforms/app-plus/app-config-service.js
浏览文件 @
ebc4358c
...
...
@@ -67,10 +67,12 @@ module.exports = function definePages (appJson) {
return
{
name
:
'
app-config-service.js
'
,
content
:
`
var isReady=false;var onReadyCallbacks=[];
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig =
${
JSON
.
stringify
(
appJson
,
null
)}
;
var __uniRoutes =
${
JSON
.
stringify
(
__uniRoutes
)}
;
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,
${
globalStatement
}
}}}});
`
}
...
...
packages/webpack-uni-pages-loader/lib/platforms/quickapp-webview/index.js
浏览文件 @
ebc4358c
...
...
@@ -5,7 +5,7 @@
*/
module
.
exports
=
function
(
pagesJson
,
manifestJson
)
{
const
{
app
,
app
,
project
}
=
require
(
'
../mp
'
)(
pagesJson
,
manifestJson
,
require
(
'
./project.config.json
'
))
...
...
@@ -16,16 +16,20 @@ module.exports = function (pagesJson, manifestJson) {
manifestJson
.
versionName
&&
(
baseJson
.
versionName
=
manifestJson
.
versionName
)
manifestJson
.
versionCode
&&
(
baseJson
.
versionCode
=
manifestJson
.
versionCode
)
Object
.
assign
(
app
.
content
,
baseJson
,
manifestJson
[
'
quickapp-webview
'
]
||
{})
const
options
=
Object
.
assign
({},
manifestJson
[
'
quickapp-webview
'
]
||
{})
if
(
process
.
env
.
UNI_SUB_PLATFORM
)
{
Object
.
assign
(
options
,
manifestJson
[
process
.
env
.
UNI_SUB_PLATFORM
]
||
{})
}
Object
.
assign
(
app
.
content
,
baseJson
,
options
)
if
(
!
app
.
content
.
package
)
{
app
.
content
.
package
=
manifestJson
.
name
}
project
.
name
=
'
quickapp.config
'
}
return
[
app
,
project
project
.
name
=
'
quickapp.config
'
return
[
app
,
project
]
}
}
src/platforms/app-plus/service/api/plugin/load-sub-package.js
浏览文件 @
ebc4358c
...
...
@@ -2,17 +2,35 @@ import {
invoke
}
from
'
../../bridge
'
import
{
loadedSubPackages
}
from
'
../../framework/load-sub-package
'
const
SUB_FILENAME
=
'
app-sub-service.js
'
function
evaluateScriptFile
(
file
,
callback
)
{
// TODO 有可能当前 instance 是非 app-service
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
([
file
],
callback
)
__uniConfig
.
onServiceReady
(()
=>
{
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
([
file
],
callback
)
})
}
export
function
loadSubPackage
({
root
},
callbackId
)
{
if
(
loadedSubPackages
.
indexOf
(
root
)
!==
-
1
)
{
return
{
errMsg
:
'
loadSubPackage:ok
'
}
}
loadedSubPackages
.
push
(
root
)
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackage]:
'
+
root
)
}
const
startTime
=
Date
.
now
()
evaluateScriptFile
(
root
+
'
/
'
+
SUB_FILENAME
,
res
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackage]:耗时(
'
+
(
Date
.
now
()
-
startTime
)
+
'
)
'
)
}
invoke
(
callbackId
,
{
errMsg
:
'
loadSubPackage:ok
'
})
...
...
src/platforms/app-plus/service/api/plugin/restore-global.js
浏览文件 @
ebc4358c
import
{
newSetStatusBarStyle
}
from
'
../../bridge
'
}
from
'
../../bridge
'
export
function
restoreGlobal
(
newWeex
,
newPlus
,
...
...
@@ -19,7 +19,7 @@ export function restoreGlobal (
console
.
log
(
`[restoreGlobal][
${
Date
.
now
()}
]`
)
}
weex
=
newWeex
plus
=
newPlus
plus
=
newPlus
plus
.
navigator
.
setStatusBarStyle
=
newSetStatusBarStyle
/* eslint-disable no-global-assign */
setTimeout
=
newSetTimeout
...
...
@@ -27,4 +27,5 @@ export function restoreGlobal (
setInterval
=
newSetInterval
clearInterval
=
newClearInterval
}
__uniConfig
.
serviceReady
=
true
}
src/platforms/app-plus/service/framework/load-sub-package.js
浏览文件 @
ebc4358c
const
loadedSubPackages
=
[]
export
const
loadedSubPackages
=
[]
/**
* 指定路由 ready 后,检查是否触发分包预加载
...
...
@@ -16,24 +16,26 @@ export function preloadSubPackages (route) {
if
(
!
packages
.
length
)
{
return
}
const
network
=
options
.
network
||
'
wifi
'
if
(
network
===
'
wifi
'
)
{
uni
.
getNetworkType
({
success
(
res
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[preloadRule]:
'
+
res
.
networkType
+
'
:
'
+
JSON
.
stringify
(
options
))
}
if
(
res
.
networkType
===
'
wifi
'
)
{
loadSubPackages
(
options
.
packages
)
}
}
})
}
else
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[preloadRule]:
'
+
JSON
.
stringify
(
options
))
}
loadSubPackages
(
options
.
packages
)
}
loadSubPackages
(
options
.
packages
)
// 暂不需要网络下载
// const network = options.network || 'wifi'
// if (network === 'wifi') {
// uni.getNetworkType({
// success (res) {
// if (process.env.NODE_ENV !== 'production') {
// console.log('UNIAPP[preloadRule]:' + res.networkType + ':' + JSON.stringify(options))
// }
// if (res.networkType === 'wifi') {
// loadSubPackages(options.packages)
// }
// }
// })
// } else {
// if (process.env.NODE_ENV !== 'production') {
// console.log('UNIAPP[preloadRule]:' + JSON.stringify(options))
// }
// loadSubPackages(options.packages)
// }
}
export
function
loadPage
(
route
,
callback
)
{
...
...
@@ -63,8 +65,9 @@ function loadSubPackage (root, callback) {
const
SUB_FILENAME
=
'
app-sub-service.js
'
function
evaluateScriptFiles
(
files
,
callback
)
{
// TODO 有可能当前 instance 是非 app-service
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
(
files
,
callback
)
__uniConfig
.
onServiceReady
(()
=>
{
weex
.
requireModule
(
'
plus
'
).
evalJSFiles
(
files
,
callback
)
})
}
function
loadSubPackages
(
packages
,
callback
)
{
...
...
@@ -77,7 +80,7 @@ function loadSubPackages (packages, callback) {
return
root
+
'
/
'
+
SUB_FILENAME
}),
res
=>
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
'
UNIAPP[loadSubPackages]:
'
+
(
Date
.
now
()
-
startTime
)
)
console
.
log
(
'
UNIAPP[loadSubPackages]:
耗时(
'
+
(
Date
.
now
()
-
startTime
)
+
'
)
'
)
}
callback
&&
callback
(
true
)
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录