|
@@ -13,9 +13,9 @@
|
|
}, function (erro) {
|
|
}, function (erro) {
|
|
msg.error(erro.data.message);
|
|
msg.error(erro.data.message);
|
|
});
|
|
});
|
|
- $scope.toProfile = function () {
|
|
|
|
- $state.go('wl.my_profile');
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ $scope.toProfile = function () {
|
|
|
|
+ $state.go('wl.my_profile');
|
|
}
|
|
}
|
|
}]);
|
|
}]);
|
|
app.controller('mySettingCtrl', ['$scope', 'data', '$state', '$http','$ionicModal','myService', function ($scope, data, $state, $http,$ionicModal,myService) {
|
|
app.controller('mySettingCtrl', ['$scope', 'data', '$state', '$http','$ionicModal','myService', function ($scope, data, $state, $http,$ionicModal,myService) {
|
|
@@ -87,10 +87,22 @@
|
|
}]);
|
|
}]);
|
|
|
|
|
|
app.controller('myProfileCtrl', ['$scope', '$ionicActionSheet', '$ionicPopup', '$timeout', 'userService', 'msg', 'util', 'data', 'camera','config', function ($scope, $ionicActionSheet, $ionicPopup, $timeout, userService, msg, util, data, camera,config) {
|
|
app.controller('myProfileCtrl', ['$scope', '$ionicActionSheet', '$ionicPopup', '$timeout', 'userService', 'msg', 'util', 'data', 'camera','config', function ($scope, $ionicActionSheet, $ionicPopup, $timeout, userService, msg, util, data, camera,config) {
|
|
- $scope.user = data.getObject('user');
|
|
|
|
|
|
+ // $scope.user = data.getObject('user');
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
|
|
+ $scope.load(true);
|
|
|
|
+ });
|
|
|
|
+ $scope.load = function (init) {
|
|
|
|
+ userService.getUser().then(function (result) {
|
|
|
|
+ $timeout(function () {
|
|
|
|
+ $scope.user = result.data.data;
|
|
|
|
+ });
|
|
|
|
+ }, function (erro) {
|
|
|
|
+ msg.error(erro.data.message);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
$scope.genderOpt = [
|
|
$scope.genderOpt = [
|
|
- { name: "男", value: 1 },
|
|
|
|
- { name: "女", value: 0 }
|
|
|
|
|
|
+ { name: "男", value: "1" },
|
|
|
|
+ { name: "女", value: "0" }
|
|
];
|
|
];
|
|
$scope.host = config.server +'/upload/avatar/';
|
|
$scope.host = config.server +'/upload/avatar/';
|
|
|
|
|
|
@@ -184,7 +196,7 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- $scope.$on('$ionicView.beforEnter', function (viewResult) {
|
|
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
$scope.load(true);
|
|
$scope.load(true);
|
|
});
|
|
});
|
|
}]);
|
|
}]);
|
|
@@ -281,7 +293,7 @@
|
|
app.controller('myTruckDetailCtrl', ['$scope', function ($scope) {
|
|
app.controller('myTruckDetailCtrl', ['$scope', function ($scope) {
|
|
|
|
|
|
}]);
|
|
}]);
|
|
- app.controller('myMessageCtrl', ['$scope', 'myService', 'msg', '$state', function ($scope, myService, msg, $state) {
|
|
|
|
|
|
+ app.controller('myMessageCtrl', ['$scope', 'myService', 'msg', '$state','config', function ($scope, myService, msg, $state,config) {
|
|
$scope.filter = {
|
|
$scope.filter = {
|
|
hasMore: false,
|
|
hasMore: false,
|
|
page: 0,
|
|
page: 0,
|
|
@@ -289,6 +301,7 @@
|
|
}
|
|
}
|
|
$scope.shouldShowDelete = false;
|
|
$scope.shouldShowDelete = false;
|
|
$scope.items = [];
|
|
$scope.items = [];
|
|
|
|
+ $scope.host = config.server +'/upload/photo/';
|
|
$scope.load = function (init) {
|
|
$scope.load = function (init) {
|
|
if (init) {
|
|
if (init) {
|
|
$scope.filter.pageIndex = 1;
|
|
$scope.filter.pageIndex = 1;
|
|
@@ -323,7 +336,7 @@
|
|
$scope.closeItem = function (item, $index) {
|
|
$scope.closeItem = function (item, $index) {
|
|
$scope.items.splice($index, 1);
|
|
$scope.items.splice($index, 1);
|
|
item.state = 10;
|
|
item.state = 10;
|
|
- myService.updateMessage(item).then(function () {
|
|
|
|
|
|
+ myService.deleteMessage(item).then(function () {
|
|
}, function (erro) {
|
|
}, function (erro) {
|
|
msg.error(erro.data.message);
|
|
msg.error(erro.data.message);
|
|
});
|
|
});
|