123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <view class="book-V-3-content">
- <view class="title-content">
- <view class="title-content__title" >{{templateData.name}}</view>
- <view class="title-content__look-more" @click="clickLookMore">
- <image class="image" src="../../../static/imgs/bookstore/img_look_more.png" mode="aspectFit"></image>
- </view>
- </view>
- <view class="book-content">
- <view class="book-content__box" v-for="(item,index) in templateData.list" :key="index"
- @click="clickBook(item,index)">
- <view class="book-content__box__book-cover">
- <image class="image" :src="item.book_cover" mode="aspectFill"></image>
- </view>
- <view class="book-content__box__book-info">
- <view class="book-content__box__book-info__name">
- {{item.book_name}}
- </view>
- <view class="book-content__box__book-info__info1">
- <view class="book-content__box__book-info__info1__author">
- {{item.author_name}} 著 | {{util.convertUnit(item.book_read_num)}}人读过
- </view>
- <view class="book-content__box__book-info__info1__status">
- <image class="image" v-if="item.book_is_action==1" src="../../../static/imgs/public/img_wanjie.png" mode="aspectFit"></image>
- <image class="image" v-else src="../../../static/imgs/public/img_lianzai.png" mode="aspectFit"></image>
- </view>
- </view>
- <!-- <view class="book-content__box__book-info__author book-content__box__book-info__name">
- 作者:{{item.author_name}}
- </view> -->
- <!-- <view class="book-content__box__book-info__readNum book-content__box__book-info__name">
- 阅读数量:{{item.book_read_num}}
- </view> -->
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import { book_item_data } from '../../../data/data';
- import { util } from '../../../framework/util';
-
- defineProps({
- templateData: Object,
- })
- const emits = defineEmits(['clickBook'])
-
- function clickLookMore() {
-
- }
-
- function clickBook(data:book_item_data) {
- emits('clickBook',data)
- }
- </script>
- <style lang="scss">
- .book-V-3-content{
- display: flex;
- flex-direction: column;
- margin: 0px 20rpx;
- margin-bottom: 30rpx;
- padding: 20rpx 0;
- border-radius: 20rpx;
- box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.1);
- background-color: #ffffff;
-
- .title-content {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-left: 30rpx;
-
- &__title {
- font-size: 20px;
- font-weight: 500;
- }
- &__look-more{
- display: flex;
- flex-shrink: 0;
- width: 134px;
- height: 54px;
- align-items: center;
- // background-color: green;
- .image{
- width: 100%;
- height: 100%;
- }
- }
- }
-
- .book-content{
- display: flex;
- flex-direction: column;
- margin-top: 10rpx;
- // background-color: red;
-
- &__box{
- display: flex;
- flex-direction: row;
- margin-bottom: 30rpx;
- padding: 0 20rpx;
- // background-color: green;
- &__book-cover{
- width: 180rpx;
- height: 200rpx;
- flex-shrink: 0; //设置flex元素所有比例.默认是1,为0的时候不进行缩放
- .image {
- width: 100%;
- height: 100%;
- }
- }
- &__book-info{
- display: flex;
- flex-direction: column;
- margin-left: 20rpx;
- width: 100%;
- // background-color: red;
- &__name{
- margin-top: 10rpx;
- display: -webkit-box;
- align-items: center;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 18px;
- }
- &__info1 {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- margin-top: 20rpx;
- // background-color: red;
- &__author{
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- font-size: 15px;
- color: #6F6F6F;
- }
- &__status{
- flex-shrink: 0; //设置flex元素所有比例.默认是1,为0的时候不进行缩放
- width: 162rpx;
- height: 48rpx;
- // background-color: green;
- .image {
- width: 100%;
- height: 100%;
- }
- }
-
- }
- &__author{
- margin-top: 20rpx;
- font-size: 16px;
- -webkit-line-clamp: 1;
- }
- &__readNum{
- margin-top: 20rpx;
- font-size: 15px;
- -webkit-line-clamp: 1;
- }
- }
-
- }
- }
- }
-
- </style>
|