Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzj-java
uni-app
提交
a3243aa0
U
uni-app
项目概览
wzj-java
/
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,发现更多精彩内容 >>
提交
a3243aa0
编写于
11月 20, 2019
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: v3-app cover-image 组件支持事件:load、error
上级
daf93aca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
85 addition
and
17 deletion
+85
-17
src/core/view/mixins/keyboard.js
src/core/view/mixins/keyboard.js
+6
-11
src/platforms/app-plus/view/components/cover-image/index.vue
src/platforms/app-plus/view/components/cover-image/index.vue
+75
-4
src/platforms/app-plus/view/components/map/index.vue
src/platforms/app-plus/view/components/map/index.vue
+1
-0
src/shared/index.js
src/shared/index.js
+3
-2
未找到文件。
src/core/view/mixins/keyboard.js
浏览文件 @
a3243aa0
import
{
plusReady
}
from
'
uni-shared
'
function
hideKeyboard
()
{
document
.
activeElement
.
blur
()
}
...
...
@@ -34,15 +38,6 @@ export default {
this
.
onKeyboardHide
()
},
methods
:
{
plusReady
(
callback
)
{
if
(
!
callback
)
{
return
}
if
(
window
.
plus
)
{
return
callback
()
}
document
.
addEventListener
(
'
plusready
'
,
callback
)
},
initKeyboard
(
el
)
{
el
.
addEventListener
(
'
focus
'
,
()
=>
{
UniViewJSBridge
.
subscribe
(
'
hideKeyboard
'
,
hideKeyboard
)
...
...
@@ -52,12 +47,12 @@ export default {
el
.
addEventListener
(
'
blur
'
,
this
.
onKeyboardHide
)
},
showSoftKeybord
()
{
this
.
plusReady
(()
=>
{
plusReady
(()
=>
{
plus
.
key
.
showSoftKeybord
()
})
},
setSoftinputTemporary
()
{
this
.
plusReady
(()
=>
{
plusReady
(()
=>
{
var
currentWebview
=
plus
.
webview
.
currentWebview
()
var
style
=
currentWebview
.
getStyle
()
||
{}
if
(
style
.
softinputMode
===
'
adjustResize
'
)
{
...
...
src/platforms/app-plus/view/components/cover-image/index.vue
浏览文件 @
a3243aa0
<
template
>
<uni-cover-image
:src=
"src"
:style=
"imageInfo"
v-on=
"$listeners"
>
<div
ref=
"container"
...
...
@@ -10,6 +11,12 @@
<
script
>
import
native
from
'
../../mixins/native
'
import
cover
from
'
../../mixins/cover
'
import
{
plusReady
}
from
'
uni-shared
'
import
{
TEMP_PATH
}
from
'
../../../service/api/constants
'
export
default
{
name
:
'
CoverImage
'
,
...
...
@@ -18,16 +25,80 @@ export default {
src
:
{
type
:
String
,
default
:
''
},
autoSize
:
{
type
:
[
Boolean
,
String
],
default
:
false
}
},
data
()
{
return
{
coverType
:
'
image
'
coverType
:
'
image
'
,
coverContent
:
''
,
imageInfo
:
{}
}
},
computed
:
{
coverContent
()
{
return
this
.
$getRealPath
(
this
.
src
)
watch
:
{
src
()
{
this
.
loadImage
()
}
},
created
()
{
this
.
loadImage
()
},
beforeDestroy
()
{
const
downloaTask
=
this
.
downloaTask
if
(
downloaTask
&&
downloaTask
.
state
<
4
)
{
downloaTask
.
abort
()
}
},
methods
:
{
loadImage
()
{
this
.
coverContent
=
''
this
.
imageInfo
=
this
.
autoSize
?
{
width
:
0
,
height
:
0
}
:
{}
const
realPath
=
this
.
src
?
this
.
$getRealPath
(
this
.
src
)
:
''
if
(
realPath
.
indexOf
(
'
http://
'
)
===
0
||
realPath
.
indexOf
(
'
https://
'
)
===
0
)
{
plusReady
(()
=>
{
this
.
downloaTask
=
plus
.
downloader
.
createDownload
(
realPath
,
{
filename
:
TEMP_PATH
+
'
/download/
'
},
(
task
,
status
)
=>
{
if
(
status
===
200
)
{
this
.
getImageInfo
(
task
.
filename
)
}
else
{
this
.
$trigger
(
'
error
'
,
{},
{
errMsg
:
'
error
'
})
}
}).
start
()
})
}
else
if
(
realPath
)
{
this
.
getImageInfo
(
realPath
)
}
},
getImageInfo
(
src
)
{
this
.
coverContent
=
src
plusReady
(()
=>
{
plus
.
io
.
getImageInfo
({
src
,
success
:
({
width
,
height
})
=>
{
if
(
this
.
autoSize
)
{
this
.
imageInfo
=
{
width
:
`
${
width
}
px`
,
height
:
`
${
height
}
px`
}
if
(
this
.
_isMounted
)
{
this
.
_requestPositionUpdate
()
}
}
this
.
$trigger
(
'
load
'
,
{},
{
width
,
height
})
},
fail
:
()
=>
{
this
.
$trigger
(
'
error
'
,
{},
{
errMsg
:
'
error
'
})
}
})
})
}
}
}
...
...
src/platforms/app-plus/view/components/map/index.vue
浏览文件 @
a3243aa0
...
...
@@ -10,6 +10,7 @@
:key=
"index"
:src=
"control.iconPath"
:style=
"control.position"
auto-size
@
click=
"controlclick(control)"
/>
<div
class=
"uni-map-slot"
>
<slot
/>
...
...
src/shared/index.js
浏览文件 @
a3243aa0
export
*
from
'
./env
'
export
*
from
'
./util
'
export
*
from
'
./env
'
export
*
from
'
./util
'
export
*
from
'
./color
'
export
*
from
'
./query
'
export
*
from
'
./scroll
'
export
*
from
'
./platform
'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录