|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="works con">
|
|
|
<div class="tab">
|
|
|
- <span>我的作品 {{list.length > 0 ? `(${list.length})`:''}}</span>
|
|
|
+ <span>我的作品 {{workTotalNum !== undefined ? `(${workTotalNum})`:''}}</span>
|
|
|
<div class="tab-r">
|
|
|
<div class="filter">
|
|
|
<div :class="{active:searchKey}">
|
|
|
@@ -98,6 +98,7 @@ export default {
|
|
|
return {
|
|
|
config,
|
|
|
list:[],
|
|
|
+ workTotalNum: undefined,
|
|
|
hasMoreData: true,
|
|
|
isRequestingMoreData: false,
|
|
|
searchKey:'',
|
|
|
@@ -179,6 +180,9 @@ export default {
|
|
|
}
|
|
|
this.isRequestingMoreData = false
|
|
|
this.lastestUsedSearchKey = lastestUsedSearchKey
|
|
|
+ if (!lastestUsedSearchKey) {
|
|
|
+ this.workTotalNum = data.data.total
|
|
|
+ }
|
|
|
// TODO: 这是干啥呢?
|
|
|
this.$nextTick(()=>{
|
|
|
this.$bus.emit('refreshTips')
|
|
|
@@ -195,7 +199,7 @@ export default {
|
|
|
},
|
|
|
requestMoreData() {
|
|
|
this.isRequestingMoreData = true
|
|
|
- const thisTimeSearchKey = this.searchKey
|
|
|
+ const lastestUsedSearchKey = this.searchKey
|
|
|
getWorksList(
|
|
|
{
|
|
|
pageNum: Math.floor(this.list.length / config.PAGE_SIZE) + 1,
|
|
|
@@ -208,14 +212,17 @@ export default {
|
|
|
this.hasMoreData = false
|
|
|
}
|
|
|
this.isRequestingMoreData = false
|
|
|
- this.lastestUsedSearchKey = thisTimeSearchKey
|
|
|
+ this.lastestUsedSearchKey = lastestUsedSearchKey
|
|
|
+ if (!lastestUsedSearchKey) {
|
|
|
+ this.workTotalNum = data.data.total
|
|
|
+ }
|
|
|
// TODO: 这是干啥呢?
|
|
|
this.$nextTick(()=>{
|
|
|
this.$bus.emit('refreshTips')
|
|
|
})
|
|
|
},
|
|
|
() => {
|
|
|
- this.lastestUsedSearchKey = thisTimeSearchKey
|
|
|
+ this.lastestUsedSearchKey = lastestUsedSearchKey
|
|
|
this.isRequestingMoreData = false
|
|
|
}
|
|
|
);
|