|
@@ -30,6 +30,42 @@
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
</van-list>
|
|
<Empty v-if="myLibListState.list.length === 0 && myLibListState.loaded">暂无我的文库</Empty>
|
|
<Empty v-if="myLibListState.list.length === 0 && myLibListState.loaded">暂无我的文库</Empty>
|
|
|
|
+ <div class="keep-group base-group">
|
|
|
|
+ <div class="title-group flex-r-c center left">
|
|
|
|
+ <span></span>
|
|
|
|
+ <h5 class="module-title">精选推荐</h5>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="list-group card-group flex-c-c">
|
|
|
|
+ <van-skeleton avatar avatar-shape="square" class="van-loading-skeleton card-style"
|
|
|
|
+ :row="4"
|
|
|
|
+ :row-width="rowWidth"
|
|
|
|
+ :loading="showLoading.keep">
|
|
|
|
+ <div class="card-item flex-r-c" v-for="item in pageData.keep" :key="item.id" @click="goContent(item)">
|
|
|
|
+ <div class="mini-img-group">
|
|
|
|
+ <img :src="item.img" alt="">
|
|
|
|
+ <van-icon :name="'diy-' + item.type" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex-c-c">
|
|
|
|
+ <div class="flex">
|
|
|
|
+ <div class="title-text van-multi-ellipsis--l2">{{item.title}}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="flex-c-c info-text">
|
|
|
|
+ <span v-if="item.contribution">贡献者: {{item.contribution}}</span>
|
|
|
|
+ <div class="info-text-group flex-r-c center left">
|
|
|
|
+ <span v-if="item.down">{{item.down}}次下载</span>
|
|
|
|
+ <span v-if="item.page">共{{item.page}}页</span>
|
|
|
|
+ <span v-if="item.size">{{item.size | sizeFormatter}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="money-group flex-r-c center left">
|
|
|
|
+ <van-icon class="s20" name="diy-iconJianYu" />
|
|
|
|
+ <span class="red-text">{{item.money}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-skeleton>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<van-notice-bar
|
|
<van-notice-bar
|
|
class="doc-tip--bottom"
|
|
class="doc-tip--bottom"
|
|
v-if="showTip"
|
|
v-if="showTip"
|
|
@@ -62,14 +98,17 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
</van-list>
|
|
- <Empty v-if="myCollectionListState.list.length === 0 && myCollectionListState.loaded">暂无文库收藏</Empty>
|
|
|
|
|
|
+ <Empty v-if="myCollectionListState.list.length === 0 && myCollectionListState.loaded">
|
|
|
|
+ <p>暂无文库收藏</p>
|
|
|
|
+ <button class="j-button-collect" @click="goCollect">前往收藏</button>
|
|
|
|
+ </Empty>
|
|
</van-tab>
|
|
</van-tab>
|
|
</van-tabs>
|
|
</van-tabs>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { Component, Vue, Watch } from 'vue-property-decorator'
|
|
import { Component, Vue, Watch } from 'vue-property-decorator'
|
|
-import { Tabs, Tab, List, NoticeBar } from 'vant'
|
|
|
|
|
|
+import { Tabs, Tab, List, NoticeBar, Icon, Skeleton } from 'vant'
|
|
import { mapState, mapMutations, mapActions } from 'vuex'
|
|
import { mapState, mapMutations, mapActions } from 'vuex'
|
|
import Card from '@/components/docs-card/Card.vue'
|
|
import Card from '@/components/docs-card/Card.vue'
|
|
import Empty from '@/components/common/Empty.vue'
|
|
import Empty from '@/components/common/Empty.vue'
|
|
@@ -82,12 +121,15 @@ import { dateFormatter, formatSize } from '@/utils/globalFunctions'
|
|
[Tab.name]: Tab,
|
|
[Tab.name]: Tab,
|
|
[List.name]: List,
|
|
[List.name]: List,
|
|
[NoticeBar.name]: NoticeBar,
|
|
[NoticeBar.name]: NoticeBar,
|
|
|
|
+ [Icon.name]: Icon,
|
|
|
|
+ [Skeleton.name]: Skeleton,
|
|
Card,
|
|
Card,
|
|
Empty
|
|
Empty
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState('main', {
|
|
...mapState('main', {
|
|
- userLibInfo: (state: any) => state.userLib
|
|
|
|
|
|
+ userLibInfo: (state: any) => state.userLib,
|
|
|
|
+ pageData: (state: any) => state.homePageData
|
|
}),
|
|
}),
|
|
showTip () {
|
|
showTip () {
|
|
return this.$route.query.tip
|
|
return this.$route.query.tip
|
|
@@ -99,7 +141,8 @@ import { dateFormatter, formatSize } from '@/utils/globalFunctions'
|
|
clearLibState: 'main/clearMyLibState'
|
|
clearLibState: 'main/clearMyLibState'
|
|
}),
|
|
}),
|
|
...mapActions({
|
|
...mapActions({
|
|
- getMyLibList: 'main/getMyLibList'
|
|
|
|
|
|
+ getMyLibList: 'main/getMyLibList',
|
|
|
|
+ getRecommendList: 'main/getRecommendList'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -110,6 +153,9 @@ export default class UserLibrary extends Vue {
|
|
protected clearLibState: any
|
|
protected clearLibState: any
|
|
|
|
|
|
protected getMyLibList: any
|
|
protected getMyLibList: any
|
|
|
|
+ protected getRecommendList: any
|
|
|
|
+ pageData: any
|
|
|
|
+ rowWidth = ['100%', '20%', '40%', '15%']
|
|
|
|
|
|
tabActive = '0'
|
|
tabActive = '0'
|
|
|
|
|
|
@@ -159,6 +205,7 @@ export default class UserLibrary extends Vue {
|
|
created () {
|
|
created () {
|
|
this.tabActive = this.$route.query.tab as string
|
|
this.tabActive = this.$route.query.tab as string
|
|
this.reStoreState()
|
|
this.reStoreState()
|
|
|
|
+ this.getRecommendList()
|
|
}
|
|
}
|
|
|
|
|
|
beforeTabChange () {
|
|
beforeTabChange () {
|
|
@@ -265,6 +312,28 @@ export default class UserLibrary extends Vue {
|
|
}
|
|
}
|
|
this.saveLibState(d)
|
|
this.saveLibState(d)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ get showLoading () {
|
|
|
|
+ const s = this.pageData
|
|
|
|
+ return {
|
|
|
|
+ new: !s?.new,
|
|
|
|
+ hot: !s?.hot,
|
|
|
|
+ keep: !s?.keep
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ goContent (item: any) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'details',
|
|
|
|
+ params: {
|
|
|
|
+ id: item.id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ goCollect () {
|
|
|
|
+ this.$router.push('/home')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -308,5 +377,155 @@ export default class UserLibrary extends Vue {
|
|
line-height: 20px;
|
|
line-height: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ @include diy-icon('iconJianYu', 16, 16);
|
|
|
|
+
|
|
|
|
+ .van-icon-diy-iconJianYu.s20 {
|
|
|
|
+ width: 20px;
|
|
|
|
+ height: 20px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @include diy-icon('pdf', 24);
|
|
|
|
+ @include diy-icon('word', 24);
|
|
|
|
+ @include diy-icon('excel', 24);
|
|
|
|
+ @include diy-icon('ppt', 24);
|
|
|
|
+
|
|
|
|
+ .base-group {
|
|
|
|
+ padding: 4px 19px 4px 16px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ .list-group {
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ background: #FFFFFF;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 8px 0;
|
|
|
|
+ &.card-group {
|
|
|
|
+ padding-left: 12px;
|
|
|
|
+ }
|
|
|
|
+ .list-item {
|
|
|
|
+ padding: 6px 12px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ i {
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ margin-right: 4px;
|
|
|
|
+ }
|
|
|
|
+ .flex {
|
|
|
|
+ min-width: 0;
|
|
|
|
+ }
|
|
|
|
+ .right-info {
|
|
|
|
+ margin-left: 4px;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .card-item {
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ padding: 8px 16px 12px 0;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
|
+ &:nth-last-child(1) {
|
|
|
|
+ border-bottom-color: transparent;
|
|
|
|
+ padding-bottom: 8px;
|
|
|
|
+ }
|
|
|
|
+ .money-group {
|
|
|
|
+ margin-top: 8px;
|
|
|
|
+ }
|
|
|
|
+ .mini-img-group {
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ position: relative;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
|
+ width: 100px;
|
|
|
|
+ height: 124px;
|
|
|
|
+ margin-right: 12px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ img {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+ i {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .info-text-group {
|
|
|
|
+ span {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ &:last-child {
|
|
|
|
+ &::after {
|
|
|
|
+ content: unset;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ &::after {
|
|
|
|
+ content: "|";
|
|
|
|
+ padding: 0 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .info-text {
|
|
|
|
+ color: #9B9CA3;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ line-height: 18px;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+ .red-text {
|
|
|
|
+ color: #FB483D;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+ .title-text {
|
|
|
|
+ color: #171826;
|
|
|
|
+ font-family: PingFang SC;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ text-align: left;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title-group {
|
|
|
|
+ padding: 16px 0 6px 0;
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ color: #171826;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 26px;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ text-align: left;
|
|
|
|
+
|
|
|
|
+ h5 {
|
|
|
|
+ color: #171826;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 26px;
|
|
|
|
+ letter-spacing: 0px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ span {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 3px;
|
|
|
|
+ height: 16px;
|
|
|
|
+ border-radius: 11px;
|
|
|
|
+ background: #2ABED1;
|
|
|
|
+ margin-right: 8px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .empty-container{
|
|
|
|
+ height: 60%;
|
|
|
|
+ }
|
|
|
|
+ .j-button-collect{
|
|
|
|
+ width: 165px;
|
|
|
|
+ height: 40px;
|
|
|
|
+ margin-top: 24px;
|
|
|
|
+ background: #2ABED1;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|