|
@ -2,8 +2,7 @@ |
|
|
<div class="hotbook-box"> |
|
|
<div class="hotbook-box"> |
|
|
<div class="most-book"> |
|
|
<div class="most-book"> |
|
|
<div class="most-book-img"> |
|
|
<div class="most-book-img"> |
|
|
<img :src="bookdata[0].img"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img :src="bookdata[0].cover" :onerror="defaultImg"> |
|
|
</div> |
|
|
</div> |
|
|
<div class="most-book-txt book-rack"> |
|
|
<div class="most-book-txt book-rack"> |
|
|
<div class="txt"> |
|
|
<div class="txt"> |
|
@ -15,17 +14,20 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<ul class="hotbook-list"> |
|
|
<ul class="hotbook-list"> |
|
|
<li v-for="(item,index) in bookdata" :key="index"> |
|
|
|
|
|
<img :src="item.img"> |
|
|
|
|
|
|
|
|
<li v-for="(item,index) in bookList" :key="index" @click="handleDetails(index)"> |
|
|
|
|
|
<img :src="item.cover" :onerror="defaultImg"> |
|
|
<p>{{ item.title }}</p> |
|
|
<p>{{ item.title }}</p> |
|
|
</li> |
|
|
</li> |
|
|
</ul> |
|
|
</ul> |
|
|
|
|
|
<BookDetails ref="detailDom" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import BookDetails from './bookDetails.vue' |
|
|
export default { |
|
|
export default { |
|
|
name: 'BookList', |
|
|
name: 'BookList', |
|
|
|
|
|
components: { BookDetails }, |
|
|
props: { |
|
|
props: { |
|
|
bookdata: { |
|
|
bookdata: { |
|
|
type: Array, |
|
|
type: Array, |
|
@ -36,7 +38,19 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
|
|
|
|
|
|
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
bookList() { |
|
|
|
|
|
const arr = this.bookdata.slice(1) |
|
|
|
|
|
return arr |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
|
|
|
handleDetails(index) { |
|
|
|
|
|
this.$refs.detailDom.bookData = this.bookdata[index] |
|
|
|
|
|
this.$refs.detailDom.dialogVisible = true |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -61,9 +75,12 @@ export default { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
left: 90px; |
|
|
left: 90px; |
|
|
bottom: 20px; |
|
|
bottom: 20px; |
|
|
|
|
|
width: 318px; |
|
|
|
|
|
height: 382px; |
|
|
|
|
|
overflow: hidden; |
|
|
img{ |
|
|
img{ |
|
|
width: 318px; |
|
|
|
|
|
height: 382px; |
|
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
vertical-align: middle; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.txt{ |
|
|
.txt{ |
|
|