Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoderSmallfan
uni-app
提交
18c992a9
U
uni-app
项目概览
CoderSmallfan
/
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,发现更多精彩内容 >>
提交
18c992a9
编写于
11月 18, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'alpha'
上级
4447e59f
bcf65737
变更
42
展开全部
隐藏空白更改
内联
并排
Showing
42 changed file
with
187 addition
and
92 deletion
+187
-92
lerna.json
lerna.json
+1
-1
packages/uni-app-plus-nvue/package.json
packages/uni-app-plus-nvue/package.json
+1
-1
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-1
packages/uni-cli-shared/package.json
packages/uni-cli-shared/package.json
+1
-1
packages/uni-cli-shared/template/common/__uniappchooselocation.js
.../uni-cli-shared/template/common/__uniappchooselocation.js
+1
-1
packages/uni-cli-shared/template/common/__uniappopenlocation.js
...es/uni-cli-shared/template/common/__uniappopenlocation.js
+1
-1
packages/uni-cli-shared/template/common/__uniapppicker.js
packages/uni-cli-shared/template/common/__uniapppicker.js
+1
-1
packages/uni-cli-shared/template/common/__uniappscan.js
packages/uni-cli-shared/template/common/__uniappscan.js
+1
-1
packages/uni-h5-ui/package.json
packages/uni-h5-ui/package.json
+1
-1
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-h5/package.json
packages/uni-h5/package.json
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+9
-3
packages/uni-mp-alipay/package.json
packages/uni-mp-alipay/package.json
+1
-1
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+26
-12
packages/uni-mp-baidu/package.json
packages/uni-mp-baidu/package.json
+1
-1
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+12
-0
packages/uni-mp-qq/package.json
packages/uni-mp-qq/package.json
+1
-1
packages/uni-mp-toutiao/package.json
packages/uni-mp-toutiao/package.json
+1
-1
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+1
-1
packages/uni-mp-weixin/package.json
packages/uni-mp-weixin/package.json
+1
-1
packages/uni-stat/package.json
packages/uni-stat/package.json
+1
-1
packages/uni-template-compiler/package.json
packages/uni-template-compiler/package.json
+1
-1
packages/vue-cli-plugin-hbuilderx/package.json
packages/vue-cli-plugin-hbuilderx/package.json
+1
-1
packages/vue-cli-plugin-uni-optimize/package.json
packages/vue-cli-plugin-uni-optimize/package.json
+1
-1
packages/vue-cli-plugin-uni/package.json
packages/vue-cli-plugin-uni/package.json
+2
-2
packages/webpack-uni-mp-loader/package.json
packages/webpack-uni-mp-loader/package.json
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/project.config.json
...-pages-loader/lib/platforms/mp-weixin/project.config.json
+1
-1
packages/webpack-uni-pages-loader/package.json
packages/webpack-uni-pages-loader/package.json
+2
-2
src/core/service/plugins/app/create-app.js
src/core/service/plugins/app/create-app.js
+5
-3
src/core/view/bridge/subscribe/scroll.js
src/core/view/bridge/subscribe/scroll.js
+27
-12
src/platforms/app-plus/service/api/page.js
src/platforms/app-plus/service/api/page.js
+9
-3
src/platforms/app-plus/service/framework/webview/index.js
src/platforms/app-plus/service/framework/webview/index.js
+26
-2
src/platforms/h5/service/api/device/get-system-info.js
src/platforms/h5/service/api/device/get-system-info.js
+1
-1
src/platforms/h5/service/api/media/get-image-info.js
src/platforms/h5/service/api/media/get-image-info.js
+2
-4
src/platforms/h5/service/api/network/socket.js
src/platforms/h5/service/api/network/socket.js
+8
-5
src/platforms/h5/view/components/picker/index.vue
src/platforms/h5/view/components/picker/index.vue
+1
-0
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
+8
-2
src/platforms/mp-alipay/runtime/wrapper/util.js
src/platforms/mp-alipay/runtime/wrapper/util.js
+1
-1
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
+7
-7
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
+15
-7
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
+1
-1
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
...tforms/mp-weixin/runtime/wrapper/component-base-parser.js
+2
-2
未找到文件。
lerna.json
浏览文件 @
18c992a9
...
...
@@ -12,5 +12,5 @@
"message"
:
"chore(release): publish %s"
}
},
"version"
:
"2.0.0-24
120191114
004"
"version"
:
"2.0.0-24
220191115
004"
}
packages/uni-app-plus-nvue/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-app-plus-nvue"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app app-plus-nvue"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-app-plus/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-app-plus"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app app-plus"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-cli-shared/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-cli-shared"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-cli-shared"
,
"main"
:
"lib/index.js"
,
"repository"
:
{
...
...
packages/uni-cli-shared/template/common/__uniappchooselocation.js
浏览文件 @
18c992a9
此差异已折叠。
点击以展开。
packages/uni-cli-shared/template/common/__uniappopenlocation.js
浏览文件 @
18c992a9
此差异已折叠。
点击以展开。
packages/uni-cli-shared/template/common/__uniapppicker.js
浏览文件 @
18c992a9
此差异已折叠。
点击以展开。
packages/uni-cli-shared/template/common/__uniappscan.js
浏览文件 @
18c992a9
此差异已折叠。
点击以展开。
packages/uni-h5-ui/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-h5-ui"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app h5 ui"
,
"main"
:
"dist/index.umd.min.js"
,
"repository"
:
{
...
...
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
18c992a9
此差异已折叠。
点击以展开。
packages/uni-h5/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-h5"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app h5"
,
"main"
:
"dist/index.umd.min.js"
,
"repository"
:
{
...
...
packages/uni-mp-alipay/dist/index.js
浏览文件 @
18c992a9
...
...
@@ -1665,7 +1665,7 @@ const customizeRE = /:/g;
const
customize
=
cached
((
str
)
=>
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
))
});
});
const
isComponent2
=
my
.
canIUse
(
'
component2
'
);
...
...
@@ -2022,8 +2022,14 @@ function parseComponent (vueComponentOptions) {
mixins
:
initBehaviors
(
vueOptions
,
initBehavior
),
data
:
initData
(
vueOptions
,
Vue
.
prototype
),
props
,
didMount
()
{
initVm
.
call
(
this
,
VueComponent
);
didMount
()
{
if
(
my
.
dd
)
{
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
setTimeout
(()
=>
{
initVm
.
call
(
this
,
VueComponent
);
},
4
);
}
else
{
initVm
.
call
(
this
,
VueComponent
);
}
initSpecialMethods
(
this
);
...
...
packages/uni-mp-alipay/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-mp-alipay"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app mp-alipay"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-mp-baidu/dist/index.js
浏览文件 @
18c992a9
...
...
@@ -1507,23 +1507,29 @@ function parseComponent (vueOptions) {
const
componentOptions
=
parseBaseComponent
(
vueOptions
,
{
isPage
,
initRelation
});
});
// 关于百度小程序新生命周期(2.0)的说明(组件作为页面时):
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
// 这里在新生命周期强制将onShow挪到onLoad之后触发,另外一处修改在page-parser.js
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
;
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
oldAttached
.
call
(
this
);
if
(
isPage
.
call
(
this
))
{
// 百度 onLoad 在 attached 之前触发
// 百度 当组件作为页面时 pageinstancce 不是原来组件的 instance
this
.
pageinstance
.
$vm
=
this
.
$vm
;
if
(
hasOwn
(
this
.
pageinstance
,
'
_$args
'
))
{
this
.
$vm
.
$mp
.
query
=
this
.
pageinstance
.
_$args
;
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
this
.
pageinstance
.
_$args
);
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
this
.
pageinstance
.
_$args
);
this
.
$vm
.
__call_hook
(
'
onShow
'
);
delete
this
.
pageinstance
.
_$args
;
}
// TODO 3.105.17以下基础库内百度 Component 作为页面时,methods 中的 onShow 不触发
!
newLifecycle
&&
this
.
$vm
.
__call_hook
(
'
onShow
'
);
}
else
{
// 百度小程序组件不触发methods内的onReady
if
(
this
.
$vm
)
{
this
.
$vm
.
_isMounted
=
true
;
this
.
$vm
.
__call_hook
(
'
mounted
'
);
}
}
};
...
...
@@ -1590,13 +1596,21 @@ function parsePage (vuePageOptions) {
initRelation
});
const
newLifecycle
=
swan
.
canIUse
(
'
lifecycle-2-0
'
);
// 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题
if
(
newLifecycle
)
{
delete
pageOptions
.
methods
.
onShow
;
}
pageOptions
.
methods
.
onLoad
=
function
onLoad
(
args
)
{
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
if
(
this
.
$vm
)
{
this
.
$vm
.
$mp
.
query
=
args
;
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
args
);
}
else
{
this
.
pageinstance
.
_$args
=
args
;
if
(
this
.
$vm
)
{
this
.
$vm
.
$mp
.
query
=
args
;
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
args
);
this
.
$vm
.
__call_hook
(
'
onShow
'
);
}
else
{
this
.
pageinstance
.
_$args
=
args
;
}
};
...
...
packages/uni-mp-baidu/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-mp-baidu"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app mp-baidu"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-mp-qq/dist/index.js
浏览文件 @
18c992a9
...
...
@@ -1214,6 +1214,11 @@ function parseBaseApp (vm, {
if
(
this
.
$vm
)
{
// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
return
}
{
if
(
!
wx
.
canIUse
(
'
nextTick
'
))
{
// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
console
.
error
(
'
当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上
'
);
}
}
this
.
$vm
=
vm
;
...
...
@@ -1339,6 +1344,13 @@ function parseBaseComponent (vueComponentOptions, {
addGlobalClass
:
true
};
{
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if
(
vueOptions
[
'
mp-weixin
'
]
&&
vueOptions
[
'
mp-weixin
'
][
'
options
'
])
{
Object
.
assign
(
options
,
vueOptions
[
'
mp-weixin
'
][
'
options
'
]);
}
}
const
componentOptions
=
{
options
,
data
:
initData
(
vueOptions
,
Vue
.
prototype
),
...
...
packages/uni-mp-qq/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-mp-qq"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app mp-qq"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-mp-toutiao/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-mp-toutiao"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app mp-toutiao"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
18c992a9
...
...
@@ -1281,7 +1281,7 @@ function parseBaseComponent (vueComponentOptions, {
};
{
// 微信
multipleSlots
部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
// 微信
multipleSlots
部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if
(
vueOptions
[
'
mp-weixin
'
]
&&
vueOptions
[
'
mp-weixin
'
][
'
options
'
])
{
Object
.
assign
(
options
,
vueOptions
[
'
mp-weixin
'
][
'
options
'
]);
}
...
...
packages/uni-mp-weixin/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-mp-weixin"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app mp-weixin"
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-stat/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-stat"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
""
,
"main"
:
"dist/index.js"
,
"repository"
:
{
...
...
packages/uni-template-compiler/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/uni-template-compiler"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-template-compiler"
,
"main"
:
"lib/index.js"
,
"repository"
:
{
...
...
packages/vue-cli-plugin-hbuilderx/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/vue-cli-plugin-hbuilderx"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"HBuilderX plugin for vue-cli 3"
,
"main"
:
"index.js"
,
"repository"
:
{
...
...
packages/vue-cli-plugin-uni-optimize/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/vue-cli-plugin-uni-optimize"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app optimize plugin for vue-cli 3"
,
"main"
:
"index.js"
,
"repository"
:
{
...
...
packages/vue-cli-plugin-uni/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/vue-cli-plugin-uni"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app plugin for vue-cli 3"
,
"main"
:
"index.js"
,
"repository"
:
{
...
...
@@ -17,7 +17,7 @@
"author"
:
"fxy060608"
,
"license"
:
"Apache-2.0"
,
"dependencies"
:
{
"@dcloudio/uni-stat"
:
"^2.0.0-24
120191114
004"
,
"@dcloudio/uni-stat"
:
"^2.0.0-24
220191115
004"
,
"copy-webpack-plugin"
:
"^4.6.0"
,
"cross-env"
:
"^5.2.0"
,
"envinfo"
:
"^6.0.1"
,
...
...
packages/webpack-uni-mp-loader/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/webpack-uni-mp-loader"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"webpack-uni-mp-loader"
,
"main"
:
"index.js"
,
"repository"
:
{
...
...
packages/webpack-uni-pages-loader/lib/platforms/mp-weixin/project.config.json
浏览文件 @
18c992a9
...
...
@@ -11,7 +11,7 @@
"newFeature"
:
true
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
""
,
"libVersion"
:
"
2.9.2
"
,
"appid"
:
"touristappid"
,
"projectname"
:
""
,
"condition"
:
{
...
...
packages/webpack-uni-pages-loader/package.json
浏览文件 @
18c992a9
{
"name"
:
"@dcloudio/webpack-uni-pages-loader"
,
"version"
:
"2.0.0-24
120191114
004"
,
"version"
:
"2.0.0-24
220191115
004"
,
"description"
:
"uni-app pages.json loader"
,
"main"
:
"lib/index.js"
,
"repository"
:
{
...
...
@@ -21,7 +21,7 @@
"strip-json-comments"
:
"^2.0.1"
},
"uni-app"
:
{
"compilerVersion"
:
"2.4.
1
"
"compilerVersion"
:
"2.4.
2
"
},
"gitHead"
:
"5e13dffd1c33347c5faa64f1f8f15f5b0edcfeed"
}
src/core/service/plugins/app/create-app.js
浏览文件 @
18c992a9
...
...
@@ -6,11 +6,13 @@ export function getApp () {
return
appVm
}
export
function
getCurrentPages
(
isAll
=
false
)
{
export
function
getCurrentPages
(
isAll
=
false
,
ignoreError
=
false
)
{
const
pages
=
[]
const
app
=
getApp
()
if
(
!
app
)
{
console
.
error
(
'
app is not ready
'
)
if
(
ignoreError
)
{
console
.
error
(
'
app is not ready
'
)
}
return
[]
}
const
childrenVm
=
app
.
$children
[
0
]
...
...
@@ -62,4 +64,4 @@ export default function createApp (vm, routes) {
// initEvents(appVm)
initRouterGuard
(
appVm
,
routes
)
}
}
src/core/view/bridge/subscribe/scroll.js
浏览文件 @
18c992a9
...
...
@@ -58,6 +58,9 @@ export function pageScrollTo ({
// bodyStyle.webkitTransform = `translateY(${documentElement.scrollTop}px) translateZ(0)`
}
let
testReachBottomTimer
let
lastScrollHeight
=
0
export
function
createScrollListener
(
pageId
,
{
enablePageScroll
,
enablePageReachBottom
,
...
...
@@ -72,14 +75,16 @@ export function createScrollListener (pageId, {
function
isReachBottom
()
{
const
{
clientHeight
,
scrollHeight
}
=
document
.
documentElement
// 部分浏览器窗口高度变化后document.documentelement.clientheight不会变化,采用window.innerHeight
const
windowHeight
=
window
.
innerHeight
const
scrollY
=
window
.
scrollY
let
isBottom
=
scrollY
>
0
&&
scrollHeight
>
clientHeight
&&
(
scrollY
+
clientHeight
+
onReachBottomDistance
)
>=
scrollHeight
if
(
isBottom
&&
!
hasReachBottom
)
{
let
isBottom
=
scrollY
>
0
&&
scrollHeight
>
windowHeight
&&
(
scrollY
+
windowHeight
+
onReachBottomDistance
)
>=
scrollHeight
// 兼容部分浏览器滚动时scroll事件不触发
const
heightChanged
=
Math
.
abs
(
scrollHeight
-
lastScrollHeight
)
>
onReachBottomDistance
if
(
isBottom
&&
(
!
hasReachBottom
||
heightChanged
))
{
lastScrollHeight
=
scrollHeight
hasReachBottom
=
true
return
true
}
...
...
@@ -108,18 +113,28 @@ export function createScrollListener (pageId, {
scrollTop
})
}
if
(
enablePageReachBottom
&&
onReachBottom
&&
isReachBottom
())
{
publishHandler
(
'
onReachBottom
'
,
{},
pageId
)
onReachBottom
=
false
setTimeout
(
function
()
{
onReachBottom
=
true
},
350
)
function
testReachBottom
()
{
if
(
isReachBottom
())
{
publishHandler
(
'
onReachBottom
'
,
{},
pageId
)
onReachBottom
=
false
setTimeout
(
function
()
{
onReachBottom
=
true
},
350
)
return
true
}
}
if
(
enablePageReachBottom
&&
onReachBottom
)
{
if
(
testReachBottom
())
{
}
else
{
// 解决部分浏览器滚动中js获取窗口高度不准确导致的问题
testReachBottomTimer
=
setTimeout
(
testReachBottom
,
300
)
}
}
ticking
=
false
}
return
function
onScroll
()
{
clearTimeout
(
testReachBottomTimer
)
if
(
!
ticking
)
{
requestAnimationFrame
(
trigger
)
}
...
...
src/platforms/app-plus/service/api/page.js
浏览文件 @
18c992a9
...
...
@@ -118,13 +118,19 @@ export function showPage ({
animationType
:
'
pop-in
'
,
animationDuration
:
200
,
uniNView
:
{
path
:
`
/
${
url
}
.js?from=
${
getPageId
()}
&runtime=
${
runtime
}
&data=
${
encodeURIComponent
(
JSON
.
stringify
(
data
))}
`
,
path
:
`
${(
typeof
process
===
'
object
'
&&
process
.
env
&&
process
.
env
.
VUE_APP_TEMPLATE_PATH
)
||
''
}
/
${
url
}
.js
`
,
defaultFontSize
:
plus_
.
screen
.
resolutionWidth
/
20
,
viewport
:
plus_
.
screen
.
resolutionWidth
}
}
style
=
Object
.
assign
(
defaultStyle
,
style
)
const
page
=
plus_
.
webview
.
create
(
''
,
pageId
,
style
)
const
page
=
plus_
.
webview
.
create
(
''
,
pageId
,
style
,
{
extras
:
{
from
:
getPageId
(),
runtime
:
runtime
,
data
}
})
page
.
addEventListener
(
'
close
'
,
onClose
)
addEventListener
(
pageId
,
message
=>
{
if
(
typeof
onMessage
===
'
function
'
)
{
...
...
@@ -136,4 +142,4 @@ export function showPage ({
})
page
.
show
(
style
.
animationType
,
style
.
animationDuration
)
return
new
Page
(
page
)
}
}
src/platforms/app-plus/service/framework/webview/index.js
浏览文件 @
18c992a9
...
...
@@ -8,7 +8,8 @@ import {
}
from
'
./parser/webview-style-parser
'
import
{
publish
publish
,
setStatusBarStyle
}
from
'
../../bridge
'
let
id
=
2
...
...
@@ -75,6 +76,29 @@ export function initWebview (webview, routeOptions) {
emit
(
'
onResize
'
,
res
,
parseInt
(
webview
.
id
))
})
webview
.
addEventListener
(
'
popGesture
'
,
e
=>
{
if
(
e
.
type
===
'
start
'
)
{
// 设置下一个页面的 statusBarStyle
const
pages
=
getCurrentPages
()
const
page
=
pages
[
pages
.
length
-
2
]
const
statusBarStyle
=
page
&&
page
.
$page
.
meta
.
statusBarStyle
statusBarStyle
&&
setStatusBarStyle
(
statusBarStyle
)
}
else
if
(
e
.
type
===
'
end
'
&&
!
e
.
result
)
{
// 拖拽未完成,设置为当前状态栏前景色
setStatusBarStyle
()
}
else
if
(
e
.
type
===
'
end
'
&&
e
.
result
)
{
const
pages
=
getCurrentPages
()
const
page
=
pages
[
pages
.
length
-
1
]
page
&&
page
.
$remove
()
setStatusBarStyle
()
UniServiceJSBridge
.
emit
(
'
onAppRoute
'
,
{
type
:
'
navigateBack
'
})
}
})
// TODO 应该结束之前未完成的下拉刷新
on
(
webview
.
id
+
'
.startPullDownRefresh
'
,
()
=>
{
webview
.
beginPullToRefresh
()
...
...
@@ -85,4 +109,4 @@ export function initWebview (webview, routeOptions) {
})
return
webview
}
}
src/platforms/h5/service/api/device/get-system-info.js
浏览文件 @
18c992a9
...
...
@@ -84,7 +84,7 @@ export function getSystemInfoSync () {
const
{
top
:
windowTop
,
bottom
:
windowBottom
}
=
getWindowOffset
()
}
=
getWindowOffset
(
false
,
true
)
windowHeight
-=
windowTop
windowHeight
-=
windowBottom
...
...
src/platforms/h5/service/api/media/get-image-info.js
浏览文件 @
18c992a9
import
getRealPath
from
'
uni-platform/helpers/get-real-path
'
function
_getServiceAddress
()
{
return
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
}
...
...
@@ -11,7 +9,7 @@ export function getImageInfo ({
invokeCallbackHandler
:
invoke
}
=
UniServiceJSBridge
const
img
=
new
Image
()
const
realPath
=
getRealPath
(
src
)
const
realPath
=
src
img
.
onload
=
function
()
{
invoke
(
callbackId
,
{
errMsg
:
'
getImageInfo:ok
'
,
...
...
@@ -26,4 +24,4 @@ export function getImageInfo ({
})
}
img
.
src
=
src
}
}
src/platforms/h5/service/api/network/socket.js
浏览文件 @
18c992a9
...
...
@@ -68,6 +68,9 @@ class SocketTask {
const
data
=
options
.
data
const
ws
=
this
.
_webSocket
try
{
if
(
ws
.
readyState
!==
ws
.
OPEN
)
{
throw
new
Error
(
'
SocketTask.readyState is not OPEN
'
)
}
ws
.
send
(
data
)
this
.
_callback
(
options
,
'
sendSocketMessage:ok
'
)
}
catch
(
error
)
{
...
...
@@ -118,11 +121,11 @@ class SocketTask {
}
}
}
eventNames
.
forEach
(
item
=>
{
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
)
SocketTask
.
prototype
[
`on
${
name
}
`
]
=
function
(
callback
)
{
this
.
_callbacks
[
item
].
push
(
callback
)
}
eventNames
.
forEach
(
item
=>
{
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
)
SocketTask
.
prototype
[
`on
${
name
}
`
]
=
function
(
callback
)
{
this
.
_callbacks
[
item
].
push
(
callback
)
}
})
/**
* 创建一个 WebSocket 连接
...
...
src/platforms/h5/view/components/picker/index.vue
浏览文件 @
18c992a9
...
...
@@ -281,6 +281,7 @@ export default {
this
.
$watch
(
'
mode
'
,
this
.
_setValue
)
},
beforeDestroy
()
{
this
.
$refs
.
picker
.
remove
()
this
.
$dispatch
(
'
Form
'
,
'
uni-form-group-update
'
,
{
type
:
'
remove
'
,
vm
:
this
...
...
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
浏览文件 @
18c992a9
...
...
@@ -91,8 +91,14 @@ export default function parseComponent (vueComponentOptions) {
mixins
:
initBehaviors
(
vueOptions
,
initBehavior
),
data
:
initData
(
vueOptions
,
Vue
.
prototype
),
props
,
didMount
()
{
initVm
.
call
(
this
,
VueComponent
)
didMount
()
{
if
(
my
.
dd
)
{
// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
setTimeout
(()
=>
{
initVm
.
call
(
this
,
VueComponent
)
},
4
)
}
else
{
initVm
.
call
(
this
,
VueComponent
)
}
initSpecialMethods
(
this
)
...
...
src/platforms/mp-alipay/runtime/wrapper/util.js
浏览文件 @
18c992a9
...
...
@@ -14,7 +14,7 @@ const customizeRE = /:/g
const
customize
=
cached
((
str
)
=>
{
return
camelize
(
str
.
replace
(
customizeRE
,
'
-
'
))
})
})
export
const
isComponent2
=
my
.
canIUse
(
'
component2
'
)
...
...
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
浏览文件 @
18c992a9
...
...
@@ -15,23 +15,23 @@ export default function parseComponent (vueOptions) {
const
componentOptions
=
parseBaseComponent
(
vueOptions
,
{
isPage
,
initRelation
})
})
// 关于百度小程序新生命周期(2.0)的说明(组件作为页面时):
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
// 这里在新生命周期强制将onShow挪到onLoad之后触发,另外一处修改在page-parser.js
const
oldAttached
=
componentOptions
.
lifetimes
.
attached
componentOptions
.
lifetimes
.
attached
=
function
attached
()
{
oldAttached
.
call
(
this
)
if
(
isPage
.
call
(
this
))
{
// 百度 onLoad 在 attached 之前触发
// 百度 当组件作为页面时 pageinstancce 不是原来组件的 instance
this
.
pageinstance
.
$vm
=
this
.
$vm
if
(
hasOwn
(
this
.
pageinstance
,
'
_$args
'
))
{
this
.
$vm
.
$mp
.
query
=
this
.
pageinstance
.
_$args
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
this
.
pageinstance
.
_$args
)
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
this
.
pageinstance
.
_$args
)
this
.
$vm
.
__call_hook
(
'
onShow
'
)
delete
this
.
pageinstance
.
_$args
}
// TODO 3.105.17以下基础库内百度 Component 作为页面时,methods 中的 onShow 不触发
!
newLifecycle
&&
this
.
$vm
.
__call_hook
(
'
onShow
'
)
}
else
{
// 百度小程序组件不触发methods内的onReady
if
(
this
.
$vm
)
{
...
...
src/platforms/mp-baidu/runtime/wrapper/page-parser.js
浏览文件 @
18c992a9
import
{
isPage
,
isPage
,
initRelation
}
from
'
./util
'
...
...
@@ -25,13 +25,21 @@ export default function parsePage (vuePageOptions) {
initRelation
})
const
newLifecycle
=
swan
.
canIUse
(
'
lifecycle-2-0
'
)
// 纠正百度小程序新生命周期(2.0)methods:onShow在methods:onLoad之前触发的问题
if
(
newLifecycle
)
{
delete
pageOptions
.
methods
.
onShow
}
pageOptions
.
methods
.
onLoad
=
function
onLoad
(
args
)
{
// 百度 onLoad 在 attached 之前触发,先存储 args, 在 attached 里边触发 onLoad
if
(
this
.
$vm
)
{
this
.
$vm
.
$mp
.
query
=
args
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
args
)
}
else
{
this
.
pageinstance
.
_$args
=
args
if
(
this
.
$vm
)
{
this
.
$vm
.
$mp
.
query
=
args
this
.
$vm
.
__call_hook
(
'
onLoad
'
,
args
)
this
.
$vm
.
__call_hook
(
'
onShow
'
)
}
else
{
this
.
pageinstance
.
_$args
=
args
}
}
...
...
@@ -41,4 +49,4 @@ export default function parsePage (vuePageOptions) {
}
return
pageOptions
}
}
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
浏览文件 @
18c992a9
...
...
@@ -52,7 +52,7 @@ export default function parseBaseApp (vm, {
if
(
this
.
$vm
)
{
// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
return
}
if
(
__PLATFORM__
===
'
mp-weixin
'
)
{
if
(
__PLATFORM__
===
'
mp-weixin
'
||
__PLATFORM__
===
'
mp-qq
'
)
{
if
(
!
wx
.
canIUse
(
'
nextTick
'
))
{
// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
console
.
error
(
'
当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上
'
)
}
...
...
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
浏览文件 @
18c992a9
...
...
@@ -26,8 +26,8 @@ export default function parseBaseComponent (vueComponentOptions, {
addGlobalClass
:
true
}
if
(
__PLATFORM__
===
'
mp-weixin
'
)
{
// 微信
multipleSlots
部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if
(
__PLATFORM__
===
'
mp-weixin
'
||
__PLATFORM__
===
'
mp-qq
'
)
{
// 微信
multipleSlots
部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if
(
vueOptions
[
'
mp-weixin
'
]
&&
vueOptions
[
'
mp-weixin
'
][
'
options
'
])
{
Object
.
assign
(
options
,
vueOptions
[
'
mp-weixin
'
][
'
options
'
])
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录