Commit a9642fdf authored by JingChao's avatar JingChao

content告诉

parent 0818d679
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
import { detectOS } from '../../common/utils/index' import { detectOS } from '../../common/utils/index'
export default { export default {
name: 'HContent', name: 'HContent',
props: { props: {
...@@ -23,12 +23,14 @@ export default { ...@@ -23,12 +23,14 @@ export default {
default: true, default: true,
}, },
}, },
mounted () { data () {
if (this.calContent) { return {
this.contentHeight() fontSize: Number(window.document.documentElement.style.fontSize.replace('px', '')),
winHeight: window.innerHeight,
winWidth: window.innerWidth,
} }
}, },
activated () { mounted () {
if (this.calContent) { if (this.calContent) {
this.contentHeight() this.contentHeight()
} }
...@@ -48,40 +50,40 @@ export default { ...@@ -48,40 +50,40 @@ export default {
return $el return $el
}, },
getNextElementHeight () { getNextElementHeight () {
//let nextElement = this.getHeader() let vm = this
let headerElement = this.$el.previousElementSibling let nextElement = this.$el.nextElementSibling
let height = 0 let nextHeight = 0
if (headerElement) { let paddingHeight = 0
height = window.getComputedStyle(headerElement).height if (nextElement) {
if (height) { nextHeight = window.getComputedStyle(nextElement).height
height = Number(height.replace('px', '')) 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 height return nextHeight + paddingHeight
}, },
contentHeight () { contentHeight () {
let vm = this
const headerEl = this.$el.previousElementSibling const headerEl = this.$el.previousElementSibling
const nextHeight = this.getNextElementHeight() const nextHeight = this.getNextElementHeight()
const winHeight = window.innerHeight let headerHeight = 0
const winWidth = window.innerWidth
let paddingHeight = 0
if (headerEl) { if (headerEl) {
if (detectOS() === 'ios' && winWidth === 375 && winHeight === 812) { headerHeight = vm.fontSize * 0.88
paddingHeight = 40 if (detectOS() === 'ios' && vm.winWidth === 375 && vm.winHeight === 812) {
} else if (detectOS() === 'ios' && winWidth === 414 && winHeight === 896) { headerHeight = headerHeight + 0.8 * vm.fontSize
paddingHeight = 44 } else if (detectOS() === 'ios' && vm.winWidth === 414 && vm.winHeight === 896) {
headerHeight = headerHeight + 0.8 * vm.fontSize
} else if (detectOS() === 'ios') { } else if (detectOS() === 'ios') {
paddingHeight = 20 headerHeight = headerHeight + 0.4 * vm.fontSize
} else {
paddingHeight = 0
} }
} }
let content = this.$el let content = this.$el
/*let offsetTop = content.offsetTop content.style.height = (window.innerHeight - nextHeight - headerHeight) + 'px'
if (offsetTop >= window.innerHeight) {
offsetTop = 0
}*/
content.style.height = (window.innerHeight - nextHeight - paddingHeight) + 'px'
}, },
}, },
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
</div> </div>
<div slot="center">小易</div> <div slot="center">小易</div>
</h-header> </h-header>
<h-content id="home-content"> <h-content id="home-content">
<div v-for="item in message" class="message"> <div v-for="item in message" class="message">
<p v-show="false" class="message-time" v-text="item.time"/> <p v-show="false" class="message-time" v-text="item.time"/>
...@@ -23,17 +22,8 @@ ...@@ -23,17 +22,8 @@
</div> </div>
</div> </div>
</h-content> </h-content>
<bottom-tab class="bar bar-footer bar-light"> <bottom-tab>
<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> </h-view>
</template> </template>
...@@ -155,7 +145,6 @@ export default { ...@@ -155,7 +145,6 @@ export default {
.content { .content {
background-color: #eeeeee; background-color: #eeeeee;
//border: 1px solid red; //border: 1px solid red;
padding-bottom: 120px;
.message { .message {
position: relative; position: relative;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment