diff --git a/api/book.js b/api/book.js index b89f1c0..8c7f1c3 100644 --- a/api/book.js +++ b/api/book.js @@ -92,4 +92,53 @@ export function FetchBookRanking(data) { // 累计借出 -// /api/screenSetting/sync82 \ No newline at end of file +// /api/screenSetting/sync82 + + + +// 根据用户openID获取收藏图书 +// ?libcode=ftzn&openId=11&page=1&size=10&title=11 +export function FetchFindAllBookCollectionByOpenId(data) { + return request({ + url: '/api/weixin/findAllBookCollectionByOpenId', + data + }) +} + +// +// 收藏图书 +//{ +// "author": "string", +// "bookrecno": "string", +// "booktype": "string", +// "classno": "string", + +// "isbn": "string", +// "libcode": "string", +// "openid": "string", +// "page": "string", +// "price": "string", +// "pubdate": "string", +// "publisher": "string", +// "subject": "string", +// "title": "string" +// } +export function FetchCollectionBook(data) { + return request({ + url: '/api/weixin/collectionBook', + method: 'POST', + data + }) +} + +// 取消收藏 +// { +// "id": 0 +// } +export function FetchCancelCollectionBook(data) { + return request({ + url: '/api/weixin/cancelCollectionBook', + method: 'POST', + data + }) +} \ No newline at end of file diff --git a/pages/home/home.vue b/pages/home/home.vue index 31d78d8..c9474c5 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -114,7 +114,8 @@ :circular="false" > - + + 读者证号 diff --git a/pages/search/search.vue b/pages/search/search.vue index 43b352c..1657380 100644 --- a/pages/search/search.vue +++ b/pages/search/search.vue @@ -77,9 +77,10 @@ @@ -96,7 +177,10 @@ export default { .empty { padding: 60px 0; + text-align: center; + color: #999; } + .no-more { text-align: center; padding: 20px 0; @@ -104,10 +188,57 @@ export default { font-size: 13px; } -.recommendation-list{ - flex-wrap: wrap; - .book-item { - margin-bottom: 16px; - } +.recommendation-list { + display: flex; + flex-direction: column; + gap: 12px; +} + +.book-item { + display: flex; + background: #fff; + border-radius: 8px; + padding: 12px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} + +.book-cover { + width: 80px; + height: 100px; + border-radius: 4px; + flex-shrink: 0; + background: #f5f5f5; +} + +.book-info { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + padding-left: 12px; + overflow: hidden; +} + +.book-title { + font-size: 15px; + font-weight: 500; + color: #333; + line-height: 1.4; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} + +.book-author { + font-size: 13px; + color: #999; + margin-top: 6px; +} + +.book-publisher { + font-size: 12px; + color: #ccc; + margin-top: 4px; } - + \ No newline at end of file