Playlists
@@ -119,16 +124,19 @@ import { search } from "@/api/others";
import Cover from "@/components/Cover.vue";
import TrackList from "@/components/TrackList.vue";
+import MvRow from "@/components/MvRow.vue";
export default {
name: "Search",
components: {
Cover,
TrackList,
+ MvRow,
},
data() {
return {
result: {},
+ mvs: [],
type: 1,
limit: 30,
offset: 0,
@@ -152,31 +160,28 @@ export default {
let track = this.tracks.find((t) => t.id === id);
appendTrackToPlayerList(track, true);
},
- },
- created() {
- search({ keywords: this.$route.query.keywords, type: 1018 }).then(
- (data) => {
+ getData(keywords) {
+ search({ keywords: keywords, type: 1018 }).then((data) => {
this.result = data.result;
NProgress.done();
- }
- );
+ });
+ search({ keywords: keywords, type: 1004 }).then((data) => {
+ this.mvs = data.result.mvs;
+ });
+ },
+ },
+ created() {
+ this.getData(this.$route.query.keywords);
},
beforeRouteUpdate(to, from, next) {
+ next();
NProgress.start();
- search({ keywords: to.query.keywords, type: 1018 }).then((data) => {
- this.result = data.result;
- next();
- NProgress.done();
- });
+ this.getData(to.query.keywords);
},
};
diff --git a/yarn.lock b/yarn.lock
index b0f3b7c..640dba8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3003,6 +3003,11 @@ csso@^4.0.2:
dependencies:
css-tree "1.0.0-alpha.39"
+custom-event-polyfill@^1.0.7:
+ version "1.0.7"
+ resolved "https://registry.yarnpkg.com/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz#9bc993ddda937c1a30ccd335614c6c58c4f87aee"
+ integrity sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==
+
cyclist@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/cyclist/download/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
@@ -5275,6 +5280,11 @@ loader-utils@^2.0.0:
emojis-list "^3.0.0"
json5 "^2.1.2"
+loadjs@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/loadjs/-/loadjs-4.2.0.tgz#2a0336376397a6a43edf98c9ec3229ddd5abb6f6"
+ integrity sha512-AgQGZisAlTPbTEzrHPb6q+NYBMD+DP9uvGSIjSUM5uG+0jG15cb8axWpxuOIqrmQjn6scaaH8JwloiP27b2KXA==
+
locate-path@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
@@ -6337,6 +6347,17 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
+plyr@^3.6.2:
+ version "3.6.2"
+ resolved "https://registry.yarnpkg.com/plyr/-/plyr-3.6.2.tgz#5a55b608acd161262de1cc75ca843aa64355a051"
+ integrity sha512-CjAhRDtzyGqMRte9Phj4FsZFegS9VxW60boOhQsAnZHuiFG3yVBRcodWsGZ79GuXHHelc4DxMHO+z0QggY+9qQ==
+ dependencies:
+ core-js "^3.6.5"
+ custom-event-polyfill "^1.0.7"
+ loadjs "^4.2.0"
+ rangetouch "^2.0.1"
+ url-polyfill "^1.1.8"
+
pnp-webpack-plugin@^1.6.4:
version "1.6.4"
resolved "https://registry.npm.taobao.org/pnp-webpack-plugin/download/pnp-webpack-plugin-1.6.4.tgz?cache=0&sync_timestamp=1589684269502&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpnp-webpack-plugin%2Fdownload%2Fpnp-webpack-plugin-1.6.4.tgz#c9711ac4dc48a685dabafc86f8b6dd9f8df84149"
@@ -6930,6 +6951,11 @@ range-parser@^1.2.1, range-parser@~1.2.1:
resolved "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
integrity sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=
+rangetouch@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/rangetouch/-/rangetouch-2.0.1.tgz#c01105110fd3afca2adcb1a580692837d883cb70"
+ integrity sha512-sln+pNSc8NGaHoLzwNBssFSf/rSYkqeBXzX1AtJlkJiUaVSJSbRAWJk+4omsXkN+EJalzkZhWQ3th1m0FpR5xA==
+
raw-body@2.4.0:
version "2.4.0"
resolved "https://registry.npm.taobao.org/raw-body/download/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332"
@@ -8353,6 +8379,11 @@ url-parse@^1.4.3:
querystringify "^2.1.1"
requires-port "^1.0.0"
+url-polyfill@^1.1.8:
+ version "1.1.10"
+ resolved "https://registry.yarnpkg.com/url-polyfill/-/url-polyfill-1.1.10.tgz#fd5bbcf66c9491fa682b0cb6d6a855e1643a9281"
+ integrity sha512-vSaPpaRgBrf41+Uky1myiSh6gpcbw8FpwHYnEy0abxndojOBnIs+yh/49gKYFLtUMP9qoNWjn6j9aUVy23Ie2A==
+
url-slug@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/url-slug/-/url-slug-2.0.0.tgz#a789d5aed4995c0d95af33377ad1d5c68d4d7027"