123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <a :href="detailUrl">
- <div class="book-card">
- <div class="thumb">
- <img
- :src="book.image"
- class="img"
- mode="aspectFit"
- @click.stop="preview"
- >
- </div>
- <div class="detail">
- <div class="row text-primary">
- <div class="right">
- {{book.rate}} <Rate :value="book.rate" />
- </div>
- <div class="left">
- {{book.title}}
- </div>
- </div>
- <div class="row">
- <div class="right text-primary">
- 浏览量: {{book.count}}
- </div>
- <div class="left">
- {{book.author}}
- </div>
- </div>
- <div class="row">
- <div class="right">
- <!-- 捐赠人 -->
- {{book.user_info.nickName}}
- </div>
- <div class="left">
- {{book.publisher}}
- </div>
- </div>
- </div>
- </div>
- </a>
- </template>
- <script>
- import Rate from '@/components/Rate';
- export default {
- components:{
- Rate
- },
- props: ['book'],
- computed: {
- detailUrl() {
- return '/pages/detail/main?id='+ this.book.id
- }
- },
- methods: {
- preview() {
- wx.previewImage({
- current: this.book.image,
- urls: [this.book.image]
- })
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- .book-card{
- padding:5px;
- overflow: hidden;
- margin-top:5px;
- margin-bottom:5px;
- font-size:14px;
- .thumb{
- width:90px;
- height:90px;
- float: left;
- margin:0 auto;
- overflow:hidden;
- .img{
- max-width: 100%;
- max-height: 100%;
- }
- }
- .detail{
- margin-left: 100px;
- .row{
- line-height:20px;
- margin-bottom:3px;
- }
- .right{
- float: right;
-
- }
- .left{
- margin-right:80px;
- }
- }
-
- }
- </style>
|