Commit e3f5ed2d authored by jyx's avatar jyx

代码优化

parent ebb216d0
<template> <template>
<z-paging style="height: 100%;"> <z-paging>
<c-navi id='navi'></c-navi> <c-navi id='navi'></c-navi>
<book-search-box id='search' :searchType='searchType'></book-search-box> <book-search-box id='search' :searchType='searchType'></book-search-box>
<read-time-count-row id='count' ref='timeCount' @resize='resizeTimeCount'></read-time-count-row> <read-time-count-row id='count' ref='timeCount' @resize='resizeTimeCount'></read-time-count-row>
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
}, },
methods: { methods: {
show() { show() {
this.$refs.timeCount.refresh()
this.initHeight(); this.initHeight();
// 监听用户变动 // 监听用户变动
watchUserInfoChange((info) => { watchUserInfoChange((info) => {
...@@ -103,6 +105,7 @@ ...@@ -103,6 +105,7 @@
query.select("#navi").boundingClientRect(); query.select("#navi").boundingClientRect();
query.select("#search").boundingClientRect(); query.select("#search").boundingClientRect();
query.select("#count").boundingClientRect(); query.select("#count").boundingClientRect();
query.select("#count").boundingClientRect();
query.exec((res) => { query.exec((res) => {
let result = 0; let result = 0;
res.forEach(item => { res.forEach(item => {
......
<template> <template>
<z-paging style="height: 100%;"> <z-paging>
<c-navi id='navi'></c-navi> <c-navi id='navi'></c-navi>
<book-search-box id='search'></book-search-box> <book-search-box id='search'></book-search-box>
<CategoryBar id='category' :range='categorys' :current='currentIndex' @change='changeCategory' <CategoryBar id='category' :range='categorys' :current='currentIndex' @change='changeCategory'
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
}; };
}, },
onLoad(options) { onLoad(options) {
}, },
computed: { computed: {
showEmpty: function() { showEmpty: function() {
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
watch: { watch: {
categroyChange: { categroyChange: {
handler: function(n, o) { handler: function(n, o) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs[`bookList${n.currentIndex}`][0].initRefresh(); this.$refs[`bookList${n.currentIndex}`][0].initRefresh();
// let ref = this.$refs.bookList; // let ref = this.$refs.bookList;
// if (ref) { // if (ref) {
// ref[n.currentIndex].initRefresh(); // ref[n.currentIndex].initRefresh();
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
res.forEach(item => { res.forEach(item => {
result = result + item.height; result = result + item.height;
}) })
this.listHeight = this.windowHeight - result; this.listHeight = this.windowHeight - result - (this.windowHeight * 0.1);
}) })
}, },
changeCategory(e) { changeCategory(e) {
......
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