|
@@ -2,28 +2,53 @@
|
|
|
|
|
|
<template>
|
|
|
<div class="shelf-wrap">
|
|
|
- <div class="border-bar"></div>
|
|
|
- <div class="shelf-total">
|
|
|
+ <div class="type-bar">
|
|
|
+ <block for="type in typeList">
|
|
|
+ <div class="type-item" @click="typeChange(type.index)">
|
|
|
+ <text class="{{type.index === current ? 'cur' : ''}}">{{type.name}}</text>
|
|
|
+ <text class="choose-bar" show="{{type.index === current}}"></text>
|
|
|
+ </div>
|
|
|
+ </block>
|
|
|
+ </div>
|
|
|
+ <div class="shelf-total {{current === 1 ? 'shelf-total__inRecent' : ''}}">
|
|
|
<text>共35本</text>
|
|
|
<text class="manager" @click="changeMode">{{modeText}}</text>
|
|
|
</div>
|
|
|
- <div class="shelf-books__wrap">
|
|
|
- <block for="mockList">
|
|
|
- <div class="book-item__wrap {{(($idx + 1)%3 === 0) ? 'm0' : ''}}">
|
|
|
- <stack>
|
|
|
- <x-book></x-book>
|
|
|
- <div class="book-del__wrap" show="{{isDelMode}}">
|
|
|
- <image src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/delete.png"></image>
|
|
|
- <text>删除</text>
|
|
|
- </div>
|
|
|
- </stack>
|
|
|
+ <block if="current === 0">
|
|
|
+ <div class="shelf-books__wrap">
|
|
|
+ <block for="mockList">
|
|
|
+ <div type="shelf-item" class="book-item__wrap {{(($idx + 1)%3 === 0) ? 'm0' : ''}}">
|
|
|
+ <stack>
|
|
|
+ <x-book></x-book>
|
|
|
+ <div class="book-del__wrap" show="{{isDelMode}}">
|
|
|
+ <image src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/delete.png"></image>
|
|
|
+ <text>删除</text>
|
|
|
+ </div>
|
|
|
+ </stack>
|
|
|
+ </div>
|
|
|
+ </block>
|
|
|
+ <div type="add-shelf" class="book-item__wrap book-item__add m0" @click="toCategory">
|
|
|
+ <image class="add-cover" src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/bookstory.png"></image>
|
|
|
+ <text>添加书籍</text>
|
|
|
</div>
|
|
|
- </block>
|
|
|
- <div class="book-item__wrap book-item__add m0" @click="toCategory">
|
|
|
- <image class="add-cover" src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/bookstory.png"></image>
|
|
|
- <text>添加书籍</text>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </block>
|
|
|
+ <block else>
|
|
|
+ <list class="recent-list">
|
|
|
+ <block for="mockList">
|
|
|
+ <list-item type="recent-item" class="recent-item">
|
|
|
+ <x-book multi="{{true}}" width="{{150}}">
|
|
|
+ <div class="book-info__wrap">
|
|
|
+ <text class="name">爱的邂逅</text>
|
|
|
+ <text class="lastest">最新 第2556章 又来了一个张老三</text>
|
|
|
+ <text class="last-read">上次阅读:第23章 张老三是个蓝精灵</text>
|
|
|
+ <text class="shelf-status">❤️ 已加入书架</text>
|
|
|
+ </div>
|
|
|
+ </x-book>
|
|
|
+ </list-item>
|
|
|
+ </block>
|
|
|
+ </list>
|
|
|
+ </block>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -32,9 +57,20 @@ export default {
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ current: 1,
|
|
|
isDelMode: false,
|
|
|
modeText: "管理",
|
|
|
- mockList: [0, 1, 2, 3, 4]
|
|
|
+ mockList: [0, 1, 2, 3, 4],
|
|
|
+ typeList: [
|
|
|
+ {
|
|
|
+ name: "我的书架",
|
|
|
+ index: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "最近阅读",
|
|
|
+ index: 1
|
|
|
+ }
|
|
|
+ ],
|
|
|
}
|
|
|
},
|
|
|
onInit() {
|
|
@@ -48,7 +84,10 @@ export default {
|
|
|
},
|
|
|
toCategory() {
|
|
|
this.$emit('change');
|
|
|
- }
|
|
|
+ },
|
|
|
+ typeChange(index) {
|
|
|
+ this.current = index;
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|