| xqd
@@ -2,6 +2,7 @@
|
|
|
app.controller('homeCtrl', ["$scope", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService"
|
|
|
, function ($scope, $http, config, $state, msg, $ionicPopover, homeService) {
|
|
|
$scope.type = 'hot';//tab切换
|
|
|
+
|
|
|
$ionicPopover.fromTemplateUrl('my-popover.html', {
|
|
|
scope: $scope
|
|
|
}).then(function (popover) {
|
| xqd
@@ -63,14 +64,15 @@
|
|
|
app.controller('dreamDetailCtrl', ["$scope", "$state", "storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
|
|
|
, function ($scope, $state, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
|
|
|
var id = $stateParams.id;
|
|
|
- id=5;
|
|
|
+ var top3user = '';
|
|
|
+ // id=5;
|
|
|
$scope.load = function (id) {
|
|
|
msg.loading();
|
|
|
homeService.dreamDetail(id).then(function (result) {
|
|
|
msg.hide();
|
|
|
console.log(result);
|
|
|
$scope.dream = result.data.data
|
|
|
- var end_time = new Date($scope.dream.end_time);
|
|
|
+ var end_time = new Date($scope.dream.end_time.replace(/-/g, "/"));
|
|
|
var date = new Date();
|
|
|
var inter = (end_time.getTime() - date.getTime()) / 1000
|
|
|
leftTimer(inter);
|
| xqd
@@ -78,19 +80,22 @@
|
|
|
$scope.multi.b = new Date($scope.dream.created_at.replace(/-/g, "/"));
|
|
|
$scope.multi.c = $scope.dream.c;
|
|
|
$scope.multi.promise = $scope.dream.a;
|
|
|
- $top3user = storage.getObject('top3user');
|
|
|
- if($scope.dream.top3user != $top3user&&$top3user != null){
|
|
|
+ var newtop3user = ''
|
|
|
+ angular.forEach($scope.dream.top3user, function(user) {
|
|
|
+ newtop3user= newtop3user +user.id+","
|
|
|
+ });
|
|
|
+ if(top3user!=''&&newtop3user!=top3user){
|
|
|
//测试动画切换
|
|
|
- if($scope.dream.top3user[0])$scope.sort.first = $scope.dream.top3user[0].avatar;
|
|
|
- if($scope.dream.top3user[1])$scope.sort.second = $scope.dream.top3user[1].avatar;
|
|
|
- if($scope.dream.top3user[2])$scope.sort.third = $scope.dream.top3user[2].avatar;
|
|
|
- $scope.sort.slide1 = 'list-grow-animation';
|
|
|
- $scope.sort.slide2 = 'slide-in-both-ways';
|
|
|
- $scope.sort.slide3 = 'bounce-animation';
|
|
|
- storage.setObject('top3user',$scope.dream.top3user)
|
|
|
+ $timeout(function() {
|
|
|
+ $scope.sort.slide1 = 'list-grow-animation';
|
|
|
+ $scope.sort.slide2 = 'slide-in-both-ways';
|
|
|
+ $scope.sort.slide3 = 'bounce-animation';
|
|
|
+ }, 50);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ top3user = newtop3user;
|
|
|
+ if($scope.dream.top3user[0])$scope.sort.first = $scope.dream.top3user[0].avatar;
|
|
|
+ if($scope.dream.top3user[1])$scope.sort.second = $scope.dream.top3user[1].avatar;
|
|
|
+ if($scope.dream.top3user[2])$scope.sort.third = $scope.dream.top3user[2].avatar;
|
|
|
$scope.calcmultiplier();
|
|
|
}, function (error) {
|
|
|
msg.hide();
|
| xqd
@@ -114,6 +119,10 @@
|
|
|
$scope.cancelSupport = function () {
|
|
|
$scope.tosupport = false;
|
|
|
}
|
|
|
+ //实时排行
|
|
|
+ $scope.sort = {
|
|
|
+ slide: ''
|
|
|
+ }
|
|
|
$scope.changeType = function (type) {
|
|
|
$ionicScrollDelegate.scrollTop(true);
|
|
|
$scope.type = type;
|
| xqd
@@ -159,11 +168,7 @@
|
|
|
$scope.changeIndex = function (index) {
|
|
|
$scope.index = index;
|
|
|
$scope.vm.coin = index*5;
|
|
|
- }
|
|
|
- //实时排行
|
|
|
- $scope.sort = {
|
|
|
- slide: ''
|
|
|
- }
|
|
|
+ }
|
|
|
$scope.vidEnded = function () {
|
|
|
alert('播放完毕');
|
|
|
}
|