| xqd
@@ -1,6 +1,6 @@
|
|
|
(function (app) {
|
|
|
- app.controller('myCtrl', ["$scope","$ionicTabsDelegate", "$state", "$http", "storage", "myService", "common", "config", "msg","$timeout"
|
|
|
- , function ($scope,$ionicTabsDelegate, $state, $http, storage, myService, common, config, msg, $timeout) {
|
|
|
+ app.controller('myCtrl', ["$scope","$ionicTabsDelegate", "$state", "$http", "storage", "myService", "common", "config", "msg"
|
|
|
+ , function ($scope,$ionicTabsDelegate, $state, $http, storage, myService, common, config, msg) {
|
|
|
$scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
|
$ionicTabsDelegate.showBar(true);
|
|
|
myService.myInfo().then(function(result){
|
| xqd
@@ -11,23 +11,35 @@
|
|
|
common.setAvator().then(function (result) {
|
|
|
var response = JSON.parse(result.response);
|
|
|
console.log(response.data.file);
|
|
|
- $timeout(function () {
|
|
|
- $scope.user.avatar = config.imgServer + response.data.file;
|
|
|
- });
|
|
|
+ $scope.user.avatar = config.imgServer + response.data.file;
|
|
|
});
|
|
|
};
|
|
|
}]);
|
|
|
- app.controller('profileCtrl', ["$scope", "$timeout","$ionicTabsDelegate","$state","$filter", "storage", "myService", "msg", "common"
|
|
|
- , function ($scope, $timeout, $ionicTabsDelegate, $state, $filter, storage, myService, msg, common) {
|
|
|
+ app.controller('profileCtrl', ["$scope","$ionicTabsDelegate","$state","$filter", "storage", "myService", "msg", "config", "common"
|
|
|
+ , function ($scope, $ionicTabsDelegate, $state, $filter, storage, myService, msg, config, common) {
|
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
|
$ionicTabsDelegate.showBar(false);
|
|
|
+ msg.loading();
|
|
|
+ myService.myInfo().then(function(result){
|
|
|
+ // alert(JSON.stringify(result.data.data));
|
|
|
+ $scope.vm = result.data.data;
|
|
|
+ console.log($scope.vm.avatar)
|
|
|
+ $scope.vm.sex = $scope.vm.sex+'';
|
|
|
+ $scope.vm.emotion = $scope.vm.emotion+'';
|
|
|
+ if($scope.vm.birthday){
|
|
|
+ var arr1 = $scope.vm.birthday.split("-");
|
|
|
+ $scope.vm.birthday1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]);
|
|
|
+ }
|
|
|
+ msg.hide();
|
|
|
+ },function(error){
|
|
|
+ msg.hide();
|
|
|
+ // msg.error(error.data.message);
|
|
|
+ })
|
|
|
});
|
|
|
$scope.setAvator = function () {
|
|
|
common.setAvator().then(function (result) {
|
|
|
var response = JSON.parse(result.response);
|
|
|
- $timeout(function () {
|
|
|
- $scope.user.avatar = config.imgServer + response.data.file;
|
|
|
- });
|
|
|
+ $scope.vm.avatar = config.imgServer + response.data.file;
|
|
|
});
|
|
|
};
|
|
|
|
| xqd
@@ -41,25 +53,7 @@
|
|
|
tall:"",
|
|
|
nickname:"",
|
|
|
birthday1:""
|
|
|
- };
|
|
|
- $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
- msg.loading();
|
|
|
- myService.myInfo().then(function(result){
|
|
|
- // alert(JSON.stringify(result.data.data));
|
|
|
- $scope.vm = result.data.data;
|
|
|
- $scope.vm.sex = $scope.vm.sex+'';
|
|
|
- $scope.vm.emotion = $scope.vm.emotion+'';
|
|
|
- if($scope.vm.birthday){
|
|
|
- var arr1 = $scope.vm.birthday.split("-");
|
|
|
- $scope.vm.birthday1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]);
|
|
|
- }
|
|
|
- msg.hide();
|
|
|
-
|
|
|
- },function(error){
|
|
|
- msg.hide();
|
|
|
- // msg.error(error.data.message);
|
|
|
- })
|
|
|
- });
|
|
|
+ };
|
|
|
|
|
|
$scope.saveMaterial = function(){
|
|
|
var data = {
|