Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_38335589
uni-app
提交
46d679a8
U
uni-app
项目概览
weixin_38335589
/
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,发现更多精彩内容 >>
提交
46d679a8
编写于
4月 13, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
npm run lint
上级
1c475042
变更
143
展开全部
隐藏空白更改
内联
并排
Showing
143 changed file
with
2257 addition
and
1876 deletion
+2257
-1876
src/core/helpers/api.js
src/core/helpers/api.js
+3
-3
src/core/helpers/hidpi.js
src/core/helpers/hidpi.js
+170
-165
src/core/helpers/params.js
src/core/helpers/params.js
+1
-1
src/core/helpers/protocol/device/make-phone-call.js
src/core/helpers/protocol/device/make-phone-call.js
+2
-2
src/core/helpers/protocol/media/choose-image.js
src/core/helpers/protocol/media/choose-image.js
+3
-3
src/core/helpers/protocol/media/choose-video.js
src/core/helpers/protocol/media/choose-video.js
+1
-1
src/core/helpers/protocol/media/get-image-info.js
src/core/helpers/protocol/media/get-image-info.js
+1
-1
src/core/helpers/protocol/network/request.js
src/core/helpers/protocol/network/request.js
+1
-1
src/core/helpers/protocol/storage/storage.js
src/core/helpers/protocol/storage/storage.js
+3
-3
src/core/helpers/protocol/ui/navigation-bar.js
src/core/helpers/protocol/ui/navigation-bar.js
+4
-4
src/core/runtime/mp/constants.js
src/core/runtime/mp/constants.js
+5
-5
src/core/runtime/mp/index.js
src/core/runtime/mp/index.js
+10
-10
src/core/runtime/mp/parser/components-parser.js
src/core/runtime/mp/parser/components-parser.js
+1
-1
src/core/runtime/mp/parser/methods-parser.js
src/core/runtime/mp/parser/methods-parser.js
+1
-1
src/core/runtime/mp/parser/relations-parser.js
src/core/runtime/mp/parser/relations-parser.js
+1
-1
src/core/runtime/web-view/index.js
src/core/runtime/web-view/index.js
+6
-2
src/core/runtime/wrapper.js
src/core/runtime/wrapper.js
+1
-1
src/core/runtime/wrapper/util.js
src/core/runtime/wrapper/util.js
+10
-10
src/core/service/api/context/audio.js
src/core/service/api/context/audio.js
+12
-6
src/core/service/api/context/background-audio.js
src/core/service/api/context/background-audio.js
+10
-5
src/core/service/api/context/canvas.js
src/core/service/api/context/canvas.js
+914
-868
src/core/service/api/context/create-video-context.js
src/core/service/api/context/create-video-context.js
+18
-9
src/core/service/api/context/editor.js
src/core/service/api/context/editor.js
+1
-0
src/core/service/api/media/recorder.js
src/core/service/api/media/recorder.js
+12
-0
src/core/service/api/network/download-file.js
src/core/service/api/network/download-file.js
+10
-5
src/core/service/api/network/socket.js
src/core/service/api/network/socket.js
+14
-7
src/core/service/api/network/upload-file.js
src/core/service/api/network/upload-file.js
+10
-5
src/core/service/api/ui/create-animation.js
src/core/service/api/ui/create-animation.js
+7
-1
src/core/service/api/ui/create-intersection-observer.js
src/core/service/api/ui/create-intersection-observer.js
+10
-5
src/core/view/bridge/subscribe/api/request-component-observer.js
...e/view/bridge/subscribe/api/request-component-observer.js
+1
-1
src/core/view/bridge/subscribe/api/util.js
src/core/view/bridge/subscribe/api/util.js
+1
-1
src/core/view/bridge/subscribe/font.js
src/core/view/bridge/subscribe/font.js
+2
-2
src/core/view/bridge/subscribe/scroll.js
src/core/view/bridge/subscribe/scroll.js
+1
-1
src/core/view/components/button/index.vue
src/core/view/components/button/index.vue
+6
-6
src/core/view/components/canvas/index.vue
src/core/view/components/canvas/index.vue
+20
-17
src/core/view/components/checkbox-group/index.vue
src/core/view/components/checkbox-group/index.vue
+6
-6
src/core/view/components/checkbox/index.vue
src/core/view/components/checkbox/index.vue
+4
-2
src/core/view/components/editor/formats/list.js
src/core/view/components/editor/formats/list.js
+8
-8
src/core/view/components/editor/index.vue
src/core/view/components/editor/index.vue
+67
-56
src/core/view/components/form/index.vue
src/core/view/components/form/index.vue
+1
-1
src/core/view/components/image/index.vue
src/core/view/components/image/index.vue
+5
-3
src/core/view/components/input/index.vue
src/core/view/components/input/index.vue
+7
-3
src/core/view/components/label/index.vue
src/core/view/components/label/index.vue
+2
-1
src/core/view/components/movable-view/index.vue
src/core/view/components/movable-view/index.vue
+7
-7
src/core/view/components/movable-view/utils.js
src/core/view/components/movable-view/utils.js
+7
-7
src/core/view/components/navigator/index.vue
src/core/view/components/navigator/index.vue
+5
-3
src/core/view/components/picker-view-column/index.vue
src/core/view/components/picker-view-column/index.vue
+1
-1
src/core/view/components/picker-view/index.vue
src/core/view/components/picker-view/index.vue
+2
-2
src/core/view/components/progress/index.vue
src/core/view/components/progress/index.vue
+9
-4
src/core/view/components/radio-group/index.vue
src/core/view/components/radio-group/index.vue
+4
-4
src/core/view/components/radio/index.vue
src/core/view/components/radio/index.vue
+4
-2
src/core/view/components/rich-text/nodes-parser.js
src/core/view/components/rich-text/nodes-parser.js
+50
-50
src/core/view/components/scroll-view/index.vue
src/core/view/components/scroll-view/index.vue
+21
-12
src/core/view/components/slider/index.vue
src/core/view/components/slider/index.vue
+21
-15
src/core/view/components/swiper-item/index.vue
src/core/view/components/swiper-item/index.vue
+1
-1
src/core/view/components/swiper/index.vue
src/core/view/components/swiper/index.vue
+6
-6
src/core/view/components/switch/index.vue
src/core/view/components/switch/index.vue
+9
-6
src/core/view/components/text/index.vue
src/core/view/components/text/index.vue
+3
-3
src/core/view/components/textarea/index.vue
src/core/view/components/textarea/index.vue
+15
-5
src/core/view/components/view/index.vue
src/core/view/components/view/index.vue
+4
-3
src/core/view/mixins/animation.js
src/core/view/mixins/animation.js
+1
-1
src/core/view/mixins/scroller/Spring.js
src/core/view/mixins/scroller/Spring.js
+7
-7
src/core/view/plugins/behaviors/form-field.js
src/core/view/plugins/behaviors/form-field.js
+4
-4
src/core/view/plugins/events.js
src/core/view/plugins/events.js
+1
-1
src/platforms/app-plus-nvue/service/api/ui/request-component-info.js
...ms/app-plus-nvue/service/api/ui/request-component-info.js
+5
-5
src/platforms/app-plus-nvue/service/api/util.js
src/platforms/app-plus-nvue/service/api/util.js
+1
-1
src/platforms/app-plus-nvue/services/api/sub-nvue.js
src/platforms/app-plus-nvue/services/api/sub-nvue.js
+1
-1
src/platforms/app-plus/page-factory.js
src/platforms/app-plus/page-factory.js
+1
-1
src/platforms/app-plus/runtime/api/sub-nvue.js
src/platforms/app-plus/runtime/api/sub-nvue.js
+1
-1
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
+6
-0
src/platforms/app-plus/service/api/context/audio.js
src/platforms/app-plus/service/api/context/audio.js
+3
-3
src/platforms/app-plus/service/api/context/background-audio.js
...latforms/app-plus/service/api/context/background-audio.js
+5
-5
src/platforms/app-plus/service/api/device/scan-code-webview.js
...latforms/app-plus/service/api/device/scan-code-webview.js
+6
-6
src/platforms/app-plus/service/api/device/soter-authentication.js
...forms/app-plus/service/api/device/soter-authentication.js
+3
-3
src/platforms/app-plus/service/api/location/choose-location-webview.js
.../app-plus/service/api/location/choose-location-webview.js
+1
-1
src/platforms/app-plus/service/api/media/choose-video.js
src/platforms/app-plus/service/api/media/choose-video.js
+2
-2
src/platforms/app-plus/service/api/media/compress-image.js
src/platforms/app-plus/service/api/media/compress-image.js
+2
-2
src/platforms/app-plus/service/api/media/preview-image.js
src/platforms/app-plus/service/api/media/preview-image.js
+1
-1
src/platforms/app-plus/service/api/network/download-file.js
src/platforms/app-plus/service/api/network/download-file.js
+6
-2
src/platforms/app-plus/service/api/network/request.js
src/platforms/app-plus/service/api/network/request.js
+157
-152
src/platforms/app-plus/service/api/network/upload-file.js
src/platforms/app-plus/service/api/network/upload-file.js
+7
-3
src/platforms/app-plus/service/api/page.js
src/platforms/app-plus/service/api/page.js
+4
-2
src/platforms/app-plus/service/api/plugin/share.js
src/platforms/app-plus/service/api/plugin/share.js
+8
-8
src/platforms/app-plus/service/api/plugin/sub-nvue.js
src/platforms/app-plus/service/api/plugin/sub-nvue.js
+2
-2
src/platforms/app-plus/service/api/ui/popup.js
src/platforms/app-plus/service/api/ui/popup.js
+1
-1
src/platforms/app-plus/service/api/util.js
src/platforms/app-plus/service/api/util.js
+3
-3
src/platforms/app-plus/service/bridge.js
src/platforms/app-plus/service/bridge.js
+1
-1
src/platforms/app-plus/service/framework/app.js
src/platforms/app-plus/service/framework/app.js
+1
-1
src/platforms/app-plus/service/framework/config.js
src/platforms/app-plus/service/framework/config.js
+1
-1
src/platforms/app-plus/service/framework/page.js
src/platforms/app-plus/service/framework/page.js
+1
-1
src/platforms/app-plus/service/framework/tab-bar.js
src/platforms/app-plus/service/framework/tab-bar.js
+2
-2
src/platforms/app-plus/service/framework/webview/index.js
src/platforms/app-plus/service/framework/webview/index.js
+6
-6
src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js
...us/service/framework/webview/parser/title-nview-parser.js
+10
-10
src/platforms/app-plus/service/on-web-invoke-app-service.js
src/platforms/app-plus/service/on-web-invoke-app-service.js
+1
-1
src/platforms/app-plus/view/components/ad/index.vue
src/platforms/app-plus/view/components/ad/index.vue
+6
-4
src/platforms/app-plus/view/components/cover-image/index.vue
src/platforms/app-plus/view/components/cover-image/index.vue
+4
-2
src/platforms/app-plus/view/components/map/index.vue
src/platforms/app-plus/view/components/map/index.vue
+6
-4
src/platforms/app-plus/view/components/picker/index.vue
src/platforms/app-plus/view/components/picker/index.vue
+17
-14
src/platforms/app-plus/view/components/picker/page.js
src/platforms/app-plus/view/components/picker/page.js
+4
-2
src/platforms/app-plus/view/components/video/index.vue
src/platforms/app-plus/view/components/video/index.vue
+2
-1
src/platforms/app-plus/view/components/web-view/index.vue
src/platforms/app-plus/view/components/web-view/index.vue
+2
-2
src/platforms/app-plus/view/framework/config.js
src/platforms/app-plus/view/framework/config.js
+1
-1
src/platforms/app-plus/view/mixins/cover.js
src/platforms/app-plus/view/mixins/cover.js
+2
-2
src/platforms/h5/components/app/index.vue
src/platforms/h5/components/app/index.vue
+8
-4
src/platforms/h5/components/app/popup/actionSheet.vue
src/platforms/h5/components/app/popup/actionSheet.vue
+16
-7
src/platforms/h5/components/app/popup/modal.vue
src/platforms/h5/components/app/popup/modal.vue
+17
-6
src/platforms/h5/components/app/popup/toast.vue
src/platforms/h5/components/app/popup/toast.vue
+20
-9
src/platforms/h5/components/app/tabBar.vue
src/platforms/h5/components/app/tabBar.vue
+10
-4
src/platforms/h5/components/async-error/index.vue
src/platforms/h5/components/async-error/index.vue
+2
-1
src/platforms/h5/components/page/index.vue
src/platforms/h5/components/page/index.vue
+11
-8
src/platforms/h5/components/page/pageHead.vue
src/platforms/h5/components/page/pageHead.vue
+18
-9
src/platforms/h5/components/page/pageRefresh.vue
src/platforms/h5/components/page/pageRefresh.vue
+10
-5
src/platforms/h5/components/page/transparent.js
src/platforms/h5/components/page/transparent.js
+3
-3
src/platforms/h5/components/system-routes/choose-location/index.vue
...rms/h5/components/system-routes/choose-location/index.vue
+6
-2
src/platforms/h5/components/system-routes/open-location/index.vue
...forms/h5/components/system-routes/open-location/index.vue
+7
-3
src/platforms/h5/components/system-routes/preview-image/index.vue
...forms/h5/components/system-routes/preview-image/index.vue
+9
-5
src/platforms/h5/components/system-routes/system-header.vue
src/platforms/h5/components/system-routes/system-header.vue
+8
-3
src/platforms/h5/helpers/file.js
src/platforms/h5/helpers/file.js
+5
-1
src/platforms/h5/service/api/context/audio.js
src/platforms/h5/service/api/context/audio.js
+10
-5
src/platforms/h5/service/api/context/inner-audio.js
src/platforms/h5/service/api/context/inner-audio.js
+5
-0
src/platforms/h5/service/api/device/get-system-info.js
src/platforms/h5/service/api/device/get-system-info.js
+5
-5
src/platforms/h5/service/api/media/choose-image.js
src/platforms/h5/service/api/media/choose-image.js
+7
-7
src/platforms/h5/service/api/media/choose-video.js
src/platforms/h5/service/api/media/choose-video.js
+7
-7
src/platforms/h5/service/api/network/download-file.js
src/platforms/h5/service/api/network/download-file.js
+5
-2
src/platforms/h5/service/api/network/request.js
src/platforms/h5/service/api/network/request.js
+12
-7
src/platforms/h5/service/api/network/socket.js
src/platforms/h5/service/api/network/socket.js
+4
-1
src/platforms/h5/service/api/network/upload-file.js
src/platforms/h5/service/api/network/upload-file.js
+4
-1
src/platforms/h5/service/api/route/route.js
src/platforms/h5/service/api/route/route.js
+20
-18
src/platforms/h5/service/api/ui/navigation-bar.js
src/platforms/h5/service/api/ui/navigation-bar.js
+32
-28
src/platforms/h5/view/components/audio/index.vue
src/platforms/h5/view/components/audio/index.vue
+16
-7
src/platforms/h5/view/components/cover-image/index.vue
src/platforms/h5/view/components/cover-image/index.vue
+6
-3
src/platforms/h5/view/components/cover-view/index.vue
src/platforms/h5/view/components/cover-view/index.vue
+5
-3
src/platforms/h5/view/components/map/index.vue
src/platforms/h5/view/components/map/index.vue
+14
-10
src/platforms/h5/view/components/picker/index.vue
src/platforms/h5/view/components/picker/index.vue
+52
-34
src/platforms/h5/view/components/video/index.vue
src/platforms/h5/view/components/video/index.vue
+40
-18
src/platforms/h5/view/components/web-view/index.vue
src/platforms/h5/view/components/web-view/index.vue
+2
-1
src/platforms/mp-alipay/runtime/api/protocols.js
src/platforms/mp-alipay/runtime/api/protocols.js
+1
-1
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
+1
-1
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
+1
-1
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
+2
-2
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
...tforms/mp-weixin/runtime/wrapper/component-base-parser.js
+3
-3
src/platforms/quickapp-vue/view/components/button/button.vue
src/platforms/quickapp-vue/view/components/button/button.vue
+4
-2
src/shared/util.js
src/shared/util.js
+1
-1
未找到文件。
src/core/helpers/api.js
浏览文件 @
46d679a8
...
...
@@ -108,7 +108,7 @@ function createApiCallback (apiName, params = {}, extras = {}) {
params
=
Object
.
assign
({},
params
)
const
apiCallbacks
=
{}
for
(
le
t
name
in
params
)
{
for
(
cons
t
name
in
params
)
{
const
param
=
params
[
name
]
if
(
isFn
(
param
))
{
apiCallbacks
[
name
]
=
tryCatch
(
param
)
...
...
@@ -135,7 +135,7 @@ function createApiCallback (apiName, params = {}, extras = {}) {
}
const
wrapperCallbacks
=
{}
for
(
le
t
name
in
extras
)
{
for
(
cons
t
name
in
extras
)
{
const
extra
=
extras
[
name
]
if
(
isFn
(
extra
))
{
wrapperCallbacks
[
name
]
=
tryCatchFramework
(
extra
)
...
...
@@ -165,7 +165,7 @@ function createApiCallback (apiName, params = {}, extras = {}) {
res
.
errMsg
=
apiName
+
'
:cancel
'
}
else
if
(
res
.
errMsg
.
indexOf
(
'
:fail
'
)
!==
-
1
)
{
let
errDetail
=
''
le
t
spaceIndex
=
res
.
errMsg
.
indexOf
(
'
'
)
cons
t
spaceIndex
=
res
.
errMsg
.
indexOf
(
'
'
)
if
(
spaceIndex
>
-
1
)
{
errDetail
=
res
.
errMsg
.
substr
(
spaceIndex
)
}
...
...
src/core/helpers/hidpi.js
浏览文件 @
46d679a8
export
const
pixelRatio
=
(
function
()
{
const
canvas
=
document
.
createElement
(
'
canvas
'
)
canvas
.
height
=
canvas
.
width
=
0
const
context
=
canvas
.
getContext
(
'
2d
'
)
const
backingStore
=
context
.
backingStorePixelRatio
||
context
.
webkitBackingStorePixelRatio
||
context
.
mozBackingStorePixelRatio
||
context
.
msBackingStorePixelRatio
||
context
.
oBackingStorePixelRatio
||
context
.
backingStorePixelRatio
||
1
return
(
window
.
devicePixelRatio
||
1
)
/
backingStore
})()
const
forEach
=
function
(
obj
,
func
)
{
for
(
let
key
in
obj
)
{
if
(
obj
.
hasOwnProperty
(
key
))
{
func
(
obj
[
key
],
key
)
}
}
}
const
ratioArgs
=
{
'
fillRect
'
:
'
all
'
,
'
clearRect
'
:
'
all
'
,
'
strokeRect
'
:
'
all
'
,
'
moveTo
'
:
'
all
'
,
'
lineTo
'
:
'
all
'
,
'
arc
'
:
[
0
,
1
,
2
],
'
arcTo
'
:
'
all
'
,
'
bezierCurveTo
'
:
'
all
'
,
'
isPointinPath
'
:
'
all
'
,
'
isPointinStroke
'
:
'
all
'
,
'
quadraticCurveTo
'
:
'
all
'
,
'
rect
'
:
'
all
'
,
'
translate
'
:
'
all
'
,
'
createRadialGradient
'
:
'
all
'
,
'
createLinearGradient
'
:
'
all
'
,
'
setTransform
'
:
[
4
,
5
]
}
const
proto
=
CanvasRenderingContext2D
.
prototype
proto
.
drawImageByCanvas
=
(
function
(
_super
)
{
return
function
(
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
,
isScale
)
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
srcx
*=
pixelRatio
srcy
*=
pixelRatio
srcw
*=
pixelRatio
srch
*=
pixelRatio
desx
*=
pixelRatio
desy
*=
pixelRatio
desw
=
isScale
?
desw
*
pixelRatio
:
desw
desh
=
isScale
?
desh
*
pixelRatio
:
desh
_super
.
call
(
this
,
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
)
}
})(
proto
.
drawImage
)
if
(
pixelRatio
!==
1
)
{
forEach
(
ratioArgs
,
function
(
value
,
key
)
{
proto
[
key
]
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
let
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
if
(
value
===
'
all
'
)
{
args
=
args
.
map
(
function
(
a
)
{
return
a
*
pixelRatio
})
}
else
if
(
Array
.
isArray
(
value
))
{
for
(
let
i
=
0
;
i
<
value
.
length
;
i
++
)
{
args
[
value
[
i
]]
*=
pixelRatio
}
}
return
_super
.
apply
(
this
,
args
)
}
})(
proto
[
key
])
})
proto
.
stroke
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
lineWidth
*=
pixelRatio
_super
.
apply
(
this
,
arguments
)
this
.
lineWidth
/=
pixelRatio
}
})(
proto
.
stroke
)
proto
.
fillText
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
const
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
args
[
1
]
*=
pixelRatio
args
[
2
]
*=
pixelRatio
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
*
pixelRatio
)
+
u
}
)
_super
.
apply
(
this
,
args
)
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
/
pixelRatio
)
+
u
}
)
}
})(
proto
.
fillText
)
proto
.
strokeText
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
args
[
1
]
*=
pixelRatio
// x
args
[
2
]
*=
pixelRatio
// y
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
*
pixelRatio
)
+
u
}
)
_super
.
apply
(
this
,
args
)
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
/
pixelRatio
)
+
u
}
)
}
})(
proto
.
strokeText
)
proto
.
drawImage
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
scale
(
pixelRatio
,
pixelRatio
)
_super
.
apply
(
this
,
arguments
)
this
.
scale
(
1
/
pixelRatio
,
1
/
pixelRatio
)
}
})(
proto
.
drawImage
)
}
export
function
wrapper
(
canvas
)
{
canvas
.
width
=
canvas
.
offsetWidth
*
pixelRatio
canvas
.
height
=
canvas
.
offsetHeight
*
pixelRatio
canvas
.
getContext
(
'
2d
'
).
__hidpi__
=
true
import
{
hasOwn
}
from
'
uni-shared
'
export
const
pixelRatio
=
(
function
()
{
const
canvas
=
document
.
createElement
(
'
canvas
'
)
canvas
.
height
=
canvas
.
width
=
0
const
context
=
canvas
.
getContext
(
'
2d
'
)
const
backingStore
=
context
.
backingStorePixelRatio
||
context
.
webkitBackingStorePixelRatio
||
context
.
mozBackingStorePixelRatio
||
context
.
msBackingStorePixelRatio
||
context
.
oBackingStorePixelRatio
||
context
.
backingStorePixelRatio
||
1
return
(
window
.
devicePixelRatio
||
1
)
/
backingStore
})()
const
forEach
=
function
(
obj
,
func
)
{
for
(
const
key
in
obj
)
{
if
(
hasOwn
(
obj
,
key
))
{
func
(
obj
[
key
],
key
)
}
}
}
const
ratioArgs
=
{
fillRect
:
'
all
'
,
clearRect
:
'
all
'
,
strokeRect
:
'
all
'
,
moveTo
:
'
all
'
,
lineTo
:
'
all
'
,
arc
:
[
0
,
1
,
2
],
arcTo
:
'
all
'
,
bezierCurveTo
:
'
all
'
,
isPointinPath
:
'
all
'
,
isPointinStroke
:
'
all
'
,
quadraticCurveTo
:
'
all
'
,
rect
:
'
all
'
,
translate
:
'
all
'
,
createRadialGradient
:
'
all
'
,
createLinearGradient
:
'
all
'
,
setTransform
:
[
4
,
5
]
}
const
proto
=
CanvasRenderingContext2D
.
prototype
proto
.
drawImageByCanvas
=
(
function
(
_super
)
{
return
function
(
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
,
isScale
)
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
srcx
*=
pixelRatio
srcy
*=
pixelRatio
srcw
*=
pixelRatio
srch
*=
pixelRatio
desx
*=
pixelRatio
desy
*=
pixelRatio
desw
=
isScale
?
desw
*
pixelRatio
:
desw
desh
=
isScale
?
desh
*
pixelRatio
:
desh
_super
.
call
(
this
,
canvas
,
srcx
,
srcy
,
srcw
,
srch
,
desx
,
desy
,
desw
,
desh
)
}
})(
proto
.
drawImage
)
if
(
pixelRatio
!==
1
)
{
forEach
(
ratioArgs
,
function
(
value
,
key
)
{
proto
[
key
]
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
let
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
if
(
value
===
'
all
'
)
{
args
=
args
.
map
(
function
(
a
)
{
return
a
*
pixelRatio
})
}
else
if
(
Array
.
isArray
(
value
))
{
for
(
let
i
=
0
;
i
<
value
.
length
;
i
++
)
{
args
[
value
[
i
]]
*=
pixelRatio
}
}
return
_super
.
apply
(
this
,
args
)
}
})(
proto
[
key
])
})
proto
.
stroke
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
lineWidth
*=
pixelRatio
_super
.
apply
(
this
,
arguments
)
this
.
lineWidth
/=
pixelRatio
}
})(
proto
.
stroke
)
proto
.
fillText
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
const
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
args
[
1
]
*=
pixelRatio
args
[
2
]
*=
pixelRatio
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
*
pixelRatio
)
+
u
}
)
_super
.
apply
(
this
,
args
)
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
/
pixelRatio
)
+
u
}
)
}
})(
proto
.
fillText
)
proto
.
strokeText
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
args
[
1
]
*=
pixelRatio
// x
args
[
2
]
*=
pixelRatio
// y
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
*
pixelRatio
)
+
u
}
)
_super
.
apply
(
this
,
args
)
this
.
font
=
this
.
font
.
replace
(
/
(\d
+
)(
px|em|rem|pt
)
/g
,
function
(
w
,
m
,
u
)
{
return
(
m
/
pixelRatio
)
+
u
}
)
}
})(
proto
.
strokeText
)
proto
.
drawImage
=
(
function
(
_super
)
{
return
function
()
{
if
(
!
this
.
__hidpi__
)
{
return
_super
.
apply
(
this
,
arguments
)
}
this
.
scale
(
pixelRatio
,
pixelRatio
)
_super
.
apply
(
this
,
arguments
)
this
.
scale
(
1
/
pixelRatio
,
1
/
pixelRatio
)
}
})(
proto
.
drawImage
)
}
export
function
wrapper
(
canvas
)
{
canvas
.
width
=
canvas
.
offsetWidth
*
pixelRatio
canvas
.
height
=
canvas
.
offsetHeight
*
pixelRatio
canvas
.
getContext
(
'
2d
'
).
__hidpi__
=
true
}
src/core/helpers/params.js
浏览文件 @
46d679a8
...
...
@@ -18,7 +18,7 @@ export default function validateParam (key, paramTypes, paramsData) {
}
if
(
value
===
undefined
)
{
if
(
hasOwn
(
paramOptions
,
'
default
'
))
{
const
paramDefault
=
paramOptions
[
'
default
'
]
const
paramDefault
=
paramOptions
.
default
value
=
isFn
(
paramDefault
)
?
paramDefault
()
:
paramDefault
paramsData
[
key
]
=
value
// 默认值
}
...
...
src/core/helpers/protocol/device/make-phone-call.js
浏览文件 @
46d679a8
export
const
makePhoneCall
=
{
'
phoneNumber
'
:
{
phoneNumber
:
{
type
:
String
,
required
:
true
,
validator
(
phoneNumber
)
{
if
(
!
phoneNumber
)
{
return
`makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;`
return
'
makePhoneCall:fail parameter error: parameter.phoneNumber should not be empty String;
'
}
}
}
...
...
src/core/helpers/protocol/media/choose-image.js
浏览文件 @
46d679a8
...
...
@@ -2,7 +2,7 @@ const SIZE_TYPES = ['original', 'compressed']
const
SOURCE_TYPES
=
[
'
album
'
,
'
camera
'
]
export
const
chooseImage
=
{
'
count
'
:
{
count
:
{
type
:
Number
,
required
:
false
,
default
:
9
,
...
...
@@ -12,7 +12,7 @@ export const chooseImage = {
}
}
},
'
sizeType
'
:
{
sizeType
:
{
type
:
[
Array
,
String
],
required
:
false
,
default
:
SIZE_TYPES
,
...
...
@@ -35,7 +35,7 @@ export const chooseImage = {
}
}
},
'
sourceType
'
:
{
sourceType
:
{
type
:
Array
,
required
:
false
,
default
:
SOURCE_TYPES
,
...
...
src/core/helpers/protocol/media/choose-video.js
浏览文件 @
46d679a8
const
SOURCE_TYPES
=
[
'
album
'
,
'
camera
'
]
export
const
chooseVideo
=
{
'
sourceType
'
:
{
sourceType
:
{
type
:
Array
,
required
:
false
,
default
:
SOURCE_TYPES
,
...
...
src/core/helpers/protocol/media/get-image-info.js
浏览文件 @
46d679a8
import
getRealPath
from
'
uni-platform/helpers/get-real-path
'
export
const
getImageInfo
=
{
'
src
'
:
{
src
:
{
type
:
String
,
required
:
true
,
validator
(
src
,
params
)
{
...
...
src/core/helpers/protocol/network/request.js
浏览文件 @
46d679a8
...
...
@@ -35,7 +35,7 @@ function stringifyQuery (url, data) {
item
=
item
.
split
(
'
=
'
)
query
[
item
[
0
]]
=
item
[
1
]
})
for
(
le
t
key
in
data
)
{
for
(
cons
t
key
in
data
)
{
if
(
hasOwn
(
data
,
key
))
{
let
v
=
data
[
key
]
if
(
typeof
v
===
'
undefined
'
||
v
===
null
)
{
...
...
src/core/helpers/protocol/storage/storage.js
浏览文件 @
46d679a8
export
const
getStorage
=
{
'
key
'
:
{
key
:
{
type
:
String
,
required
:
true
}
...
...
@@ -12,11 +12,11 @@ export const getStorageSync = [{
}]
export
const
setStorage
=
{
'
key
'
:
{
key
:
{
type
:
String
,
required
:
true
},
'
data
'
:
{
data
:
{
required
:
true
}
}
...
...
src/core/helpers/protocol/ui/navigation-bar.js
浏览文件 @
46d679a8
const
FRONT_COLORS
=
[
'
#ffffff
'
,
'
#000000
'
]
export
const
setNavigationBarColor
=
{
'
frontColor
'
:
{
frontColor
:
{
type
:
String
,
required
:
true
,
validator
(
frontColor
,
params
)
{
...
...
@@ -9,11 +9,11 @@ export const setNavigationBarColor = {
}
}
},
'
backgroundColor
'
:
{
backgroundColor
:
{
type
:
String
,
required
:
true
},
'
animation
'
:
{
animation
:
{
type
:
Object
,
default
()
{
return
{
...
...
@@ -30,7 +30,7 @@ export const setNavigationBarColor = {
}
}
export
const
setNavigationBarTitle
=
{
'
title
'
:
{
title
:
{
type
:
String
,
required
:
true
}
...
...
src/core/runtime/mp/constants.js
浏览文件 @
46d679a8
export
const
SOURCE_KEY
=
'
__data__
'
export
const
COMPONENT_LIFECYCLE
=
{
'
created
'
:
'
onServiceCreated
'
,
'
attached
'
:
'
onServiceAttached
'
,
'
ready
'
:
'
mounted
'
,
'
moved
'
:
'
moved
'
,
'
detached
'
:
'
destroyed
'
created
:
'
onServiceCreated
'
,
attached
:
'
onServiceAttached
'
,
ready
:
'
mounted
'
,
moved
:
'
moved
'
,
detached
:
'
destroyed
'
}
export
const
COMPONENT_LIFECYCLE_KEYS
=
Object
.
keys
(
COMPONENT_LIFECYCLE
)
...
...
src/core/runtime/mp/index.js
浏览文件 @
46d679a8
...
...
@@ -14,23 +14,23 @@ import {
import
polyfill
from
'
./polyfill/index
'
global
[
'
__wxRoute
'
]
=
''
global
[
'
__wxComponents
'
]
=
Object
.
create
(
null
)
global
[
'
__wxVueOptions
'
]
=
Object
.
create
(
null
)
global
.
__wxRoute
=
''
global
.
__wxComponents
=
Object
.
create
(
null
)
global
.
__wxVueOptions
=
Object
.
create
(
null
)
export
function
Page
(
options
)
{
const
pageOptions
=
parsePage
(
options
)
pageOptions
.
mixins
.
unshift
(
polyfill
)
pageOptions
.
mpOptions
.
path
=
global
[
'
__wxRoute
'
]
global
[
'
__wxComponents
'
][
global
[
'
__wxRoute
'
]
]
=
pageOptions
pageOptions
.
mpOptions
.
path
=
global
.
__wxRoute
global
.
__wxComponents
[
global
.
__wxRoute
]
=
pageOptions
}
function
initRelationsHandler
(
vueComponentOptions
)
{
// linked 需要在当前组件 attached 之后再执行
if
(
!
vueComponentOptions
[
'
onServiceAttached
'
]
)
{
vueComponentOptions
[
'
onServiceAttached
'
]
=
[]
if
(
!
vueComponentOptions
.
onServiceAttached
)
{
vueComponentOptions
.
onServiceAttached
=
[]
}
vueComponentOptions
[
'
onServiceAttached
'
]
.
push
(
function
onServiceAttached
()
{
vueComponentOptions
.
onServiceAttached
.
push
(
function
onServiceAttached
()
{
handleRelations
(
this
,
'
linked
'
)
})
}
...
...
@@ -38,9 +38,9 @@ function initRelationsHandler (vueComponentOptions) {
export
function
Component
(
options
)
{
const
componentOptions
=
parseComponent
(
options
)
componentOptions
.
mixins
.
unshift
(
polyfill
)
componentOptions
.
mpOptions
.
path
=
global
[
'
__wxRoute
'
]
componentOptions
.
mpOptions
.
path
=
global
.
__wxRoute
initRelationsHandler
(
componentOptions
)
global
[
'
__wxComponents
'
][
global
[
'
__wxRoute
'
]
]
=
componentOptions
global
.
__wxComponents
[
global
.
__wxRoute
]
=
componentOptions
}
export
function
Behavior
(
options
)
{
...
...
src/core/runtime/mp/parser/components-parser.js
浏览文件 @
46d679a8
export
function
parseComponents
(
vueComponentOptions
)
{
vueComponentOptions
.
components
=
global
[
'
__wxVueOptions
'
]
.
components
vueComponentOptions
.
components
=
global
.
__wxVueOptions
.
components
}
src/core/runtime/mp/parser/methods-parser.js
浏览文件 @
46d679a8
...
...
@@ -3,7 +3,7 @@ export function parseMethods (methods, vueComponentOptions) {
return
}
if
(
methods
.
$emit
)
{
console
.
warn
(
`Method "$emit" conflicts with an existing Vue instance method`
)
console
.
warn
(
'
Method "$emit" conflicts with an existing Vue instance method
'
)
delete
methods
.
$emit
}
vueComponentOptions
.
methods
=
methods
...
...
src/core/runtime/mp/parser/relations-parser.js
浏览文件 @
46d679a8
...
...
@@ -25,7 +25,7 @@ export function parseRelations (relations, vueComponentOptions) {
Object
.
keys
(
relations
).
forEach
(
name
=>
{
const
relation
=
relations
[
name
]
relation
.
name
=
name
relation
.
target
=
relation
.
target
?
String
(
relation
.
target
)
:
relative
(
global
[
'
__wxRoute
'
]
,
name
)
relation
.
target
=
relation
.
target
?
String
(
relation
.
target
)
:
relative
(
global
.
__wxRoute
,
name
)
})
vueComponentOptions
.
mpOptions
.
relations
=
relations
}
src/core/runtime/web-view/index.js
浏览文件 @
46d679a8
import
{
hasOwn
}
from
'
uni-shared
'
import
{
initWebviewApi
as
initAppplusWebviewApi
}
from
'
uni-platforms/app-plus/runtime/web-view
'
...
...
@@ -58,11 +62,11 @@ const api = typeof uni !== 'undefined' ? uni : {}
if
(
!
api
.
navigateTo
)
{
for
(
const
key
in
webViewApi
)
{
if
(
webViewApi
.
hasOwnProperty
(
key
))
{
if
(
hasOwn
(
webViewApi
,
key
))
{
api
[
key
]
=
webViewApi
[
key
]
}
}
}
api
.
webView
=
webViewApi
export
default
api
export
default
api
src/core/runtime/wrapper.js
浏览文件 @
46d679a8
...
...
@@ -26,7 +26,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if
(
isFn
(
argsOption
))
{
argsOption
=
argsOption
(
fromArgs
,
toArgs
)
||
{}
}
for
(
le
t
key
in
fromArgs
)
{
for
(
cons
t
key
in
fromArgs
)
{
if
(
hasOwn
(
argsOption
,
key
))
{
let
keyOption
=
argsOption
[
key
]
if
(
isFn
(
keyOption
))
{
...
...
src/core/runtime/wrapper/util.js
浏览文件 @
46d679a8
...
...
@@ -144,14 +144,14 @@ function createObserver (name) {
}
export
function
initBehaviors
(
vueOptions
,
initBehavior
)
{
const
vueBehaviors
=
vueOptions
[
'
behaviors
'
]
const
vueExtends
=
vueOptions
[
'
extends
'
]
const
vueMixins
=
vueOptions
[
'
mixins
'
]
const
vueBehaviors
=
vueOptions
.
behaviors
const
vueExtends
=
vueOptions
.
extends
const
vueMixins
=
vueOptions
.
mixins
let
vueProps
=
vueOptions
[
'
props
'
]
let
vueProps
=
vueOptions
.
props
if
(
!
vueProps
)
{
vueOptions
[
'
props
'
]
=
vueProps
=
[]
vueOptions
.
props
=
vueProps
=
[]
}
const
behaviors
=
[]
...
...
@@ -163,11 +163,11 @@ export function initBehaviors (vueOptions, initBehavior) {
vueProps
.
push
(
'
name
'
)
vueProps
.
push
(
'
value
'
)
}
else
{
vueProps
[
'
name
'
]
=
{
vueProps
.
name
=
{
type
:
String
,
default
:
''
}
vueProps
[
'
value
'
]
=
{
vueProps
.
value
=
{
type
:
[
String
,
Number
,
Boolean
,
Array
,
Object
,
Date
],
default
:
''
}
...
...
@@ -252,7 +252,7 @@ export function initProperties (props, isBehavior = false, file = '') {
Object
.
keys
(
props
).
forEach
(
key
=>
{
const
opts
=
props
[
key
]
if
(
isPlainObject
(
opts
))
{
// title:{type:String,default:''}
let
value
=
opts
[
'
default
'
]
let
value
=
opts
.
default
if
(
isFn
(
value
))
{
value
=
value
()
}
...
...
@@ -453,11 +453,11 @@ export function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const
dataset
=
(
event
.
currentTarget
||
event
.
target
).
dataset
if
(
!
dataset
)
{
return
console
.
warn
(
`事件信息不存在`
)
return
console
.
warn
(
'
事件信息不存在
'
)
}
const
eventOpts
=
dataset
.
eventOpts
||
dataset
[
'
event-opts
'
]
// 支付宝 web-view 组件 dataset 非驼峰
if
(
!
eventOpts
)
{
return
console
.
warn
(
`事件信息不存在`
)
return
console
.
warn
(
'
事件信息不存在
'
)
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
...
...
src/core/service/api/context/audio.js
浏览文件 @
46d679a8
...
...
@@ -92,28 +92,34 @@ class InnerAudioContext {
}
Object
.
defineProperty
(
this
,
name
,
data
)
})
}
}
play
()
{
this
.
_operate
(
'
play
'
)
}
}
pause
()
{
this
.
_operate
(
'
pause
'
)
}
}
stop
()
{
this
.
_operate
(
'
stop
'
)
}
}
seek
(
position
)
{
this
.
_operate
(
'
seek
'
,
{
currentTime
:
position
*
1
e3
})
}
}
destroy
()
{
clearInterval
(
this
.
__timing
)
invokeMethod
(
'
destroyAudioInstance
'
,
{
audioId
:
this
.
id
})
delete
innerAudioContexts
[
this
.
id
]
}
}
_operate
(
type
,
options
)
{
invokeMethod
(
'
operateAudio
'
,
Object
.
assign
({},
options
,
{
audioId
:
this
.
id
,
...
...
src/core/service/api/context/background-audio.js
浏览文件 @
46d679a8
...
...
@@ -108,21 +108,26 @@ class BackgroundAudioManager {
}
Object
.
defineProperty
(
this
,
name
,
data
)
})
}
}
play
()
{
this
.
_operate
(
'
play
'
)
}
}
pause
()
{
this
.
_operate
(
'
pause
'
)
}
}
stop
()
{
this
.
_operate
(
'
stop
'
)
}
}
seek
(
position
)
{
this
.
_operate
(
'
seek
'
,
{
currentTime
:
position
})
}
}
_operate
(
type
,
options
)
{
invokeMethod
(
'
operateBackgroundAudio
'
,
Object
.
assign
({},
options
,
{
operationType
:
type
...
...
src/core/service/api/context/canvas.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/core/service/api/context/create-video-context.js
浏览文件 @
46d679a8
...
...
@@ -17,21 +17,26 @@ export class VideoContext {
play
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
play
'
)
}
}
pause
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
pause
'
)
}
}
stop
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
stop
'
)
}
}
seek
(
position
)
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
seek
'
,
{
position
})
}
}
sendDanmu
(
args
)
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
sendDanmu
'
,
args
)
}
}
playbackRate
(
rate
)
{
if
(
!~
RATES
.
indexOf
(
rate
))
{
rate
=
1.0
...
...
@@ -39,16 +44,20 @@ export class VideoContext {
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
playbackRate
'
,
{
rate
})
}
}
requestFullScreen
(
args
=
{})
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
requestFullScreen
'
,
args
)
}
}
exitFullScreen
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
exitFullScreen
'
)
}
}
showStatusBar
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
showStatusBar
'
)
}
}
hideStatusBar
()
{
operateVideoPlayer
(
this
.
id
,
this
.
pageVm
,
'
hideStatusBar
'
)
}
...
...
src/core/service/api/context/editor.js
浏览文件 @
46d679a8
...
...
@@ -24,6 +24,7 @@ export class EditorContext {
this
.
id
=
id
this
.
pageId
=
pageId
}
format
(
name
,
value
)
{
operateEditor
(
this
.
id
,
this
.
pageId
,
'
format
'
,
{
options
:
{
...
...
src/core/service/api/media/recorder.js
浏览文件 @
46d679a8
...
...
@@ -22,45 +22,57 @@ class RecorderManager {
}
})
}
onError
(
callback
)
{
callbacks
.
error
=
callback
}
onFrameRecorded
(
callback
)
{
}
onInterruptionBegin
(
callback
)
{
}
onInterruptionEnd
(
callback
)
{
}
onPause
(
callback
)
{
callbacks
.
pause
=
callback
}
onResume
(
callback
)
{
callbacks
.
resume
=
callback
}
onStart
(
callback
)
{
callbacks
.
start
=
callback
}
onStop
(
callback
)
{
callbacks
.
stop
=
callback
}
pause
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
pause
'
})
}
resume
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
resume
'
})
}
start
(
options
)
{
invokeMethod
(
'
operateRecorder
'
,
Object
.
assign
({},
options
,
{
operationType
:
'
start
'
}))
}
stop
()
{
invokeMethod
(
'
operateRecorder
'
,
{
operationType
:
'
stop
'
...
...
src/core/service/api/network/download-file.js
浏览文件 @
46d679a8
...
...
@@ -12,28 +12,33 @@ class DownloadTask {
this
.
id
=
downloadTaskId
this
.
_callbackId
=
callbackId
this
.
_callbacks
=
[]
}
}
abort
()
{
invokeMethod
(
'
operateRequestTask
'
,
{
downloadTaskId
:
this
.
id
,
operationType
:
'
abort
'
})
}
}
onProgressUpdate
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
}
this
.
_callbacks
.
push
(
callback
)
}
}
onHeadersReceived
()
{
}
}
offProgressUpdate
(
callback
)
{
const
index
=
this
.
_callbacks
.
indexOf
(
callback
)
if
(
index
>=
0
)
{
this
.
_callbacks
.
splice
(
index
,
1
)
}
}
}
offHeadersReceived
()
{
}
...
...
src/core/service/api/network/socket.js
浏览文件 @
46d679a8
...
...
@@ -21,7 +21,8 @@ class SocketTask {
this
.
CONNECTING
=
0
this
.
OPEN
=
1
this
.
readyState
=
this
.
CLOSED
}
}
send
(
args
)
{
if
(
this
.
readyState
!==
this
.
OPEN
)
{
this
.
_callback
(
args
,
'
sendSocketMessage:fail WebSocket is not connected
'
)
...
...
@@ -33,7 +34,8 @@ class SocketTask {
socketTaskId
:
this
.
id
}))
this
.
_callback
(
args
,
errMsg
.
replace
(
'
operateSocketTask
'
,
'
sendSocketMessage
'
))
}
}
close
(
args
)
{
this
.
readyState
=
this
.
CLOSING
const
{
...
...
@@ -43,19 +45,24 @@ class SocketTask {
socketTaskId
:
this
.
id
}))
this
.
_callback
(
args
,
errMsg
.
replace
(
'
operateSocketTask
'
,
'
closeSocket
'
))
}
}
onOpen
(
callback
)
{
this
.
_callbacks
.
open
.
push
(
callback
)
}
}
onClose
(
callback
)
{
this
.
_callbacks
.
close
.
push
(
callback
)
}
}
onError
(
callback
)
{
this
.
_callbacks
.
error
.
push
(
callback
)
}
}
onMessage
(
callback
)
{
this
.
_callbacks
.
message
.
push
(
callback
)
}
}
_callback
({
success
,
fail
,
...
...
src/core/service/api/network/upload-file.js
浏览文件 @
46d679a8
...
...
@@ -12,28 +12,33 @@ class UploadTask {
this
.
id
=
uploadTaskId
this
.
_callbackId
=
callbackId
this
.
_callbacks
=
[]
}
}
abort
()
{
invokeMethod
(
'
operateRequestTask
'
,
{
uploadTaskId
:
this
.
id
,
operationType
:
'
abort
'
})
}
}
onProgressUpdate
(
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
}
this
.
_callbacks
.
push
(
callback
)
}
}
onHeadersReceived
()
{
}
}
offProgressUpdate
(
callback
)
{
const
index
=
this
.
_callbacks
.
indexOf
(
callback
)
if
(
index
>=
0
)
{
this
.
_callbacks
.
splice
(
index
,
1
)
}
}
}
offHeadersReceived
()
{
}
...
...
src/core/service/api/ui/create-animation.js
浏览文件 @
46d679a8
...
...
@@ -12,28 +12,33 @@ class MPAnimation {
this
.
currentStepAnimates
=
[]
this
.
option
=
Object
.
assign
({},
defaultOption
,
option
)
}
_getOption
(
option
)
{
le
t
_option
=
{
cons
t
_option
=
{
transition
:
Object
.
assign
({},
this
.
option
,
option
)
}
_option
.
transformOrigin
=
_option
.
transition
.
transformOrigin
delete
_option
.
transition
.
transformOrigin
return
_option
}
_pushAnimates
(
type
,
args
)
{
this
.
currentStepAnimates
.
push
({
type
:
type
,
args
:
args
})
}
_converType
(
type
)
{
return
type
.
replace
(
/
[
A-Z
]
/g
,
text
=>
{
return
`-
${
text
.
toLowerCase
()}
`
})
}
_getValue
(
value
)
{
return
typeof
value
===
'
number
'
?
`
${
value
}
px`
:
value
}
export
()
{
const
actions
=
this
.
actions
this
.
actions
=
[]
...
...
@@ -41,6 +46,7 @@ class MPAnimation {
actions
}
}
step
(
option
)
{
this
.
currentStepAnimates
.
forEach
(
animate
=>
{
if
(
animate
.
type
!==
'
style
'
)
{
...
...
src/core/service/api/ui/create-intersection-observer.js
浏览文件 @
46d679a8
...
...
@@ -17,21 +17,25 @@ class ServiceIntersectionObserver {
this
.
pageId
=
component
.
$page
.
id
this
.
component
=
component
.
_$id
||
component
// app-plus 平台传输_$id
this
.
options
=
Object
.
assign
({},
defaultOptions
,
options
)
}
}
_makeRootMargin
(
margins
=
{})
{
this
.
options
.
rootMargin
=
[
'
top
'
,
'
right
'
,
'
bottom
'
,
'
left
'
].
map
(
name
=>
`
${
Number
(
margins
[
name
])
||
0
}
px`
).
join
(
'
'
)
}
}
relativeTo
(
selector
,
margins
)
{
this
.
options
.
relativeToSelector
=
selector
this
.
_makeRootMargin
(
margins
)
return
this
}
}
relativeToViewport
(
margins
)
{
this
.
options
.
relativeToSelector
=
null
this
.
_makeRootMargin
(
margins
)
return
this
}
}
observe
(
selector
,
callback
)
{
if
(
typeof
callback
!==
'
function
'
)
{
return
...
...
@@ -45,7 +49,8 @@ class ServiceIntersectionObserver {
component
:
this
.
component
,
options
:
this
.
options
},
this
.
pageId
)
}
}
disconnect
()
{
UniServiceJSBridge
.
publishHandler
(
'
destroyComponentObserver
'
,
{
reqId
:
this
.
reqId
...
...
src/core/view/bridge/subscribe/api/request-component-observer.js
浏览文件 @
46d679a8
...
...
@@ -40,7 +40,7 @@ export function requestComponentObserver ({
const
root
=
options
.
relativeToSelector
?
$el
.
querySelector
(
options
.
relativeToSelector
)
:
null
le
t
intersectionObserver
=
intersectionObservers
[
reqId
]
=
new
IntersectionObserver
((
entries
,
observer
)
=>
{
cons
t
intersectionObserver
=
intersectionObservers
[
reqId
]
=
new
IntersectionObserver
((
entries
,
observer
)
=>
{
entries
.
forEach
(
entrie
=>
{
UniViewJSBridge
.
publishHandler
(
'
onRequestComponentObserver
'
,
{
reqId
,
...
...
src/core/view/bridge/subscribe/api/util.js
浏览文件 @
46d679a8
...
...
@@ -14,7 +14,7 @@ function findVmById (id, vm) {
export
function
findElm
(
component
,
pageVm
)
{
if
(
!
pageVm
)
{
return
console
.
error
(
`page is not ready`
)
return
console
.
error
(
'
page is not ready
'
)
}
if
(
!
component
)
{
return
pageVm
.
$el
...
...
src/core/view/bridge/subscribe/font.js
浏览文件 @
46d679a8
...
...
@@ -13,7 +13,7 @@ export function loadFontFace ({
UniViewJSBridge
.
publishHandler
(
'
onLoadFontFaceCallback
'
,
{
callbackId
,
data
:
{
errMsg
:
`loadFontFace:ok`
errMsg
:
'
loadFontFace:ok
'
}
})
})
...
...
@@ -32,7 +32,7 @@ export function loadFontFace ({
UniViewJSBridge
.
publishHandler
(
'
onLoadFontFaceCallback
'
,
{
callbackId
,
data
:
{
errMsg
:
`loadFontFace:ok`
errMsg
:
'
loadFontFace:ok
'
}
})
}
...
...
src/core/view/bridge/subscribe/scroll.js
浏览文件 @
46d679a8
...
...
@@ -80,7 +80,7 @@ export function createScrollListener (pageId, {
// 部分浏览器窗口高度变化后document.documentelement.clientheight不会变化,采用window.innerHeight
const
windowHeight
=
window
.
innerHeight
const
scrollY
=
window
.
scrollY
le
t
isBottom
=
scrollY
>
0
&&
scrollHeight
>
windowHeight
&&
(
scrollY
+
windowHeight
+
onReachBottomDistance
)
>=
scrollHeight
cons
t
isBottom
=
scrollY
>
0
&&
scrollHeight
>
windowHeight
&&
(
scrollY
+
windowHeight
+
onReachBottomDistance
)
>=
scrollHeight
// 兼容部分浏览器滚动时scroll事件不触发
const
heightChanged
=
Math
.
abs
(
scrollHeight
-
lastScrollHeight
)
>
onReachBottomDistance
if
(
isBottom
&&
(
!
hasReachBottom
||
heightChanged
))
{
...
...
src/core/view/components/button/index.vue
浏览文件 @
46d679a8
...
...
@@ -63,9 +63,9 @@ export default {
},
_bindObjectListeners
(
data
,
value
)
{
if
(
value
)
{
for
(
le
t
key
in
value
)
{
le
t
existing
=
data
.
on
[
key
]
le
t
ours
=
value
[
key
]
for
(
cons
t
key
in
value
)
{
cons
t
existing
=
data
.
on
[
key
]
cons
t
ours
=
value
[
key
]
data
.
on
[
key
]
=
existing
?
[].
concat
(
existing
,
ours
)
:
ours
}
}
...
...
@@ -73,7 +73,7 @@ export default {
}
},
render
(
createElement
)
{
le
t
$listeners
=
Object
.
create
(
null
)
cons
t
$listeners
=
Object
.
create
(
null
)
if
(
this
.
$listeners
)
{
Object
.
keys
(
this
.
$listeners
).
forEach
(
e
=>
{
if
(
this
.
disabled
&&
(
e
===
'
click
'
||
e
===
'
tap
'
))
{
...
...
@@ -86,7 +86,7 @@ export default {
return
createElement
(
'
uni-button
'
,
this
.
_bindObjectListeners
({
class
:
[
this
.
hovering
?
this
.
hoverClass
:
''
],
attrs
:
{
'
disabled
'
:
this
.
disabled
disabled
:
this
.
disabled
},
on
:
{
touchstart
:
this
.
_hoverTouchStart
,
...
...
@@ -99,7 +99,7 @@ export default {
return
createElement
(
'
uni-button
'
,
this
.
_bindObjectListeners
({
class
:
[
this
.
hovering
?
this
.
hoverClass
:
''
],
attrs
:
{
'
disabled
'
:
this
.
disabled
disabled
:
this
.
disabled
},
on
:
{
click
:
this
.
_onClick
...
...
src/core/view/components/canvas/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,17 +2,20 @@
<uni-canvas
:canvas-id=
"canvasId"
:disable-scroll=
"disableScroll"
v-on=
"_listeners"
>
v-on=
"_listeners"
>
<canvas
ref=
"canvas"
width=
"300"
height=
"150"
/>
height=
"150"
/>
<div
style=
"position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden;"
>
<slot
/>
</div>
<v-uni-resize-sensor
ref=
"sensor"
@
resize=
"_resize"
/>
@
resize=
"_resize"
/>
</uni-canvas>
</
template
>
<
script
>
...
...
@@ -162,36 +165,36 @@ export default {
}
this
.
preloadImage
(
actions
)
for
(
let
index
=
0
;
index
<
actions
.
length
;
index
++
)
{
le
t
action
=
actions
[
index
]
cons
t
action
=
actions
[
index
]
let
method
=
action
.
method
le
t
data
=
action
.
data
cons
t
data
=
action
.
data
if
(
/^set/
.
test
(
method
)
&&
method
!==
'
setTransform
'
)
{
le
t
method1
=
method
[
3
].
toLowerCase
()
+
method
.
slice
(
4
)
cons
t
method1
=
method
[
3
].
toLowerCase
()
+
method
.
slice
(
4
)
let
color
if
(
method1
===
'
fillStyle
'
||
method1
===
'
strokeStyle
'
)
{
if
(
data
[
0
]
===
'
normal
'
)
{
color
=
resolveColor
(
data
[
1
])
}
else
if
(
data
[
0
]
===
'
linear
'
)
{
le
t
LinearGradient
=
c2d
.
createLinearGradient
(...
data
[
1
])
cons
t
LinearGradient
=
c2d
.
createLinearGradient
(...
data
[
1
])
data
[
2
].
forEach
(
function
(
data2
)
{
le
t
offset
=
data2
[
0
]
le
t
color
=
resolveColor
(
data2
[
1
])
cons
t
offset
=
data2
[
0
]
cons
t
color
=
resolveColor
(
data2
[
1
])
LinearGradient
.
addColorStop
(
offset
,
color
)
})
color
=
LinearGradient
}
else
if
(
data
[
0
]
===
'
radial
'
)
{
le
t
x
=
data
[
1
][
0
]
le
t
y
=
data
[
1
][
1
]
le
t
r
=
data
[
1
][
2
]
le
t
LinearGradient
=
c2d
.
createRadialGradient
(
x
,
y
,
0
,
x
,
y
,
r
)
cons
t
x
=
data
[
1
][
0
]
cons
t
y
=
data
[
1
][
1
]
cons
t
r
=
data
[
1
][
2
]
cons
t
LinearGradient
=
c2d
.
createRadialGradient
(
x
,
y
,
0
,
x
,
y
,
r
)
data
[
2
].
forEach
(
function
(
data2
)
{
le
t
offset
=
data2
[
0
]
le
t
color
=
resolveColor
(
data2
[
1
])
cons
t
offset
=
data2
[
0
]
cons
t
color
=
resolveColor
(
data2
[
1
])
LinearGradient
.
addColorStop
(
offset
,
color
)
})
color
=
LinearGradient
}
else
if
(
data
[
0
]
===
'
pattern
'
)
{
le
t
loaded
=
this
.
checkImageLoaded
(
data
[
1
],
actions
.
slice
(
index
+
1
),
callbackId
,
cons
t
loaded
=
this
.
checkImageLoaded
(
data
[
1
],
actions
.
slice
(
index
+
1
),
callbackId
,
function
(
image
)
{
if
(
image
)
{
c2d
[
method1
]
=
c2d
.
createPattern
(
image
,
data
[
2
])
...
...
@@ -510,7 +513,7 @@ export default {
qualit
,
callbackId
})
{
le
t
res
=
this
.
getImageData
({
cons
t
res
=
this
.
getImageData
({
x
,
y
,
width
,
...
...
src/core/view/components/checkbox-group/index.vue
浏览文件 @
46d679a8
...
...
@@ -41,7 +41,7 @@ export default {
},
methods
:
{
_changeHandler
(
$event
)
{
le
t
value
=
[]
cons
t
value
=
[]
this
.
checkboxList
.
forEach
(
vm
=>
{
if
(
vm
.
checkboxChecked
)
{
value
.
push
(
vm
.
value
)
...
...
@@ -55,21 +55,21 @@ export default {
if
(
$event
.
type
===
'
add
'
)
{
this
.
checkboxList
.
push
(
$event
.
vm
)
}
else
{
le
t
index
=
this
.
checkboxList
.
indexOf
(
$event
.
vm
)
cons
t
index
=
this
.
checkboxList
.
indexOf
(
$event
.
vm
)
this
.
checkboxList
.
splice
(
index
,
1
)
}
},
_getFormData
()
{
le
t
data
=
{}
cons
t
data
=
{}
if
(
this
.
name
!==
''
)
{
le
t
value
=
[]
cons
t
value
=
[]
this
.
checkboxList
.
forEach
(
vm
=>
{
if
(
vm
.
checkboxChecked
)
{
value
.
push
(
vm
.
value
)
}
})
data
[
'
value
'
]
=
value
data
[
'
key
'
]
=
this
.
name
data
.
value
=
value
data
.
key
=
this
.
name
}
return
data
}
...
...
src/core/view/components/checkbox/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,12 +2,14 @@
<uni-checkbox
:disabled=
"disabled"
v-on=
"$listeners"
@
click=
"_onClick"
>
@
click=
"_onClick"
>
<div
class=
"uni-checkbox-wrapper"
>
<div
:class=
"[checkboxChecked ? 'uni-checkbox-input-checked' : '']"
:style=
"
{color:color}"
class="uni-checkbox-input" />
class="uni-checkbox-input"
/>
<slot
/>
</div>
</uni-checkbox>
...
...
src/core/view/components/editor/formats/list.js
浏览文件 @
46d679a8
...
...
@@ -5,8 +5,8 @@ export default function (Quill) {
class
List
extends
Container
{
static
create
(
value
)
{
le
t
tagName
=
value
===
'
ordered
'
?
'
OL
'
:
'
UL
'
le
t
node
=
super
.
create
(
tagName
)
cons
t
tagName
=
value
===
'
ordered
'
?
'
OL
'
:
'
UL
'
cons
t
node
=
super
.
create
(
tagName
)
if
(
value
===
'
checked
'
||
value
===
'
unchecked
'
)
{
node
.
setAttribute
(
'
data-checked
'
,
value
===
'
checked
'
)
}
...
...
@@ -29,8 +29,8 @@ export default function (Quill) {
super
(
domNode
)
const
listEventHandler
=
(
e
)
=>
{
if
(
e
.
target
.
parentNode
!==
domNode
)
return
le
t
format
=
this
.
statics
.
formats
(
domNode
)
le
t
blot
=
Parchment
.
find
(
e
.
target
)
cons
t
format
=
this
.
statics
.
formats
(
domNode
)
cons
t
blot
=
Parchment
.
find
(
e
.
target
)
if
(
format
===
'
checked
'
)
{
blot
.
format
(
'
list
'
,
'
unchecked
'
)
}
else
if
(
format
===
'
unchecked
'
)
{
...
...
@@ -56,15 +56,15 @@ export default function (Quill) {
if
(
blot
instanceof
ListItem
)
{
super
.
insertBefore
(
blot
,
ref
)
}
else
{
le
t
index
=
ref
==
null
?
this
.
length
()
:
ref
.
offset
(
this
)
le
t
after
=
this
.
split
(
index
)
cons
t
index
=
ref
==
null
?
this
.
length
()
:
ref
.
offset
(
this
)
cons
t
after
=
this
.
split
(
index
)
after
.
parent
.
insertBefore
(
blot
,
after
)
}
}
optimize
(
context
)
{
super
.
optimize
(
context
)
le
t
next
=
this
.
next
cons
t
next
=
this
.
next
if
(
next
!=
null
&&
next
.
prev
===
this
&&
next
.
statics
.
blotName
===
this
.
statics
.
blotName
&&
next
.
domNode
.
tagName
===
this
.
domNode
.
tagName
&&
...
...
@@ -76,7 +76,7 @@ export default function (Quill) {
replace
(
target
)
{
if
(
target
.
statics
.
blotName
!==
this
.
statics
.
blotName
)
{
le
t
item
=
Parchment
.
create
(
this
.
statics
.
defaultChild
)
cons
t
item
=
Parchment
.
create
(
this
.
statics
.
defaultChild
)
target
.
moveChildren
(
item
)
this
.
appendChild
(
item
)
}
...
...
src/core/view/components/editor/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,7 +2,8 @@
<uni-editor
:id=
"id"
class=
"ql-container"
v-on=
"$listeners"
/>
v-on=
"$listeners"
/>
</
template
>
<
script
>
...
...
@@ -101,34 +102,36 @@ export default {
if
(
this
.
quillReady
)
{
switch
(
type
)
{
case
'
format
'
:
let
{
name
=
''
,
value
=
false
}
=
options
range
=
quill
.
getSelection
(
true
)
let
format
=
quill
.
getFormat
(
range
)[
name
]
||
false
if
([
'
bold
'
,
'
italic
'
,
'
underline
'
,
'
strike
'
,
'
ins
'
].
includes
(
name
))
{
value
=
!
format
}
else
if
(
name
===
'
direction
'
)
{
value
=
value
===
'
rtl
'
&&
format
?
false
:
value
const
align
=
quill
.
getFormat
(
range
).
align
if
(
value
===
'
rtl
'
&&
!
align
)
{
quill
.
format
(
'
align
'
,
'
right
'
,
Quill
.
sources
.
USER
)
}
else
if
(
!
value
&&
align
===
'
right
'
)
{
quill
.
format
(
'
align
'
,
false
,
Quill
.
sources
.
USER
)
}
}
else
if
(
name
===
'
indent
'
)
{
const
rtl
=
quill
.
getFormat
(
range
).
direction
===
'
rtl
'
value
=
value
===
'
+1
'
if
(
rtl
)
{
value
=
!
value
}
value
=
value
?
'
+1
'
:
'
-1
'
}
else
{
if
(
name
===
'
list
'
)
{
value
=
value
===
'
check
'
?
'
unchecked
'
:
value
format
=
format
===
'
checked
'
?
'
unchecked
'
:
format
{
let
{
name
=
''
,
value
=
false
}
=
options
range
=
quill
.
getSelection
(
true
)
let
format
=
quill
.
getFormat
(
range
)[
name
]
||
false
if
([
'
bold
'
,
'
italic
'
,
'
underline
'
,
'
strike
'
,
'
ins
'
].
includes
(
name
))
{
value
=
!
format
}
else
if
(
name
===
'
direction
'
)
{
value
=
value
===
'
rtl
'
&&
format
?
false
:
value
const
align
=
quill
.
getFormat
(
range
).
align
if
(
value
===
'
rtl
'
&&
!
align
)
{
quill
.
format
(
'
align
'
,
'
right
'
,
Quill
.
sources
.
USER
)
}
else
if
(
!
value
&&
align
===
'
right
'
)
{
quill
.
format
(
'
align
'
,
false
,
Quill
.
sources
.
USER
)
}
}
else
if
(
name
===
'
indent
'
)
{
const
rtl
=
quill
.
getFormat
(
range
).
direction
===
'
rtl
'
value
=
value
===
'
+1
'
if
(
rtl
)
{
value
=
!
value
}
value
=
value
?
'
+1
'
:
'
-1
'
}
else
{
if
(
name
===
'
list
'
)
{
value
=
value
===
'
check
'
?
'
unchecked
'
:
value
format
=
format
===
'
checked
'
?
'
unchecked
'
:
format
}
value
=
((
format
&&
format
!==
(
value
||
false
))
||
(
!
format
&&
value
))
?
value
:
!
format
}
value
=
((
format
&&
format
!==
(
value
||
false
))
||
(
!
format
&&
value
))
?
value
:
!
format
quill
.
format
(
name
,
value
,
Quill
.
sources
.
USER
)
}
quill
.
format
(
name
,
value
,
Quill
.
sources
.
USER
)
break
case
'
insertDivider
'
:
range
=
quill
.
getSelection
(
true
)
...
...
@@ -137,27 +140,33 @@ export default {
quill
.
setSelection
(
range
.
index
+
2
,
Quill
.
sources
.
SILENT
)
break
case
'
insertImage
'
:
range
=
quill
.
getSelection
(
true
)
const
{
src
=
''
,
alt
=
''
,
data
=
{}
}
=
options
quill
.
insertEmbed
(
range
.
index
,
'
image
'
,
this
.
$getRealPath
(
src
),
Quill
.
sources
.
USER
)
quill
.
formatText
(
range
.
index
,
1
,
'
alt
'
,
alt
)
quill
.
formatText
(
range
.
index
,
1
,
'
data-custom
'
,
Object
.
keys
(
data
).
map
(
key
=>
`
${
key
}
=
${
data
[
key
]}
`
).
join
(
'
&
'
))
quill
.
setSelection
(
range
.
index
+
1
,
Quill
.
sources
.
SILENT
)
{
range
=
quill
.
getSelection
(
true
)
const
{
src
=
''
,
alt
=
''
,
data
=
{}
}
=
options
quill
.
insertEmbed
(
range
.
index
,
'
image
'
,
this
.
$getRealPath
(
src
),
Quill
.
sources
.
USER
)
quill
.
formatText
(
range
.
index
,
1
,
'
alt
'
,
alt
)
quill
.
formatText
(
range
.
index
,
1
,
'
data-custom
'
,
Object
.
keys
(
data
).
map
(
key
=>
`
${
key
}
=
${
data
[
key
]}
`
).
join
(
'
&
'
))
quill
.
setSelection
(
range
.
index
+
1
,
Quill
.
sources
.
SILENT
)
}
break
case
'
insertText
'
:
range
=
quill
.
getSelection
(
true
)
const
{
text
=
''
}
=
options
quill
.
insertText
(
range
.
index
,
text
,
Quill
.
sources
.
USER
)
quill
.
setSelection
(
range
.
index
+
text
.
length
,
0
,
Quill
.
sources
.
SILENT
)
{
range
=
quill
.
getSelection
(
true
)
const
{
text
=
''
}
=
options
quill
.
insertText
(
range
.
index
,
text
,
Quill
.
sources
.
USER
)
quill
.
setSelection
(
range
.
index
+
text
.
length
,
0
,
Quill
.
sources
.
SILENT
)
}
break
case
'
setContents
'
:
const
{
delta
,
html
}
=
options
if
(
typeof
delta
===
'
object
'
)
{
quill
.
setContents
(
delta
,
Quill
.
sources
.
SILENT
)
}
else
if
(
typeof
html
===
'
string
'
)
{
quill
.
setContents
(
this
.
html2delta
(
html
),
Quill
.
sources
.
SILENT
)
}
else
{
errMsg
=
'
contents is missing
'
{
const
{
delta
,
html
}
=
options
if
(
typeof
delta
===
'
object
'
)
{
quill
.
setContents
(
delta
,
Quill
.
sources
.
SILENT
)
}
else
if
(
typeof
html
===
'
string
'
)
{
quill
.
setContents
(
this
.
html2delta
(
html
),
Quill
.
sources
.
SILENT
)
}
else
{
errMsg
=
'
contents is missing
'
}
}
break
case
'
getContents
'
:
...
...
@@ -167,16 +176,18 @@ export default {
quill
.
setContents
([])
break
case
'
removeFormat
'
:
range
=
quill
.
getSelection
(
true
)
var
parchment
=
Quill
.
import
(
'
parchment
'
)
if
(
range
.
length
)
{
quill
.
removeFormat
(
range
,
Quill
.
sources
.
USER
)
}
else
{
Object
.
keys
(
quill
.
getFormat
(
range
)).
forEach
(
key
=>
{
if
(
parchment
.
query
(
key
,
parchment
.
Scope
.
INLINE
))
{
quill
.
format
(
key
,
false
)
}
})
{
range
=
quill
.
getSelection
(
true
)
const
parchment
=
Quill
.
import
(
'
parchment
'
)
if
(
range
.
length
)
{
quill
.
removeFormat
(
range
,
Quill
.
sources
.
USER
)
}
else
{
Object
.
keys
(
quill
.
getFormat
(
range
)).
forEach
(
key
=>
{
if
(
parchment
.
query
(
key
,
parchment
.
Scope
.
INLINE
))
{
quill
.
format
(
key
,
false
)
}
})
}
}
break
case
'
undo
'
:
...
...
@@ -208,7 +219,7 @@ export default {
}
return
}
le
t
script
=
document
.
createElement
(
'
script
'
)
cons
t
script
=
document
.
createElement
(
'
script
'
)
script
.
src
=
window
.
plus
?
'
./__uniappquill.js
'
:
'
https://unpkg.com/quill@1.3.7/dist/quill.min.js
'
document
.
body
.
appendChild
(
script
)
script
.
onload
=
callback
...
...
@@ -220,7 +231,7 @@ export default {
}
return
}
le
t
script
=
document
.
createElement
(
'
script
'
)
cons
t
script
=
document
.
createElement
(
'
script
'
)
script
.
src
=
window
.
plus
?
'
./__uniappquillimageresize.js
'
:
'
https://unpkg.com/quill-image-resize-mp@3.0.1/image-resize.min.js
'
document
.
body
.
appendChild
(
script
)
script
.
onload
=
callback
...
...
src/core/view/components/form/index.vue
浏览文件 @
46d679a8
...
...
@@ -24,7 +24,7 @@ export default {
},
methods
:
{
_onSubmit
(
$event
)
{
le
t
data
=
{}
cons
t
data
=
{}
this
.
childrenList
.
forEach
(
vm
=>
{
if
(
vm
.
_getFormData
&&
vm
.
_getFormData
().
key
)
{
data
[
vm
.
_getFormData
().
key
]
=
vm
.
_getFormData
().
value
...
...
src/core/view/components/image/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,12 +2,14 @@
<uni-image
v-on=
"$listeners"
>
<div
ref=
"content"
:style=
"modeStyle"
/>
:style=
"modeStyle"
/>
<img
:src=
"realImagePath"
>
<v-uni-resize-sensor
v-if=
"mode === 'widthFix'"
ref=
"sensor"
@
resize=
"_resize"
/>
@
resize=
"_resize"
/>
</uni-image>
</
template
>
<
script
>
...
...
@@ -46,7 +48,7 @@ export default {
modeStyle
()
{
let
size
=
'
auto
'
let
position
=
''
le
t
repeat
=
'
no-repeat
'
cons
t
repeat
=
'
no-repeat
'
switch
(
this
.
mode
)
{
case
'
aspectFit
'
:
...
...
src/core/view/components/input/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-input
@
change.stop
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<div
ref=
"wrapper"
class=
"uni-input-wrapper"
>
class=
"uni-input-wrapper"
>
<div
v-show=
"!(composing || inputValue.length)"
ref=
"placeholder"
:style=
"placeholderStyle"
:class=
"placeholderClass"
class=
"uni-input-placeholder"
>
{{
placeholder
}}
</div>
>
{{
placeholder
}}
</div>
<input
ref=
"input"
v-model=
"inputValue"
...
...
src/core/view/components/label/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,7 +2,8 @@
<uni-label
:class=
"
{'uni-label-pointer':pointer}"
v-on="$listeners"
@click="_onClick">
@click="_onClick"
>
<slot
/>
</uni-label>
</
template
>
...
...
src/core/view/components/movable-view/index.vue
浏览文件 @
46d679a8
...
...
@@ -382,12 +382,12 @@ export default {
this
.
$el
.
style
.
willChange
=
'
auto
'
this
.
_isTouching
=
false
if
(
!
this
.
_checkCanMove
&&
!
this
.
_revise
(
'
out-of-bounds
'
)
&&
this
.
inertia
)
{
le
t
xv
=
1000
*
(
this
.
__touchInfo
.
historyX
[
1
]
-
this
.
__touchInfo
.
historyX
[
0
])
/
(
this
.
__touchInfo
.
historyT
[
1
]
-
this
.
__touchInfo
.
historyT
[
0
])
le
t
yv
=
1000
*
(
this
.
__touchInfo
.
historyY
[
1
]
-
this
.
__touchInfo
.
historyY
[
0
])
/
(
this
.
__touchInfo
.
historyT
[
1
]
-
this
.
__touchInfo
.
historyT
[
0
])
cons
t
xv
=
1000
*
(
this
.
__touchInfo
.
historyX
[
1
]
-
this
.
__touchInfo
.
historyX
[
0
])
/
(
this
.
__touchInfo
.
historyT
[
1
]
-
this
.
__touchInfo
.
historyT
[
0
])
cons
t
yv
=
1000
*
(
this
.
__touchInfo
.
historyY
[
1
]
-
this
.
__touchInfo
.
historyY
[
0
])
/
(
this
.
__touchInfo
.
historyT
[
1
]
-
this
.
__touchInfo
.
historyT
[
0
])
this
.
_friction
.
setV
(
xv
,
yv
)
this
.
_friction
.
setS
(
this
.
_translateX
,
this
.
_translateY
)
le
t
x0
=
this
.
_friction
.
delta
().
x
le
t
y0
=
this
.
_friction
.
delta
().
y
cons
t
x0
=
this
.
_friction
.
delta
().
x
cons
t
y0
=
this
.
_friction
.
delta
().
y
let
x
=
x0
+
this
.
_translateX
let
y
=
y0
+
this
.
_translateY
if
(
x
<
this
.
minX
)
{
...
...
@@ -526,9 +526,9 @@ export default {
scale
=
this
.
_adjustScale
(
scale
)
this
.
_updateWH
(
scale
)
this
.
_updateBoundary
()
le
t
limitXY
=
this
.
_getLimitXY
(
this
.
_translateX
,
this
.
_translateY
)
le
t
x
=
limitXY
.
x
le
t
y
=
limitXY
.
y
cons
t
limitXY
=
this
.
_getLimitXY
(
this
.
_translateX
,
this
.
_translateY
)
cons
t
x
=
limitXY
.
x
cons
t
y
=
limitXY
.
y
if
(
animat
)
{
this
.
_animationTo
(
x
,
y
,
scale
,
''
,
true
,
true
)
}
else
{
...
...
src/core/view/components/movable-view/utils.js
浏览文件 @
46d679a8
...
...
@@ -101,9 +101,9 @@ Spring.prototype._solve = function (e, t) {
var
r
=
this
.
_k
var
o
=
n
*
n
-
4
*
i
*
r
if
(
o
===
0
)
{
le
t
a
=
-
n
/
(
2
*
i
)
le
t
s
=
e
le
t
l
=
t
/
(
a
*
e
)
cons
t
a
=
-
n
/
(
2
*
i
)
cons
t
s
=
e
cons
t
l
=
t
/
(
a
*
e
)
return
{
x
:
function
(
e
)
{
return
(
s
+
l
*
e
)
*
Math
.
pow
(
Math
.
E
,
a
*
e
)
...
...
@@ -115,10 +115,10 @@ Spring.prototype._solve = function (e, t) {
}
}
if
(
o
>
0
)
{
le
t
c
=
(
-
n
-
Math
.
sqrt
(
o
))
/
(
2
*
i
)
le
t
u
=
(
-
n
+
Math
.
sqrt
(
o
))
/
(
2
*
i
)
le
t
d
=
(
t
-
c
*
e
)
/
(
u
-
c
)
le
t
h
=
e
-
d
cons
t
c
=
(
-
n
-
Math
.
sqrt
(
o
))
/
(
2
*
i
)
cons
t
u
=
(
-
n
+
Math
.
sqrt
(
o
))
/
(
2
*
i
)
cons
t
d
=
(
t
-
c
*
e
)
/
(
u
-
c
)
cons
t
h
=
e
-
d
return
{
x
:
function
(
e
)
{
var
t
...
...
src/core/view/components/navigator/index.vue
浏览文件 @
46d679a8
...
...
@@ -6,13 +6,15 @@
@
touchend=
"_hoverTouchEnd"
@
touchcancel=
"_hoverTouchCancel"
@
click=
"_onClick"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<slot
/>
</uni-navigator>
<uni-navigator
v-else
@
click=
"_onClick"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<slot
/>
</uni-navigator>
</
template
>
...
...
@@ -59,7 +61,7 @@ export default {
methods
:
{
_onClick
(
$event
)
{
if
(
this
.
openType
!==
'
navigateBack
'
&&
!
this
.
url
)
{
console
.
error
(
`<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab`
)
console
.
error
(
'
<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab
'
)
return
}
...
...
src/core/view/components/picker-view-column/index.vue
浏览文件 @
46d679a8
...
...
@@ -23,7 +23,7 @@ function initClick (dom) {
dom
.
addEventListener
(
'
touchend
'
,
(
event
)
=>
{
const
info
=
event
.
changedTouches
[
0
]
if
(
Math
.
abs
(
info
.
clientX
-
x
)
<
MAX_MOVE
&&
Math
.
abs
(
info
.
clientY
-
y
)
<
MAX_MOVE
)
{
le
t
customEvent
=
new
CustomEvent
(
'
click
'
,
{
cons
t
customEvent
=
new
CustomEvent
(
'
click
'
,
{
bubbles
:
true
,
cancelable
:
true
,
target
:
event
.
target
,
...
...
src/core/view/components/picker-view/index.vue
浏览文件 @
46d679a8
...
...
@@ -55,7 +55,7 @@ export default {
}
else
{
this
.
changeSource
=
''
// 避免外部直接对此值进行修改
le
t
value
=
val
.
map
(
val
=>
val
)
cons
t
value
=
val
.
map
(
val
=>
val
)
this
.
$emit
(
'
update:value
'
,
value
)
this
.
$trigger
(
'
change
'
,
{},
{
value
...
...
@@ -114,7 +114,7 @@ export default {
}),
createElement
(
'
div
'
,
{
ref
:
'
wrapper
'
,
'
class
'
:
'
uni-picker-view-wrapper
'
class
:
'
uni-picker-view-wrapper
'
},
items
)
])
}
...
...
src/core/view/components/progress/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-progress
class=
"uni-progress"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<div
:style=
"outerBarStyle"
class=
"uni-progress-bar"
>
class=
"uni-progress-bar"
>
<div
:style=
"innerBarStyle"
class=
"uni-progress-inner-bar"
/>
class=
"uni-progress-inner-bar"
/>
</div>
<template
v-if=
"showInfo"
>
<p
class=
"uni-progress-info"
>
{{
currentPercent
}}
%
</p>
<p
class=
"uni-progress-info"
>
{{
currentPercent
}}
%
</p>
</
template
>
</uni-progress>
</template>
...
...
src/core/view/components/radio-group/index.vue
浏览文件 @
46d679a8
...
...
@@ -44,7 +44,7 @@ export default {
},
methods
:
{
_changeHandler
(
$event
,
vm
)
{
le
t
index
=
this
.
radioList
.
indexOf
(
vm
)
cons
t
index
=
this
.
radioList
.
indexOf
(
vm
)
this
.
_resetRadioGroupValue
(
index
,
true
)
this
.
$trigger
(
'
change
'
,
$event
,
{
value
:
vm
.
radioValue
...
...
@@ -78,7 +78,7 @@ export default {
})
},
_getFormData
()
{
le
t
data
=
{}
cons
t
data
=
{}
if
(
this
.
name
!==
''
)
{
let
value
=
''
this
.
radioList
.
forEach
(
vm
=>
{
...
...
@@ -86,8 +86,8 @@ export default {
value
=
vm
.
value
}
})
data
[
'
value
'
]
=
value
data
[
'
key
'
]
=
this
.
name
data
.
value
=
value
data
.
key
=
this
.
name
}
return
data
}
...
...
src/core/view/components/radio/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,12 +2,14 @@
<uni-radio
:disabled=
"disabled"
v-on=
"$listeners"
@
click=
"_onClick"
>
@
click=
"_onClick"
>
<div
class=
"uni-radio-wrapper"
>
<div
:class=
"radioChecked ? 'uni-radio-input-checked' : ''"
:style=
"radioChecked ? checkedStyle : ''"
class=
"uni-radio-input"
/>
class=
"uni-radio-input"
/>
<slot
/>
</div>
</uni-radio>
...
...
src/core/view/components/rich-text/nodes-parser.js
浏览文件 @
46d679a8
...
...
@@ -4,57 +4,57 @@ import {
}
from
'
uni-shared
'
const
TAGS
=
{
'
a
'
:
''
,
'
abbr
'
:
''
,
'
b
'
:
''
,
'
blockquote
'
:
''
,
'
br
'
:
''
,
'
code
'
:
''
,
'
col
'
:
[
'
span
'
,
'
width
'
],
'
colgroup
'
:
[
'
span
'
,
'
width
'
],
'
dd
'
:
''
,
'
del
'
:
''
,
'
div
'
:
''
,
'
dl
'
:
''
,
'
dt
'
:
''
,
'
em
'
:
''
,
'
fieldset
'
:
''
,
'
h1
'
:
''
,
'
h2
'
:
''
,
'
h3
'
:
''
,
'
h4
'
:
''
,
'
h5
'
:
''
,
'
h6
'
:
''
,
'
hr
'
:
''
,
'
i
'
:
''
,
'
img
'
:
[
'
alt
'
,
'
src
'
,
'
height
'
,
'
width
'
],
'
ins
'
:
''
,
'
label
'
:
''
,
'
legend
'
:
''
,
'
li
'
:
''
,
'
ol
'
:
[
'
start
'
,
'
type
'
],
'
p
'
:
''
,
'
q
'
:
''
,
'
span
'
:
''
,
'
strong
'
:
''
,
'
sub
'
:
''
,
'
sup
'
:
''
,
'
table
'
:
[
'
width
'
],
'
tbody
'
:
''
,
'
td
'
:
[
'
colspan
'
,
'
rowspan
'
,
'
height
'
,
'
width
'
],
'
tfoot
'
:
''
,
'
th
'
:
[
'
colspan
'
,
'
rowspan
'
,
'
height
'
,
'
width
'
],
'
thead
'
:
''
,
'
tr
'
:
''
,
'
ul
'
:
''
a
:
''
,
abbr
:
''
,
b
:
''
,
blockquote
:
''
,
br
:
''
,
code
:
''
,
col
:
[
'
span
'
,
'
width
'
],
colgroup
:
[
'
span
'
,
'
width
'
],
dd
:
''
,
del
:
''
,
div
:
''
,
dl
:
''
,
dt
:
''
,
em
:
''
,
fieldset
:
''
,
h1
:
''
,
h2
:
''
,
h3
:
''
,
h4
:
''
,
h5
:
''
,
h6
:
''
,
hr
:
''
,
i
:
''
,
img
:
[
'
alt
'
,
'
src
'
,
'
height
'
,
'
width
'
],
ins
:
''
,
label
:
''
,
legend
:
''
,
li
:
''
,
ol
:
[
'
start
'
,
'
type
'
],
p
:
''
,
q
:
''
,
span
:
''
,
strong
:
''
,
sub
:
''
,
sup
:
''
,
table
:
[
'
width
'
],
tbody
:
''
,
td
:
[
'
colspan
'
,
'
rowspan
'
,
'
height
'
,
'
width
'
],
tfoot
:
''
,
th
:
[
'
colspan
'
,
'
rowspan
'
,
'
height
'
,
'
width
'
],
thead
:
''
,
tr
:
''
,
ul
:
''
}
const
CHARS
=
{
'
amp
'
:
'
&
'
,
'
gt
'
:
'
>
'
,
'
lt
'
:
'
<
'
,
'
nbsp
'
:
'
'
,
'
quot
'
:
'
"
'
,
'
apos
'
:
"
'
"
amp
:
'
&
'
,
gt
:
'
>
'
,
lt
:
'
<
'
,
nbsp
:
'
'
,
quot
:
'
"
'
,
apos
:
"
'
"
}
function
decodeEntities
(
htmlString
)
{
...
...
@@ -68,7 +68,7 @@ function decodeEntities (htmlString) {
if
(
/^#x
[
0-9a-f
]{1,4}
$/i
.
test
(
stage
))
{
return
String
.
fromCharCode
(
'
0
'
+
stage
.
slice
(
1
))
}
le
t
wrap
=
document
.
createElement
(
'
div
'
)
cons
t
wrap
=
document
.
createElement
(
'
div
'
)
wrap
.
innerHTML
=
match
return
wrap
.
innerText
||
wrap
.
textContent
})
...
...
src/core/view/components/scroll-view/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,20 +2,24 @@
<uni-scroll-view
v-on=
"$listeners"
>
<div
ref=
"wrap"
class=
"uni-scroll-view"
>
class=
"uni-scroll-view"
>
<div
ref=
"main"
:style=
"
{'overflow-x': scrollX?'auto':'hidden','overflow-y': scrollY?'auto':'hidden'}"
class="uni-scroll-view">
class="uni-scroll-view"
>
<div
ref=
"content"
>
<div
v-if=
"refresherEnabled"
ref=
"refresherinner"
:style=
"
{'background-color': refresherBackground, 'height': refresherHeight + 'px'}"
class="uni-scroll-view-refresher">
class="uni-scroll-view-refresher"
>
<div
v-if=
"refresherDefaultStyle !== 'none'"
class=
"uni-scroll-view-refresh"
>
class=
"uni-scroll-view-refresh"
>
<div
class=
"uni-scroll-view-refresh-inner"
>
<svg
v-if=
"refreshState=='pulling'"
...
...
@@ -24,33 +28,38 @@
class="uni-scroll-view-refresh__icon"
width="24"
height="24"
viewBox="0 0 24 24">
viewBox="0 0 24 24"
>
<path
d=
"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
/>
<path
d=
"M0 0h24v24H0z"
fill=
"none"
/>
fill=
"none"
/>
</svg>
<svg
v-if=
"refreshState=='refreshing'"
class=
"uni-scroll-view-refresh__spinner"
width=
"24"
height=
"24"
viewBox=
"25 25 50 50"
>
viewBox=
"25 25 50 50"
>
<circle
cx=
"50"
cy=
"50"
r=
"20"
fill=
"none"
style=
"color: #2BD009;"
stroke-width=
"3"
/>
stroke-width=
"3"
/>
</svg>
</div>
</div>
<slot
v-if=
"refresherDefaultStyle=='none'"
name=
"refresher"
/>
name=
"refresher"
/>
</div>
<slot/>
<slot
/>
</div>
</div>
</div>
...
...
@@ -230,7 +239,7 @@ export default {
}
if
(
self
.
refresherEnabled
&&
self
.
refreshState
===
'
pulling
'
)
{
le
t
dy
=
y
-
touchStart
.
y
cons
t
dy
=
y
-
touchStart
.
y
self
.
refresherHeight
=
dy
let
rotate
=
dy
/
self
.
refresherThreshold
...
...
@@ -360,7 +369,7 @@ export default {
_handleScroll
:
function
(
$event
)
{
if
(
!
(
$event
.
timeStamp
-
this
.
_lastScrollTime
<
20
))
{
this
.
_lastScrollTime
=
$event
.
timeStamp
le
t
target
=
$event
.
target
cons
t
target
=
$event
.
target
this
.
$trigger
(
'
scroll
'
,
$event
,
{
scrollLeft
:
target
.
scrollLeft
,
scrollTop
:
target
.
scrollTop
,
...
...
src/core/view/components/slider/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,27 +2,33 @@
<uni-slider
ref=
"uni-slider"
v-on=
"$listeners"
@
click=
"_onClick"
>
@
click=
"_onClick"
>
<div
class=
"uni-slider-wrapper"
>
<div
class=
"uni-slider-tap-area"
>
<div
:style=
"setBgColor"
class=
"uni-slider-handle-wrapper"
>
class=
"uni-slider-handle-wrapper"
>
<div
ref=
"uni-slider-handle"
:style=
"setBlockBg"
class=
"uni-slider-handle"
/>
class=
"uni-slider-handle"
/>
<div
:style=
"setBlockStyle"
class=
"uni-slider-thumb"
/>
class=
"uni-slider-thumb"
/>
<div
:style=
"setActiveColor"
class=
"uni-slider-track"
/>
class=
"uni-slider-track"
/>
</div>
</div>
<span
v-show=
"showValue"
class=
"uni-slider-value"
>
{{
sliderValue
}}
</span>
class=
"uni-slider-value"
>
{{
sliderValue
}}
</span>
</div>
<slot
/>
</uni-slider>
...
...
@@ -145,10 +151,10 @@ export default {
},
methods
:
{
_onUserChangedValue
(
e
)
{
le
t
slider
=
this
.
$refs
[
'
uni-slider
'
]
le
t
offsetWidth
=
slider
.
offsetWidth
le
t
boxLeft
=
slider
.
getBoundingClientRect
().
left
le
t
value
=
(
e
.
x
-
boxLeft
)
*
(
this
.
max
-
this
.
min
)
/
offsetWidth
+
Number
(
this
.
min
)
cons
t
slider
=
this
.
$refs
[
'
uni-slider
'
]
cons
t
offsetWidth
=
slider
.
offsetWidth
cons
t
boxLeft
=
slider
.
getBoundingClientRect
().
left
cons
t
value
=
(
e
.
x
-
boxLeft
)
*
(
this
.
max
-
this
.
min
)
/
offsetWidth
+
Number
(
this
.
min
)
this
.
sliderValue
=
this
.
_filterValue
(
value
)
},
_filterValue
(
e
)
{
...
...
@@ -167,12 +173,12 @@ export default {
:
'
#e9e9e9
'
)
},
_onTrack
:
function
(
e
)
{
if
(
!
this
.
disabled
)
{
if
(
!
this
.
disabled
)
{
return
e
.
detail
.
state
===
'
move
'
?
(
this
.
_onUserChangedValue
({
x
:
e
.
detail
.
x0
}),
this
.
$trigger
(
'
changing
'
,
e
,
{
value
:
this
.
sliderValue
}),
!
1
)
:
void
(
e
.
detail
.
state
===
'
end
'
&&
this
.
$trigger
(
'
change
'
,
e
,
{
}),
!
1
)
:
(
e
.
detail
.
state
===
'
end
'
&&
this
.
$trigger
(
'
change
'
,
e
,
{
value
:
this
.
sliderValue
}))
}
...
...
@@ -190,10 +196,10 @@ export default {
this
.
sliderValue
=
this
.
min
},
_getFormData
()
{
le
t
data
=
{}
cons
t
data
=
{}
if
(
this
.
name
!==
''
)
{
data
[
'
value
'
]
=
this
.
sliderValue
data
[
'
key
'
]
=
this
.
name
data
.
value
=
this
.
sliderValue
data
.
key
=
this
.
name
}
return
data
}
...
...
src/core/view/components/swiper-item/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-swiper-item
v-on=
"$listeners"
>
<slot/>
<slot
/>
</uni-swiper-item>
</
template
>
<
script
>
...
...
src/core/view/components/swiper/index.vue
浏览文件 @
46d679a8
...
...
@@ -205,7 +205,7 @@ export default {
var
current
=
-
1
if
(
this
.
currentItemId
)
{
for
(
let
i
=
0
,
items
=
this
.
items
;
i
<
items
.
length
;
i
++
)
{
le
t
componentInstance
=
items
[
i
].
componentInstance
cons
t
componentInstance
=
items
[
i
].
componentInstance
if
(
componentInstance
&&
componentInstance
.
itemId
===
this
.
currentItemId
)
{
current
=
i
break
...
...
@@ -612,7 +612,7 @@ export default {
})
}
for
(
let
index
=
0
,
length
=
swiperItems
.
length
;
index
<
length
;
index
++
)
{
le
t
currentSync
=
this
.
currentSync
cons
t
currentSync
=
this
.
currentSync
slidesDots
.
push
(
createElement
(
'
div
'
,
{
on
:
{
click
:
()
=>
{
...
...
@@ -624,7 +624,7 @@ export default {
'
uni-swiper-dot-active
'
:
(
index
<
currentSync
+
this
.
displayMultipleItemsNumber
&&
index
>=
currentSync
)
||
(
index
<
currentSync
+
this
.
displayMultipleItemsNumber
-
length
)
},
style
:
{
'
background
'
:
index
===
currentSync
?
this
.
indicatorActiveColor
:
this
.
indicatorColor
background
:
index
===
currentSync
?
this
.
indicatorActiveColor
:
this
.
indicatorColor
}
}))
}
...
...
@@ -632,7 +632,7 @@ export default {
var
slidesWrapperChild
=
[
createElement
(
'
div
'
,
{
ref
:
'
slides
'
,
style
:
this
.
slidesStyle
,
'
class
'
:
'
uni-swiper-slides
'
class
:
'
uni-swiper-slides
'
},
[
createElement
(
'
div
'
,
{
ref
:
'
slideFrame
'
,
...
...
@@ -643,7 +643,7 @@ export default {
if
(
this
.
indicatorDots
)
{
slidesWrapperChild
.
push
(
createElement
(
'
div
'
,
{
ref
:
'
slidesDots
'
,
'
class
'
:
[
'
uni-swiper-dots
'
,
this
.
vertical
?
'
uni-swiper-dots-vertical
'
:
'
uni-swiper-dots-horizontal
'
]
class
:
[
'
uni-swiper-dots
'
,
this
.
vertical
?
'
uni-swiper-dots-vertical
'
:
'
uni-swiper-dots-horizontal
'
]
},
slidesDots
))
}
...
...
@@ -652,7 +652,7 @@ export default {
on
:
this
.
$listeners
},
[
createElement
(
'
div
'
,
{
ref
:
'
slidesWrapper
'
,
'
class
'
:
'
uni-swiper-wrapper
'
class
:
'
uni-swiper-wrapper
'
},
slidesWrapperChild
)]
)
}
...
...
src/core/view/components/switch/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,18 +2,21 @@
<uni-switch
:disabled=
"disabled"
v-on=
"$listeners"
@
click=
"_onClick"
>
@
click=
"_onClick"
>
<div
class=
"uni-switch-wrapper"
>
<div
v-show=
"type === 'switch'"
:class=
"[switchChecked ? 'uni-switch-input-checked' : '']"
:style=
"
{backgroundColor: switchChecked ? color : '#DFDFDF',borderColor:switchChecked ? color : '#DFDFDF'}"
class="uni-switch-input" />
class="uni-switch-input"
/>
<div
v-show=
"type === 'checkbox'"
:class=
"[switchChecked ? 'uni-checkbox-input-checked' : '']"
:style=
"
{color: color}"
class="uni-checkbox-input" />
class="uni-checkbox-input"
/>
</div>
</uni-switch>
</
template
>
...
...
@@ -92,10 +95,10 @@ export default {
this
.
switchChecked
=
false
},
_getFormData
()
{
le
t
data
=
{}
cons
t
data
=
{}
if
(
this
.
name
!==
''
)
{
data
[
'
value
'
]
=
this
.
switchChecked
data
[
'
key
'
]
=
this
.
name
data
.
value
=
this
.
switchChecked
data
.
key
=
this
.
name
}
return
data
}
...
...
src/core/view/components/text/index.vue
浏览文件 @
46d679a8
<
script
>
const
SPACE_UNICODE
=
{
'
ensp
'
:
'
\
u2002
'
,
'
emsp
'
:
'
\
u2003
'
,
'
nbsp
'
:
'
\
u00a0
'
ensp
:
'
\
u2002
'
,
emsp
:
'
\
u2003
'
,
nbsp
:
'
\
u00a0
'
}
export
default
{
...
...
src/core/view/components/textarea/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-textarea
@
change.stop
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<div
class=
"uni-textarea-wrapper"
>
<div
v-show=
"!(composition||valueSync.length)"
...
...
@@ -9,17 +10,26 @@
:style=
"placeholderStyle"
:class=
"placeholderClass"
class=
"uni-textarea-placeholder"
>
{{
placeholder
}}
</div>
>
{{
placeholder
}}
</div>
<div
ref=
"line"
class=
"uni-textarea-line"
>
</div>
class=
"uni-textarea-line"
>
</div>
<div
class=
"uni-textarea-compute"
>
<div
v-for=
"(item,index) in valueCompute"
:key=
"index"
>
{{
item
.
trim
()
?
item
:
'
.
'
}}
</div>
:key=
"index"
>
{{
item
.
trim
()
?
item
:
'
.
'
}}
</div>
<v-uni-resize-sensor
ref=
"sensor"
@
resize=
"_resize"
/>
@
resize=
"_resize"
/>
</div>
<textarea
ref=
"textarea"
...
...
src/core/view/components/view/index.vue
浏览文件 @
46d679a8
...
...
@@ -7,12 +7,13 @@
@
touchcancel=
"_hoverTouchCancel"
v-on=
"$listeners"
>
<slot/>
<slot
/>
</uni-view>
<uni-view
v-else
v-on=
"$listeners"
>
<slot/>
v-on=
"$listeners"
>
<slot
/>
</uni-view>
</
template
>
...
...
src/core/view/mixins/animation.js
浏览文件 @
46d679a8
...
...
@@ -25,7 +25,7 @@ function getStyle (action) {
const
option
=
action
.
option
const
transition
=
option
.
transition
const
style
=
{}
le
t
transform
=
[]
cons
t
transform
=
[]
animates
.
forEach
(
animate
=>
{
let
type
=
animate
.
type
let
args
=
[...
animate
.
args
]
...
...
src/core/view/mixins/scroller/Spring.js
浏览文件 @
46d679a8
...
...
@@ -21,9 +21,9 @@ Spring.prototype._solve = function (e, t) {
var
r
=
this
.
_k
var
o
=
n
*
n
-
4
*
i
*
r
if
(
o
===
0
)
{
le
t
a
=
-
n
/
(
2
*
i
)
le
t
s
=
e
le
t
l
=
t
/
(
a
*
e
)
cons
t
a
=
-
n
/
(
2
*
i
)
cons
t
s
=
e
cons
t
l
=
t
/
(
a
*
e
)
return
{
x
:
function
(
e
)
{
return
(
s
+
l
*
e
)
*
Math
.
pow
(
Math
.
E
,
a
*
e
)
...
...
@@ -35,10 +35,10 @@ Spring.prototype._solve = function (e, t) {
}
}
if
(
o
>
0
)
{
le
t
c
=
(
-
n
-
Math
.
sqrt
(
o
))
/
(
2
*
i
)
le
t
u
=
(
-
n
+
Math
.
sqrt
(
o
))
/
(
2
*
i
)
le
t
l
=
(
t
-
c
*
e
)
/
(
u
-
c
)
le
t
s
=
e
-
l
cons
t
c
=
(
-
n
-
Math
.
sqrt
(
o
))
/
(
2
*
i
)
cons
t
u
=
(
-
n
+
Math
.
sqrt
(
o
))
/
(
2
*
i
)
cons
t
l
=
(
t
-
c
*
e
)
/
(
u
-
c
)
cons
t
s
=
e
-
l
return
{
x
:
function
(
e
)
{
let
t
...
...
src/core/view/plugins/behaviors/form-field.js
浏览文件 @
46d679a8
...
...
@@ -91,14 +91,14 @@ export default {
Object
.
assign
(
vm
.
constructor
.
options
.
methods
,
emitter
.
methods
)
Object
.
assign
(
options
.
methods
,
emitter
.
methods
)
const
createdHooks
=
options
[
'
created
'
]
vm
.
constructor
.
options
[
'
created
'
]
=
options
[
'
created
'
]
=
const
createdHooks
=
options
.
created
vm
.
constructor
.
options
.
created
=
options
.
created
=
createdHooks
?
[].
concat
(
created
,
createdHooks
)
:
[
created
]
const
beforeDestroyHooks
=
options
[
'
beforeDestroy
'
]
vm
.
constructor
.
options
[
'
beforeDestroy
'
]
=
options
[
'
beforeDestroy
'
]
=
const
beforeDestroyHooks
=
options
.
beforeDestroy
vm
.
constructor
.
options
.
beforeDestroy
=
options
.
beforeDestroy
=
beforeDestroyHooks
?
[].
concat
(
beforeDestroy
,
beforeDestroyHooks
)
:
[
beforeDestroy
]
...
...
src/core/view/plugins/events.js
浏览文件 @
46d679a8
...
...
@@ -135,7 +135,7 @@ function touchstart (evt) {
startPageY
=
pageY
longPressTimer
=
setTimeout
(
function
()
{
le
t
customEvent
=
new
CustomEvent
(
'
longpress
'
,
{
cons
t
customEvent
=
new
CustomEvent
(
'
longpress
'
,
{
bubbles
:
true
,
cancelable
:
true
,
target
:
evt
.
target
,
...
...
src/platforms/app-plus-nvue/service/api/ui/request-component-info.js
浏览文件 @
46d679a8
...
...
@@ -13,14 +13,14 @@ function parseDataset (attr) {
}
function
findAttrs
(
ids
,
elm
,
result
)
{
le
t
nodes
=
elm
.
children
cons
t
nodes
=
elm
.
children
if
(
!
Array
.
isArray
(
nodes
))
{
return
false
}
for
(
let
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
le
t
node
=
nodes
[
i
]
cons
t
node
=
nodes
[
i
]
if
(
node
.
attr
)
{
le
t
index
=
ids
.
indexOf
(
node
.
attr
.
id
)
cons
t
index
=
ids
.
indexOf
(
node
.
attr
.
id
)
if
(
index
>=
0
)
{
result
[
index
]
=
{
id
:
ids
[
index
],
...
...
@@ -39,7 +39,7 @@ function findAttrs (ids, elm, result) {
}
function
getSelectors
(
queue
)
{
le
t
ids
=
[]
cons
t
ids
=
[]
for
(
let
i
=
0
;
i
<
queue
.
length
;
i
++
)
{
const
selector
=
queue
[
i
].
selector
if
(
selector
.
indexOf
(
'
#
'
)
===
0
)
{
...
...
@@ -68,7 +68,7 @@ export function requestComponentInfo (pageVm, queue, callback) {
// TODO 重构,逻辑不对,queue 里的每一项可能有单独的作用域查找(即 component)
const
dom
=
pageVm
.
_$weex
.
requireModule
(
'
dom
'
)
const
selectors
=
getSelectors
(
queue
)
le
t
outAttrs
=
new
Array
(
selectors
.
length
)
cons
t
outAttrs
=
new
Array
(
selectors
.
length
)
findAttrs
(
selectors
,
pageVm
.
$el
,
outAttrs
)
getComponentRectAll
(
dom
,
outAttrs
,
0
,
[],
(
result
)
=>
{
callback
(
result
)
...
...
src/platforms/app-plus-nvue/service/api/util.js
浏览文件 @
46d679a8
...
...
@@ -108,7 +108,7 @@ function normalizeCallback (method, callbacks) {
isFn
(
callback
)
&&
callback
(
ret
)
if
(
type
===
SUCCESS
||
type
===
FAIL
)
{
const
complete
=
callbacks
[
'
complete
'
]
const
complete
=
callbacks
.
complete
isFn
(
complete
)
&&
complete
(
ret
)
}
}
...
...
src/platforms/app-plus-nvue/services/api/sub-nvue.js
浏览文件 @
46d679a8
...
...
@@ -71,7 +71,7 @@ export function initSubNVue (nvue, plus, BroadcastChannel) {
const
maskColor
=
webview
.
__uniapp_mask
le
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
cons
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
setStyle
({
mask
})
{
nvue
.
requireModule
(
'
uni-tabview
'
).
setMask
({
color
:
mask
...
...
src/platforms/app-plus/page-factory.js
浏览文件 @
46d679a8
...
...
@@ -16,7 +16,7 @@ export function createPage (pagePath, pageId, pageQuery, pageInstance) {
if
(
!
pageFactory
[
pagePath
])
{
console
.
error
(
`
${
pagePath
}
not found`
)
}
le
t
startTime
=
Date
.
now
()
cons
t
startTime
=
Date
.
now
()
const
pageVm
=
new
(
getPageVueComponent
(
pagePath
))({
mpType
:
'
page
'
,
pageId
,
...
...
src/platforms/app-plus/runtime/api/sub-nvue.js
浏览文件 @
46d679a8
...
...
@@ -23,7 +23,7 @@ function wrapper (webview) {
return
}
const
maskColor
=
webview
.
__uniapp_mask
le
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
cons
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
setStyle
({
mask
})
{
...
...
src/platforms/app-plus/service/api/ad/rewarded-video-ad.js
浏览文件 @
46d679a8
...
...
@@ -51,6 +51,7 @@ class RewardedVideoAd {
})
this
.
_loadAd
()
}
load
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
_isLoad
)
{
...
...
@@ -62,6 +63,7 @@ class RewardedVideoAd {
this
.
_loadAd
()
})
}
show
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
_isLoad
)
{
...
...
@@ -72,16 +74,20 @@ class RewardedVideoAd {
}
})
}
getProvider
()
{
return
this
.
_rewardAd
.
getProvider
()
}
destroy
()
{
this
.
_rewardAd
.
destroy
()
}
_loadAd
()
{
this
.
_isLoad
=
false
this
.
_rewardAd
.
load
()
}
_dispatchEvent
(
name
,
data
)
{
this
.
_callbacks
[
name
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
...
...
src/platforms/app-plus/service/api/context/audio.js
浏览文件 @
46d679a8
...
...
@@ -6,7 +6,7 @@ import {
publish
}
from
'
../../bridge
'
le
t
audios
=
{}
cons
t
audios
=
{}
const
evts
=
[
'
play
'
,
'
canplay
'
,
'
ended
'
,
'
stop
'
,
'
waiting
'
,
'
seeking
'
,
'
seeked
'
,
'
pause
'
]
...
...
@@ -82,7 +82,7 @@ export function setAudioState ({
})
{
const
audio
=
audios
[
audioId
]
if
(
audio
)
{
le
t
style
=
{
cons
t
style
=
{
loop
,
autoplay
}
...
...
@@ -112,7 +112,7 @@ export function getAudioState ({
errMsg
:
'
getAudioState:fail
'
}
}
le
t
{
cons
t
{
src
,
startTime
,
volume
...
...
src/platforms/app-plus/service/api/context/background-audio.js
浏览文件 @
46d679a8
...
...
@@ -115,12 +115,12 @@ export function getMusicPlayerState () {
currentPosition
:
audio
.
getPosition
(),
status
:
audio
.
isPaused
()
?
0
:
1
,
downloadPercent
:
Math
.
round
(
100
*
audio
.
getBuffered
()
/
audio
.
getDuration
()),
errMsg
:
`getMusicPlayerState:ok`
errMsg
:
'
getMusicPlayerState:ok
'
}
}
return
{
status
:
2
,
errMsg
:
`getMusicPlayerState:ok`
errMsg
:
'
getMusicPlayerState:ok
'
}
}
export
function
operateMusicPlayer
({
...
...
@@ -153,7 +153,7 @@ export function operateMusicPlayer ({
export
function
setBackgroundAudioState
(
args
)
{
setMusicState
(
args
)
return
{
errMsg
:
`setBackgroundAudioState:ok`
errMsg
:
'
setBackgroundAudioState:ok
'
}
}
export
function
operateBackgroundAudio
({
...
...
@@ -182,11 +182,11 @@ export function getBackgroundAudioState () {
coverImgUrl
:
''
,
webUrl
:
''
,
startTime
:
0
,
errMsg
:
`getBackgroundAudioState:ok`
errMsg
:
'
getBackgroundAudioState:ok
'
}
const
audio
=
getAudio
()
if
(
audio
)
{
le
t
newData
=
{
cons
t
newData
=
{
duration
:
audio
.
getDuration
()
||
0
,
currentTime
:
audio
.
isStopped
?
0
:
audio
.
getPosition
(),
paused
:
audio
.
isPaused
(),
...
...
src/platforms/app-plus/service/api/device/scan-code-webview.js
浏览文件 @
46d679a8
...
...
@@ -27,12 +27,12 @@ export function scanCode ({
},
callbackId
)
{
const
barcode
=
plus
.
barcode
const
SCAN_TYPES
=
{
'
qrCode
'
:
[
qrCode
:
[
barcode
.
QR
,
barcode
.
AZTEC
,
barcode
.
MAXICODE
],
'
barCode
'
:
[
barCode
:
[
barcode
.
EAN13
,
barcode
.
EAN8
,
barcode
.
UPCA
,
...
...
@@ -45,8 +45,8 @@ export function scanCode ({
barcode
.
RSS14
,
barcode
.
RSSEXPANDED
],
'
datamatrix
'
:
[
barcode
.
DATAMATRIX
],
'
pdf417
'
:
[
barcode
.
PDF417
]
datamatrix
:
[
barcode
.
DATAMATRIX
],
pdf417
:
[
barcode
.
PDF417
]
}
const
SCAN_MAPS
=
{
...
...
@@ -82,8 +82,8 @@ export function scanCode ({
})
}
if
(
!
filters
.
length
)
{
filters
=
filters
.
concat
(
SCAN_TYPES
[
'
qrCode
'
]).
concat
(
SCAN_TYPES
[
'
barCode
'
]).
concat
(
SCAN_TYPES
[
'
datamatrix
'
]
).
concat
(
SCAN_TYPES
[
'
pdf417
'
]
)
filters
=
filters
.
concat
(
SCAN_TYPES
.
qrCode
).
concat
(
SCAN_TYPES
.
barCode
).
concat
(
SCAN_TYPES
.
datamatrix
).
concat
(
SCAN_TYPES
.
pdf417
)
}
const
buttons
=
[]
...
...
src/platforms/app-plus/service/api/device/soter-authentication.js
浏览文件 @
46d679a8
...
...
@@ -17,7 +17,7 @@ function checkIsSupportFingerPrint () {
}
export
function
checkIsSupportSoterAuthentication
()
{
le
t
supportMode
=
[]
cons
t
supportMode
=
[]
if
(
checkIsSupportFingerPrint
())
{
supportMode
.
push
(
'
fingerPrint
'
)
}
...
...
@@ -96,7 +96,7 @@ export function startSoterAuthentication ({
errMsg
:
'
startSoterAuthentication:fail
'
}
}
le
t
supportRequestAuthMode
=
[]
cons
t
supportRequestAuthMode
=
[]
requestAuthModes
.
map
((
item
,
index
)
=>
{
if
(
supportMode
.
indexOf
(
item
)
>
-
1
)
{
supportRequestAuthMode
.
push
(
item
)
...
...
@@ -109,7 +109,7 @@ export function startSoterAuthentication ({
errMsg
:
'
startSoterAuthentication:fail no corresponding mode
'
}
}
le
t
enrolledRequestAuthMode
=
[]
cons
t
enrolledRequestAuthMode
=
[]
supportRequestAuthMode
.
map
((
item
,
index
)
=>
{
const
checked
=
checkIsSoterEnrolledInDevice
({
checkAuthMode
:
item
...
...
src/platforms/app-plus/service/api/location/choose-location-webview.js
浏览文件 @
46d679a8
...
...
@@ -62,7 +62,7 @@ export function chooseLocation (params, callbackId) {
})
}
let
index
=
0
le
t
onShow
=
function
()
{
cons
t
onShow
=
function
()
{
index
++
if
(
index
===
2
)
{
webview
.
evalJS
(
`__chooseLocation__(
${
JSON
.
stringify
(
params
)}
)`
)
...
...
src/platforms/app-plus/service/api/media/choose-video.js
浏览文件 @
46d679a8
...
...
@@ -7,7 +7,7 @@ import {
}
from
'
../../bridge
'
const
invokeChooseVideo
=
function
(
callbackId
,
type
,
tempFilePath
=
''
)
{
le
t
callbackResult
=
{
cons
t
callbackResult
=
{
errMsg
:
`chooseVideo:
${
type
}
`
,
tempFilePath
:
tempFilePath
,
duration
:
0
,
...
...
@@ -62,7 +62,7 @@ export function chooseVideo ({
camera
=
'
back
'
}
=
{},
callbackId
)
{
let
fallback
=
true
le
t
cameraIndex
=
(
camera
===
'
front
'
)
?
2
:
1
cons
t
cameraIndex
=
(
camera
===
'
front
'
)
?
2
:
1
if
(
sourceType
.
length
===
1
)
{
if
(
sourceType
[
0
]
===
'
album
'
)
{
fallback
=
false
...
...
src/platforms/app-plus/service/api/media/compress-image.js
浏览文件 @
46d679a8
...
...
@@ -17,12 +17,12 @@ export function compressImage ({
quality
},
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
`compressImage:ok`
,
errMsg
:
'
compressImage:ok
'
,
tempFilePath
:
dst
})
},
()
=>
{
invoke
(
callbackId
,
{
errMsg
:
`compressImage:fail`
errMsg
:
'
compressImage:fail
'
})
})
}
src/platforms/app-plus/service/api/media/preview-image.js
浏览文件 @
46d679a8
...
...
@@ -33,7 +33,7 @@ export function previewImagePlus ({
let
itemList
=
[]
let
itemColor
=
''
let
title
=
''
le
t
hasLongPressActions
=
longPressActions
&&
longPressActions
.
callbackId
cons
t
hasLongPressActions
=
longPressActions
&&
longPressActions
.
callbackId
if
(
!
hasLongPressActions
)
{
itemList
=
[
'
保存相册
'
]
itemColor
=
'
#000000
'
...
...
src/platforms/app-plus/service/api/network/download-file.js
浏览文件 @
46d679a8
import
{
hasOwn
}
from
'
uni-shared
'
import
{
TEMP_PATH
}
from
'
../constants
'
...
...
@@ -40,7 +44,7 @@ const createDownloadTaskById = function (downloadTaskId, {
}
})
for
(
const
name
in
header
)
{
if
(
h
eader
.
hasOwnProperty
(
name
))
{
if
(
h
asOwn
(
header
,
name
))
{
downloader
.
setRequestHeader
(
name
,
header
[
name
])
}
}
...
...
@@ -87,4 +91,4 @@ export function operateDownloadTask ({
export
function
createDownloadTask
(
args
)
{
return
createDownloadTaskById
(
++
downloadTaskId
,
args
)
}
}
src/platforms/app-plus/service/api/network/request.js
浏览文件 @
46d679a8
import
{
publish
,
requireNativePlugin
,
base64ToArrayBuffer
}
from
'
../../bridge
'
let
requestTaskId
=
0
const
requestTasks
=
{}
const
publishStateChange
=
res
=>
{
publish
(
'
onRequestTaskStateChange
'
,
res
)
delete
requestTasks
[
requestTaskId
]
}
export
function
createRequestTaskById
(
requestTaskId
,
{
url
,
data
,
header
,
method
=
'
GET
'
,
responseType
,
sslVerify
=
true
}
=
{})
{
const
stream
=
requireNativePlugin
(
'
stream
'
)
const
headers
=
{}
let
abortTimeout
let
aborted
let
hasContentType
=
false
for
(
const
name
in
header
)
{
if
(
!
hasContentType
&&
name
.
toLowerCase
()
===
'
content-type
'
)
{
hasContentType
=
true
headers
[
'
Content-Type
'
]
=
header
[
name
]
// TODO 需要重构
if
(
method
!==
'
GET
'
&&
header
[
name
].
indexOf
(
'
application/x-www-form-urlencoded
'
)
===
0
&&
typeof
data
!==
'
string
'
&&
!
(
data
instanceof
ArrayBuffer
))
{
let
bodyArray
=
[]
for
(
let
key
in
data
)
{
if
(
data
.
hasOwnProperty
(
key
))
{
bodyArray
.
push
(
encodeURIComponent
(
key
)
+
'
=
'
+
encodeURIComponent
(
data
[
key
]))
}
}
data
=
bodyArray
.
join
(
'
&
'
)
}
}
else
{
headers
[
name
]
=
header
[
name
]
}
}
if
(
!
hasContentType
&&
method
===
'
POST
'
)
{
headers
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded; charset=UTF-8
'
}
const
timeout
=
__uniConfig
.
networkTimeout
.
request
if
(
timeout
)
{
abortTimeout
=
setTimeout
(()
=>
{
aborted
=
true
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
:
0
,
errMsg
:
'
timeout
'
})
},
(
timeout
+
200
))
// TODO +200 发消息到原生层有时间开销,以后考虑由原生层回调超时
}
const
options
=
{
method
,
url
:
url
.
trim
(),
// weex 官方文档有误,headers 类型实际 object,用 string 类型会无响应
headers
,
type
:
responseType
===
'
arraybuffer
'
?
'
base64
'
:
'
text
'
,
// weex 官方文档未说明实际支持 timeout,单位:ms
timeout
:
timeout
||
6
e5
,
// 配置和weex模块内相反
sslVerify
:
!
sslVerify
}
if
(
method
!==
'
GET
'
)
{
options
.
body
=
data
}
try
{
stream
.
fetch
(
options
,
({
ok
,
status
,
data
,
headers
})
=>
{
if
(
aborted
)
{
return
}
if
(
abortTimeout
)
{
clearTimeout
(
abortTimeout
)
}
const
statusCode
=
status
if
(
statusCode
>
0
)
{
publishStateChange
({
requestTaskId
,
state
:
'
success
'
,
data
:
ok
&&
responseType
===
'
arraybuffer
'
?
base64ToArrayBuffer
(
data
)
:
data
,
statusCode
,
header
:
headers
})
}
else
{
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
,
errMsg
:
'
abort statusCode:
'
+
statusCode
})
}
})
requestTasks
[
requestTaskId
]
=
{
abort
()
{
aborted
=
true
if
(
abortTimeout
)
{
clearTimeout
(
abortTimeout
)
}
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
:
0
,
errMsg
:
'
abort
'
})
}
}
}
catch
(
e
)
{
return
{
requestTaskId
,
errMsg
:
'
createRequestTask:fail
'
}
}
return
{
requestTaskId
,
errMsg
:
'
createRequestTask:ok
'
}
}
export
function
createRequestTask
(
args
)
{
return
createRequestTaskById
(
++
requestTaskId
,
args
)
}
export
function
operateRequestTask
({
requestTaskId
,
operationType
}
=
{})
{
const
requestTask
=
requestTasks
[
requestTaskId
]
if
(
requestTask
&&
operationType
===
'
abort
'
)
{
requestTask
.
abort
()
return
{
errMsg
:
'
operateRequestTask:ok
'
}
}
return
{
errMsg
:
'
operateRequestTask:fail
'
}
import
{
hasOwn
}
from
'
uni-shared
'
import
{
publish
,
requireNativePlugin
,
base64ToArrayBuffer
}
from
'
../../bridge
'
let
requestTaskId
=
0
const
requestTasks
=
{}
const
publishStateChange
=
res
=>
{
publish
(
'
onRequestTaskStateChange
'
,
res
)
delete
requestTasks
[
requestTaskId
]
}
export
function
createRequestTaskById
(
requestTaskId
,
{
url
,
data
,
header
,
method
=
'
GET
'
,
responseType
,
sslVerify
=
true
}
=
{})
{
const
stream
=
requireNativePlugin
(
'
stream
'
)
const
headers
=
{}
let
abortTimeout
let
aborted
let
hasContentType
=
false
for
(
const
name
in
header
)
{
if
(
!
hasContentType
&&
name
.
toLowerCase
()
===
'
content-type
'
)
{
hasContentType
=
true
headers
[
'
Content-Type
'
]
=
header
[
name
]
// TODO 需要重构
if
(
method
!==
'
GET
'
&&
header
[
name
].
indexOf
(
'
application/x-www-form-urlencoded
'
)
===
0
&&
typeof
data
!==
'
string
'
&&
!
(
data
instanceof
ArrayBuffer
))
{
const
bodyArray
=
[]
for
(
const
key
in
data
)
{
if
(
hasOwn
(
data
,
key
))
{
bodyArray
.
push
(
encodeURIComponent
(
key
)
+
'
=
'
+
encodeURIComponent
(
data
[
key
]))
}
}
data
=
bodyArray
.
join
(
'
&
'
)
}
}
else
{
headers
[
name
]
=
header
[
name
]
}
}
if
(
!
hasContentType
&&
method
===
'
POST
'
)
{
headers
[
'
Content-Type
'
]
=
'
application/x-www-form-urlencoded; charset=UTF-8
'
}
const
timeout
=
__uniConfig
.
networkTimeout
.
request
if
(
timeout
)
{
abortTimeout
=
setTimeout
(()
=>
{
aborted
=
true
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
:
0
,
errMsg
:
'
timeout
'
})
},
(
timeout
+
200
))
// TODO +200 发消息到原生层有时间开销,以后考虑由原生层回调超时
}
const
options
=
{
method
,
url
:
url
.
trim
(),
// weex 官方文档有误,headers 类型实际 object,用 string 类型会无响应
headers
,
type
:
responseType
===
'
arraybuffer
'
?
'
base64
'
:
'
text
'
,
// weex 官方文档未说明实际支持 timeout,单位:ms
timeout
:
timeout
||
6
e5
,
// 配置和weex模块内相反
sslVerify
:
!
sslVerify
}
if
(
method
!==
'
GET
'
)
{
options
.
body
=
data
}
try
{
stream
.
fetch
(
options
,
({
ok
,
status
,
data
,
headers
})
=>
{
if
(
aborted
)
{
return
}
if
(
abortTimeout
)
{
clearTimeout
(
abortTimeout
)
}
const
statusCode
=
status
if
(
statusCode
>
0
)
{
publishStateChange
({
requestTaskId
,
state
:
'
success
'
,
data
:
ok
&&
responseType
===
'
arraybuffer
'
?
base64ToArrayBuffer
(
data
)
:
data
,
statusCode
,
header
:
headers
})
}
else
{
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
,
errMsg
:
'
abort statusCode:
'
+
statusCode
})
}
})
requestTasks
[
requestTaskId
]
=
{
abort
()
{
aborted
=
true
if
(
abortTimeout
)
{
clearTimeout
(
abortTimeout
)
}
publishStateChange
({
requestTaskId
,
state
:
'
fail
'
,
statusCode
:
0
,
errMsg
:
'
abort
'
})
}
}
}
catch
(
e
)
{
return
{
requestTaskId
,
errMsg
:
'
createRequestTask:fail
'
}
}
return
{
requestTaskId
,
errMsg
:
'
createRequestTask:ok
'
}
}
export
function
createRequestTask
(
args
)
{
return
createRequestTaskById
(
++
requestTaskId
,
args
)
}
export
function
operateRequestTask
({
requestTaskId
,
operationType
}
=
{})
{
const
requestTask
=
requestTasks
[
requestTaskId
]
if
(
requestTask
&&
operationType
===
'
abort
'
)
{
requestTask
.
abort
()
return
{
errMsg
:
'
operateRequestTask:ok
'
}
}
return
{
errMsg
:
'
operateRequestTask:fail
'
}
}
src/platforms/app-plus/service/api/network/upload-file.js
浏览文件 @
46d679a8
import
{
hasOwn
}
from
'
uni-shared
'
import
{
getRealPath
}
from
'
../util
'
...
...
@@ -46,12 +50,12 @@ const createUploadTaskById = function (uploadTaskId, {
})
for
(
const
name
in
header
)
{
if
(
h
eader
.
hasOwnProperty
(
name
))
{
if
(
h
asOwn
(
header
,
name
))
{
uploader
.
setRequestHeader
(
name
,
header
[
name
])
}
}
for
(
const
name
in
formData
)
{
if
(
formData
.
hasOwnProperty
(
name
))
{
if
(
hasOwn
(
formData
,
name
))
{
uploader
.
addData
(
name
,
String
(
formData
[
name
]))
}
}
...
...
@@ -109,4 +113,4 @@ export function operateUploadTask ({
export
function
createUploadTask
(
args
)
{
return
createUploadTaskById
(
++
uploadTaskId
,
args
)
}
}
src/platforms/app-plus/service/api/page.js
浏览文件 @
46d679a8
...
...
@@ -46,7 +46,8 @@ function addEventListener (pageId, callback) {
class
Page
{
constructor
(
webview
)
{
this
.
webview
=
webview
}
}
sendMessage
(
data
)
{
const
message
=
{
__message
:
{
...
...
@@ -60,7 +61,8 @@ class Page {
}
else
{
plus_
.
webview
.
postMessageToUniNView
(
message
,
id
)
}
}
}
close
()
{
this
.
webview
.
close
()
}
...
...
src/platforms/app-plus/service/api/plugin/share.js
浏览文件 @
46d679a8
...
...
@@ -12,27 +12,27 @@ import {
// 0:图文,1:纯文字,2:纯图片,3:音乐,4:视频,5:小程序
const
TYPES
=
{
'
0
'
:
{
0
:
{
name
:
'
web
'
,
title
:
'
图文
'
},
'
1
'
:
{
1
:
{
name
:
'
text
'
,
title
:
'
纯文字
'
},
'
2
'
:
{
2
:
{
name
:
'
image
'
,
title
:
'
纯图片
'
},
'
3
'
:
{
3
:
{
name
:
'
music
'
,
title
:
'
音乐
'
},
'
4
'
:
{
4
:
{
name
:
'
video
'
,
title
:
'
视频
'
},
'
5
'
:
{
5
:
{
name
:
'
miniProgram
'
,
title
:
'
小程序
'
}
...
...
@@ -59,7 +59,7 @@ const parseParams = (args, callbackId, method) => {
const
shareType
=
TYPES
[
type
+
''
]
if
(
shareType
)
{
le
t
sendMsg
=
{
cons
t
sendMsg
=
{
provider
,
type
:
shareType
.
name
,
title
,
...
...
@@ -215,7 +215,7 @@ export function shareWithSystem (params, callbackId, method = 'shareWithSystem')
}
plus
.
share
.
sendWithSystem
({
type
,
pictures
:
imageUrl
?
[
imageUrl
]
:
void
0
,
pictures
:
imageUrl
&&
[
imageUrl
]
,
content
,
href
},
function
(
res
)
{
...
...
src/platforms/app-plus/service/api/plugin/sub-nvue.js
浏览文件 @
46d679a8
...
...
@@ -23,7 +23,7 @@ function wrapper (webview) {
return
}
const
maskColor
=
webview
.
__uniapp_mask
le
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
cons
t
maskWebview
=
webview
.
__uniapp_mask_id
===
'
0
'
?
{
setStyle
({
mask
})
{
...
...
@@ -66,7 +66,7 @@ export function getSubNVueById (id) {
if
(
webview
&&
!
webview
.
$processed
)
{
wrapper
(
webview
)
}
le
t
oldSetStyle
=
webview
.
setStyle
cons
t
oldSetStyle
=
webview
.
setStyle
var
parentWebview
=
plus
.
webview
.
getWebviewById
(
webview
.
__uniapp_mask_id
)
webview
.
setStyle
=
function
(
style
)
{
if
(
style
&&
style
.
mask
)
{
...
...
src/platforms/app-plus/service/api/ui/popup.js
浏览文件 @
46d679a8
...
...
@@ -37,7 +37,7 @@ export function showToast ({
waiting
.
close
()
}
if
(
~
[
'
top
'
,
'
center
'
,
'
bottom
'
].
indexOf
(
position
))
{
le
t
richText
=
`<span>
${
title
}
</span>`
cons
t
richText
=
`<span>
${
title
}
</span>`
plus
.
nativeUI
.
toast
(
richText
,
{
verticalAlign
:
position
,
type
:
'
richtext
'
...
...
src/platforms/app-plus/service/api/util.js
浏览文件 @
46d679a8
...
...
@@ -27,18 +27,18 @@ const getRealRoute = (e, t) => {
if
(
t
.
indexOf
(
'
./
'
)
===
0
)
return
getRealRoute
(
e
,
t
.
substr
(
2
),
!
1
)
let
n
let
i
le
t
o
=
t
.
split
(
'
/
'
)
cons
t
o
=
t
.
split
(
'
/
'
)
for
(
n
=
0
,
i
=
o
.
length
;
n
<
i
&&
o
[
n
]
===
'
..
'
;
n
++
);
o
.
splice
(
0
,
n
)
t
=
o
.
join
(
'
/
'
)
le
t
r
=
e
.
length
>
0
?
e
.
split
(
'
/
'
)
:
[]
cons
t
r
=
e
.
length
>
0
?
e
.
split
(
'
/
'
)
:
[]
r
.
splice
(
r
.
length
-
n
-
1
,
n
+
1
)
return
r
.
concat
(
o
).
join
(
'
/
'
)
}
// 处理 Android 平台解压与非解压模式下获取的路径不一致的情况
const
_handleLocalPath
=
filePath
=>
{
le
t
localUrl
=
plus
.
io
.
convertLocalFileSystemURL
(
filePath
)
cons
t
localUrl
=
plus
.
io
.
convertLocalFileSystemURL
(
filePath
)
return
localUrl
.
replace
(
/^
\/?
apps
\/
/
,
'
/android_asset/apps/
'
).
replace
(
/
\/
$/
,
''
)
}
...
...
src/platforms/app-plus/service/bridge.js
浏览文件 @
46d679a8
...
...
@@ -47,7 +47,7 @@ export function setStatusBarStyle (statusBarStyle) {
return
}
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] setStatusBarStyle`
,
statusBarStyle
)
console
.
log
(
'
[uni-app] setStatusBarStyle
'
,
statusBarStyle
)
}
lastStatusBarStyle
=
statusBarStyle
...
...
src/platforms/app-plus/service/framework/app.js
浏览文件 @
46d679a8
...
...
@@ -200,7 +200,7 @@ function initEntryPage () {
export
function
registerApp
(
appVm
)
{
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] registerApp`
)
console
.
log
(
'
[uni-app] registerApp
'
)
}
appCtx
=
appVm
...
...
src/platforms/app-plus/service/framework/config.js
浏览文件 @
46d679a8
...
...
@@ -33,6 +33,6 @@ export function registerConfig (config, Vue) {
parseRoutes
(
__uniConfig
)
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] registerConfig`
,
__uniConfig
)
console
.
log
(
'
[uni-app] registerConfig
'
,
__uniConfig
)
}
}
src/platforms/app-plus/service/framework/page.js
浏览文件 @
46d679a8
...
...
@@ -93,7 +93,7 @@ export function registerPage ({
this
.
$vm
.
$destroy
()
}
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] removePage`
,
path
,
webview
.
id
)
console
.
log
(
'
[uni-app] removePage
'
,
path
,
webview
.
id
)
}
}
},
...
...
src/platforms/app-plus/service/framework/tab-bar.js
浏览文件 @
46d679a8
...
...
@@ -92,7 +92,7 @@ function showTabBar (animation) {
})
}
le
t
maskClickCallback
=
[]
cons
t
maskClickCallback
=
[]
export
default
{
id
:
'
0
'
,
...
...
@@ -179,7 +179,7 @@ export default {
maskClickCallback
.
push
(
callback
)
},
removeEventListener
(
name
,
callback
)
{
le
t
callbackIndex
=
maskClickCallback
.
indexOf
(
callback
)
cons
t
callbackIndex
=
maskClickCallback
.
indexOf
(
callback
)
maskClickCallback
.
splice
(
callbackIndex
,
1
)
}
}
src/platforms/app-plus/service/framework/webview/index.js
浏览文件 @
46d679a8
...
...
@@ -35,10 +35,10 @@ export let preloadWebview
let
id
=
2
const
WEBVIEW_LISTENERS
=
{
'
pullToRefresh
'
:
'
onPullDownRefresh
'
,
'
titleNViewSearchInputChanged
'
:
'
onNavigationBarSearchInputChanged
'
,
'
titleNViewSearchInputConfirmed
'
:
'
onNavigationBarSearchInputConfirmed
'
,
'
titleNViewSearchInputClicked
'
:
'
onNavigationBarSearchInputClicked
'
pullToRefresh
:
'
onPullDownRefresh
'
,
titleNViewSearchInputChanged
:
'
onNavigationBarSearchInputChanged
'
,
titleNViewSearchInputConfirmed
:
'
onNavigationBarSearchInputConfirmed
'
,
titleNViewSearchInputClicked
:
'
onNavigationBarSearchInputClicked
'
}
export
function
setPreloadWebview
(
webview
)
{
...
...
@@ -78,7 +78,7 @@ export function createWebview (path, routeOptions, query) {
)
webviewStyle
.
uniPageUrl
=
getUniPageUrl
(
path
,
query
)
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] createWebview`
,
webviewId
,
path
,
webviewStyle
)
console
.
log
(
'
[uni-app] createWebview
'
,
webviewId
,
path
,
webviewStyle
)
}
return
plus
.
webview
.
create
(
''
,
String
(
webviewId
),
webviewStyle
,
{
nvue
:
true
...
...
@@ -106,7 +106,7 @@ export function initWebview (webview, routeOptions, path, query) {
webviewStyle
.
debugRefresh
=
getDebugRefresh
(
path
,
query
,
routeOptions
)
}
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`[uni-app] updateWebview`
,
webviewStyle
)
console
.
log
(
'
[uni-app] updateWebview
'
,
webviewStyle
)
}
webview
.
setStyle
(
webviewStyle
)
...
...
src/platforms/app-plus/service/framework/webview/parser/title-nview-parser.js
浏览文件 @
46d679a8
...
...
@@ -49,9 +49,9 @@ export function parseTitleNView (routeOptions) {
const
titleImage
=
windowOptions
.
titleImage
||
''
const
transparentTitle
=
windowOptions
.
transparentTitle
||
'
none
'
const
titleNViewTypeList
=
{
'
none
'
:
'
default
'
,
'
auto
'
:
'
transparent
'
,
'
always
'
:
'
float
'
none
:
'
default
'
,
auto
:
'
transparent
'
,
always
:
'
float
'
}
const
ret
=
{
...
...
@@ -61,13 +61,13 @@ export function parseTitleNView (routeOptions) {
type
:
titleNViewTypeList
[
transparentTitle
],
backgroundColor
:
windowOptions
.
navigationBarBackgroundColor
||
'
#f8f8f8
'
,
tags
:
titleImage
===
''
?
[]
:
[{
'
tag
'
:
'
img
'
,
'
src
'
:
titleImage
,
'
position
'
:
{
'
left
'
:
'
auto
'
,
'
top
'
:
'
auto
'
,
'
width
'
:
'
auto
'
,
'
height
'
:
'
26px
'
tag
:
'
img
'
,
src
:
titleImage
,
position
:
{
left
:
'
auto
'
,
top
:
'
auto
'
,
width
:
'
auto
'
,
height
:
'
26px
'
}
}]
}
...
...
src/platforms/app-plus/service/on-web-invoke-app-service.js
浏览文件 @
46d679a8
...
...
@@ -5,7 +5,7 @@ function onMessage (pageId, arg) {
return
}
if
(
!
page
.
$page
.
meta
.
isNVue
)
{
const
target
=
page
.
$vm
.
_$vd
.
elements
.
find
(
target
=>
target
.
type
===
'
web-view
'
&&
target
.
events
[
'
message
'
]
)
const
target
=
page
.
$vm
.
_$vd
.
elements
.
find
(
target
=>
target
.
type
===
'
web-view
'
&&
target
.
events
.
message
)
if
(
!
target
)
{
return
}
...
...
src/platforms/app-plus/view/components/ad/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-ad
v-bind=
"attrs"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<div
ref=
"container"
class=
"uni-ad-container"
/>
class=
"uni-ad-container"
/>
</uni-ad>
</
template
>
<
script
>
...
...
@@ -96,10 +98,10 @@ export default {
}
},
mounted
()
{
le
t
adStyle
=
Object
.
assign
({
cons
t
adStyle
=
Object
.
assign
({
id
:
'
AdView
'
+
Date
.
now
()
},
this
.
position
)
le
t
adView
=
this
.
adView
=
plus
.
ad
.
createAdView
(
adStyle
)
cons
t
adView
=
this
.
adView
=
plus
.
ad
.
createAdView
(
adStyle
)
adView
.
interceptTouchEvent
(
false
)
plus
.
webview
.
currentWebview
().
append
(
adView
)
if
(
this
.
hidden
)
{
...
...
src/platforms/app-plus/view/components/cover-image/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,10 +2,12 @@
<uni-cover-image
:src=
"src"
:style=
"imageInfo"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<div
ref=
"container"
class=
"uni-cover-image"
/>
class=
"uni-cover-image"
/>
</uni-cover-image>
</
template
>
<
script
>
...
...
src/platforms/app-plus/view/components/map/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,14 +2,16 @@
<uni-map
v-on=
"$listeners"
>
<div
ref=
"container"
class=
"uni-map-container"
/>
class=
"uni-map-container"
/>
<v-uni-cover-image
v-for=
"(control, index) in mapControls"
:key=
"index"
:src=
"control.iconPath"
:style=
"control.position"
auto-size
@
click=
"controlclick(control)"
/>
@
click=
"controlclick(control)"
/>
<div
class=
"uni-map-slot"
>
<slot
/>
</div>
...
...
@@ -144,7 +146,7 @@ export default {
},
mapControls
()
{
const
list
=
this
.
controls
.
map
((
control
)
=>
{
le
t
position
=
{
position
:
'
absolute
'
};
cons
t
position
=
{
position
:
'
absolute
'
};
[
'
top
'
,
'
left
'
,
'
width
'
,
'
height
'
].
forEach
(
key
=>
{
if
(
control
.
position
[
key
])
{
position
[
key
]
=
control
.
position
[
key
]
+
'
px
'
...
...
@@ -187,7 +189,7 @@ export default {
}
},
mounted
()
{
le
t
mapStyle
=
Object
.
assign
({},
this
.
attrs
,
this
.
position
)
cons
t
mapStyle
=
Object
.
assign
({},
this
.
attrs
,
this
.
position
)
if
(
this
.
latitude
&&
this
.
longitude
)
{
mapStyle
.
center
=
new
plus
.
maps
.
Point
(
this
.
longitude
,
this
.
latitude
)
}
...
...
src/platforms/app-plus/view/components/picker/index.vue
浏览文件 @
46d679a8
<
template
>
<uni-picker
@
click.stop=
"_show"
v-on=
"$listeners"
>
v-on=
"$listeners"
>
<slot
/>
</uni-picker>
</
template
>
...
...
@@ -48,7 +49,7 @@ function getDefaultStartValue () {
return
'
00:00
'
}
if
(
this
.
mode
===
mode
.
DATE
)
{
le
t
year
=
new
Date
().
getFullYear
()
-
100
cons
t
year
=
new
Date
().
getFullYear
()
-
100
switch
(
this
.
fields
)
{
case
fields
.
YEAR
:
return
year
...
...
@@ -66,7 +67,7 @@ function getDefaultEndValue () {
return
'
23:59
'
}
if
(
this
.
mode
===
mode
.
DATE
)
{
le
t
year
=
new
Date
().
getFullYear
()
+
100
cons
t
year
=
new
Date
().
getFullYear
()
+
100
switch
(
this
.
fields
)
{
case
fields
.
YEAR
:
return
year
...
...
@@ -162,17 +163,19 @@ export default {
let
val
=
this
.
value
switch
(
this
.
mode
)
{
case
mode
.
MULTISELECTOR
:
if
(
!
Array
.
isArray
(
val
))
{
val
=
[]
}
if
(
!
Array
.
isArray
(
this
.
valueSync
))
{
this
.
valueSync
=
[]
}
const
length
=
this
.
valueSync
.
length
=
Math
.
max
(
val
.
length
,
this
.
range
.
length
)
for
(
let
index
=
0
;
index
<
length
;
index
++
)
{
const
val0
=
Number
(
val
[
index
])
const
val1
=
Number
(
this
.
valueSync
[
index
])
this
.
valueSync
.
splice
(
index
,
1
,
isNaN
(
val0
)
?
(
isNaN
(
val1
)
?
0
:
val1
)
:
val0
)
{
if
(
!
Array
.
isArray
(
val
))
{
val
=
[]
}
if
(
!
Array
.
isArray
(
this
.
valueSync
))
{
this
.
valueSync
=
[]
}
const
length
=
this
.
valueSync
.
length
=
Math
.
max
(
val
.
length
,
this
.
range
.
length
)
for
(
let
index
=
0
;
index
<
length
;
index
++
)
{
const
val0
=
Number
(
val
[
index
])
const
val1
=
Number
(
this
.
valueSync
[
index
])
this
.
valueSync
.
splice
(
index
,
1
,
isNaN
(
val0
)
?
(
isNaN
(
val1
)
?
0
:
val1
)
:
val0
)
}
}
break
case
mode
.
TIME
:
...
...
src/platforms/app-plus/view/components/picker/page.js
浏览文件 @
46d679a8
...
...
@@ -46,7 +46,8 @@ function addEventListener (pageId, callback) {
class
Page
{
constructor
(
webview
)
{
this
.
webview
=
webview
}
}
sendMessage
(
data
)
{
const
message
=
{
__message
:
{
...
...
@@ -60,7 +61,8 @@ class Page {
}
else
{
plus_
.
webview
.
postMessageToUniNView
(
message
,
id
)
}
}
}
close
()
{
this
.
webview
.
close
()
}
...
...
src/platforms/app-plus/view/components/video/index.vue
浏览文件 @
46d679a8
...
...
@@ -2,7 +2,8 @@
<uni-video
v-on=
"$listeners"
>
<div
ref=
"container"
class=
"uni-video-container"
/>
class=
"uni-video-container"
/>
<div
class=
"uni-video-slot"
>
<slot
/>
</div>
...
...
src/platforms/app-plus/view/components/web-view/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/app-plus/view/framework/config.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/app-plus/view/mixins/cover.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/app/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/app/popup/actionSheet.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/app/popup/modal.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/app/popup/toast.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/app/tabBar.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/async-error/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/page/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/page/pageHead.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/page/pageRefresh.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/page/transparent.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/system-routes/choose-location/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/system-routes/open-location/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/system-routes/preview-image/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/components/system-routes/system-header.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/helpers/file.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/context/audio.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/context/inner-audio.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/device/get-system-info.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/media/choose-image.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/media/choose-video.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/network/download-file.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/network/request.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/network/socket.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/network/upload-file.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/route/route.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/service/api/ui/navigation-bar.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/audio/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/cover-image/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/cover-view/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/map/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/picker/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/video/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/h5/view/components/web-view/index.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/mp-alipay/runtime/api/protocols.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/mp-alipay/runtime/wrapper/component-parser.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/mp-alipay/runtime/wrapper/page-parser.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/mp-baidu/runtime/wrapper/component-parser.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/platforms/quickapp-vue/view/components/button/button.vue
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
src/shared/util.js
浏览文件 @
46d679a8
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录