|
@@ -11,25 +11,26 @@
|
|
|
</block>
|
|
|
</div>
|
|
|
</list-item>
|
|
|
- <list-item type="banner" class="free-title">
|
|
|
+ <list-item type="banner" class="free-title" if="{{endTime}}">
|
|
|
<text>限时免费结束时间:{{endTime}}</text>
|
|
|
</list-item>
|
|
|
- <block for="list">
|
|
|
- <list-item type="books-item" class="book-list__wrap book-list__wrap--multi" >
|
|
|
+ <block for="book in list" if="{{isInit && list.length>0}}">
|
|
|
+ <list-item type="books-item" class="book-list__wrap book-list__wrap--multi">
|
|
|
<div class="book-list__multi">
|
|
|
- <block for="book in list">
|
|
|
- <div class="book-item">
|
|
|
- <x-book multi="{{true}}" width="{{150}}" book="{{book}}">
|
|
|
- <div class="book-info__multi">
|
|
|
- <text class="name">{{book.book_name}}</text>
|
|
|
- <text class="intro">{{book.intro}}</text>
|
|
|
- </div>
|
|
|
- </x-book>
|
|
|
- </div>
|
|
|
- </block>
|
|
|
- </div>
|
|
|
- </list-item>
|
|
|
+ <div class="book-item">
|
|
|
+ <x-book multi="{{true}}" width="{{150}}" book="{{book}}">
|
|
|
+ <div class="book-info__multi">
|
|
|
+ <text class="name">{{book.book_name}}</text>
|
|
|
+ <text class="intro">{{book.intro}}</text>
|
|
|
+ </div>
|
|
|
+ </x-book>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </list-item>
|
|
|
</block>
|
|
|
+ <list-item type="blank" if="{{isInit && list.length<=0}}" class="blank_img">
|
|
|
+ <image src="https://cdn-novel.iycdm.com/quickapp/activity/white_shelf.png"></image>
|
|
|
+ </list-item>
|
|
|
</list>
|
|
|
</template>
|
|
|
|
|
@@ -46,9 +47,9 @@ export default {
|
|
|
chapter_sequence: "",
|
|
|
},
|
|
|
private: {
|
|
|
- isInit:false,
|
|
|
+ isInit: false,
|
|
|
list: [],
|
|
|
- endTime:'',
|
|
|
+ endTime: '',
|
|
|
typeList: [
|
|
|
{
|
|
|
name: "男生",
|
|
@@ -59,7 +60,7 @@ export default {
|
|
|
index: 2
|
|
|
}
|
|
|
],
|
|
|
- current:2
|
|
|
+ current: 2
|
|
|
},
|
|
|
onInit() {
|
|
|
this.getBookList(this.current)
|
|
@@ -70,11 +71,18 @@ export default {
|
|
|
this.getBookList(index);
|
|
|
|
|
|
},
|
|
|
- async getBookList(index = 2){
|
|
|
+ async getBookList(index = 2) {
|
|
|
let data = await getFreeBook(index);
|
|
|
- this.list = data.list;
|
|
|
- this.endTime = data.end_time;
|
|
|
- this.isInit = true;
|
|
|
+ if (!data || (Array.isArray(data) && data.length <= 0)) {
|
|
|
+ this.list = [];
|
|
|
+ this.endTime = undefined;
|
|
|
+ this.isInit = true;
|
|
|
+ } else {
|
|
|
+ this.list = data.list;
|
|
|
+ this.endTime = data.end_time;
|
|
|
+ this.isInit = true;
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
@@ -97,62 +105,71 @@ export default {
|
|
|
border-radius: 30px;
|
|
|
}
|
|
|
}
|
|
|
- .book-list__wrap {
|
|
|
- background-color: #fff;
|
|
|
- // margin-top: 24px;
|
|
|
- padding: 0 24px;
|
|
|
- flex-direction: column;
|
|
|
-
|
|
|
- .book-list__title {
|
|
|
- padding: 30px 0;
|
|
|
- align-items: center;
|
|
|
+.book-list__wrap {
|
|
|
+ background-color: #fff;
|
|
|
+ // margin-top: 24px;
|
|
|
+ padding: 0 24px;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .book-list__title {
|
|
|
+ padding: 30px 0;
|
|
|
+ align-items: center;
|
|
|
|
|
|
- text {
|
|
|
- color: #333;
|
|
|
- font-size: 32px;
|
|
|
- }
|
|
|
+ text {
|
|
|
+ color: #333;
|
|
|
+ font-size: 32px;
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
- .book-list {
|
|
|
- flex: 1;
|
|
|
- flex-direction: row;
|
|
|
- flex-wrap: wrap;
|
|
|
- justify-content: space-between;
|
|
|
+.book-list {
|
|
|
+ flex: 1;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.book-list__multi {
|
|
|
+ margin-top: 30px;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .book-item {
|
|
|
+ margin-bottom: 30px;
|
|
|
}
|
|
|
- .book-list__multi {
|
|
|
- margin-top: 30px;
|
|
|
- flex-direction: column;
|
|
|
|
|
|
- .book-item {
|
|
|
- margin-bottom: 30px;
|
|
|
+ .book-info__multi {
|
|
|
+ flex: 1;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: flex-start;
|
|
|
+ margin-left: 38px;
|
|
|
+ // margin-bottom: 40px;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ font-size: 32px;
|
|
|
+ color: #333;
|
|
|
+ lines: 1;
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
|
|
|
|
- .book-info__multi {
|
|
|
- flex: 1;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: flex-start;
|
|
|
- align-items: flex-start;
|
|
|
- margin-left: 38px;
|
|
|
- // margin-bottom: 40px;
|
|
|
-
|
|
|
- .name {
|
|
|
- font-size: 32px;
|
|
|
- color: #333;
|
|
|
- lines: 1;
|
|
|
- text-overflow: ellipsis;
|
|
|
- }
|
|
|
-
|
|
|
- .intro {
|
|
|
- font-size: 24px;
|
|
|
- color: #666;
|
|
|
- lines: 3;
|
|
|
- text-overflow: ellipsis;
|
|
|
- margin-top: 36px;
|
|
|
- line-height: 36px;
|
|
|
- }
|
|
|
+ .intro {
|
|
|
+ font-size: 24px;
|
|
|
+ color: #666;
|
|
|
+ lines: 3;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ margin-top: 36px;
|
|
|
+ line-height: 36px;
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+.blank_img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ image {
|
|
|
+ width: 500px;
|
|
|
+ }
|
|
|
+}
|
|
|
.type-bar {
|
|
|
width: 100%;
|
|
|
.type-item {
|