| xqd
@@ -288,10 +288,10 @@
|
|
|
|
|
|
$scope.isTest = true;
|
|
|
userService.isTest().then(function(res){
|
|
|
- if(res.data.data==1){
|
|
|
- $scope.isTest = false;
|
|
|
- }else{
|
|
|
+ if(res.data.data){
|
|
|
$scope.isTest = true;
|
|
|
+ }else{
|
|
|
+ $scope.isTest = false;
|
|
|
}
|
|
|
})
|
|
|
|
| xqd
@@ -385,25 +385,19 @@
|
|
|
if(result==true){
|
|
|
msg.confirm('举报或拉黑该用户','','举报','拉黑').then(function(result){
|
|
|
if(result==true){
|
|
|
- msg.confirm('确定拉黑?').then(function(result){
|
|
|
- if(result==true){
|
|
|
- homeService.report(dream_id,interaction_id,user_id).then(function(result){
|
|
|
- if(result.data.status_code==0){
|
|
|
- msg.text('已拉黑');
|
|
|
- $scope.load(dream_id);
|
|
|
- }
|
|
|
- },function(error){
|
|
|
-
|
|
|
- })
|
|
|
+ homeService.report(dream_id,interaction_id,user_id).then(function(result){
|
|
|
+ if(result.data.status_code==0){
|
|
|
+ msg.text('已拉黑');
|
|
|
+ $scope.load(dream_id);
|
|
|
+ }
|
|
|
+ },function(error){
|
|
|
+ if(error.data.message == "没有操作权限"){
|
|
|
+ msg.text('你不是该梦想的所有者哦!');
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
- msg.confirm('确定举报?').then(function(result){
|
|
|
- if(result==true){
|
|
|
- $state.go('app.homeContact');
|
|
|
- }
|
|
|
- })
|
|
|
+ $state.go('app.homeContact',{user_name: $scope.dream.user.nickname, dream_name: $scope.dream.name, dream_id: $scope.dream.id});
|
|
|
}
|
|
|
})
|
|
|
}
|
| xqd
@@ -411,16 +405,17 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- // 举报或拉黑(主页)
|
|
|
+ // 举报(主页)
|
|
|
$scope.detailReport = function(ev){
|
|
|
ev.stopPropagation();
|
|
|
$scope.toshare = false;
|
|
|
msg.confirm('确定举报?').then(function(result){
|
|
|
if(result==true){
|
|
|
- $state.go('app.homeContact');
|
|
|
+ $state.go('app.homeContact',{user_name: $scope.dream.user.nickname, dream_name: $scope.dream.name, dream_id: $scope.dream.id});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ // 拉黑(主页)
|
|
|
$scope.detailDelete = function(ev,user_id){
|
|
|
ev.stopPropagation();
|
|
|
$scope.toshare = false;
|
| xqd
@@ -460,38 +455,9 @@
|
|
|
|
|
|
})
|
|
|
};
|
|
|
- // $scope.reportUser = function(ev,user_id){
|
|
|
- // ev.stopPropagation();
|
|
|
- // msg.confirm('举报或拉黑该用户','','举报','拉黑').then(function(result){
|
|
|
- // if(result==true){
|
|
|
- // msg.confirm('确定拉黑?').then(function(result){
|
|
|
- // if(result==true){
|
|
|
- // var res = typeof(storage.getObject('reportUser'));
|
|
|
- // if(res != 'object'){
|
|
|
- // var reportUser = storage.getObject('reportUser');
|
|
|
- // }
|
|
|
- // else{
|
|
|
- // var reportUser = [];
|
|
|
- // }
|
|
|
- // reportUser.push($scope.dream.user_id);
|
|
|
- // storage.setObject('reportUser',reportUser);
|
|
|
- // msg.text('已拉黑');
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // msg.confirm('确定举报?').then(function(result){
|
|
|
- // if(result==true){
|
|
|
- // $state.go('app.homeContact');
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
|
|
|
$scope.load = function (id,dream_user_id,interaction_id) {
|
|
|
homeService.dreamDetail(id,dream_user_id,interaction_id).then(function (result) {
|
|
|
- console.log(result);
|
|
|
$scope.blackUser_id = result.data.data.user_id;
|
|
|
$scope.showCode = function(codeName){
|
|
|
$scope.url = codeName;
|
| xqd
@@ -1372,5 +1338,41 @@
|
|
|
$state.go('app.home_dreamdetail',{id:id});
|
|
|
};
|
|
|
}]);
|
|
|
+ app.controller('contactHomeCtrl', ["$scope","$ionicTabsDelegate","$stateParams","$location", "$ionicHistory","$timeout","$state", "myService", "msg","storage"
|
|
|
+ , function ($scope,$ionicTabsDelegate,$stateParams,$location,$ionicHistory, $timeout,$state,myService, msg, storage) {
|
|
|
+ $scope.user_name = $stateParams.user_name;
|
|
|
+ $scope.dream_id = $stateParams.dream_id;
|
|
|
+ $scope.dream_name = $stateParams.dream_name;
|
|
|
+ $scope.vm={
|
|
|
+ content:"",
|
|
|
+ email:""
|
|
|
+ };
|
|
|
+ $scope.contact = function(){
|
|
|
+ var data={
|
|
|
+ data:{
|
|
|
+ content: $scope.vm.content,
|
|
|
+ email: $scope.vm.email,
|
|
|
+ dream_id: $scope.dream_id
|
|
|
+ }
|
|
|
+ };
|
|
|
+ myService.contact(data).then(function(result){
|
|
|
+ msg.text("发送成功");
|
|
|
+ $timeout(function(){
|
|
|
+ if($location.path()=='/app/home/contact'){
|
|
|
+ $ionicHistory.goBack();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $state.go("app.my");
|
|
|
+ }
|
|
|
+ },1000);
|
|
|
+ $scope.vm={
|
|
|
+ content:"",
|
|
|
+ email:""
|
|
|
+ }
|
|
|
+ },function(error){
|
|
|
+ msg.error(error.data.message);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }]);
|
|
|
|
|
|
})(angular.module('app.controllers'));
|