Skip to content

Commit

Permalink
"按上映年份"排序改为降序排序,从新到旧排序
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiocean committed Jun 5, 2021
1 parent 0816933 commit 1e9f48e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/Film.vue
Expand Up @@ -510,7 +510,7 @@ export default {
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.year - b.year
return b.year - a.year
})
break
case '按片名':
Expand All @@ -524,6 +524,9 @@ export default {
})
break
default:
filteredData.sort(function (a, b) {
return new Date(b.last) - new Date(a.last)
})
break
}
if (this.showFind) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Recommendation.vue
Expand Up @@ -486,7 +486,7 @@ export default {
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.detail.year - b.detail.year
return b.detail.year - a.detail.year
})
break
case '按片名':
Expand Down
2 changes: 1 addition & 1 deletion src/components/Star.vue
Expand Up @@ -324,7 +324,7 @@ export default {
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.detail.year - b.detail.year
return b.detail.year - a.detail.year
})
break
case '按片名':
Expand Down

0 comments on commit 1e9f48e

Please sign in to comment.