|
@@ -147,10 +147,16 @@
|
|
app.controller('attention_DetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
|
|
app.controller('attention_DetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
|
|
, function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
|
|
, function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
|
|
var id = $stateParams.id;
|
|
var id = $stateParams.id;
|
|
- $scope. items = $stateParams.items;
|
|
|
|
|
|
+ $scope.items = $stateParams.items;
|
|
|
|
+ $scope.dream_id = $scope.items.near_dream.id;
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$ionicTabsDelegate.showBar(false);
|
|
$ionicTabsDelegate.showBar(false);
|
|
});
|
|
});
|
|
|
|
+ $scope.attentionUser = function(id,is_care){
|
|
|
|
+ homeService.attentionUser(id,is_care).then(function(result){
|
|
|
|
+ $scope.items.is_care=result.data.data;
|
|
|
|
+ })
|
|
|
|
+ };
|
|
|
|
|
|
$scope.cancelSupport = function () {
|
|
$scope.cancelSupport = function () {
|
|
$scope.tosupport = false;
|
|
$scope.tosupport = false;
|
|
@@ -165,14 +171,14 @@
|
|
$scope.shareDream = function(){
|
|
$scope.shareDream = function(){
|
|
$state.go("app.my_shareDream",{item:$scope.user});
|
|
$state.go("app.my_shareDream",{item:$scope.user});
|
|
};
|
|
};
|
|
- $scope.toDetail = function (id) {
|
|
|
|
- $state.go('app.my_dreamdetail',{id:id});
|
|
|
|
|
|
+ $scope.toDetail = function (dream_id) {
|
|
|
|
+ $state.go('app.my_dreamdetail',{id:dream_id});
|
|
};
|
|
};
|
|
$scope.toOldDream = function(){
|
|
$scope.toOldDream = function(){
|
|
$state.go("app.myOldDream");
|
|
$state.go("app.myOldDream");
|
|
};
|
|
};
|
|
$scope.toSupportDream = function(){
|
|
$scope.toSupportDream = function(){
|
|
- $state.go("app.mySupportDream");
|
|
|
|
|
|
+ $state.go("app.mySupportDream",{user_id:$scope.items.user.id});
|
|
};
|
|
};
|
|
$scope.collectionDream = function(is_collection){
|
|
$scope.collectionDream = function(is_collection){
|
|
homeService.collectionDream(id,is_collection).then(function(result){
|
|
homeService.collectionDream(id,is_collection).then(function(result){
|
|
@@ -183,15 +189,41 @@
|
|
|
|
|
|
app.controller('mySupportDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
|
|
app.controller('mySupportDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
|
|
, function ($scope,homeService,$stateParams, $state, msg) {
|
|
, function ($scope,homeService,$stateParams, $state, msg) {
|
|
|
|
+ var user_id = $stateParams.user_id;
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter',function(){
|
|
|
|
+ $scope.toUserDetail(user_id);
|
|
|
|
+ });
|
|
|
|
+ $scope.toUserDetail = function(user_id){
|
|
|
|
+ homeService.toUserDetail(user_id).then(function(result){
|
|
|
|
+ $scope.items = result.data.data;
|
|
|
|
+ $scope.user = result.data.data.user;
|
|
|
|
+ $scope.dreams = $scope.user.sup_dream;
|
|
|
|
+ },function(error){
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ };
|
|
$scope.toDetail = function(){
|
|
$scope.toDetail = function(){
|
|
- $state.go("app.attention_Detail")
|
|
|
|
|
|
+ $state.go("app.attention_Detail",{user_id:user_id,items:$scope.items})
|
|
}
|
|
}
|
|
}]);
|
|
}]);
|
|
app.controller('myOldDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
|
|
app.controller('myOldDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
|
|
, function ($scope,homeService,$stateParams, $state, msg) {
|
|
, function ($scope,homeService,$stateParams, $state, msg) {
|
|
|
|
+ var user_id = $stateParams.user_id;
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter',function(){
|
|
|
|
+ $scope.toUserDetail(user_id);
|
|
|
|
+ });
|
|
|
|
+ $scope.toUserDetail = function(user_id){
|
|
|
|
+ homeService.toUserDetail(user_id).then(function(result){
|
|
|
|
+ $scope.items = result.data.data;
|
|
|
|
+ $scope.user = result.data.data.user;
|
|
|
|
+ $scope.dreams = $scope.user.sup_dream;
|
|
|
|
+ },function(error){
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ };
|
|
$scope.toDetail = function(){
|
|
$scope.toDetail = function(){
|
|
- $state.go("app.attention_Detail")
|
|
|
|
- }
|
|
|
|
|
|
+ $state.go("app.attention_Detail",{user_id:user_id,items:$scope.items})
|
|
|
|
+ };
|
|
}]);
|
|
}]);
|
|
app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
@@ -322,28 +354,36 @@
|
|
console.log('图片选择失败');
|
|
console.log('图片选择失败');
|
|
});
|
|
});
|
|
};
|
|
};
|
|
- $scope.addvideo = function () {
|
|
|
|
- common.chooseVideo().then(function (file) {
|
|
|
|
- $scope.video.path = file;
|
|
|
|
- common.uploadFiles(file, 2).then(function (result) {
|
|
|
|
- var response = JSON.parse(result.response);
|
|
|
|
- var file = response.data.file;
|
|
|
|
- console.log("file:"+config.imgServer+file);
|
|
|
|
- $scope.video.isOK = true;
|
|
|
|
- $scope.video.server = config.imgServer+file;
|
|
|
|
- }, function (error) {
|
|
|
|
- msg.error('视频上传失败');
|
|
|
|
- });
|
|
|
|
- }, function (erro) {
|
|
|
|
- console.log('选择视频失败');
|
|
|
|
- });
|
|
|
|
- };
|
|
|
|
$scope.deletefile = function (file) {
|
|
$scope.deletefile = function (file) {
|
|
var index = $scope.imgs.indexOf(file);
|
|
var index = $scope.imgs.indexOf(file);
|
|
$scope.imgs.splice(index, 1);
|
|
$scope.imgs.splice(index, 1);
|
|
common.deletefile(file).then(function () {
|
|
common.deletefile(file).then(function () {
|
|
})
|
|
})
|
|
};
|
|
};
|
|
|
|
+ $scope.vm={
|
|
|
|
+ name:'',
|
|
|
|
+ about:'',
|
|
|
|
+ coin:''
|
|
|
|
+ };
|
|
|
|
+ $scope.add = function () {
|
|
|
|
+ var data = {
|
|
|
|
+ pics: $scope.imgs,
|
|
|
|
+ video:$scope.video.server,
|
|
|
|
+ name: $scope.vm.name,
|
|
|
|
+ about: $scope.vm.about,
|
|
|
|
+ days: 21, //默认21
|
|
|
|
+ coin: $scope.vm.coin
|
|
|
|
+ };
|
|
|
|
+ msg.loading('保存中...');
|
|
|
|
+ dreamService.addDream(data).then(function (result) {
|
|
|
|
+ msg.hide();
|
|
|
|
+ $state.go('app.home');
|
|
|
|
+ }, function (error) {
|
|
|
|
+ msg.hide();
|
|
|
|
+ msg.error(error.data.message);
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
}]);
|
|
}]);
|
|
app.controller('messageCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
|
|
app.controller('messageCtrl', ["$scope", "$ionicTabsDelegate","$state", "myService", "msg"
|
|
, function ($scope,$ionicTabsDelegate, $state, myService, msg) {
|
|
, function ($scope,$ionicTabsDelegate, $state, myService, msg) {
|
|
@@ -422,7 +462,6 @@
|
|
$ionicTabsDelegate.showBar(false);
|
|
$ionicTabsDelegate.showBar(false);
|
|
myService.collect().then(function(result){
|
|
myService.collect().then(function(result){
|
|
$scope.dreams = result.data.data.dreams;
|
|
$scope.dreams = result.data.data.dreams;
|
|
- $scope.users = result.data.data.users;
|
|
|
|
});
|
|
});
|
|
});
|
|
});
|
|
$scope.toDetail = function (id) {
|
|
$scope.toDetail = function (id) {
|