|
@@ -3,7 +3,6 @@
|
|
|
|
|
|
<template>
|
|
|
<div class="category-wrap">
|
|
|
- <div class="page_title"><text>分类</text></div>
|
|
|
<div class="tab_bar">
|
|
|
<div class="filter-item">
|
|
|
<div class="filter-item__list">
|
|
@@ -20,30 +19,12 @@
|
|
|
></text>
|
|
|
</div>
|
|
|
</block>
|
|
|
- <div class="filter-item_warp" @click="toPage('Free')">
|
|
|
- <text>限时免费</text>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<list class="list-content" @scrollbottom="onReachBottom">
|
|
|
- <!-- <list-item type="tab" class="tab_bar"> </list-item> -->
|
|
|
-
|
|
|
- <!-- <list-item type="search" class="search-bar">
|
|
|
- <div class="search-bar__wrap">
|
|
|
- <input
|
|
|
- id="search"
|
|
|
- type="text"
|
|
|
- enterkeytype="search"
|
|
|
- placeholder="请输入书名或者作者"
|
|
|
- @enterkeyclick="bookSearch"
|
|
|
- />
|
|
|
- <image
|
|
|
- src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/search.png"
|
|
|
- ></image>
|
|
|
- </div>
|
|
|
- </list-item> -->
|
|
|
+
|
|
|
<list-item type="filter" class="filter-wrap">
|
|
|
<div class="filter-item">
|
|
|
<!-- <text class="filter-item__name">类型</text> -->
|
|
@@ -84,24 +65,17 @@
|
|
|
<div class="book-info">
|
|
|
<text class="name">{{ $item.book_name }}</text>
|
|
|
<text class="intro">{{ $item.book_summary }}</text>
|
|
|
- <!-- <text class="status">豪门虐情 完结</text>
|
|
|
- <text class="words">字数:1231231</text>
|
|
|
- <div class="update">
|
|
|
- <text>最新:</text>
|
|
|
- <text class="lastest">第213章 我是最后一章</text>
|
|
|
- <image src="../../assets/imgs/book-vip.png"></image>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
</x-book>
|
|
|
</list-item>
|
|
|
</block>
|
|
|
- <list-item style="height:120px;"></list-item>
|
|
|
+ <list-item onappear="getBooksList" style="height:120px;"></list-item>
|
|
|
</list>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getCategory, getBooksList } from '../../api'
|
|
|
+import { getCategory, booksList } from '../../api'
|
|
|
import { pageLoad } from '../../helper'
|
|
|
import storage from '@system.storage'
|
|
|
import router from '@system.router'
|
|
@@ -127,7 +101,7 @@ export default {
|
|
|
category_id: '',
|
|
|
order_field: 'recommend_index',
|
|
|
order_seq: 'asc',
|
|
|
- page_size: 100,
|
|
|
+ page_size: 10,
|
|
|
page: 1,
|
|
|
status: 1
|
|
|
},
|
|
@@ -138,13 +112,13 @@ export default {
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
// 请求更多数据
|
|
|
- this.getBooksArray()
|
|
|
+ this.getBooksList()
|
|
|
},
|
|
|
async getCategory() {
|
|
|
this.category = this.initCategory(await getCategory())
|
|
|
console.log("this.category:", this.category);
|
|
|
await this.initChannel(this.category)
|
|
|
- this.getBooksArray()
|
|
|
+ this.getBooksList()
|
|
|
},
|
|
|
async initChannel(category) {
|
|
|
this.filter.channel_id = +(await storage.get({ key: 'sex' })).data
|
|
@@ -171,14 +145,14 @@ export default {
|
|
|
this.filter[field] = value
|
|
|
if (field === 'channel_id')
|
|
|
this.filter.category_id = this.category[value].id
|
|
|
- this.getBooksArray(false)
|
|
|
+ this.getBooksList(false)
|
|
|
},
|
|
|
bookSearch(iptValue) {
|
|
|
this.filter.key = iptValue.value
|
|
|
- this.getBooksArray(false)
|
|
|
+ this.getBooksList(false)
|
|
|
this.$element('search').focus({ focus: false })
|
|
|
},
|
|
|
- getBooksArray(isLoad = true) {
|
|
|
+ getBooksList(isLoad = true) {
|
|
|
this.empty = false
|
|
|
this.loadingText = '加载ing...'
|
|
|
this.filter.page = (this.meta.current_page || 0) + 1
|
|
@@ -187,7 +161,7 @@ export default {
|
|
|
this.meta = {}
|
|
|
}
|
|
|
let params = this.filter
|
|
|
- pageLoad(this.meta, getBooksList, params)
|
|
|
+ pageLoad(this.meta, booksList, params)
|
|
|
.then(ret => {
|
|
|
let newList = isLoad ? this.list : []
|
|
|
let dataList = ret.list
|