|
@@ -55,13 +55,13 @@
|
|
}
|
|
}
|
|
$scope.data = {};
|
|
$scope.data = {};
|
|
$scope.load(true);
|
|
$scope.load(true);
|
|
- $scope.$on('$ionicView.leave', function () {
|
|
|
|
|
|
+ $scope.$on('$ionicView.beforeLeave', function () {
|
|
$scope.popover.hide();
|
|
$scope.popover.hide();
|
|
});
|
|
});
|
|
}]);
|
|
}]);
|
|
|
|
|
|
- app.controller('dreamDetailCtrl', ["$scope", "$state", "msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
|
|
|
|
- , function ($scope, $state, msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
|
|
|
|
|
|
+ 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;
|
|
var id = $stateParams.id;
|
|
id=5;
|
|
id=5;
|
|
$scope.load = function (id) {
|
|
$scope.load = function (id) {
|
|
@@ -70,24 +70,39 @@
|
|
msg.hide();
|
|
msg.hide();
|
|
console.log(result);
|
|
console.log(result);
|
|
$scope.dream = result.data.data
|
|
$scope.dream = result.data.data
|
|
- console.log();
|
|
|
|
|
|
+ var end_time = new Date($scope.dream.end_time);
|
|
var date = new Date();
|
|
var date = new Date();
|
|
- var inter = (date.getTime() - new Date($scope.dream.created_at.replace(/-/g, "/")).getTime()) / 1000
|
|
|
|
-
|
|
|
|
- leftTimer($scope.dream.time-inter);
|
|
|
|
- $scope.multi = {
|
|
|
|
- a: $scope.dream.a,
|
|
|
|
- b: new Date($scope.dream.created_at.replace(/-/g, "/")),
|
|
|
|
- c: $scope.dream.c,
|
|
|
|
- result: 1,
|
|
|
|
- promise:null,
|
|
|
|
|
|
+ var inter = (end_time.getTime() - date.getTime()) / 1000
|
|
|
|
+ leftTimer(inter);
|
|
|
|
+ $scope.multi.a = $scope.dream.a;
|
|
|
|
+ $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){
|
|
|
|
+ //测试动画切换
|
|
|
|
+ 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)
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
$scope.calcmultiplier();
|
|
$scope.calcmultiplier();
|
|
}, function (error) {
|
|
}, function (error) {
|
|
msg.hide();
|
|
msg.hide();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ $scope.multi = {
|
|
|
|
+ a: '',
|
|
|
|
+ b: '',
|
|
|
|
+ c: '',
|
|
|
|
+ result: 1,
|
|
|
|
+ promise:null,
|
|
|
|
+ }
|
|
$scope.type = 1;//tab切换
|
|
$scope.type = 1;//tab切换
|
|
$scope.tosupport = false;
|
|
$scope.tosupport = false;
|
|
$scope.support = function ($event) {
|
|
$scope.support = function ($event) {
|
|
@@ -107,6 +122,8 @@
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.load(id);
|
|
$scope.load(id);
|
|
$ionicTabsDelegate.showBar(false);
|
|
$ionicTabsDelegate.showBar(false);
|
|
|
|
+ $scope.thisUser = storage.getObject('user');
|
|
|
|
+ console.log($scope.user);
|
|
});
|
|
});
|
|
$scope.$on('$ionicView.leave', function () {
|
|
$scope.$on('$ionicView.leave', function () {
|
|
$ionicTabsDelegate.showBar(true);
|
|
$ionicTabsDelegate.showBar(true);
|
|
@@ -145,9 +162,6 @@
|
|
}
|
|
}
|
|
//实时排行
|
|
//实时排行
|
|
$scope.sort = {
|
|
$scope.sort = {
|
|
- first: 'img/demo/head5.jpg',
|
|
|
|
- second: 'img/demo/head6.jpg',
|
|
|
|
- third: 'img/demo/head7.jpg',
|
|
|
|
slide: ''
|
|
slide: ''
|
|
}
|
|
}
|
|
$scope.vidEnded = function () {
|
|
$scope.vidEnded = function () {
|
|
@@ -180,16 +194,7 @@
|
|
|
|
|
|
homeService.supportDream(data).then(function(result){
|
|
homeService.supportDream(data).then(function(result){
|
|
$scope.tosupport = false;
|
|
$scope.tosupport = false;
|
|
-
|
|
|
|
$scope.load(id);
|
|
$scope.load(id);
|
|
- //
|
|
|
|
- //测试动画切换
|
|
|
|
- $scope.sort.first = 'img/demo/head7.jpg';
|
|
|
|
- $scope.sort.second = 'img/demo/head6.jpg';
|
|
|
|
- $scope.sort.third = 'img/demo/head5.jpg';
|
|
|
|
- $scope.sort.slide1 = 'list-grow-animation';
|
|
|
|
- $scope.sort.slide2 = 'slide-in-both-ways';
|
|
|
|
- $scope.sort.slide3 = 'bounce-animation';
|
|
|
|
$interval.cancel($scope.multi.promise);
|
|
$interval.cancel($scope.multi.promise);
|
|
})
|
|
})
|
|
};
|
|
};
|
|
@@ -226,8 +231,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
$scope.replay = function ($event, name) {
|
|
$scope.replay = function ($event, name) {
|
|
-
|
|
|
|
- //$event.stopPropagation();
|
|
|
|
|
|
+ $event.stopPropagation();
|
|
$scope.input.focus = true;
|
|
$scope.input.focus = true;
|
|
$scope.input.placeholder = "回复" + name;
|
|
$scope.input.placeholder = "回复" + name;
|
|
$scope.vm.title='';
|
|
$scope.vm.title='';
|
|
@@ -238,12 +242,13 @@
|
|
$scope.input.focus = true;
|
|
$scope.input.focus = true;
|
|
$scope.vm.title='';
|
|
$scope.vm.title='';
|
|
}
|
|
}
|
|
- $scope.submitComment = function(id){
|
|
|
|
- // $scope.input.placeholder = "评论";
|
|
|
|
|
|
+ $scope.submitComment = function(iid){
|
|
|
|
+ if($scope.vm.comment&&$scope.vm.comment==''||!iid)return;
|
|
var data = {
|
|
var data = {
|
|
- id:id,
|
|
|
|
|
|
+ id:iid,
|
|
content:$scope.vm.comment,
|
|
content:$scope.vm.comment,
|
|
};
|
|
};
|
|
|
|
+ console.log($scope.vm.comment+" "+iid)
|
|
homeService.add_comment(data).then(function(){
|
|
homeService.add_comment(data).then(function(){
|
|
$scope.vm.comment = '' ;
|
|
$scope.vm.comment = '' ;
|
|
$scope.load(id);
|
|
$scope.load(id);
|