Commit 29a12846 by tang

feat: 条码图书接口调试

parent 05e671ca
...@@ -6,16 +6,17 @@ ...@@ -6,16 +6,17 @@
<el-tab-pane label="条码图书" name="first"> <el-tab-pane label="条码图书" name="first">
<div class="book-card" :key="i" v-for="(item,i) in bookList"> <div class="book-card" :key="i" v-for="(item,i) in bookList">
<div class="book-img"> <div class="book-img">
<img :src="item.img" alt=""> <img :src="item.graph" alt="">
</div> </div>
<div class="book-content"> <div class="book-content">
<div class="title">{{ item.name }}</div> <div class="title">{{ item.prename }}</div>
<div class="price">¥{{ item.price }}</div> <div class="price">¥{{ item.price }}</div>
<div class="desc"> <div class="desc">
<span>{{ item.author }}</span><span>{{ item.date }}</span><span>{{ item.press }}</span> <span>{{ item.author }}</span><span>{{ item.predate }}</span><span>{{ item.company }}</span>
</div> </div>
</div> </div>
</div> </div>
<pages :pages="page" @toPagesFather="getBooks"></pages>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="软件下载" name="second"> <el-tab-pane label="软件下载" name="second">
...@@ -52,7 +53,10 @@ ...@@ -52,7 +53,10 @@
</template> </template>
<script> <script>
import pages from "../comps/pages.vue";
export default { export default {
components: {pages},
data() { data() {
return { return {
activeName: 'second', activeName: 'second',
...@@ -96,27 +100,27 @@ export default { ...@@ -96,27 +100,27 @@ export default {
}, },
], ],
bookList: [], bookList: [],
page: {
currentPage: 1,
pageSize: 10,
pageCount: 1,
total: 10,
},
} }
}, },
created() { created() {
this.getBooks() this.getBooks()
}, },
methods: { methods: {
getBooks() { async getBooks(page = 1) {
for (let i = 0; i < 10; ++i) { const res = await this.$api.service.getCodeBook({page: page, size: this.page.pageSize})
this.bookList.push( const {returnCode, data} = res;
{ if (returnCode === "0") {
id: i, this.bookList = data.list
name: '条码小达人', this.page.currentPage = data.currPage
img:require('./img/5d1d4969-956a-4a85-9631-e45605b0c221.jpg'), this.page.total = data.totalCount
price: 30.00, this.page.pageCount = data.totalPage
author: '张海成 张铎',
date: '2010.1',
press: '武汉大学出版社'
},
)
} }
console.log(this.bookList)
} }
} }
}; };
...@@ -132,9 +136,11 @@ export default { ...@@ -132,9 +136,11 @@ export default {
border: 1px solid rgba(197, 216, 238, 0.5); border: 1px solid rgba(197, 216, 238, 0.5);
margin-bottom: 30px; margin-bottom: 30px;
cursor: pointer; cursor: pointer;
&:hover{
&:hover {
box-shadow: 0 4px 15px 2px rgba(4, 64, 141, 0.08); box-shadow: 0 4px 15px 2px rgba(4, 64, 141, 0.08);
} }
.book-img { .book-img {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -151,26 +157,27 @@ export default { ...@@ -151,26 +157,27 @@ export default {
.book-content { .book-content {
padding: 16px 20px; padding: 16px 20px;
.title { > .title {
font-size: 21px; font-size: 21px;
font-weight: 500; font-weight: 500;
color: #454545; color: #454545;
margin-bottom: 46px; height: 70px;
overflow: hidden;
} }
.price { > .price {
font-size: 32px; font-size: 32px;
font-weight: 500; font-weight: 500;
color: #F23535; color: #F23535;
line-height: 45px; line-height: 45px;
margin-bottom: 20px; margin-bottom: 15px;
} }
.desc { > .desc {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
line-height: 20px; line-height: 18px;
} }
} }
} }
...@@ -183,9 +190,11 @@ export default { ...@@ -183,9 +190,11 @@ export default {
border: 1px solid rgba(197, 216, 238, 0.5); border: 1px solid rgba(197, 216, 238, 0.5);
margin-bottom: 25px; margin-bottom: 25px;
cursor: pointer; cursor: pointer;
&:hover{
&:hover {
box-shadow: 0px 4px 15px 2px rgba(4, 64, 141, 0.08); box-shadow: 0px 4px 15px 2px rgba(4, 64, 141, 0.08);
} }
.app-img { .app-img {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -253,7 +262,7 @@ export default { ...@@ -253,7 +262,7 @@ export default {
} }
} }
.el-tabs__content{ .el-tabs__content {
padding-top: 14px; padding-top: 14px;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment