<template>
	<view class="bookshelf_content">
		<CommNavBar :navBarList="navBarList" @navBarClick="handelCommNavBar" :navBarActive="navBarActive" />
		<view class="bookshelf_content_body" :style="`z-index:${bookshelfContentBodyZindex}`">
			<scroll-view scroll-y="true" class="scroll_y">
				<view class="scroll_y_item">
					<view class="bookshelf_content_sign_in_box" @tap="toSignInBookCurrency">
						<view class="_sign_in_box_tips">
							<view class="_sign_in_text">
								<text>本周已连续签到</text>
								<text class="_sign_in_Days">{{totalNum}}</text>
								<text>天</text>
							</view>
						</view>
					</view>
					<view class="bookshelf_list_body">
						<BookshelfListBody @bookshelfContentBodyZindexFn="bookshelfContentBodyZindexFn"
							ref="BookshelfListBody" />
					</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import CommNavBar from '@/components/commNavBar/index.vue'
	import BookshelfListBody from './bookshelfListBody.vue'
	export default {
		components: {
			CommNavBar,
			BookshelfListBody
		},
		data() {
			return {
				navBarList: [{
					id: '1',
					name: '书架'
				}],
				navBarActive: '1',
				totalNum: 0,
				bookshelfContentBodyZindex: 2
			}
		},
		onShow() {
			uni.$u.http.post('/getSigInfo', {}).then((res) => {
				if (res.status == 1) {
					const {
						totalNum,
					} = res.data;
					this.totalNum = totalNum;
				}
			}).catch((err) => {
				uni.hideLoading();
				console.log(err, "errerr")
			})
			this.$nextTick(() => {
				this.$refs.BookshelfListBody.getBooksData()
			})
		},
		methods: {
			handelCommNavBar() {

			},
			toSignInBookCurrency() {
				uni.navigateTo({
					url: `/pages/signInBookCurrency/index`
				})
			},
			bookshelfContentBodyZindexFn(z) {
				this.bookshelfContentBodyZindex = z;
			}
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}
	.is_image {
		display: block;
		width: 100%;
		height: 100%;
	}

	.bookshelf_content {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
		// padding-bottom: 40rpx;
		box-sizing: border-box;
		overflow: hidden;

		.bookshelf_content_body {
			flex: 1;
			width: 100%;
			height: 100%;
			position: relative;
			z-index: 996;

			.scroll_y {
				position: absolute;
				left: 0;
				right: 0;
				top: 0;
				bottom: 0;

				.scroll_y_item {
					 // padding-bottom: 40rpx;
					.bookshelf_content_sign_in_box {
						width: 100%;
						padding: 0 32rpx 32rpx;
						box-sizing: border-box;

						._sign_in_box_tips {
							position: relative;
							width: 100%;
							height: 146rpx;
							background: url('/static/images/bookshelf/_sign_in.png') no-repeat;
							background-size: 100% 100%;

							._sign_in_text {
								position: absolute;
								left: 40rpx;
								bottom: 22rpx;
								font-size: 28rpx;
								color: rgba(255, 255, 255, 0.6);

								._sign_in_Days {
									color: #fff;
									margin: 0 6rpx;
									font-weight: 600;
								}
							}
						}
					}

					.bookshelf_list_body {
						width: 100%;
						padding: 10rpx 32rpx 32rpx;
						box-sizing: border-box;
						// background-color: #fff;

					}
				}
			}
		}

	}
</style>