|
@@ -2,7 +2,10 @@
|
|
app.controller('myCtrl', ["$scope", "$state", "$http", "storage", "myService", "common", "config", "msg"
|
|
app.controller('myCtrl', ["$scope", "$state", "$http", "storage", "myService", "common", "config", "msg"
|
|
, function ($scope, $state, $http, storage, myService, common, config, msg) {
|
|
, function ($scope, $state, $http, storage, myService, common, config, msg) {
|
|
$scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
$scope.$on('$ionicView.beforeEnter', function (viewResult) {
|
|
-
|
|
|
|
|
|
+ myService.myIndex().then(function(result){
|
|
|
|
+ console.log(result.data.data);
|
|
|
|
+ $scope.user = result.data.data
|
|
|
|
+ });
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -17,9 +20,9 @@
|
|
msg.erro(JSON.stringify(erro));
|
|
msg.erro(JSON.stringify(erro));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
- $scope.toprofile = function () {
|
|
|
|
- $state.go('app.my_profile');
|
|
|
|
- };
|
|
|
|
|
|
+ $scope.toprofile = function () {
|
|
|
|
+ $state.go('app.my_profile');
|
|
|
|
+ };
|
|
|
|
|
|
//我的设置
|
|
//我的设置
|
|
$scope.setting = function(){
|
|
$scope.setting = function(){
|
|
@@ -84,8 +87,8 @@
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
msg.loading();
|
|
msg.loading();
|
|
myService.myIndex().then(function(result){
|
|
myService.myIndex().then(function(result){
|
|
- // alert(JSON.stringify(result.data.data.user));
|
|
|
|
- $scope.vm = result.data.data.user;
|
|
|
|
|
|
+ // alert(JSON.stringify(result.data.data));
|
|
|
|
+ $scope.vm = result.data.data;
|
|
$scope.vm.sex = $scope.vm.sex+'';
|
|
$scope.vm.sex = $scope.vm.sex+'';
|
|
$scope.vm.emotion = $scope.vm.emotion+'';
|
|
$scope.vm.emotion = $scope.vm.emotion+'';
|
|
if($scope.vm.birthday){
|
|
if($scope.vm.birthday){
|
|
@@ -100,7 +103,6 @@
|
|
});
|
|
});
|
|
|
|
|
|
$scope.saveMaterial = function(){
|
|
$scope.saveMaterial = function(){
|
|
-
|
|
|
|
var data = {
|
|
var data = {
|
|
pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
|
|
pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
|
|
sex:$scope.vm.sex,
|
|
sex:$scope.vm.sex,
|
|
@@ -118,6 +120,7 @@
|
|
myService.saveMaterial(data).then(function(result){
|
|
myService.saveMaterial(data).then(function(result){
|
|
msg.hide();
|
|
msg.hide();
|
|
msg.success("保存成功!");
|
|
msg.success("保存成功!");
|
|
|
|
+ $state.go('app.my')
|
|
},function(error){
|
|
},function(error){
|
|
msg.hide();
|
|
msg.hide();
|
|
msg.error(error.data.message);
|
|
msg.error(error.data.message);
|
|
@@ -139,15 +142,17 @@
|
|
}]);
|
|
}]);
|
|
app.controller('rechargeCtrl', ["$scope", "$state", "myService", "msg"
|
|
app.controller('rechargeCtrl', ["$scope", "$state", "myService", "msg"
|
|
, function ($scope, $state, myService, msg) {
|
|
, function ($scope, $state, myService, msg) {
|
|
- $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
|
|
+ $scope.$on('$ionicView.beforeEnter', function () {
|
|
|
|
|
|
|
|
+ $scope.vm = {
|
|
|
|
+ money:"",
|
|
|
|
+ }
|
|
});
|
|
});
|
|
//充值
|
|
//充值
|
|
- $scope.recharge = function(){
|
|
|
|
- myService.recharge().then(function(result){
|
|
|
|
-
|
|
|
|
- },function(error){
|
|
|
|
|
|
+ $scope.recharge = function(money){
|
|
|
|
+ myService.recharge(money).then(function(result){
|
|
|
|
|
|
|
|
+ $state.go('app.my');
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|