|
|
|
@ -7,6 +7,7 @@ if(debug===true){
|
|
|
|
|
apiUrl = 'https://www.trustie.net/api/v1/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.factory('auth', function($http,$routeParams, $cookies, $q){
|
|
|
|
|
var _openid = '';
|
|
|
|
|
|
|
|
|
@ -66,7 +67,7 @@ app.factory('rms', function(){
|
|
|
|
|
return {save: save, get: get};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.controller('ActivityController',function($scope, $http, auth, rms, common){
|
|
|
|
|
app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){
|
|
|
|
|
$scope.replaceUrl = function(url){
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
@ -76,6 +77,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
|
|
|
|
|
$scope.page = 0;
|
|
|
|
|
|
|
|
|
|
var loadActData = function(page){
|
|
|
|
|
if (page <= 0 && $scope.activities.length >0){
|
|
|
|
|
var yOffset = rms.get("yoffset");
|
|
|
|
|
$location.hash(yOffset);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.page = page;
|
|
|
|
|
$http({
|
|
|
|
|
method: 'POST',
|
|
|
|
@ -109,6 +116,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
|
|
|
|
|
|
|
|
|
|
$scope.loadActData = loadActData;
|
|
|
|
|
|
|
|
|
|
//跳到详情页
|
|
|
|
|
$scope.goDetail = function(type, id){
|
|
|
|
|
rms.save("yoffset", id);
|
|
|
|
|
$location.path('/'+type+'/'+id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.addPraise = function(act){
|
|
|
|
|
common.addCommonPraise(act);
|
|
|
|
|
};
|
|
|
|
@ -117,6 +130,8 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
|
|
|
|
|
common.decreaseCommonPraise(act);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
app.factory('common', function($http, auth, $routeParams){
|
|
|
|
|