feat(medals): new module medals

This commit is contained in:
OldHawk
2018-06-18 20:32:11 +08:00
parent 70cd5c2a55
commit 18dbdf50b1
126 changed files with 12789 additions and 1124 deletions

View File

@@ -6,10 +6,10 @@
.controller('UserInfoController', UserInfoController);
UserInfoController.$inject = ['$scope', '$rootScope', '$state', 'Authentication', 'userResolve', 'ScoreLevelService', '$timeout', 'MeanTorrentConfig', 'UsersService',
'DebugConsoleService', 'NotifycationService'];
'DebugConsoleService', 'NotifycationService', 'localStorageService', 'MedalsService', 'MedalsInfoServices'];
function UserInfoController($scope, $rootScope, $state, Authentication, user, ScoreLevelService, $timeout, MeanTorrentConfig, UsersService,
mtDebug, NotifycationService) {
mtDebug, NotifycationService, localStorageService, MedalsService, MedalsInfoServices) {
var vm = this;
vm.authentication = Authentication;
@@ -20,9 +20,18 @@
vm.isContextUserSelf = isContextUserSelf;
vm.scoreLevelData = ScoreLevelService.getScoreLevelJson(vm.user.score);
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
vm.homeConfig = MeanTorrentConfig.meanTorrentConfig.home;
mtDebug.info(user);
/**
* initTopBackground
*/
vm.initTopBackground = function () {
var url = localStorageService.get('body_background_image') || vm.homeConfig.bodyBackgroundImage;
$('.backdrop').css('backgroundImage', 'url("' + url + '")');
};
/**
* messageTo
*/
@@ -90,5 +99,16 @@
NotifycationService.showErrorNotify(response.data.message, 'UNFOLLOW_ERROR');
}
};
/**
* getUserMedals
*/
vm.getUserMedals = function () {
MedalsService.query({
userId: vm.user._id
}, function (medals) {
vm.userMedals = MedalsInfoServices.mergeMedalsProperty(medals);
});
};
}
}());