Commit 328c45b5 by tang

feat: 图书详情页

parent 063fcfcf
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="body"> <div class="body">
<el-tabs v-model="activeName" class="tab-no-bottom"> <el-tabs v-model="activeName" class="tab-no-bottom">
<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" @click="showBookDetail(item)" :key="i" v-for="(item,i) in bookList">
<div class="book-img"> <div class="book-img">
<img :src="item.graph" alt=""> <img :src="item.graph" alt="">
</div> </div>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</div> </div>
</div> </div>
</div> </div>
<pages :pages="page" @toPagesFather="getBooks"></pages> <pages v-bind="page" @getLimit="getBooks"></pages>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="软件下载" name="second"> <el-tab-pane label="软件下载" name="second">
...@@ -53,6 +53,28 @@ ...@@ -53,6 +53,28 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<el-dialog
class="gs-book-detail-dialog"
:title="currentBook.prename"
:visible.sync="dialogVisible"
width="55%"
>
<div class="book-card">
<div class="book-img">
<img :src="currentBook.graph" alt="">
</div>
<div class="book-content">
<div class="title">{{ currentBook.prename }}</div>
<div class="price">¥{{ currentBook.price }}</div>
<div class="desc">
<span>{{ currentBook.author }}</span><span>{{ currentBook.predate }}</span>
<span>{{ currentBook.company }}</span>
</div>
</div>
</div>
<h4 style="border-bottom: none; margin-bottom: 20px; font-size: 16px;color: #002c6c">图书介绍</h4>
<div style="text-indent: 2em" v-html="currentBook.description"></div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -67,6 +89,8 @@ export default { ...@@ -67,6 +89,8 @@ export default {
}, },
data() { data() {
return { return {
dialogVisible: false,
currentBook: {},
activeName: 'second', activeName: 'second',
appList: [ appList: [
{ {
...@@ -110,7 +134,7 @@ export default { ...@@ -110,7 +134,7 @@ export default {
], ],
bookList: [], bookList: [],
page: { page: {
currentPage: 1, currPage: 1,
pageSize: 10, pageSize: 10,
pageCount: 1, pageCount: 1,
total: 10, total: 10,
...@@ -121,13 +145,17 @@ export default { ...@@ -121,13 +145,17 @@ export default {
this.getBooks() this.getBooks()
}, },
methods: { methods: {
showBookDetail(book) {
this.currentBook = book;
this.dialogVisible = true;
},
async getBooks(page = 1) { async getBooks(page = 1) {
const res = await this.$api.service.getCodeBook({page: page, size: this.page.pageSize}) const res = await this.$api.service.getCodeBook({page: page, size: this.page.pageSize})
const {returnCode, data} = res; const {returnCode, data} = res;
console.log(data, 'datadatadatadata');
if (returnCode === "0") { if (returnCode === "0") {
this.bookList = data.list this.bookList = data.list
this.page.currentPage = data.currPage this.page.currPage = data.currPage
this.page.total = data.totalCount this.page.total = data.totalCount
this.page.pageCount = data.totalPage this.page.pageCount = data.totalPage
} }
...@@ -137,6 +165,10 @@ export default { ...@@ -137,6 +165,10 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.gs-book-detail-dialog .el-dialog .el-dialog__body{
background-color: #FDFAF6;
padding: 28px 24px;
}
.book.n-service { .book.n-service {
.book-card { .book-card {
display: flex; display: flex;
......
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