| xqd
@@ -310,7 +310,7 @@
|
|
|
}]);
|
|
|
app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
|
|
-
|
|
|
+
|
|
|
}]);
|
|
|
app.controller('personalLetterCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg","storage"
|
|
|
, function ($scope,$ionicTabsDelegate, $state,myService, msg, storage) {
|
| xqd
@@ -690,47 +690,48 @@
|
|
|
|
|
|
app.controller('messageReplyCtrl', ["$scope","$ionicTabsDelegate", "$state", "myService", "msg", "$ionicModal"
|
|
|
, function ($scope,$ionicTabsDelegate, $state, myService, msg, $ionicModal) {
|
|
|
- $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
- myService.replyMy().then(function(result){
|
|
|
- $scope.comments = result.data.data;
|
|
|
- },function(error){
|
|
|
- });
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
+ $scope.load();
|
|
|
+ });
|
|
|
+ $scope.load = function () {
|
|
|
+ myService.replyMy().then(function (result) {
|
|
|
+ $scope.comments = result.data.data;
|
|
|
+ }, function (error) {
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //我的回复
|
|
|
+ $scope.vm = {
|
|
|
+ content: ""
|
|
|
+ };
|
|
|
+ $ionicModal.fromTemplateUrl('my-modal.html', {
|
|
|
+ scope: $scope,
|
|
|
+ animation: 'slide-in-up'
|
|
|
+ }).then(function (modal) {
|
|
|
+ $scope.modal = modal;
|
|
|
});
|
|
|
- //$ionicModal.fromTemplateUrl('my-modal.html', {
|
|
|
- // scope: $scope,
|
|
|
- // animation: 'slide-in-up'
|
|
|
- //}).then(function (modal) {
|
|
|
- // $scope.modal = modal;
|
|
|
- //});
|
|
|
- //$scope.openModal = function () {
|
|
|
- // $scope.modal.show();
|
|
|
- //};
|
|
|
- //$scope.closeModal = function () {
|
|
|
- // $scope.modal.hide();
|
|
|
- //
|
|
|
- //};
|
|
|
-
|
|
|
- $scope.goDetail = function (){
|
|
|
- $state.go('app.home_dreamdetail',{id:$scope.comments.dream_id,type:2});
|
|
|
- };
|
|
|
-
|
|
|
- //我的回复
|
|
|
- $scope.vm={
|
|
|
- content:"",
|
|
|
- comment_id:""
|
|
|
- };
|
|
|
- $scope.myReplay = function(){
|
|
|
+
|
|
|
+ $scope.closeModal = function () {
|
|
|
var data = {
|
|
|
- content:$scope.vm.content,
|
|
|
- comment_id:$scope.vm.id
|
|
|
+ content: $scope.vm.content,
|
|
|
+ comment_id: $scope.item.id,
|
|
|
+ interaction_id: $scope.item.interaction_id
|
|
|
};
|
|
|
- myService.myReplay(data).then(function(result){
|
|
|
-
|
|
|
- },function(error){
|
|
|
-
|
|
|
+ myService.myReplay(data).then(function (result) {
|
|
|
+ msg.success('回复成功');
|
|
|
+ $scope.load();
|
|
|
+ }, function (error) {
|
|
|
+ msg.error('回复失败');
|
|
|
});
|
|
|
+ $scope.vm.content = '';
|
|
|
+ $scope.item = null;
|
|
|
$scope.modal.hide();
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.reply = function (item) {
|
|
|
+ $scope.item = item;
|
|
|
+ $scope.modal.show();
|
|
|
}
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
})(angular.module('app.controllers'));
|