|
@@ -28,13 +28,18 @@
|
|
|
<script>
|
|
|
import {getToken} from '@/libs/auth.js';
|
|
|
import {MessageTimeFormat} from '@/libs/index.js';
|
|
|
- import {getArtCatTop,getArtByList} from '@/api/system/art.js'
|
|
|
+ import {getArtCatTop,getArtByPage} from '@/api/system/art.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
artCatId:"",
|
|
|
tabs:[],
|
|
|
- artList:[]
|
|
|
+ artList:[],
|
|
|
+ conditions: {
|
|
|
+ page: 1,
|
|
|
+ limit: 10
|
|
|
+ },
|
|
|
+ total:0
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -44,22 +49,29 @@
|
|
|
MessageTimeFormat,
|
|
|
changeTab(item){
|
|
|
this.artCatId=item.artCatId
|
|
|
- this.getArtByList()
|
|
|
+ this.conditions={
|
|
|
+ page: 1,
|
|
|
+ limit: 10
|
|
|
+ }
|
|
|
+ this.getArtByPage()
|
|
|
},
|
|
|
getArtCatTop(){
|
|
|
getArtCatTop().then((res)=>{
|
|
|
this.tabs=res.data
|
|
|
if(res.data.length>0){
|
|
|
this.artCatId=res.data[0].artCatId
|
|
|
- this.getArtByList()
|
|
|
+ this.getArtByPage()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getArtByList(){
|
|
|
- getArtByList({
|
|
|
+ getArtByPage(){
|
|
|
+ let items=JSON.parse(JSON.stringify(this.artList))
|
|
|
+ getArtByPage({
|
|
|
+ ...this.conditions,
|
|
|
artCatId:this.artCatId
|
|
|
}).then((res)=>{
|
|
|
- this.artList=res.data
|
|
|
+ this.artList=items.concat(res.data)
|
|
|
+ this.total=res.total
|
|
|
})
|
|
|
},
|
|
|
showDetail(){
|
|
@@ -69,6 +81,12 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ onReachBottom() {
|
|
|
+ if(this.total>=this.conditions.page*this.conditions.limit){
|
|
|
+ this.conditions.page++
|
|
|
+ this.getArtByPage()
|
|
|
+ }
|
|
|
+ },
|
|
|
onPullDownRefresh() {
|
|
|
this.getArtCatTop()
|
|
|
uni.stopPullDownRefresh()
|
|
@@ -131,8 +149,9 @@
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
.tag{
|
|
|
+ font-size: 20rpx;
|
|
|
display: inline-block;
|
|
|
- padding:10rpx 16rpx;
|
|
|
+ padding:4rpx 6rpx;
|
|
|
border: 1px solid #15CD85;
|
|
|
line-height: 1;
|
|
|
color: #15CD85;
|