From ef37c59e055a990ce247b265b27d3fcef430a243 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期五, 15 八月 2025 10:19:18 +0800 Subject: [PATCH] first submit --- src/components/detail/bookInfo.vue | 127 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 127 insertions(+), 0 deletions(-) diff --git a/src/components/detail/bookInfo.vue b/src/components/detail/bookInfo.vue new file mode 100644 index 0000000..96b7e66 --- /dev/null +++ b/src/components/detail/bookInfo.vue @@ -0,0 +1,127 @@ +<template> + <div class="bookInfo"> + <div class="recommend" v-if="bookInfo.caupress_recommendationReason"> + <div class="title">鎺ㄨ崘鐞嗙敱</div> + <div + class="content" + v-html="bookInfo.caupress_recommendationReason" + ></div> + </div> + <div class="otherBox"> + <div class="itemBox" v-for="(item, index) in dataList" :key="index"> + <div v-if="item.content != undefined && item.content.length > 0"> + <div class="itemTitle"> + <div class="titleName">{{ item.title }}</div> + + </div> + <div + class="itemContent" + v-html="item.content" + v-if="item.content != undefined" + ></div> + <el-empty description="鏆傛棤鍐呭" v-else></el-empty> + </div> + </div> + </div> + </div> +</template> + +<script> +export default { + data() { + return { + dataList: [ + { + title: "浣滆�呯畝浠�", + content: null, + }, + { + title: "绠�浠�", + content: null, + }, + { + title: "鍓嶈█", + content: null, + }, + { + title: "鐩綍", + content: null, + }, + ], + }; + }, + props: { + bookInfo: { + type: Object, + default: () => {}, + }, + }, + watch: { + bookInfo() { + this.dataList.forEach((item) => { + if (item.title == "浣滆�呯畝浠�") + item.content = this.bookInfo.caupress_authorAbout; + if (item.title == "绠�浠�") item.content = this.bookInfo.caupress_content; + if (item.title == "鍓嶈█") item.content = this.bookInfo.caupress_preface; + if (item.title == "鐩綍") item.content = this.bookInfo.caupress_catalog; + }); + }, + }, +}; +</script> + +<style scoped> +.bookInfo { + width: 813px; + background-color: #fff; + margin: 10px 0 0 10px; + padding: 40px; + box-sizing: border-box; +} +.recommend { + max-height: 270px; + background-color: #fbf5eb; + overflow: auto; + border-radius: 4px; + border: 1px solid #ebd5b4; +} +.title { + height: 20px; + line-height: 20px; + border-bottom: 1px dashed #d6d6d6; + padding: 20px; + color: #333333; + font-size: 18px; + font-weight: 700; +} +.content { + max-height: 210px; + line-height: 40px; + margin-top: 20px; + padding: 20px; +} +.itemTitle { + height: 20px; + position: relative; + border-left: 3px solid #019E58; + line-height: 20px; + padding-left: 20px; +} +.titleName { + font-size: 18px; + font-weight: 700; + position: absolute; +} +.otherBox { + margin-top: 40px; +} +.itemContent { + padding: 20px; + line-height: 25px; + max-height: 900px; + overflow: auto; +} +.itemBox { + margin-top: 50px; +} +</style> -- Gitblit v1.9.1