BookCard.vue 1.6 KB
Newer Older
东方怂天's avatar
东方怂天 已提交
1
<template name="BookCard">
东方怂天's avatar
东方怂天 已提交
2
	<view class="CardContent" @tap="ToRead">
东方怂天's avatar
东方怂天 已提交
3 4 5 6 7 8
		<view class="BookName">{{BookName}}</view>
		<DivLine></DivLine>
		<view class="BookContent">
			<image class="BookPic" mode="aspectFit" :src="BookPic"></image>
			<view>{{BookContent}}</view>
		</view>
东方怂天's avatar
东方怂天 已提交
9 10 11 12
	</view>
</template>

<script>
东方怂天's avatar
Newly  
东方怂天 已提交
13
	//引入分割线组件
东方怂天's avatar
东方怂天 已提交
14
	import DivLine from "./DivLine.vue"
东方怂天's avatar
东方怂天 已提交
15
	export default {
东方怂天's avatar
东方怂天 已提交
16 17 18 19 20 21 22 23
		name: "BookCard",
		props: {
			BookName: {
				type: String,
				default: "书名"
			},
			BookContent: {
				type: String,
东方怂天's avatar
Newly  
东方怂天 已提交
24
				default: "在这里我们存放一段关于本书的简介。"
东方怂天's avatar
东方怂天 已提交
25 26 27
			},
			BookPic: {
				type: String,
东方怂天's avatar
Newly  
东方怂天 已提交
28
				default: "../../static/DefaultPicture/BookPic_Default.png"
东方怂天's avatar
东方怂天 已提交
29 30 31 32
			}
		},
		components: {
			DivLine
东方怂天's avatar
东方怂天 已提交
33 34 35 36 37 38 39
		},
		methods: {
			ToRead() {
				uni.navigateTo({
					url: '../ReadingPage/ReadingPage?Title=弟弟行为'
				})
			}
东方怂天's avatar
东方怂天 已提交
40 41 42 43
		}
	}
</script>

东方怂天's avatar
东方怂天 已提交
44 45 46
<style scoped>
	.CardContent {
		/*背景颜色*/
东方怂天's avatar
Newly  
东方怂天 已提交
47
		background: #9CCDD9;
东方怂天's avatar
东方怂天 已提交
48 49 50 51 52 53 54 55 56
		/*圆角设置*/
		border-radius: 15upx;
		/*边框宽度*/
		/*padding: 5upx;*/
		/*宽度设置*/
		width: 95%;
		/*背景颜色*/
		display: flex;
		flex-direction: column;
东方怂天's avatar
Newly  
东方怂天 已提交
57 58
		/*边缘距离*/
		margin: 15upx;
东方怂天's avatar
东方怂天 已提交
59 60 61 62 63
	}

	.BookName,
	.BookContent,
	.BookPic {
东方怂天's avatar
Newly  
东方怂天 已提交
64
		/*离边缘距离*/
东方怂天's avatar
东方怂天 已提交
65 66
		margin: 5upx 5upx 5upx 5upx;
	}
东方怂天's avatar
东方怂天 已提交
67

东方怂天's avatar
Newly  
东方怂天 已提交
68 69 70 71 72
	.BookName {
		/*书名字体大小*/
		font-size: 14px;
	}

东方怂天's avatar
东方怂天 已提交
73
	.BookContent {
东方怂天's avatar
Newly  
东方怂天 已提交
74
		/*书内容简介布局*/
东方怂天's avatar
东方怂天 已提交
75
		display: flex;
东方怂天's avatar
Newly  
东方怂天 已提交
76
		/*横向*/
东方怂天's avatar
东方怂天 已提交
77
		flex-direction: row;
东方怂天's avatar
Newly  
东方怂天 已提交
78
		/*垂直居中*/
东方怂天's avatar
东方怂天 已提交
79
		align-items: center;
东方怂天's avatar
Newly  
东方怂天 已提交
80 81
		/*字体大小*/
		font-size: 10px;
东方怂天's avatar
东方怂天 已提交
82 83 84
	}

	.BookPic {
东方怂天's avatar
Newly  
东方怂天 已提交
85 86 87 88 89 90 91 92 93
		/*书籍图片*/
		/*宽度设置*/
		min-width: 15%;
		max-width: 20%;
		/*长度设置*/
		min-height: 50upx;
		max-height: 150upx;
		/*圆角设置*/
		border-radius: 5px;
东方怂天's avatar
东方怂天 已提交
94
	}
东方怂天's avatar
东方怂天 已提交
95
</style>