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
a9642fdf
Commit
a9642fdf
authored
Sep 10, 2019
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
content告诉
parent
0818d679
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
47 deletions
+38
-47
index.vue
packages/components/HContent/index.vue
+36
-34
home.vue
src/pages/home.vue
+2
-13
No files found.
packages/components/HContent/index.vue
View file @
a9642fdf
...
...
@@ -10,7 +10,7 @@
</
template
>
<
script
>
import
{
detectOS
}
from
'../../common/utils/index'
import
{
detectOS
}
from
'../../common/utils/index'
export
default
{
name
:
'HContent'
,
props
:
{
...
...
@@ -23,12 +23,14 @@ export default {
default
:
true
,
},
},
mounted
()
{
if
(
this
.
calContent
)
{
this
.
contentHeight
()
data
()
{
return
{
fontSize
:
Number
(
window
.
document
.
documentElement
.
style
.
fontSize
.
replace
(
'px'
,
''
)),
winHeight
:
window
.
innerHeight
,
winWidth
:
window
.
innerWidth
,
}
},
activa
ted
()
{
moun
ted
()
{
if
(
this
.
calContent
)
{
this
.
contentHeight
()
}
...
...
@@ -48,40 +50,40 @@ export default {
return
$el
},
getNextElementHeight
()
{
//let nextElement = this.getHeader()
let
headerElement
=
this
.
$el
.
previousElementSibling
let
height
=
0
if
(
headerElement
)
{
height
=
window
.
getComputedStyle
(
headerElement
).
height
if
(
height
)
{
height
=
Number
(
height
.
replace
(
'px'
,
''
))
let
vm
=
this
let
nextElement
=
this
.
$el
.
nextElementSibling
let
nextHeight
=
0
let
paddingHeight
=
0
if
(
nextElement
)
{
nextHeight
=
window
.
getComputedStyle
(
nextElement
).
height
if
(
nextHeight
)
{
nextHeight
=
Number
(
nextHeight
.
replace
(
'px'
,
''
))
}
if
(
detectOS
()
===
'ios'
&&
vm
.
winWidth
===
375
&&
vm
.
winHeight
===
812
)
{
paddingHeight
=
vm
.
fontSize
*
0.68
}
else
if
(
detectOS
()
===
'ios'
&&
vm
.
winWidth
===
414
&&
vm
.
winHeight
===
896
)
{
paddingHeight
=
vm
.
fontSize
*
0.68
}
}
return
h
eight
return
nextHeight
+
paddingH
eight
},
contentHeight
()
{
const
headerEl
=
this
.
$el
.
previousElementSibling
const
nextHeight
=
this
.
getNextElementHeight
()
const
winHeight
=
window
.
innerHeight
const
winWidth
=
window
.
innerWidth
let
paddingHeight
=
0
if
(
headerEl
)
{
if
(
detectOS
()
===
'ios'
&&
winWidth
===
375
&&
winHeight
===
812
)
{
paddingHeight
=
40
}
else
if
(
detectOS
()
===
'ios'
&&
winWidth
===
414
&&
winHeight
===
896
)
{
paddingHeight
=
44
}
else
if
(
detectOS
()
===
'ios'
)
{
paddingHeight
=
20
}
else
{
paddingHeight
=
0
}
}
let
vm
=
this
const
headerEl
=
this
.
$el
.
previousElementSibling
const
nextHeight
=
this
.
getNextElementHeight
()
let
headerHeight
=
0
if
(
headerEl
)
{
headerHeight
=
vm
.
fontSize
*
0.88
if
(
detectOS
()
===
'ios'
&&
vm
.
winWidth
===
375
&&
vm
.
winHeight
===
812
)
{
headerHeight
=
headerHeight
+
0.8
*
vm
.
fontSize
}
else
if
(
detectOS
()
===
'ios'
&&
vm
.
winWidth
===
414
&&
vm
.
winHeight
===
896
)
{
headerHeight
=
headerHeight
+
0.8
*
vm
.
fontSize
}
else
if
(
detectOS
()
===
'ios'
)
{
headerHeight
=
headerHeight
+
0.4
*
vm
.
fontSize
}
}
let
content
=
this
.
$el
/*let offsetTop = content.offsetTop
if (offsetTop >= window.innerHeight) {
offsetTop = 0
}*/
content
.
style
.
height
=
(
window
.
innerHeight
-
nextHeight
-
paddingHeight
)
+
'px'
content
.
style
.
height
=
(
window
.
innerHeight
-
nextHeight
-
headerHeight
)
+
'px'
},
},
}
...
...
src/pages/home.vue
View file @
a9642fdf
...
...
@@ -6,7 +6,6 @@
</div>
<div
slot=
"center"
>
小易
</div>
</h-header>
<h-content
id=
"home-content"
>
<div
v-for=
"item in message"
class=
"message"
>
<p
v-show=
"false"
class=
"message-time"
v-text=
"item.time"
/>
...
...
@@ -23,17 +22,8 @@
</div>
</div>
</h-content>
<bottom-tab
class=
"bar bar-footer bar-light"
>
<label
class=
"item item-input footer-input"
>
<textarea
v-auto-size
ref=
"textarea"
v-model=
"robot_message.question"
placeholder=
"请输入"
rows=
"1"
/>
</label>
<div
class=
"footer-btn-wrap"
@
click=
"sendMsg()"
>
<div
class=
"send-button"
>
<p>
发送
</p>
</div>
</div>
<bottom-tab>
</bottom-tab>
</h-view>
</
template
>
...
...
@@ -155,7 +145,6 @@ export default {
.content {
background-color: #eeeeee;
//border: 1px solid red;
padding-bottom: 120px;
.message {
position: relative;
}
...
...
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