Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
hls-easy-ui
Commits
13ac9ef2
Commit
13ac9ef2
authored
Sep 29, 2019
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scroll与notify组件修改
parent
63a57615
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
80 deletions
+13
-80
Notify.vue
packages/components/Dialog/Notify.vue
+1
-1
index.vue
packages/components/HContent/index.vue
+4
-2
index.vue
packages/components/Scroll/index.vue
+8
-77
www.zip
www.zip
+0
-0
No files found.
packages/components/Dialog/Notify.vue
View file @
13ac9ef2
...
...
@@ -111,7 +111,7 @@ export default {
position: absolute;
left: 0;
text-align: center;
z-index:
5
;
z-index:
30
;
&-top {
top: 0;
...
...
packages/components/HContent/index.vue
View file @
13ac9ef2
...
...
@@ -87,7 +87,8 @@ export default {
do
{
if
(
$el
)
{
let
elHeight
=
window
.
getComputedStyle
(
$el
).
height
if
(
elHeight
)
{
let
part
=
/^
\d
+
(\.\d
+
)?
px$/
if
(
elHeight
&&
part
.
test
(
elHeight
))
{
headerHeight
+=
Number
(
elHeight
.
replace
(
'px'
,
''
))
}
if
(
$el
.
_prevClass
&&
$el
.
_prevClass
.
indexOf
(
'h-header'
)
===
0
)
{
...
...
@@ -112,7 +113,8 @@ export default {
do
{
if
(
nextElement
)
{
let
elHeight
=
window
.
getComputedStyle
(
nextElement
).
height
if
(
elHeight
)
{
let
part
=
/^
\d
+
(\.\d
+
)?
px$/
if
(
elHeight
&&
part
.
test
(
elHeight
))
{
nextHeight
+=
Number
(
elHeight
.
replace
(
'px'
,
''
))
}
if
(
nextElement
.
_prevClass
&&
nextElement
.
_prevClass
.
indexOf
(
'h-bottom-tab'
)
===
0
)
{
...
...
packages/components/Scroll/index.vue
View file @
13ac9ef2
...
...
@@ -5,18 +5,10 @@
*/
<
template
>
<div
ref=
"scroll"
:class=
"[c(),
{'h-ios': isIos}]" class="content">
<div
ref=
"scroll"
:class=
"[c(),
{'h-ios': isIos}]" class="content
scroll-content
">
<div
:class=
"c('__wrapper')"
>
<div
ref=
"scrollContent"
class=
"scrollContent"
@
contextmenu=
"preventDefault"
@
touchend=
"end"
@
touchstart=
"start"
@
touchcancel=
"end"
@
mousedown=
"start"
@
mouseup=
"end"
@
mouseleave=
"end"
>
<div
ref=
"scrollContent"
class=
"scrollContent"
>
<slot/>
</div>
...
...
@@ -65,14 +57,10 @@ import BScroll from 'better-scroll'
import
Loading
from
'./loading'
import
Bubble
from
'./bubble'
import
mixin
from
'./mixins'
import
{
timeout
}
from
'./utils'
import
{
timeout
}
from
'./utils'
import
{
detectOS
}
from
'../../common/utils/index'
let
currenTranslateY
=
0
let
scollHeight
=
0
let
minHeight
=
0
let
globleThis
=
null
let
paddingBottom
=
0
export
default
{
name
:
'Scroll'
,
components
:
{
...
...
@@ -140,7 +128,7 @@ export default {
type
:
Object
,
default
:
()
=>
({
threshold
:
100
,
// 提前触发 pullingUp 的距离
txt
:
{
more
:
'上拉加载'
,
noMore
:
'— 我是有底线的 —'
},
txt
:
{
more
:
'上拉加载'
,
noMore
:
'— 我是有底线的 —'
},
}),
},
startY
:
{
...
...
@@ -200,7 +188,6 @@ export default {
bubbleY
:
0
,
// 气泡y坐标,
isIos
:
false
,
fullScreen
:
true
,
}
},
computed
:
{
...
...
@@ -227,7 +214,6 @@ export default {
await
this
.
$nextTick
()
this
.
refresh
()
},
},
created
()
{
...
...
@@ -244,28 +230,6 @@ export default {
},
{
deep
:
true
,
})
window
.
addEventListener
(
'native.keyboardhide'
,
function
(
e
)
{
console
.
log
(
'native.keyboardhide'
)
if
(
currenTranslateY
)
{
console
.
dir
(
globleThis
)
globleThis
.
$refs
.
scrollContent
.
style
.
paddingBottom
=
paddingBottom
+
'px'
globleThis
.
$refs
.
scrollContent
.
style
.
minHeight
=
minHeight
+
'px'
globleThis
.
scrollTo
(
0
,
-
(
currenTranslateY
))
}
})
window
.
addEventListener
(
'native.keyboardshow'
,
function
(
e
)
{
console
.
log
(
'native.keyboardshow'
)
console
.
log
(
'scollHeight:'
+
scollHeight
)
console
.
log
(
'currenTranslateY:'
+
currenTranslateY
)
if
(
scollHeight
)
{
console
.
dir
(
globleThis
)
paddingBottom
=
Number
(
globleThis
.
$refs
.
scrollContent
.
style
.
paddingBottom
)
// vm.$refs.scrollContent.style.minHeight = `${minHeight + scollHeight + 100}px`
globleThis
.
$refs
.
scrollContent
.
style
.
paddingBottom
=
(
paddingBottom
+
scollHeight
+
100
)
+
'px'
globleThis
.
scrollTo
(
0
,
-
(
currenTranslateY
+
scollHeight
))
}
})
},
methods
:
{
// 初始化scroll
...
...
@@ -276,7 +240,6 @@ export default {
// 设置scrollContent的最小高,实现高度不足时也有回弹效果
if
(
this
.
$refs
.
scrollContent
)
{
this
.
$refs
.
scrollContent
.
style
.
minHeight
=
`
${
this
.
$refs
.
scroll
.
getBoundingClientRect
().
height
+
1
}
px`
minHeight
=
Number
(
`
${
this
.
$refs
.
scroll
.
getBoundingClientRect
().
height
+
1
}
`
)
if
(
vm
.
hasFoot
.
footFlag
)
{
let
height
=
vm
.
hasFoot
.
height
||
88
// this.$refs.scrollContent.style.minHeight = `${this.$refs.scroll.getBoundingClientRect().height - height}px`
...
...
@@ -422,7 +385,6 @@ export default {
*/
scrollTo
(
x
=
0
,
y
=
0
,
time
=
this
.
bounceTime
)
{
this
.
scroll
&&
this
.
scroll
.
scrollTo
(
x
,
y
,
time
)
console
.
log
(
y
)
},
// 滚动到元素
scrollToElement
()
{
...
...
@@ -436,36 +398,6 @@ export default {
scrollToBottom
()
{
this
.
scroll
&&
this
.
scrollTo
(
0
,
this
.
scroll
.
maxScrollY
)
},
getKeyboardHeight
()
{
let
innerWidth
=
window
.
innerWidth
if
(
this
.
isIos
)
{
if
(
innerWidth
>=
375
&&
innerHeight
>=
812
)
{
return
400
}
return
370
}
else
{
return
275
}
},
preventDefault
(
e
)
{
// 移动浏览器中长按元素会触发显示菜单,导致touchend事件不会触发,需要阻止该行为
e
.
preventDefault
()
},
start
(
e
)
{
},
end
:
function
(
e
)
{
let
vm
=
globleThis
=
this
if
(
e
.
target
.
readOnly
)
return
if
(
e
.
target
.
nodeName
===
'INPUT'
||
e
.
target
.
nodeName
===
'TEXTAREA'
)
{
const
vueScrollElement
=
vm
.
$refs
.
scroll
.
children
[
0
]
currenTranslateY
=
Number
(
vueScrollElement
.
style
.
transform
.
match
(
/
\d
+
(
.
\d
+
)?
/g
)[
1
])
const
pointY
=
e
.
changedTouches
[
0
].
clientY
const
innerHeight
=
window
.
innerHeight
const
keyBoardHeight
=
this
.
getKeyboardHeight
()
scollHeight
=
(
innerHeight
-
pointY
)
<
keyBoardHeight
?
(
keyBoardHeight
-
(
innerHeight
-
pointY
))
:
0
}
},
},
}
</
script
>
...
...
@@ -478,7 +410,6 @@ export default {
box-sizing border-box
position relative
height 100%
overflow-y hidden !important
&__wrapper {
-webkit-user-select: none;
...
...
@@ -491,6 +422,7 @@ export default {
text-size-adjust: none;
-webkit-transform-origin: left top;
transform-origin: left top;
padding-bottom: 0.9rem;
}
&__pullup {
...
...
@@ -530,14 +462,13 @@ export default {
}
}
.platform-ios
{
.platform-ios{
.vue-better-scroll {
&__wrapper {
// padding-bottom: 2.16rem;
}
}
}
// iPhoneX适配
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios {
...
...
www.zip
deleted
100644 → 0
View file @
63a57615
File deleted
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment