|
@@ -78,12 +78,13 @@
|
|
|
</div>
|
|
|
</x-book>
|
|
|
</list-item>
|
|
|
+ <<list-item onappear="getBooksList" ></list-item>
|
|
|
</block>
|
|
|
</list>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getBooksList, getHotMain, getUserInfo } from "../../api";
|
|
|
+import { booksList, getHotMain, getUserInfo } from "../../api";
|
|
|
import { pageLoad } from "../../helper";
|
|
|
import storage from '@system.storage';
|
|
|
import prompt from '@system.prompt';
|
|
@@ -101,7 +102,7 @@ export default {
|
|
|
uid: '',
|
|
|
filter: {
|
|
|
key: "",
|
|
|
- page_size: 100,
|
|
|
+ page_size: 5,
|
|
|
page: 1,
|
|
|
status: 1,
|
|
|
},
|
|
@@ -140,14 +141,14 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
this.filter.key = iptValue.value;
|
|
|
- this.getBooksArray(false);
|
|
|
+ this.getBooksList(false);
|
|
|
this.$element('search').focus({ focus: false });
|
|
|
this.showHistory = false;
|
|
|
},
|
|
|
serachItem(key) {
|
|
|
this.filter.key = key;
|
|
|
this.inputValue = key;
|
|
|
- this.getBooksArray(false);
|
|
|
+ this.getBooksList(false);
|
|
|
this.showHistory = false;
|
|
|
},
|
|
|
deleteHistory() {
|
|
@@ -187,7 +188,7 @@ export default {
|
|
|
this.showHistory = true;
|
|
|
}
|
|
|
},
|
|
|
- async getBooksArray(isLoad = true) {
|
|
|
+ async getBooksList(isLoad = true) {
|
|
|
this.empty = false;
|
|
|
this.loadingText = "加载ing...";
|
|
|
this.filter.page = (this.meta.current_page || 0) + 1;
|
|
@@ -198,7 +199,7 @@ export default {
|
|
|
let params = this.filter;
|
|
|
params.uid = this.uid;
|
|
|
console.log(params);
|
|
|
- pageLoad(this.meta, getBooksList, params).then(ret => {
|
|
|
+ pageLoad(this.meta, booksList, params).then(ret => {
|
|
|
let newList = isLoad ? this.list : [];
|
|
|
let dataList = ret.list;
|
|
|
newList.push(...dataList);
|
|
@@ -227,7 +228,7 @@ export default {
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
// 请求更多数据
|
|
|
- this.getBooksArray();
|
|
|
+ this.getBooksList();
|
|
|
},
|
|
|
}
|
|
|
</script>
|