From ec5e36a74a237218cadd8c161c7639146039d5e8 Mon Sep 17 00:00:00 2001 From: yanwenlong Date: Wed, 10 Jan 2024 22:33:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E4=B9=A6=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/library/library.vue | 57 +++++++++++++++++++++++++++++++++++---- pages/peanut/home.vue | 41 +++++++++++++++++++++++----- 2 files changed, 87 insertions(+), 11 deletions(-) diff --git a/pages/library/library.vue b/pages/library/library.vue index ed3de1c..3ac3fa3 100644 --- a/pages/library/library.vue +++ b/pages/library/library.vue @@ -29,7 +29,7 @@ - + 已购图书 @@ -39,6 +39,11 @@ + + + {{item.labelName}} + + @@ -202,6 +207,16 @@ name: '推荐图书' } ], + tagList:[ + {splId:"",labelName:"全部"}, + {splId:"2",labelName:"中医经典"}, + {splId:"1",labelName:"中医基础"}, + {splId:"3",labelName:"各家学说"}, + {splId:"4",labelName:"中医临床"}, + {splId:"5",labelName:"文学"}, + {splId:"6",labelName:"哲学"}, + ] ,// 推荐标签列表 + tabsid: '' } }, onLoad() { @@ -282,6 +297,13 @@ contentButtonClick(e) { this.contentShow = e.index }, + tabsChange(item){ + this.bookList = [] + this.tabsid = item.splId + this.page = 1 + // 获取推荐数据 + this.getfreeBook() + }, // 获取已购买书籍 getfreeBook() { this.$http @@ -289,7 +311,8 @@ // .post('book/buyorderdetail/querybuy', { 'userId': this.userInfo.id, 'page': this.page, - 'limit': 10 + 'limit': 10, + 'type':this.tabsid }) .then(res => { @@ -539,9 +562,33 @@ height: 300rpx; } - .scroll-view_H { - white-space: nowrap; - width: 100%; + // .scroll-view_H { + // white-space: nowrap; + // width: 100%; + // } + .scroll-view_H{background-color: #fff;white-space: nowrap; + padding:10rpx ; margin-top: 12rpx;} + .scroll-view_H{ + .item { padding: 10rpx; overflow: hidden; display: inline-block; padding-bottom: 0; + width: 180rpx !important; margin-right: 20rpx; border-radius: 10rpx; + .videoBox{ + image{display: block; width:150rpx; + height: 170rpx; + } + } + .bookName{display: block; margin-top: 6rpx; color: #666; font-size: 24rpx; white-space: nowrap; + overflow-x: hidden; overflow: hidden; + text-overflow: ellipsis;} + } + // .item.active{margin-right: 20rpx; border: 1px solid #55aa00; border-radius: 10rpx;} + } + .ProTabs{ + // margin: 20rpx 0; + padding:0 20rpx; + text{padding: 8rpx 14rpx; font-size: 32rpx; display: inline-block; border-radius: 10rpx; overflow: hidden; + // background-color: #eee; + color: #55aa7f; margin-right: 10rpx;} + text.cur{background-color:#55aa7f ; color: #fff;} } .scroll-view-item { diff --git a/pages/peanut/home.vue b/pages/peanut/home.vue index df458f5..4ec4f37 100644 --- a/pages/peanut/home.vue +++ b/pages/peanut/home.vue @@ -231,6 +231,11 @@ {{item.labelName}} + + + {{item.labelName}} + + @@ -325,6 +330,12 @@ color: '#54a966', }, tagList:[] ,// 推荐标签列表 + wztaglist:[ + {splId:"",labelName:"全部"}, + {splId:"5",labelName:"文学"}, + {splId:"6",labelName:"哲学"}, + ], + wztabsid: '', pageSize:10, page:1, totalPage:0, @@ -438,11 +449,19 @@ }); }, tabsChange(item){ - this.tjProList = [] - this.tabsid = item.splId - this.page = 1 - // 获取推荐数据 - this.getJtData() + this.tjProList = [] + this.tabsid = item.splId + this.wztabsid = '' + this.page = 1 + // 获取推荐数据 + this.getJtData() + }, + wztabsChange(item){ + this.tjProList = [] + this.wztabsid = item.splId + this.page = 1 + // 获取推荐数据 + this.getJtData() }, getJtData(){ this.$http @@ -450,7 +469,8 @@ .post('book/label/getProductsByLabel',{ 'splId': this.tabsid, 'limit': this.pageSize, - 'page': this.page + 'page': this.page, + 'type': this.wztabsid }) .then(res => { @@ -774,6 +794,15 @@ color: #55aa7f; margin-right: 10rpx;} text.cur{background-color:#55aa7f ; color: #fff;} } + .wzProTabs{ + display: flex; + justify-content: center; + padding:0 20rpx; + text{padding: 8rpx 14rpx; font-size: 32rpx; display: inline-block; border-radius: 10rpx; overflow: hidden; + // background-color: #eee; + color: #55aa7f; margin-right: 10rpx;} + text.cur{background-color:#55aa7f ; color: #fff;} + } // .newBook{margin-top: 10rpx;} .scroll-view_H{background-color: #fff;white-space: nowrap; padding:10rpx ; margin-top: 12rpx;}