Skip to content

Commit 1e9f48e

Browse files
committed
"按上映年份"排序改为降序排序,从新到旧排序
1 parent 0816933 commit 1e9f48e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/components/Film.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ export default {
510510
switch (this.sortKeyword) {
511511
case '按上映年份':
512512
filteredData.sort(function (a, b) {
513-
return a.year - b.year
513+
return b.year - a.year
514514
})
515515
break
516516
case '按片名':
@@ -524,6 +524,9 @@ export default {
524524
})
525525
break
526526
default:
527+
filteredData.sort(function (a, b) {
528+
return new Date(b.last) - new Date(a.last)
529+
})
527530
break
528531
}
529532
if (this.showFind) {

src/components/Recommendation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export default {
486486
switch (this.sortKeyword) {
487487
case '按上映年份':
488488
filteredData.sort(function (a, b) {
489-
return a.detail.year - b.detail.year
489+
return b.detail.year - a.detail.year
490490
})
491491
break
492492
case '按片名':

src/components/Star.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export default {
324324
switch (this.sortKeyword) {
325325
case '按上映年份':
326326
filteredData.sort(function (a, b) {
327-
return a.detail.year - b.detail.year
327+
return b.detail.year - a.detail.year
328328
})
329329
break
330330
case '按片名':

0 commit comments

Comments
 (0)