scrolling by button to show album(playlist) (#35)
* scrolling by button to show album(playlist) * fixed minor format issue and remove uneccecary library
This commit is contained in:
parent
bc3be0988d
commit
19affaa402
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
# Folder view configuration files
|
||||
.DS_Store
|
||||
|
@ -26,7 +26,6 @@ a {
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
padding: 20px;
|
||||
background-color: #333;
|
||||
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
@ -159,6 +158,17 @@ a {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.playlist-covers .loading_bottom button{
|
||||
width:95%;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.playlist-covers .loading_bottom .loading{
|
||||
width:95%;
|
||||
text-align:center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.u-cover .mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
23
js/app.js
23
js/app.js
@ -917,7 +917,7 @@
|
||||
}]);
|
||||
|
||||
app.controller('MyPlayListController', ['$http','$scope', '$timeout',
|
||||
'angularPlayer', 'loWeb',
|
||||
'angularPlayer', 'loWeb',
|
||||
function($http, $scope, $timeout, angularPlayer, loWeb){
|
||||
$scope.myplaylists = [];
|
||||
|
||||
@ -941,21 +941,33 @@
|
||||
|
||||
}]);
|
||||
|
||||
app.controller('PlayListController', ['$http','$scope', '$timeout',
|
||||
'angularPlayer','loWeb', function($http, $scope, $timeout, angularPlayer, loWeb){
|
||||
app.controller('PlayListController', ['$http','$scope', '$timeout',
|
||||
'angularPlayer','loWeb',
|
||||
function($http, $scope, $timeout, angularPlayer, loWeb){
|
||||
$scope.result = [];
|
||||
|
||||
$scope.tab = 0;
|
||||
$scope.loading = true
|
||||
|
||||
$scope.changeTab = function(newTab){
|
||||
$scope.tab = newTab;
|
||||
$scope.result = [];
|
||||
|
||||
loWeb.get('/show_playlist?source=' + getSourceName($scope.tab)).success(function(data) {
|
||||
$scope.result = data.result;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.scrolling = function(){
|
||||
if ($scope.loading == true) {
|
||||
return
|
||||
}
|
||||
$scope.loading = true;
|
||||
var offset = $scope.result.length
|
||||
loWeb.get('/show_playlist?source=' + getSourceName($scope.tab) + '&offset=' + offset).success(function(data) {
|
||||
$scope.result = $scope.result.concat(data.result);
|
||||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.isActiveTab = function(tab){
|
||||
return $scope.tab === tab;
|
||||
};
|
||||
@ -964,6 +976,7 @@
|
||||
$scope.loadPlaylist = function(){
|
||||
loWeb.get('/show_playlist?source=' + getSourceName($scope.tab)).success(function(data) {
|
||||
$scope.result = data.result;
|
||||
$scope.loading = false;
|
||||
});
|
||||
};
|
||||
}]);
|
||||
|
@ -2,7 +2,15 @@ var netease = (function() {
|
||||
'use strict';
|
||||
|
||||
var ne_show_playlist = function(url, hm) {
|
||||
var target_url = 'http://music.163.com/discover/playlist/';
|
||||
|
||||
var order = "hot"
|
||||
var offset = getParameterByName('offset',url)
|
||||
|
||||
if (offset != null) {
|
||||
var target_url = 'http://music.163.com/discover/playlist/?order=' + order + '&limit=35&offset=' + offset;
|
||||
} else {
|
||||
var target_url = 'http://music.163.com/discover/playlist/?order=' + order;
|
||||
}
|
||||
|
||||
return {
|
||||
success: function(fn) {
|
||||
|
6
js/qq.js
6
js/qq.js
@ -6,8 +6,12 @@ var qq = (function() {
|
||||
}
|
||||
|
||||
var qq_show_playlist = function(url, hm) {
|
||||
|
||||
var offset = getParameterByName("offset", url);
|
||||
var page = offset/50 + 1;
|
||||
var target_url = 'http://i.y.qq.com/s.plcloud/fcgi-bin/fcg_get_diss_by_tag' +
|
||||
'.fcg?categoryId=10000000&sortId=1&sin=0&ein=49&' +
|
||||
'.fcg?categoryId=10000000&sortId=' + page +
|
||||
'&sin=0&ein=49&' +
|
||||
'format=jsonp&g_tk=5381&loginUin=0&hostUin=0&' +
|
||||
'format=jsonp&inCharset=GB2312&outCharset=utf-8' +
|
||||
'¬ice=0&platform=yqq&jsonpCallback=' +
|
||||
|
@ -35,7 +35,10 @@ var xiami = (function() {
|
||||
}
|
||||
|
||||
var xm_show_playlist = function(url, hm) {
|
||||
var target_url = 'http://www.xiami.com/collect/recommend';
|
||||
var offset = getParameterByName("offset",url)
|
||||
var page = offset/30 + 1
|
||||
|
||||
var target_url = 'http://www.xiami.com/collect/recommend/page/' + page;
|
||||
|
||||
return {
|
||||
success: function(fn) {
|
||||
|
31
listen1.html
31
listen1.html
@ -153,20 +153,27 @@
|
||||
<!-- <button type="button" class="btn btn-default" ng-class="{'active':isActiveTab(3)}" ng-click="changeTab(3)" ng-show="isDoubanLogin">豆瓣</button> -->
|
||||
</div>
|
||||
<div class="playlist">
|
||||
<ul class="playlist-covers">
|
||||
<li ng-repeat="i in result ">
|
||||
<div class="u-cover">
|
||||
<img ng-src="{{i.cover_img_url}}">
|
||||
<a title="" class="mask" ng-click="showPlaylist(i.id)"></a>
|
||||
<div class="bottom">
|
||||
<a class="icon-play" title="播放" ng-click="directplaylist(i.id)"></a>
|
||||
<!--div infinite-scroll='scrolling()' infinite-scroll-disabled='loading' infinite-scroll-distance='2'-->
|
||||
<ul class="playlist-covers">
|
||||
<li ng-repeat="i in result ">
|
||||
<div class="u-cover">
|
||||
<img ng-src="{{i.cover_img_url}}">
|
||||
<a title="" class="mask" ng-click="showPlaylist(i.id)"></a>
|
||||
<div class="bottom">
|
||||
<a class="icon-play" title="播放" ng-click="directplaylist(i.id)"></a>
|
||||
</div>
|
||||
</div>
|
||||
<p class="desc">
|
||||
<a title="{{i.title}}" ng-click="showPlaylist(i.id)">{{i.title}}</a>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<div class="loading_bottom">
|
||||
<button ng-click="scrolling()" ng-show='loading==false'>点击以加载更多</button>
|
||||
<div class="loading" ng-show='loading'>Loading data...</div>
|
||||
</div>
|
||||
<p class="desc">
|
||||
<a title="{{i.title}}" ng-click="showPlaylist(i.id)">{{i.title}}</a>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<!--/div-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user