|
|
@ -37,16 +37,16 @@ |
|
|
> |
|
|
> |
|
|
<el-carousel-item v-for="(item,index) in topThree" :key="index"> |
|
|
<el-carousel-item v-for="(item,index) in topThree" :key="index"> |
|
|
<div class="ranking-img"> |
|
|
<div class="ranking-img"> |
|
|
<img :src="coverUrl+'/demoOnlineSelect/getBookCover.do?id='+item.id" alt="" /> |
|
|
|
|
|
|
|
|
<img :src="coverUrl+'/demoRecommend/getBookCover.do?id='+item.id" alt="" /> |
|
|
</div> |
|
|
</div> |
|
|
</el-carousel-item> |
|
|
</el-carousel-item> |
|
|
</el-carousel> |
|
|
</el-carousel> |
|
|
<div v-if="i === carIndex" class="ranking-book-detail" v-for="(item,i) in topThree" :key="i"> |
|
|
<div v-if="i === carIndex" class="ranking-book-detail" v-for="(item,i) in topThree" :key="i"> |
|
|
<div class="book-info"> |
|
|
<div class="book-info"> |
|
|
<h5 class="title-item-only">{{ item.bookName }}</h5> |
|
|
<h5 class="title-item-only">{{ item.bookName }}</h5> |
|
|
<div class="book-author"> |
|
|
|
|
|
<span>{{ item.author }}</span> |
|
|
|
|
|
<span>{{ item.publish }}</span> |
|
|
|
|
|
|
|
|
<div class="book-author" style="display: flex; justify-content: flex-start;"> |
|
|
|
|
|
<span class="title-item-only">{{ item.author }}</span> |
|
|
|
|
|
<span class="title-item-only">{{ item.publish }}</span> |
|
|
</div> |
|
|
</div> |
|
|
<p class="book-intro title-item"> |
|
|
<p class="book-intro title-item"> |
|
|
{{ item.introduce }} |
|
|
{{ item.introduce }} |
|
|
@ -103,7 +103,7 @@ |
|
|
<div class="recommend-item" v-for="(item,index) in bookList" :key="index"> |
|
|
<div class="recommend-item" v-for="(item,index) in bookList" :key="index"> |
|
|
<div class="book-detail"> |
|
|
<div class="book-detail"> |
|
|
<div class="book-img"> |
|
|
<div class="book-img"> |
|
|
<img :src="coverUrl+'/demoOnlineSelect/getBookCover.do?id='+item.id" alt="" /> |
|
|
|
|
|
|
|
|
<img :src="coverUrl+'/demoRecommend/getBookCover.do?id='+item.id" alt="" /> |
|
|
</div> |
|
|
</div> |
|
|
<div class="book-txt"> |
|
|
<div class="book-txt"> |
|
|
<h4> |
|
|
<h4> |
|
|
@ -125,11 +125,11 @@ |
|
|
<div class="book-eval"> |
|
|
<div class="book-eval"> |
|
|
<span class="eval-num">{{item.clickNum}}次</span> |
|
|
<span class="eval-num">{{item.clickNum}}次</span> |
|
|
<div class="eval-star"> |
|
|
<div class="eval-star"> |
|
|
<span class="active"></span> |
|
|
|
|
|
<span class="active"></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
|
|
|
<span :class="{ 'active': 1 <= item.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 2 <= item.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 3 <= item.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 4 <= item.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 5 <= item.recommendIndex }"></span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="to-book-more" @click="getBookDetail(item)">查看详情</div> |
|
|
<div class="to-book-more" @click="getBookDetail(item)">查看详情</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -145,7 +145,7 @@ |
|
|
<div class="dialog-book"> |
|
|
<div class="dialog-book"> |
|
|
<div class="book-detail"> |
|
|
<div class="book-detail"> |
|
|
<div class="book-img"> |
|
|
<div class="book-img"> |
|
|
<img :src="coverUrl+'/demoOnlineSelect/getBookCover.do?id='+detailData.id" alt="" /> |
|
|
|
|
|
|
|
|
<img :src="coverUrl+'/demoRecommend/getBookCover.do?id='+detailData.id" alt="" /> |
|
|
</div> |
|
|
</div> |
|
|
<div class="book-txt"> |
|
|
<div class="book-txt"> |
|
|
<h4> |
|
|
<h4> |
|
|
@ -167,11 +167,11 @@ |
|
|
<div class="book-eval"> |
|
|
<div class="book-eval"> |
|
|
<span class="eval-num"> {{ detailData.clickNum }}次</span> |
|
|
<span class="eval-num"> {{ detailData.clickNum }}次</span> |
|
|
<div class="eval-star"> |
|
|
<div class="eval-star"> |
|
|
<span class="active"></span> |
|
|
|
|
|
<span class="active"></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
<span></span> |
|
|
|
|
|
|
|
|
<span :class="{ 'active': 1 <= detailData.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 2 <= detailData.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 3 <= detailData.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 4 <= detailData.recommendIndex }"></span> |
|
|
|
|
|
<span :class="{ 'active': 5 <= detailData.recommendIndex }"></span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -233,7 +233,7 @@ export default { |
|
|
publishDate:[], |
|
|
publishDate:[], |
|
|
topThree: [], |
|
|
topThree: [], |
|
|
rankingOther: [], |
|
|
rankingOther: [], |
|
|
keywordData:['人工智能','遥遥领先','ChatAPT','5G'], |
|
|
|
|
|
|
|
|
keywordData:['余华','人工智能','5G', 'ChatAPT','遥遥领先',], |
|
|
selectedIndex: null, |
|
|
selectedIndex: null, |
|
|
selectedDateIndex: null, |
|
|
selectedDateIndex: null, |
|
|
keyWordIndex: null, |
|
|
keyWordIndex: null, |
|
|
@ -286,9 +286,14 @@ export default { |
|
|
}, |
|
|
}, |
|
|
resetSearch(){ |
|
|
resetSearch(){ |
|
|
this.resetData() |
|
|
this.resetData() |
|
|
|
|
|
this.keyWordIndex = null |
|
|
|
|
|
this.selectedIndex = null |
|
|
|
|
|
this.selectedDateIndex = null |
|
|
this.addMoreData() |
|
|
this.addMoreData() |
|
|
}, |
|
|
}, |
|
|
toSearch(){ |
|
|
toSearch(){ |
|
|
|
|
|
this.selectedIndex = null |
|
|
|
|
|
this.selectedDateIndex = null |
|
|
this.query = { |
|
|
this.query = { |
|
|
title: null, |
|
|
title: null, |
|
|
isbn: null, |
|
|
isbn: null, |
|
|
@ -329,7 +334,6 @@ export default { |
|
|
'publish':this.query.publish, |
|
|
'publish':this.query.publish, |
|
|
'createdDate':this.query.createdDate |
|
|
'createdDate':this.query.createdDate |
|
|
} |
|
|
} |
|
|
console.log(params) |
|
|
|
|
|
FetchBookRecommendList(params).then(res => { |
|
|
FetchBookRecommendList(params).then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
this.publish = res.publishGroup |
|
|
this.publish = res.publishGroup |
|
|
@ -347,20 +351,22 @@ export default { |
|
|
this.totalPages = res.page.totalPages; |
|
|
this.totalPages = res.page.totalPages; |
|
|
if (this.pageIndex < 1) { |
|
|
if (this.pageIndex < 1) { |
|
|
this.bookList = resData; |
|
|
this.bookList = resData; |
|
|
} else { |
|
|
|
|
|
this.bookList = this.bookList.concat(resData) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
this.bookList = this.bookList.concat(resData) |
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.$message.error('接口错误') |
|
|
this.$message.error('接口错误') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getBookDetail(item){ |
|
|
getBookDetail(item){ |
|
|
FetchBookRecommendDetails({bookId: item.id}).then(res => { |
|
|
|
|
|
|
|
|
let param = { |
|
|
|
|
|
'bookId': item.id |
|
|
|
|
|
} |
|
|
|
|
|
FetchBookRecommendDetails(param).then(res => { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
this.detailShow = true |
|
|
this.detailShow = true |
|
|
if(Object.keys(res).length !== 0){ |
|
|
if(Object.keys(res).length !== 0){ |
|
|
|
|
|
|
|
|
|
|
|
this.detailData = res.book |
|
|
}else{ |
|
|
}else{ |
|
|
this.detailData = item |
|
|
this.detailData = item |
|
|
} |
|
|
} |
|
|
@ -408,12 +414,31 @@ export default { |
|
|
this.addMoreData() |
|
|
this.addMoreData() |
|
|
}, |
|
|
}, |
|
|
selectKeyWord(index){ |
|
|
selectKeyWord(index){ |
|
|
this.addMoreData() |
|
|
|
|
|
|
|
|
this.resetData() |
|
|
if (this.keyWordIndex === index) { |
|
|
if (this.keyWordIndex === index) { |
|
|
this.keyWordIndex = null; |
|
|
this.keyWordIndex = null; |
|
|
} else { |
|
|
} else { |
|
|
this.keyWordIndex = index; |
|
|
this.keyWordIndex = index; |
|
|
|
|
|
this.keyword = this.keywordData[index] |
|
|
|
|
|
switch(this.selectValue){ |
|
|
|
|
|
case 'title' : |
|
|
|
|
|
this.query.title = this.keyword |
|
|
|
|
|
break; |
|
|
|
|
|
case 'isbn' : |
|
|
|
|
|
this.query.isbn = this.keyword |
|
|
|
|
|
break; |
|
|
|
|
|
case 'author' : |
|
|
|
|
|
this.query.author = this.keyword |
|
|
|
|
|
break; |
|
|
|
|
|
case 'publish' : |
|
|
|
|
|
this.query.publish = this.keyword |
|
|
|
|
|
break; |
|
|
|
|
|
case 'createdDate' : |
|
|
|
|
|
this.query.createdDate = this.keyword |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
this.addMoreData() |
|
|
}, |
|
|
}, |
|
|
carouselChange(val) { |
|
|
carouselChange(val) { |
|
|
this.carIndex = val |
|
|
this.carIndex = val |
|
|
|